/* ============================================
   INSELF — AI Workforce Dashboard
   Light Mode — Mercury-Inspired Design System
   ============================================ */

/* ============ DESIGN TOKENS ============ */
:root {
  /* Backgrounds — warm, soft tones like Mercury */
  --bg-primary: #F7F7F5;
  --bg-secondary: #FFFFFF;
  --bg-tertiary: #F2F2EF;

  /* Surfaces — no visible borders, shadow-only elevation */
  --surface-card: #FFFFFF;
  --surface-border: rgba(0, 0, 0, 0.06);
  --surface-hover: rgba(0, 0, 0, 0.025);

  /* Text — warm dark tones, not pure black */
  --text-primary: #1C1C1C;
  --text-secondary: #71717A;
  --text-tertiary: #A1A1AA;

  /* Semantic colors — every color has a purpose */
  --color-success: #22C55E;
  --color-success-bg: rgba(34, 197, 94, 0.08);
  --color-warning: #EAB308;
  --color-warning-bg: rgba(234, 179, 8, 0.08);
  --color-error: #EF4444;
  --color-error-bg: rgba(239, 68, 68, 0.06);
  --color-info: #3B82F6;
  --color-info-bg: rgba(59, 130, 246, 0.06);
  --color-neutral: #A1A1AA;
  --color-neutral-bg: rgba(161, 161, 170, 0.1);

  /* Accent — used sparingly for primary actions */
  --accent: #1C1C1C;
  --accent-hover: #333333;
  --accent-bg: rgba(28, 28, 28, 0.06);

  /* Radii — softer, rounder */
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-pill: 100px;

  /* Shadows — soft, warm, layered like Mercury */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.03), 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 40px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-secondary);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 13.5px;
  line-height: 1.55;
  letter-spacing: -0.01em;
  overflow: hidden;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* Focus-visible — keyboard users only */
:focus-visible {
  outline: 2px solid var(--text-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

:focus:not(:focus-visible) {
  outline: none;
}

/* Selection */
::selection {
  background: rgba(28, 28, 28, 0.12);
  color: var(--text-primary);
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

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

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 100px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.2);
}

/* Hide scrollbar until hover */
.content::-webkit-scrollbar-thumb,
.chat-messages::-webkit-scrollbar-thumb {
  background: transparent;
}

.content:hover::-webkit-scrollbar-thumb,
.chat-messages:hover::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
}

/* ============ LAYOUT ============ */
.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ============ SIDEBAR ============ */
.sidebar {
  width: 240px;
  min-width: 240px;
  background: var(--bg-secondary);
  border-right: 1px solid rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width 0.28s cubic-bezier(0.4, 0, 0.2, 1),
              min-width 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

/* ── Collapsed state — icon-only strip ── */
.sidebar.collapsed {
  width: 56px;
  min-width: 56px;
}

/* Hide text elements when collapsed, keep icons */
.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-item span:not(.nav-icon),
.sidebar.collapsed .nav-badge,
.sidebar.collapsed .sidebar-footer,
.sidebar.collapsed .user-info,
.sidebar.collapsed .trial-cta-card,
.sidebar.collapsed .credits-indicator {
  display: none;
}

.sidebar.collapsed .sidebar-header {
  padding: 14px 0;
  justify-content: center;
  flex-direction: column;
  gap: 0;
}
.sidebar.collapsed .logo { justify-content: center; }
/* Always show the toggle button */
.sidebar.collapsed .sidebar-toggle { display: flex; }
.sidebar.collapsed .sidebar-nav { padding: 4px 8px; }
.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 10px;
  border-radius: 10px;
}
.sidebar.collapsed .nav-item .nav-icon { margin: 0; }

/* Toggle button — sits at top of sidebar */
.sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.08);
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}
.sidebar-toggle:hover { background: var(--surface-hover); color: var(--text-primary); }
.sidebar-toggle svg { width: 15px; height: 15px; }

.sidebar-header {
  padding: 24px 24px 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

.logo-icon svg {
  width: 28px;
  height: 28px;
}

.logo-text {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

/* Nav */
.sidebar-nav {
  flex: 1;
  padding: 4px 12px;
}

.nav-section {
  margin-bottom: 8px;
}

.nav-label {
  display: block;
  padding: 8px 12px 4px;
  font-size: 0.68rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 420;
  transition: all 0.15s ease;
  position: relative;
}

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

.nav-item.active {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-primary);
  font-weight: 500;
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-tertiary);
  min-width: 18px;
  text-align: center;
}

.nav-badge.accent {
  color: var(--accent);
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 12px 12px;
  border-top: 1px solid var(--surface-border);
}

/* ── Trial CTA Card ── */
.trial-cta-card {
  padding: 14px 14px 12px;
  margin-bottom: 8px;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  border: 1px solid rgba(22,163,74,0.25);
  cursor: pointer;
  transition: all 0.2s;
}
.trial-cta-card:hover {
  border-color: rgba(22,163,74,0.5);
  background: rgba(22,163,74,0.04);
  transform: translateY(-1px);
}

/* ── Credits Indicator ── */
.credits-indicator {
  padding: 10px 12px;
  margin-bottom: 8px;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  cursor: pointer;
  transition: background 0.2s;
}
.credits-indicator:hover { background: var(--surface-hover); }
.credits-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3px;
}
.credits-label { font-size: 0.7rem; color: var(--text-secondary); }
.credits-value { font-size: 0.72rem; font-weight: 600; color: var(--text-primary); }
.credits-bar {
  height: 4px;
  background: var(--bg-primary);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 6px;
}
.credits-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--accent-primary);
  transition: width 0.5s ease, background 0.3s;
}
.credits-bar-fill.warn { background: #f59e0b; }
.credits-bar-fill.danger { background: #ef4444; }
.credits-bar-fill.email { background: #8b5cf6; }
.credits-bar-fill.email.warn { background: #f59e0b; }
.credits-bar-fill.email.danger { background: #ef4444; }
.credits-upgrade-hint {
  display: block;
  text-align: center;
  font-size: 0.62rem;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* ── Upgrade Modal ── */
.upgrade-modal {
  max-width: 420px;
  max-height: 85vh;
  overflow-y: auto;
}
.form-select {
  background: var(--bg-primary);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  color: var(--text-primary);
  font-size: 0.82rem;
  outline: none;
  appearance: none;
  cursor: pointer;
}
.form-select:focus { border-color: var(--accent-primary); }

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: var(--radius-md);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  border: 1px solid var(--surface-border);
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-primary);
}

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

/* ============ MAIN ============ */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-primary);
}

/* ============ TOP BAR ============ */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 40px;
  background: var(--bg-secondary);
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  min-height: 60px;
}

.page-title {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Search — Mercury's command palette style */
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--bg-primary);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-pill);
  min-width: 220px;
}

.search-icon {
  width: 14px;
  height: 14px;
  color: var(--text-tertiary);
}

.search-input {
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 400;
  width: 100%;
}

.search-input::placeholder {
  color: var(--text-tertiary);
}

.search-box::after {
  content: '⌘K';
  font-size: 0.68rem;
  color: var(--text-tertiary);
  padding: 2px 6px;
  background: var(--bg-secondary);
  border: 1px solid var(--surface-border);
  border-radius: 4px;
  font-family: inherit;
  white-space: nowrap;
}

/* Notification button */
.btn-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--surface-border);
  border-radius: 50%;
  color: var(--text-secondary);
  position: relative;
  transition: all 0.15s ease;
}

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

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

.notification-dot {
  width: 7px;
  height: 7px;
  background: var(--color-error);
  border-radius: 50%;
  position: absolute;
  top: 8px;
  right: 8px;
  border: 2px solid var(--bg-secondary);
}

/* ============ CONTENT ============ */
.content {
  flex: 1;
  overflow-y: auto;
  padding: 32px 40px 48px;
  min-width: 0; /* Prevent flex child from overflowing */
}

.content > .view.active {
  max-width: 1400px;
}

.view { display: none; }
.view.active { display: block; }

/* Agents view fills the full content height like the cockpit */
.content:has(#view-agents.active) {
  overflow: hidden;
  padding: 0;
}
#view-agents {
  display: none;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}
#view-agents.active {
  display: flex;
}

/* ============ ACTION BAR ============ */
.action-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 450;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.action-btn:hover {
  border-color: rgba(0, 0, 0, 0.15);
  color: var(--text-primary);
  background: var(--bg-secondary);
}

.action-btn.primary {
  background: var(--accent);
  color: #FFFFFF;
  border-color: transparent;
}

.action-btn.primary:hover {
  background: var(--accent-hover);
  border-color: transparent;
}

/* ============ BUTTONS ============ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 18px;
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 500;
  border: none;
  background: var(--accent);
  color: #FFFFFF;
  transition: all 0.15s ease;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 18px;
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 500;
  border: 1px solid var(--surface-border);
  background: var(--bg-secondary);
  color: var(--text-primary);
  transition: all 0.15s ease;
}

.btn-secondary:hover {
  background: var(--surface-hover);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: var(--radius-sm);
  border: none;
  background: none;
  color: var(--text-tertiary);
  transition: all 0.15s ease;
}

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

/* ============ CARDS ============ */
.card {
  background: var(--surface-card);
  border: none;
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.card-link {
  font-size: 0.78rem;
  color: var(--text-tertiary);
  transition: color 0.15s ease;
}

.card-link:hover {
  color: var(--text-primary);
}

/* ============ WELCOME ============ */
.welcome-heading {
  font-size: 1.75rem;
  font-weight: 400;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
  color: var(--text-primary);
}

/* ============ METRICS GRID ============ */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.metric-card {
  background: var(--surface-card);
  border: none;
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.metric-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.metric-label {
  font-size: 0.78rem;
  font-weight: 450;
  color: var(--text-secondary);
}

.metric-change {
  font-size: 0.72rem;
  font-weight: 500;
}

.metric-change.positive { color: var(--color-success); }
.metric-change.warning { color: var(--color-warning); }
.metric-change.negative { color: var(--color-error); }

.metric-value {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  margin: 8px 0 16px;
}

.metric-sparkline {
  height: 40px;
  width: 100%;
}

.metric-sparkline svg {
  width: 100%;
  height: 100%;
}

/* ============ DASHBOARD GRID ============ */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
}

/* Activity list (dashboard) */
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

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

.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}

.activity-dot.green { background: var(--color-success); }
.activity-dot.yellow { background: var(--color-warning); }
.activity-dot.red { background: var(--color-error); }
.activity-dot.blue { background: var(--color-info); }
.activity-dot.purple { background: #7C3AED; }

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

.activity-text {
  font-size: 0.82rem;
  color: var(--text-primary);
  line-height: 1.4;
}

.activity-text strong {
  font-weight: 550;
}

.activity-time {
  font-size: 0.72rem;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* Agent performance list (dashboard) */
.agent-perf-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.agent-perf-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

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

.agent-perf-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 600;
  flex-shrink: 0;
  background: var(--bg-primary);
  color: var(--text-secondary);
  border: 1px solid var(--surface-border);
}

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

.agent-perf-name {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-primary);
}

.agent-perf-role {
  font-size: 0.72rem;
  color: var(--text-tertiary);
}

.agent-perf-bar {
  width: 80px;
  height: 4px;
  background: var(--bg-primary);
  border-radius: 2px;
  overflow: hidden;
}

.agent-perf-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--color-success);
  transition: width 0.6s ease;
}

.agent-perf-stat {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  min-width: 36px;
  text-align: right;
}

/* ============ VIEW HEADER ============ */
.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
}

/* Tabs */
.view-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--surface-border);
}

.tab {
  padding: 8px 16px;
  font-size: 0.82rem;
  font-weight: 450;
  color: var(--text-tertiary);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  transition: all 0.15s ease;
  margin-bottom: -1px;
}

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

.tab.active {
  color: var(--text-primary);
  font-weight: 500;
  border-bottom-color: var(--text-primary);
}

/* ============ AGENTS TABLE ============ */
.agents-table-wrap {
  background: var(--surface-card);
  border: none;
  border-radius: var(--radius-lg);
  overflow-x: auto;
  overflow-y: visible;
  box-shadow: var(--shadow-md);
  -webkit-overflow-scrolling: touch;
}

.agents-table {
  width: 100%;
  min-width: 800px;
  border-collapse: collapse;
}

.agents-table th {
  padding: 13px 20px;
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  text-align: left;
  background: var(--bg-tertiary);
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.agents-table td {
  padding: 15px 20px;
  font-size: 0.82rem;
  color: var(--text-primary);
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

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

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

.agent-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.agent-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 600;
  flex-shrink: 0;
  background: var(--bg-primary);
  color: var(--text-secondary);
  border: 1px solid var(--surface-border);
}

.agent-name {
  font-weight: 500;
}

/* Status badges — semantic */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 450;
}

.status-badge.active {
  background: var(--color-success-bg);
  color: var(--color-success);
}

.status-badge.inactive {
  background: var(--color-neutral-bg);
  color: var(--color-neutral);
}

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

/* Success rate bar */
.success-rate {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rate-bar {
  width: 60px;
  height: 4px;
  background: var(--bg-primary);
  border-radius: 2px;
  overflow: hidden;
}

.rate-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--color-success);
}

/* ============ KANBAN ============ */
.kanban {
  display: grid;
  grid-template-columns: repeat(4, minmax(260px, 1fr));
  gap: 16px;
  align-items: flex-start;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  padding-bottom: 4px; /* Space for scrollbar */
}

.kanban-column {
  scroll-snap-align: start;
  background: var(--bg-tertiary);
  border: none;
  border-radius: var(--radius-lg);
  min-height: 260px;
  box-shadow: var(--shadow-sm);
  min-width: 0;
}

.kanban-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
}

.kanban-column-title {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-primary);
}

.kanban-column-count {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-tertiary);
  background: var(--surface-border);
  padding: 1px 8px;
  border-radius: var(--radius-pill);
}

.kanban-cards {
  padding: 0 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 100px;
}

.kanban-card {
  background: var(--surface-card);
  border: none;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  cursor: grab;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.kanban-card:hover {
  box-shadow: var(--shadow-md);
}

.kanban-card.dragging {
  opacity: 0.5;
  transform: rotate(2deg);
}

.kanban-card-title {
  font-size: 0.82rem;
  font-weight: 450;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.4;
}

.kanban-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

/* Tags — muted semantic colors */
.kanban-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
  font-weight: 500;
}

.kanban-tag.research {
  background: var(--color-info-bg);
  color: var(--color-info);
}

.kanban-tag.code {
  background: var(--color-success-bg);
  color: var(--color-success);
}

.kanban-tag.writing {
  background: rgba(124, 58, 237, 0.08);
  color: #7C3AED;
}

.kanban-tag.analysis {
  background: var(--color-warning-bg);
  color: var(--color-warning);
}

.kanban-tag.review {
  background: var(--color-error-bg);
  color: var(--color-error);
}

.kanban-assignee {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 600;
  background: var(--bg-primary);
  color: var(--text-secondary);
  border: 1px solid var(--surface-border);
}

.kanban-card-priority {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--text-tertiary);
}

.priority-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.priority-dot.high { background: var(--color-error); }
.priority-dot.medium { background: var(--color-warning); }
.priority-dot.low { background: var(--color-success); }

/* ============ CAMPAIGNS ============ */
.campaign-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
  padding: 4px 0;
}

.campaign-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s;
}

.campaign-card:hover {
  border-color: var(--border-active);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  transform: translateY(-1px);
}

.campaign-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.campaign-status {
  font-size: 0.78rem;
  font-weight: 600;
}

.campaign-type-badge {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 12px;
  background: var(--bg-tertiary);
  color: var(--text-tertiary);
}

.campaign-card-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 6px;
  color: var(--text-primary);
}

.campaign-subject {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin: 0 0 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.campaign-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 12px 0;
  border-top: 1px solid var(--border-primary);
  border-bottom: 1px solid var(--border-primary);
}

.campaign-metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.campaign-metric-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.campaign-metric-label {
  font-size: 0.68rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.campaign-card-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--text-tertiary);
}

/* Campaign Detail */
.campaign-detail-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.campaign-detail-metric {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-primary);
}

.cdm-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.cdm-data { display: flex; flex-direction: column; gap: 2px; }
.cdm-value { font-size: 1.2rem; font-weight: 700; }
.cdm-label { font-size: 0.75rem; color: var(--text-tertiary); }

.campaign-status-large {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: capitalize;
}

.campaign-status-large.active { background: rgba(34,197,94,0.1); color: #22c55e; }
.campaign-status-large.paused { background: rgba(245,158,11,0.1); color: #f59e0b; }
.campaign-status-large.draft { background: var(--bg-tertiary); color: var(--text-tertiary); }
.campaign-status-large.completed { background: rgba(59,130,246,0.1); color: #3b82f6; }

.campaign-batches {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.campaign-batch {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-primary);
  font-size: 0.85rem;
}

.batch-number { font-weight: 600; min-width: 70px; }
.batch-recipients { flex: 1; color: var(--text-secondary); }
.batch-status {
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
}
.batch-status.completed { background: rgba(34,197,94,0.1); color: #22c55e; }
.batch-status.sending { background: rgba(59,130,246,0.1); color: #3b82f6; }
.batch-status.pending { background: var(--bg-tertiary); color: var(--text-tertiary); }

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

/* ============ CHAT ============ */
.chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 152px);
  background: var(--surface-card);
  border: none;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.chat-welcome {
  text-align: center;
  padding: 80px 20px 40px;
}

.chat-welcome-icon {
  margin-bottom: 16px;
}

.chat-welcome-icon i {
  width: 48px;
  height: 48px;
  color: var(--text-tertiary);
}

.chat-welcome h2 {
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.chat-welcome p {
  font-size: 0.85rem;
  color: var(--text-tertiary);
  max-width: 400px;
  margin: 0 auto 24px;
}

.chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.suggestion-chip {
  padding: 8px 14px;
  background: var(--bg-primary);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.suggestion-chip:hover {
  border-color: rgba(0, 0, 0, 0.15);
  color: var(--text-primary);
}

.chat-msg {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  max-width: 700px;
}

.chat-msg.user {
  flex-direction: row-reverse;
  margin-left: auto;
}

.chat-msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 600;
  flex-shrink: 0;
  background: var(--bg-primary);
  color: var(--text-secondary);
  border: 1px solid var(--surface-border);
}

.chat-msg.user .chat-msg-avatar {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.chat-msg-bubble {
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-primary);
}

.chat-msg.assistant .chat-msg-bubble {
  background: var(--bg-primary);
  border: 1px solid var(--surface-border);
}

.chat-msg.user .chat-msg-bubble {
  background: var(--accent);
  color: #FFFFFF;
}

/* Chat input */
.chat-input-area {
  padding: 20px 24px;
  border-top: 1px solid rgba(0, 0, 0, 0.04);
}

.chat-input-wrap {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  background: var(--bg-primary);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-lg);
  padding: 10px 14px;
}

.chat-input-wrap textarea {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  resize: none;
  color: var(--text-primary);
  font-size: 0.85rem;
  line-height: 1.5;
  min-height: 24px;
  max-height: 120px;
}

.chat-input-wrap textarea::placeholder {
  color: var(--text-tertiary);
}

.chat-send {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  border: none;
  border-radius: 50%;
  color: #FFFFFF;
  flex-shrink: 0;
  transition: opacity 0.15s;
}

.chat-send:hover {
  opacity: 0.9;
}

/* ============ DOCUMENTS ============ */
.drop-zone {
  border: 2px dashed rgba(0, 0, 0, 0.1);
  border-radius: var(--radius-lg);
  padding: 48px;
  text-align: center;
  margin-bottom: 28px;
  background: rgba(255, 255, 255, 0.5);
  transition: all 0.2s ease;
}

.drop-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-bg);
}

.drop-zone-icon {
  width: 48px;
  height: 48px;
  color: var(--text-tertiary);
  margin-bottom: 12px;
}

.drop-zone h3 {
  font-size: 0.92rem;
  font-weight: 500;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.drop-zone p {
  font-size: 0.78rem;
  color: var(--text-tertiary);
}

.documents-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--surface-card);
  border: none;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.document-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  transition: background 0.15s ease;
}

.document-card:last-child {
  border-bottom: none;
}

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

.doc-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.doc-icon.pdf { background: var(--color-error-bg); color: var(--color-error); }
.doc-icon.doc { background: var(--color-info-bg); color: var(--color-info); }
.doc-icon.csv { background: var(--color-success-bg); color: var(--color-success); }
.doc-icon.md { background: rgba(124, 58, 237, 0.08); color: #7C3AED; }
.doc-icon.txt { background: var(--color-neutral-bg); color: var(--color-neutral); }

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

.doc-name {
  font-size: 0.85rem;
  font-weight: 450;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.doc-meta {
  font-size: 0.72rem;
  color: var(--text-tertiary);
}

.doc-status {
  font-size: 0.72rem;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.doc-status.ready {
  color: var(--color-success);
  background: var(--color-success-bg);
}

.doc-status.processing {
  color: var(--color-warning);
  background: var(--color-warning-bg);
}

.doc-status.error {
  color: var(--color-error);
  background: var(--color-error-bg);
}

/* ============ ACTIVITY TIMELINE ============ */
.activity-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--surface-card);
  border: none;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.timeline-item {
  display: flex;
  gap: 16px;
  padding: 20px 28px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

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

.timeline-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}

.timeline-dot.green { background: var(--color-success); }
.timeline-dot.blue { background: var(--color-info); }
.timeline-dot.yellow { background: var(--color-warning); }
.timeline-dot.red { background: var(--color-error); }
.timeline-dot.purple { background: #7C3AED; }

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

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.timeline-title {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
}

.timeline-time {
  font-size: 0.72rem;
  color: var(--text-tertiary);
}

.timeline-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 6px;
}

.timeline-agent {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--text-tertiary);
}

.timeline-agent-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-neutral);
}

/* Activity filter */
.activity-filter {
  display: flex;
  align-items: center;
  gap: 8px;
}

.select-minimal {
  padding: 6px 12px;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-pill);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 0.78rem;
  outline: none;
  cursor: pointer;
}

/* ============ MODALS ============ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

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

.modal {
  background: var(--bg-secondary);
  border: none;
  border-radius: var(--radius-lg);
  width: 520px;
  max-width: 90vw;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(10px);
  transition: transform 0.2s ease;
}

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

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 0;
}

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

.modal-close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
  font-size: 1.2rem;
  transition: all 0.15s;
}

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

.modal-body {
  padding: 20px 24px 24px;
}

/* Form elements */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.15s;
}

.form-input:focus {
  border-color: var(--accent);
}

.form-select {
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

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

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.04);
}

/* ============ LOGIN SCREEN ============ */
.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg-primary);
}

.login-card {
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 400px;
  margin: 20px;
}

.login-logo {
  text-align: center;
}

.login-logo svg {
  margin: 0 auto;
  display: block;
}

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

/* Large desktop — graceful narrowing */
@media (max-width: 1400px) {
  .content { padding: 28px 32px 40px; }
  .topbar { padding: 14px 32px; }
}

/* Medium desktop / large tablet — 2-column metrics, stack dashboard */
@media (max-width: 1200px) {
  .kanban {
    grid-template-columns: repeat(4, minmax(240px, 1fr));
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

/* Narrow window / iPad landscape — collapse sidebar, scroll kanban */
@media (max-width: 1024px) {
  .sidebar {
    width: 200px;
    min-width: 200px;
  }
  .sidebar-header { padding: 20px 16px 12px; }
  .sidebar-nav { padding: 4px 8px; }
  .nav-item { padding: 8px 12px; font-size: 0.82rem; }
  .content { padding: 24px 24px 36px; }
  .topbar { padding: 12px 24px; }
  .action-bar { margin-bottom: 24px; }
  .welcome-heading { font-size: 1.5rem; margin-bottom: 16px; }
  .card { padding: 22px; }
  .metric-card { padding: 20px 22px; }
}

/* Tablet portrait / half-screen — sidebar collapses to icons */
@media (max-width: 860px) {
  .sidebar {
    width: 64px;
    min-width: 64px;
  }
  .sidebar-header { padding: 16px 0 12px; justify-content: center; }
  .logo-text { display: none; }
  .logo { justify-content: center; }
  .nav-label { display: none; }
  .nav-item {
    justify-content: center;
    padding: 10px;
    gap: 0;
  }
  .nav-item span { display: none; }
  .nav-badge { display: none; }
  .sidebar-footer { padding: 8px; }
  .user-card { justify-content: center; padding: 6px; }
  .user-info { display: none; }

  .content { padding: 20px 20px 32px; }
  .topbar { padding: 12px 20px; min-height: 52px; }
  .search-box { min-width: 160px; }
  .search-box::after { display: none; }
  .action-btn { padding: 8px 14px; font-size: 0.78rem; }
  .kanban {
    grid-template-columns: repeat(4, minmax(220px, 1fr));
  }
}

/* Small mobile — full stack */
@media (max-width: 640px) {
  .sidebar { display: none; }
  .content { padding: 16px 16px 24px; }
  .topbar { padding: 10px 16px; min-height: 48px; }
  .page-title { font-size: 0.9rem; }
  .search-box { min-width: 0; flex: 1; }
  .welcome-heading { font-size: 1.25rem; }
  .action-bar {
    gap: 8px;
    margin-bottom: 20px;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }
  .action-btn {
    flex-shrink: 0;
    white-space: nowrap;
  }
  .dashboard-grid { grid-template-columns: 1fr; }
  .kanban {
    grid-template-columns: repeat(4, minmax(280px, 1fr));
    gap: 12px;
  }
  .card { padding: 20px; }
  .card-header { margin-bottom: 12px; }
  .chat-container { height: calc(100vh - 120px); }
}

/* Tiny mobile */
@media (max-width: 480px) {
  .metrics-grid { gap: 12px; }
  .metric-card { padding: 18px; }
  .topbar-right { gap: 4px; }
  .btn-icon { width: 32px; height: 32px; }
}

/* Smooth transitions for resize */
.sidebar,
.content,
.topbar,
.metrics-grid,
.dashboard-grid {
  transition: padding 0.2s ease;
}

/* ============ AGENT ACTIONS GRID ============ */
.agent-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.action-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 20px;
  background: var(--bg-primary);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
}

.action-card:hover {
  background: var(--bg-secondary);
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: var(--shadow-sm);
}

.action-card.action-danger:hover {
  border-color: rgba(239, 68, 68, 0.2);
  background: var(--color-error-bg);
}

.action-title {
  font-size: 0.85rem;
  font-weight: 550;
  color: var(--text-primary);
}

.action-desc {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

/* ============ STANDING INSTRUCTIONS ============ */
.instr-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

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

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

.instr-text {
  font-size: 0.85rem;
  color: var(--text-primary);
  line-height: 1.4;
  word-break: break-word;
}

.instr-meta {
  display: flex;
  gap: 12px;
  margin-top: 4px;
}

.instr-schedule {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-bg);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.instr-last {
  font-size: 0.72rem;
  color: var(--text-tertiary);
}

.instr-actions {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}

.form-divider {
  height: 1px;
  background: var(--surface-border);
  margin: 8px 0;
}

/* ============ ACTIVITY TIMELINE (Full View) ============ */
.activity-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.activity-timeline .activity-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

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

.dot-accent {
  background: var(--accent) !important;
}

.activity-body {
  flex: 1;
  min-width: 0;
}

.activity-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.activity-agent {
  font-size: 0.82rem;
  font-weight: 550;
  color: var(--text-primary);
}

.activity-type {
  font-size: 0.72rem;
  text-transform: capitalize;
}

.badge-subtle {
  font-size: 0.7rem;
  font-weight: 450;
  color: var(--text-tertiary);
  background: var(--bg-primary);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--surface-border);
}

.activity-detail {
  font-size: 0.78rem;
  color: var(--text-tertiary);
  margin-top: 4px;
  word-break: break-word;
  font-family: 'JetBrains Mono', monospace;
  line-height: 1.4;
}

.activity-filter {
  flex-shrink: 0;
}

.select-minimal {
  padding: 6px 12px;
  font-size: 0.82rem;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-pill);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  cursor: pointer;
}

/* ============ DANGER COLOR VARIABLE ============ */
:root {
  --danger: #EF4444;
}

/* ═══════════════════════════════════════════════════════════════
   MAPS SYSTEM — AI-Generated Business Roadmaps
   ═══════════════════════════════════════════════════════════════ */

/* Hero / Generator */
.map-generator {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 0;
}

.map-hero {
  text-align: center;
  margin-bottom: 32px;
}

.map-hero-icon {
  font-size: 3.5rem;
  margin-bottom: 12px;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.1));
}

.map-hero h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0 0 8px;
  background: linear-gradient(135deg, var(--text-primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.map-hero p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: 480px;
  margin: 0 auto;
}

.map-form {
  background: var(--bg-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

/* Loading */
.map-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  text-align: center;
}

.map-loading h3 {
  margin: 20px 0 8px;
  font-weight: 600;
}

.map-loading p {
  color: var(--text-tertiary);
  font-size: 0.85rem;
}

.map-loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--surface-border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: mapSpin 0.8s linear infinite;
}

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

/* Maps Grid */
.maps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.map-card {
  background: var(--bg-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.map-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
  transform: translateY(-2px);
}

.map-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.map-card-type {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  text-transform: capitalize;
}

.map-status-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  text-transform: capitalize;
}

.map-card-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 8px;
}

.map-card-meta {
  display: flex;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.map-progress-bar {
  height: 4px;
  background: var(--surface-border);
  border-radius: 2px;
  margin-top: 12px;
  overflow: hidden;
}

.map-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #22c55e);
  border-radius: 2px;
  transition: width 0.5s ease;
}

/* Map Detail */
.map-detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--surface-border);
}

.map-research {
  background: linear-gradient(135deg, #f0f9ff, #f0fdf4);
  border: 1px solid #e0f2fe;
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 24px;
}

/* Timeline */
.map-timeline {
  padding: 8px 0;
}

.map-step {
  display: flex;
  gap: 16px;
  margin-bottom: 0;
}

.map-step-connector {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 40px;
  flex-shrink: 0;
}

.map-step-number {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
  z-index: 1;
}

.map-step.completed .map-step-number { background: #22c55e; }
.map-step.in_progress .map-step-number { background: #3b82f6; animation: pulse 2s infinite; }
.map-step.failed .map-step-number { background: #ef4444; }
.map-step.pending .map-step-number { background: var(--text-tertiary); }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(59, 130, 246, 0); }
}

.map-step-line {
  width: 2px;
  flex: 1;
  min-height: 20px;
  background: var(--surface-border);
}

.map-step.completed .map-step-line { background: #22c55e; }
.map-step.in_progress .map-step-line { background: #3b82f6; }

.map-step-card {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 12px;
  transition: all 0.2s ease;
}

.map-step.completed .map-step-card { border-left: 3px solid #22c55e; }
.map-step.in_progress .map-step-card { border-left: 3px solid #3b82f6; box-shadow: 0 2px 12px rgba(59,130,246,0.08); }
.map-step.failed .map-step-card { border-left: 3px solid #ef4444; }

.map-step-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 6px;
}

.map-step-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0;
}

.map-step-status {
  font-size: 0.7rem;
  font-weight: 500;
  white-space: nowrap;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--bg-secondary);
}

.map-step-status.completed { background: #dcfce7; color: #166534; }
.map-step-status.in_progress { background: #dbeafe; color: #1e40af; }
.map-step-status.failed { background: #fee2e2; color: #991b1b; }

.map-step-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0 0 10px;
}

.map-step-meta {
  display: flex;
  gap: 16px;
  font-size: 0.78rem;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}

.map-step-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.skill-pill {
  font-size: 0.68rem;
  padding: 2px 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-pill);
  color: var(--text-tertiary);
}

/* ═══════════════════════════════════════════════════════════════
   GOALS TERMINAL — Live Execution Logs
   ═══════════════════════════════════════════════════════════════ */

.goal-terminal {
  background: #0d1117;
  border-radius: 12px;
  border: 1px solid #30363d;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.goal-terminal-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: #161b22;
  border-bottom: 1px solid #30363d;
}

.goal-terminal-header .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.goal-terminal-header .dot.red { background: #ff5f56; }
.goal-terminal-header .dot.yellow { background: #ffbd2e; }
.goal-terminal-header .dot.green { background: #27c93f; }

.goal-terminal-title {
  flex: 1;
  text-align: center;
  font-size: 0.72rem;
  color: #6e7681;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}

.goal-terminal-body {
  padding: 16px;
  min-height: 180px;
  max-height: 400px;
  overflow-y: auto;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.8rem;
  line-height: 1.7;
  color: #3fb950;
}

.goal-terminal-body::-webkit-scrollbar { width: 6px; }
.goal-terminal-body::-webkit-scrollbar-track { background: transparent; }
.goal-terminal-body::-webkit-scrollbar-thumb { background: #30363d; border-radius: 3px; }

.term-line {
  opacity: 0;
  animation: termLineIn 0.3s ease forwards;
}
.term-line::before { content: '> '; color: #484f58; }
.term-line.cyan { color: #58a6ff; }
.term-line.dim { color: #6e7681; }
.term-line.white { color: #e6edf3; }
.term-line.green { color: #3fb950; }
.term-line.bold { color: #fff; font-weight: 700; }
.term-line.error { color: #f85149; }
.term-line.success { color: #3fb950; font-weight: 600; }

@keyframes termLineIn {
  from { opacity: 0; transform: translateX(-6px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ═══ Goals Split-Panel Layout ═══ */
.goal-detail-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  min-height: 500px;
}

.goal-steps-panel {
  overflow-y: auto;
  max-height: calc(100vh - 200px);
}

.goal-execution-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Goal progress bar */
.goal-progress {
  background: var(--bg-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
}
.goal-progress-title {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 4px;
}
.goal-progress-subtitle {
  font-size: 0.78rem;
  color: var(--text-tertiary);
  margin-bottom: 12px;
}
.goal-progress-bar {
  height: 8px;
  background: var(--surface-border);
  border-radius: 4px;
  overflow: hidden;
}
.goal-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #22c55e);
  border-radius: 4px;
  transition: width 0.6s ease;
}
.goal-progress-stats {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 0.72rem;
  color: var(--text-tertiary);
}

/* Step output card */
.step-output {
  margin-top: 10px;
  background: #f8fafc;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--text-secondary);
  white-space: pre-wrap;
  max-height: 200px;
  overflow-y: auto;
}

.step-output-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--accent);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
}
.step-output-toggle:hover { text-decoration: underline; }

/* Step timer */
.step-timer {
  font-size: 0.72rem;
  font-weight: 600;
  color: #3b82f6;
  font-family: 'SF Mono', 'Fira Code', monospace;
}

/* Responsive */
@media (max-width: 1024px) {
  .goal-detail-split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .goal-terminal-body {
    font-size: 0.72rem;
    min-height: 120px;
    max-height: 250px;
  }
}


/* ══════════════════════════════════════════════
   GOAL OS COCKPIT — Single-screen OS-style view
   ══════════════════════════════════════════════ */

/* Hide topbar (page title) when cockpit takes over the full screen */
.content.cockpit-mode ~ header,
.main:has(.content.cockpit-mode) .topbar,
.topbar:has(~ .content.cockpit-mode) { display: none; }

/* Make the content area full-height with no padding when in cockpit mode */
.content.cockpit-mode {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 0px);
  max-height: 100vh;
}

/* Force the container chain inside cockpit mode to pass down full flex height,
   overriding any inline display: block styles from JS that break the layout.
   MUST include .active — without it the flex !important overrides .view { display: none }
   and the cockpit bleeds into every other section (settings, documents, etc.) */
.content.cockpit-mode #view-maps.active,
.content.cockpit-mode #view-maps.active #mapsContainer,
.content.cockpit-mode #view-maps.active #mapDetail,
.content.cockpit-mode #view-maps.active #mapDetailContent {
  display: flex !important;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
}

/* Outer wrapper — fills remaining space */
.goal-cockpit {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* ── Cockpit Header ── */
.cockpit-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  background: var(--bg-secondary);
  flex-shrink: 0;
}

/* Top-right section management bar */
.cockpit-manage-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
}

.cockpit-manage-label {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-tertiary);
  margin-right: 2px;
  letter-spacing: 0.02em;
}

.cockpit-manage-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 13px;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
}
.cockpit-manage-btn.secondary {
  background: transparent;
  color: var(--text-primary);
  border-color: rgba(0,0,0,0.15);
}
.cockpit-manage-btn:hover { opacity: 0.85; }
.cockpit-manage-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.cockpit-manage-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Slide-down goal manager panel */
.cockpit-goal-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.28s cubic-bezier(0.4,0,0.2,1),
              padding 0.28s cubic-bezier(0.4,0,0.2,1);
  background: var(--bg-secondary);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  padding: 0 24px;
}
.cockpit-goal-panel.open {
  max-height: 220px;
  padding: 14px 24px;
}

.cockpit-panel-mode { width: 100%; }

/* New goal text input */
.cockpit-goal-input {
  flex: 1;
  padding: 8px 14px;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
  background: var(--bg-secondary);
  color: var(--text-primary);
  transition: border-color 0.15s;
  min-width: 0;
}
.cockpit-goal-input:focus { border-color: var(--accent); }
.cockpit-goal-input::placeholder { color: var(--text-tertiary); }

/* Existing goals chip list */
.cockpit-goal-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  max-height: 150px;
  overflow-y: auto;
}

.cockpit-goal-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 13px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(0,0,0,0.1);
  background: var(--bg-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--text-primary);
}
.cockpit-goal-chip:hover { border-color: var(--accent); background: var(--accent-bg); }
.cockpit-goal-chip.active { border-color: var(--accent); background: var(--accent-bg); font-weight: 600; }

.cockpit-chip-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.cockpit-chip-title { max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cockpit-chip-steps { font-size: 0.68rem; color: var(--text-tertiary); flex-shrink: 0; }

.cockpit-goal-title {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cockpit-progress-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.cockpit-progress-bar {
  width: 120px;
  height: 5px;
  background: rgba(0,0,0,0.08);
  border-radius: 10px;
  overflow: hidden;
}

.cockpit-progress-fill {
  height: 100%;
  border-radius: 10px;
  background: #22c55e;
  transition: width 0.5s ease;
}

.cockpit-pct {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 30px;
}

.cockpit-change-goal {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}
.cockpit-change-goal:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

/* ── Cockpit Body: left + right panels ── */
/* (canonical rules below at .goal-cockpit redeclaration) */

/* ─── Logs panel — contained terminal widget, not a rogue strip ─── */
.cockpit-logs {
  background: #0d1117;          /* GitHub dark — rich, intentional */
  color: #8b949e;
  font-family: 'SF Mono', 'Fira Code', 'Menlo', monospace;
  font-size: 0.73rem;
  line-height: 1.65;
  flex-shrink: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.4,0,0.2,1);
  max-height: 100px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  cursor: pointer;
  user-select: none;
  margin: 16px 16px 0;         /* breathe away from all edges */
  border-radius: 10px 10px 0 0; /* rounded top corners = contained widget */
  border: 1px solid rgba(255,255,255,0.06);
  border-bottom: none;
}
.cockpit-logs:not(.expanded):hover {
  background: #0f1923;
}
.cockpit-logs.expanded {
  max-height: 260px;
  overflow-y: auto;
  cursor: default;
  user-select: text;
  border-radius: 10px;          /* full radius when tall */
  margin-bottom: 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

/* Tiny label row at top of logs so it reads as intentional */
.cockpit-logs::before {
  content: 'LOGS';
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.2);
  padding: 7px 14px 4px;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

/* The inner padding container */
.cockpit-logs-body { padding: 10px 18px; }

/* Log toggle button in header */
.cockpit-logs-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 100px;
  background: rgba(0,0,0,0.06);
  border: 1px solid rgba(0,0,0,0.1);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.cockpit-logs-btn:hover { background: rgba(0,0,0,0.1); color: var(--text-primary); }
.cockpit-logs-btn svg { width: 12px; height: 12px; transition: transform 0.22s; }
.cockpit-logs-btn.active svg { transform: rotate(180deg); }

.cockpit-logs .term-line { display: block; }
.cockpit-logs .term-line.success { color: #4ade80; }
.cockpit-logs .term-line.error { color: #f87171; }
.cockpit-logs .term-line.cyan { color: #67e8f9; }
.cockpit-logs .term-line.dim { color: #64748b; }
.cockpit-logs .term-line.white { color: #f1f5f9; }
.cockpit-logs .term-line.bold { font-weight: 700; color: #fff; }
.cockpit-logs .term-log-label {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #475569;
  padding: 0 0 4px;
}

/* Task cards section — NO overflow-y here; .cockpit-left is the scroll container */
.cockpit-tasks {
  padding: 20px 24px;
  background: var(--bg-secondary);
  /* grows to fit all content: tasks + resources */
}

.cockpit-tasks-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.cockpit-tasks-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-tertiary);
}

.cockpit-run-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  font-size: 0.78rem;
  font-weight: 500;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(0,0,0,0.1);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}
.cockpit-run-all:hover {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}

/* Task cards — responsive auto-fill grid */
.cockpit-task-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.cockpit-task-card {
  background: var(--bg-secondary);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: var(--radius-lg);
  padding: 0;
  cursor: pointer;
  transition: all 0.18s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  user-select: none;
}

/* Strong hover — lift + darker border + shadow to signal interactivity */
.cockpit-task-card:not(.done):hover {
  border-color: var(--accent);
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}

/* Card body */
.cockpit-task-card-body {
  padding: 16px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

/* Bottom CTA strip — visible but secondary at rest, bold on hover */
.cockpit-card-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-tertiary);
  border-top: 1px solid rgba(0,0,0,0.05);
  background: transparent;
  transition: all 0.18s ease;
  letter-spacing: 0.01em;
}
.cockpit-card-cta svg { width: 13px; height: 13px; transition: transform 0.2s; }

/* On card hover — CTA lights up */
.cockpit-task-card:not(.done):hover .cockpit-card-cta {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}
.cockpit-task-card:not(.done):hover .cockpit-card-cta svg {
  transform: scale(1.15);
}

.cockpit-task-card.running {
  border-color: #3b82f6;
  background: rgba(59,130,246,0.02);
}
.cockpit-task-card.running .cockpit-card-cta {
  background: #3b82f620;
  color: #3b82f6;
}

.cockpit-task-card.done {
  border-color: #22c55e20;
  background: rgba(34,197,94,0.03);
  opacity: 0.7;
  cursor: default;
}
.cockpit-task-card.done .cockpit-card-cta {
  color: #22c55e;
  background: rgba(34,197,94,0.06);
}

/* Journey spinner for running state */
.spinner-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  animation: spinnerPulse 1s ease-in-out infinite;
  margin-right: 4px;
  vertical-align: middle;
}
@keyframes spinnerPulse {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}

.cockpit-card-tag {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  margin-bottom: 2px;
}

.cockpit-card-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
}

.cockpit-card-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.5;
  flex: 1;
  /* clamp to 2 lines */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cockpit-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.cockpit-card-agent {
  font-size: 0.7rem;
  color: var(--text-tertiary);
}

.cockpit-card-run {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}
.cockpit-card-run:hover { background: var(--accent-hover); }
.cockpit-card-run:disabled {
  background: #22c55e;
  cursor: default;
}
.cockpit-card-run.loading {
  background: #3b82f6;
  pointer-events: none;
}

/* ── Goal Cockpit Layout (canonical) ── */
.goal-cockpit {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.cockpit-body {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden; /* clips the pair; each child controls its own scroll */
}

/* LEFT: scrolls as a whole — logs + tasks + resources all in one flow */
.cockpit-left {
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;   /* THE single scroll container for the left side */
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(0,0,0,0.06);
  /* custom scrollbar */
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.15) transparent;
}
.cockpit-left::-webkit-scrollbar { width: 4px; }
.cockpit-left::-webkit-scrollbar-track { background: transparent; }
.cockpit-left::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 2px; }

@media (max-width: 768px) {
  /* Mobile: stack panels vertically, both scroll with the page */
  .cockpit-body {
    flex-direction: column;
    overflow: visible;
    height: auto;
  }
  .cockpit-left {
    overflow-y: visible;
    border-right: none;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    min-height: auto;
  }
  .cockpit-chat {
    width: 100% !important;
    max-height: 70vh;
    min-height: 360px;
  }
  .content.cockpit-mode {
    overflow-y: auto !important;
    height: auto !important;
    max-height: none !important;
  }
  .goal-cockpit {
    height: auto;
    overflow: visible;
  }
}

/* ── RIGHT: Agent Chat Panel ── */
.cockpit-chat {
  width: 340px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
  overflow: hidden;
  min-height: 0;
}

.cockpit-chat-header {
  padding: 16px 20px 12px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.cockpit-chat-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.cockpit-chat-messages {
  flex: 1;
  min-height: 0;
  max-height: calc(100vh - 160px);
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

.cockpit-chat-msg {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-width: 90%;
}

.cockpit-chat-msg.user { align-self: flex-end; align-items: flex-end; }
.cockpit-chat-msg.agent { align-self: flex-start; }

.cockpit-chat-bubble {
  padding: 8px 12px;
  border-radius: 14px;
  font-size: 0.8rem;
  line-height: 1.5;
}

.cockpit-chat-msg.user .cockpit-chat-bubble {
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.cockpit-chat-msg.agent .cockpit-chat-bubble {
  background: var(--bg-primary);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
  border: 1px solid rgba(0,0,0,0.07);
}

.cockpit-chat-time {
  font-size: 0.62rem;
  color: var(--text-tertiary);
  padding: 0 4px;
}

.cockpit-chat-input-wrap {
  padding: 12px 16px;
  border-top: 1px solid rgba(0,0,0,0.06);
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-shrink: 0;
}

.cockpit-chat-input {
  flex: 1;
  background: var(--bg-primary);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 0.8rem;
  resize: none;
  outline: none;
  font-family: inherit;
  color: var(--text-primary);
  max-height: 100px;
  overflow-y: auto;
  transition: border-color 0.15s;
}

.cockpit-chat-input:focus {
  border-color: rgba(0,0,0,0.18);
}

.cockpit-chat-send {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.cockpit-chat-send:hover { background: var(--accent-hover); }
.cockpit-chat-send svg { width: 14px; height: 14px; }

/* ── BOTTOM: Resources + Launch Emails ── */
.cockpit-resources {
  border-top: 1px solid rgba(0,0,0,0.06);
  background: var(--bg-secondary);
  padding: 16px 24px;
  overflow-y: auto;
  max-height: 220px;
  flex-shrink: 0;
}

.cockpit-resources-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.cockpit-resources-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-tertiary);
}

.btn-launch-emails {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 18px;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--radius-pill);
  background: #16a34a;
  color: #fff;
  border: none;
  cursor: pointer;
  transition: all 0.18s;
  box-shadow: 0 2px 8px rgba(22,163,74,0.25);
}
.btn-launch-emails:hover {
  background: #15803d;
  box-shadow: 0 4px 14px rgba(22,163,74,0.35);
  transform: translateY(-1px);
}
.btn-launch-emails:active { transform: translateY(0); }

.cockpit-resources-grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.cockpit-resource-tile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-primary);
  border: 1px solid rgba(0,0,0,0.07);
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.15s;
  max-width: 260px;
}
.cockpit-resource-tile:hover {
  border-color: rgba(0,0,0,0.14);
  box-shadow: var(--shadow-sm);
}
.cockpit-resource-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}
.cockpit-resource-info { min-width: 0; }
.cockpit-resource-name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cockpit-resource-type {
  font-size: 0.68rem;
  color: var(--text-tertiary);
}

/* No resources placeholder */
.cockpit-resources-empty {
  font-size: 0.78rem;
  color: var(--text-tertiary);
  font-style: italic;
}

/* Artifact tiles — downloads from Supabase Storage */
.cockpit-artifacts-grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.artifact-tile {
  border-left: 3px solid var(--accent);
}
.artifact-tile:hover {
  border-left-color: var(--accent-hover);
}
.artifact-download {
  margin-left: auto;
  font-size: 0.9rem;
  opacity: 0.4;
  transition: opacity 0.15s;
}
.artifact-tile:hover .artifact-download {
  opacity: 1;
}

/* ── Responsive ── */
@media (max-width: 1100px) {
  .cockpit-chat { width: 280px; }
  .cockpit-task-cards { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .cockpit-body { flex-direction: column; }
  .cockpit-chat { width: 100%; height: 280px; border-right: none; border-top: 1px solid rgba(0,0,0,0.06); }
  .cockpit-task-cards { grid-template-columns: 1fr; }
}


/* Responsive */
@media (max-width: 1024px) {
  .goal-detail-split {
    grid-template-columns: 1fr;
  }
}

/* ═══════════════════════════════════════
   AGENTS WORKSPACE
   ═══════════════════════════════════════ */

/* Header */
.agents-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px 0;
}
.agents-header-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.agents-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}
.agents-subtitle {
  font-size: 0.72rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 500;
}

/* Two-panel layout */
.agents-workspace {
  display: flex;
  gap: 12px;
  flex: 1;
  overflow: hidden;
  padding: 16px;
  min-height: 0;
}

/* ─ Kanban ─ */
.agents-kanban {
  flex: 0 0 55%;
  max-width: 55%;
  display: flex;
  gap: 10px;
  overflow-x: hidden;
  overflow-y: hidden;
  padding-bottom: 0;
  min-width: 0;
}

.kanban-col {
  flex: 1;
  min-width: 0;
  max-width: 100%;
  background: #f8f9fa;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
}

.kanban-col-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  background: #fff;
  border-radius: 12px 12px 0 0;
  flex-shrink: 0;
}
.kanban-col-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.kanban-col-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}
.kanban-col-count {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-tertiary);
  background: rgba(0,0,0,0.06);
  padding: 1px 7px;
  border-radius: 20px;
}

.kanban-cards-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Individual task card */
.kb-card {
  background: #fff;
  border: 1px solid rgba(0,0,0,0.07);
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.kb-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transform: translateY(-1px);
}
.kb-card-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
}
.kb-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.kb-card-agent {
  font-size: 0.68rem;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  gap: 5px;
}
.kb-agent-avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(0,0,0,0.07);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--text-secondary);
  flex-shrink: 0;
}
.kb-card-status {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
}
.kb-card-status.queue    { background: rgba(148,163,184,0.15); color: #64748b; }
.kb-card-status.progress { background: rgba(59,130,246,0.12); color: #3b82f6; }
.kb-card-status.done     { background: rgba(34,197,94,0.12); color: #16a34a; }

/* Empty column state */
.kanban-empty {
  text-align: center;
  color: var(--text-tertiary);
  font-size: 0.75rem;
  padding: 24px 12px;
  border: 1.5px dashed rgba(0,0,0,0.1);
  border-radius: 8px;
  margin: 4px;
}


/* ─ Chat Pane ─ */

.agents-chat-pane {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.06);
  background: #fff;
  overflow: hidden;
  margin-left: 12px;
}

/* Roster pills strip */
.agents-chat-roster {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  flex-shrink: 0;
  scrollbar-width: none;
}
.agents-chat-roster::-webkit-scrollbar { display: none; }
.roster-loading {
  font-size: 0.72rem;
  color: var(--text-tertiary);
  padding: 4px 0;
}
.roster-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 6px;
  border-radius: 20px;
  border: 1px solid rgba(0,0,0,0.08);
  background: #f8f9fa;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.12s;
  white-space: nowrap;
}
.roster-pill:hover { background: #f0f1f3; border-color: rgba(0,0,0,0.14); }
.roster-pill-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0,0,0,0.08);
  font-size: 0.58rem;
  font-weight: 700;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.roster-pill-name {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-primary);
}
.roster-pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.roster-pill-dot.idle { background: #94a3b8; }
.roster-pill-dot.busy { background: #f59e0b; }
.roster-pill-dot.active { background: #22c55e; }

/* Chat messages area */
.agents-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.agents-chat-welcome {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: #f8f9fa;
  border-radius: 10px;
  margin-bottom: 4px;
}
.agents-chat-welcome-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}
.agents-chat-welcome-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.agents-chat-welcome-text strong {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}
.agents-chat-welcome-text span {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

/* Suggestion chips */
.agents-chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.agents-suggestion-chip {
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid rgba(0,0,0,0.1);
  background: #fff;
  font-size: 0.72rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.12s;
}
.agents-suggestion-chip:hover {
  background: var(--text-primary);
  color: #fff;
  border-color: var(--text-primary);
}

/* Chat bubbles */
.agents-chat-msg {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.agents-chat-msg.user { flex-direction: row-reverse; }
.agents-chat-bubble {
  max-width: 78%;
  padding: 9px 13px;
  border-radius: 12px;
  font-size: 0.8rem;
  line-height: 1.5;
}
.agents-chat-msg.user .agents-chat-bubble {
  background: var(--text-primary);
  color: #fff;
  border-radius: 12px 12px 2px 12px;
}
.agents-chat-msg.ai .agents-chat-bubble {
  background: #f1f3f5;
  color: var(--text-primary);
  border-radius: 12px 12px 12px 2px;
}

/* Chat input */
.agents-chat-input-area {
  padding: 12px;
  border-top: 1px solid rgba(0,0,0,0.06);
  flex-shrink: 0;
}
.agents-chat-input-wrap {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: #f8f9fa;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 10px;
  padding: 10px 12px;
  transition: border-color 0.15s;
}
.agents-chat-input-wrap:focus-within {
  border-color: var(--text-primary);
  background: #fff;
}
.agents-chat-input-wrap textarea {
  flex: 1;
  border: none;
  background: none;
  outline: none;
  resize: none;
  font-size: 0.82rem;
  color: var(--text-primary);
  font-family: inherit;
  line-height: 1.45;
  max-height: 120px;
  overflow-y: auto;
}
.agents-chat-input-wrap textarea::placeholder { color: var(--text-tertiary); }
.agents-chat-send {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--text-primary);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity 0.15s;
}
.agents-chat-send:hover { opacity: 0.8; }

@media (max-width: 640px) {
  .goal-terminal-body {
    font-size: 0.72rem;
    min-height: 120px;
    max-height: 250px;
  }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Phase 2 Billing Gate ─────────────────────────────────────────── */

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

/* Phase 2 card: full-color, same card look but with locked CTA */
.cockpit-task-card.phase2-card {
  border-color: rgba(124, 58, 237, 0.15);
  background: var(--bg-secondary);
}
.cockpit-task-card.phase2-card:hover {
  border-color: rgba(124, 58, 237, 0.4);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.1);
}

/* Locked CTA strip (before payment) */
.cockpit-card-cta.phase2-cta {
  color: var(--text-tertiary);
  background: rgba(124, 58, 237, 0.04);
  border-top-color: rgba(124, 58, 237, 0.1);
  font-size: 0.75rem;
  letter-spacing: 0.01em;
  gap: 6px;
}
.cockpit-task-card.phase2-card:hover .cockpit-card-cta.phase2-cta {
  background: linear-gradient(135deg, #7c3aed, #6366f1);
  color: #fff;
  border-color: transparent;
}

/* Past tasks archive toggle button */
#pastTasksToggle {
  font-family: inherit;
  transition: color 0.15s;
}
#pastTasksToggle:hover { color: var(--text-primary); }

/* Archive grid — uses same cockpit-task-cards layout */
#pastTasksGrid.cockpit-task-cards {
  pointer-events: none;
  opacity: 0.55;
}


/* ══════════════════════════════════════════════
   DAILY IMPROVEMENTS PAGE
   ══════════════════════════════════════════════ */

/* Nav badge glow for the improvements link */
.improvements-nav-item .improvements-badge {
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: #fff;
  font-size: 0.62rem;
  padding: 2px 7px;
  border-radius: 99px;
  font-weight: 600;
  letter-spacing: 0.03em;
  animation: improveBadgePulse 2.5s ease-in-out infinite;
}

@keyframes improveBadgePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(168,85,247,0.4); }
  50% { box-shadow: 0 0 0 5px rgba(168,85,247,0); }
}

/* Hero header */
.improvements-hero {
  text-align: center;
  padding: 48px 24px 32px;
}

.improvements-hero-icon {
  font-size: 3rem;
  line-height: 1;
  margin-bottom: 16px;
  animation: floatIcon 3s ease-in-out infinite;
}

@keyframes floatIcon {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.improvements-hero-title {
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(135deg, #7c3aed 0%, #a855f7 50%, #ec4899 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0 0 10px;
}

.improvements-hero-sub {
  color: var(--text-secondary);
  font-size: 0.95rem;
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Log container */
.improvements-log {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px 48px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.improvements-loading {
  text-align: center;
  color: var(--text-tertiary);
  padding: 32px;
}

/* Day card */
.improvements-day {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}

.improvements-day:hover {
  box-shadow: 0 4px 24px rgba(0,0,0,0.07);
}

.improvements-day-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-primary);
}

.improvements-day-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  flex-shrink: 0;
}

.improvements-day-label {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-primary);
  flex: 1;
}

.improvements-day-count {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 2px 10px;
}

/* Individual improvement entries */
.improvements-entries {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.improvements-entry {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--bg-primary);
  border: 1px solid var(--border);
  transition: border-color 0.15s, transform 0.15s;
}

.improvements-entry:hover {
  border-color: rgba(168,85,247,0.35);
  transform: translateX(3px);
}

.improvements-entry-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.improvements-entry-text {
  font-size: 0.9rem;
  color: var(--text-primary);
  line-height: 1.55;
}

/* "Today" highlight strip */
.improvements-day.is-today .improvements-day-header {
  background: linear-gradient(135deg, rgba(124,58,237,0.08), rgba(168,85,247,0.06));
  border-bottom-color: rgba(168,85,247,0.2);
}

.improvements-day.is-today .improvements-day-dot {
  box-shadow: 0 0 0 3px rgba(168,85,247,0.25);
}
