/* ========================================
   Command Center - Executive Dashboard
   Avatara Design System v1.0.0
   ======================================== */

/* CSS Variables - Aligned with Avatara Design System */
:root {
  /* ==========================================
     Brand Colors - From Design System
     ========================================== */
  
  /* Emerald (Primary) */
  --color-emerald-400: #34d399;
  --color-emerald-500: #10b981;
  --color-emerald-600: #059669;
  
  /* Indigo (Secondary/Accent) */
  --color-indigo-400: #818cf8;
  --color-indigo-500: #6366f1;
  --color-indigo-600: #4f46e5;
  
  /* ==========================================
     Background Colors (Dark Theme)
     ========================================== */
  --bg-dark: #0a0f1a;
  --bg-sidebar: #0d1321;
  --bg-card: #141b2d;
  --bg-card-hover: #1a2438;
  --bg-input: #0d1321;
  --bg-secondary: #1a2438;
  --bg-elevated: #1e2642;
  --bg-primary: var(--color-emerald-500);
  
  /* ==========================================
     Text Colors - WCAG Compliant
     ========================================== */
  --text-primary: #f4f6f9;
  --text-secondary: #a0aec0;
  --text-muted: #8b95a5;  /* Updated for 4.5:1 contrast */
  --text: #f4f6f9;
  --text-link: var(--color-emerald-400);
  
  /* ==========================================
     Border Colors
     ========================================== */
  --border-color: #1e293b;
  --border-light: #2d3748;
  --border-subtle: #1e293b;
  --border-emphasis: #3d4a5c;
  --border: #1e293b;
  
  /* ==========================================
     Primary & Accent Colors
     ========================================== */
  --primary: var(--color-emerald-500);
  --primary-hover: var(--color-emerald-600);
  --primary-light: var(--color-emerald-400);
  --primary-glow: rgba(16, 185, 129, 0.25);
  
  --accent: var(--color-indigo-500);
  --accent-hover: var(--color-indigo-400);
  --accent-primary: var(--color-indigo-500);
  --accent-primary-rgb: 99, 102, 241;
  --accent-purple: #8b5cf6;
  
  /* ==========================================
     Semantic/Status Colors
     ========================================== */
  --success: #22c55e;
  --success-glow: rgba(34, 197, 94, 0.2);
  --warning: #f59e0b;
  --warning-glow: rgba(245, 158, 11, 0.2);
  --danger: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.2);
  --urgent: #dc2626;
  --info: #3b82f6;
  
  /* Alias for card (used in some places) */
  --card: #141b2d;
  --card-hover: #1a2438;
  
  /* ==========================================
     Layout Tokens
     ========================================== */
  --sidebar-width: 260px;
  --sidebar-collapsed: 72px;
  --header-height: 64px;
  --content-max-width: 1200px;
  
  /* ==========================================
     Spacing Scale (4px base)
     ========================================== */
  --space-1: 0.25rem;   /* 4px */
  --space-2: 0.5rem;    /* 8px */
  --space-3: 0.75rem;   /* 12px */
  --space-4: 1rem;      /* 16px */
  --space-5: 1.25rem;   /* 20px */
  --space-6: 1.5rem;    /* 24px */
  --space-8: 2rem;      /* 32px */
  
  /* ==========================================
     Border Radius
     ========================================== */
  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;
  
  /* ==========================================
     Shadows & Effects
     ========================================== */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-glow-primary: 0 0 30px var(--primary-glow);
  
  /* ==========================================
     Transitions
     ========================================== */
  --transition-fast: 0.1s ease;
  --transition: 0.2s ease;
  --transition-slow: 0.3s ease;
  
  /* ==========================================
     Typography
     ========================================== */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'SF Mono', Monaco, 'Cascadia Code', monospace;
}

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

html, body {
  height: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.5;
  overflow: hidden;
  max-width: 100vw;
}

/* Prevent any horizontal scroll from dynamic content */
html, body {
  overflow-x: hidden;
}

.view-container {
  overflow-x: hidden;
}

/* ==========================================
   Accessibility Utilities
   ========================================== */

/* Skip Link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: white;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius);
  z-index: 9999;
  transition: top var(--transition-fast);
  text-decoration: none;
  font-weight: 500;
}

.skip-link:focus {
  top: var(--space-4);
}

/* Screen Reader Only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus Visible */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* App Layout */
.app {
  display: flex;
  height: 100vh;
}

/* ========================================
   Sidebar
   ======================================== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  transition: width var(--transition);
  z-index: 100;
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed);
}

.sidebar.collapsed .nav-label,
.sidebar.collapsed .logo-text,
.sidebar.collapsed .user-details {
  display: none;
}

.sidebar.collapsed .sidebar-header {
  justify-content: center;
}

.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 0.875rem;
}

.sidebar.collapsed .user-info {
  justify-content: center;
}

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

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

.logo-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
}

.logo-text {
  font-weight: 700;
  font-size: 1rem;
  background: linear-gradient(135deg, var(--primary), #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--radius);
  transition: all var(--transition);
}

.sidebar-toggle:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

.sidebar.collapsed .sidebar-toggle svg {
  transform: rotate(180deg);
}

/* Sidebar Navigation */
.sidebar-nav {
  flex: 1;
  padding: 1rem 0.75rem;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius);
  transition: all var(--transition);
  margin-bottom: 0.25rem;
}

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

.nav-item.active {
  color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
  font-weight: 500;
}

.nav-icon {
  font-size: 1.25rem;
  width: 24px;
  text-align: center;
}

.nav-label {
  font-size: 0.875rem;
}

.nav-divider {
  height: 1px;
  background: var(--border-color);
  margin: 1rem 0;
}

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

.user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-avatar {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), #a78bfa);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
}

.user-details {
  flex: 1;
}

.user-name {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
}

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

/* ========================================
   Main Content Area
   ======================================== */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Header */
.header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-color);
}

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

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.5rem;
}

.breadcrumb {
  font-size: 1.25rem;
  font-weight: 600;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.header-stats {
  display: flex;
  gap: 0.75rem;
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--bg-card);
  border-radius: 9999px;
  font-size: 0.875rem;
}

.stat-pill.urgent {
  background: rgba(220, 38, 38, 0.15);
}

.stat-pill.urgent .stat-value {
  color: var(--danger);
}

.stat-value {
  font-weight: 600;
  color: var(--primary);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 0 20px var(--primary-glow);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

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

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

/* ========================================
   View Container
   ======================================== */
.view-container {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

.view {
  display: none;
}

.view.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

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

/* ========================================
   Dashboard View
   ======================================== */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.5rem;
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: 1.5rem;
  transition: all var(--transition);
}

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

.card-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

/* Welcome Card */
.welcome-card {
  grid-column: span 8;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(99, 102, 241, 0.1) 100%);
  border-color: rgba(99, 102, 241, 0.2);
}

.welcome-content h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.welcome-subtitle {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.welcome-summary {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.welcome-avatar img {
  width: 120px;
  height: 120px;
  opacity: 0.9;
}

/* Stats Card */
.stats-card {
  grid-column: span 4;
}

/* Task Breakdown Card */
.breakdown-card {
  grid-column: span 12;
}

.breakdown-card.full-width {
  grid-column: span 12;
}

.breakdown-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.breakdown-title {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.breakdown-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.breakdown-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: 9999px;
  font-size: 0.75rem;
  line-height: 1;
}

.breakdown-chip .label {
  color: var(--text-secondary);
  white-space: nowrap;
}

.breakdown-chip .count {
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.breakdown-chip.urgent { border-color: rgba(220, 38, 38, 0.35); }
.breakdown-chip.high { border-color: rgba(239, 68, 68, 0.35); }
.breakdown-chip.medium { border-color: rgba(245, 158, 11, 0.35); }
.breakdown-chip.low { border-color: rgba(100, 116, 139, 0.35); }

.progress-item {
  margin-bottom: 1.25rem;
}

.progress-item:last-child {
  margin-bottom: 0;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

.progress-label {
  color: var(--text-secondary);
}

.progress-value {
  font-weight: 600;
}

.progress-bar {
  height: 8px;
  background: var(--bg-dark);
  border-radius: 9999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 9999px;
  transition: width 0.5s ease;
}

.progress-fill.success {
  background: var(--success);
}

/* Active Work Card */
.active-work-card {
  grid-column: span 6;
}

.active-work-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 300px;
  overflow-y: auto;
}

.work-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-dark);
  border-radius: var(--radius);
  border-left: 3px solid var(--success);
}

.work-agent {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.work-agent-emoji {
  font-size: 1.5rem;
}

.work-agent-name {
  font-weight: 600;
  font-size: 0.875rem;
}

.work-task {
  flex: 1;
}

.work-task-title {
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.work-task-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.work-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--success);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 var(--success-glow); }
  50% { opacity: 0.7; box-shadow: 0 0 0 8px transparent; }
}

/* Upcoming Tasks Card */
.upcoming-card {
  grid-column: span 6;
}

.upcoming-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 300px;
  overflow-y: auto;
}

.upcoming-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem;
  background: var(--bg-dark);
  border-radius: var(--radius);
  transition: all var(--transition);
}

.upcoming-item:hover {
  background: var(--bg-card-hover);
}

.upcoming-priority {
  width: 4px;
  height: 40px;
  border-radius: 0.125rem;
}

.upcoming-priority.urgent { background: var(--urgent); }
.upcoming-priority.high { background: var(--danger); }
.upcoming-priority.medium { background: var(--warning); }
.upcoming-priority.low { background: var(--text-muted); }

.upcoming-content {
  flex: 1;
}

.upcoming-title {
  font-weight: 500;
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

.upcoming-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  gap: 1rem;
}

.upcoming-agent {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Agent Status Card */
.agents-card {
  grid-column: span 12;
}

.agents-mini-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 0.75rem;
  max-height: 280px;
  overflow-y: auto;
}

.agent-mini-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  background: var(--bg-dark);
  border-radius: var(--radius);
  transition: all var(--transition);
  cursor: pointer;
}

.agent-mini-card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.agent-mini-card.working {
  box-shadow: 0 0 0 1px var(--success), 0 0 20px var(--success-glow);
}

.agent-mini-emoji {
  font-size: 2rem;
}

.agent-mini-name {
  font-size: 0.75rem;
  font-weight: 500;
  text-align: center;
}

.agent-mini-status {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.65rem;
  color: var(--text-muted);
}

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

.status-dot.working { background: var(--success); }
.status-dot.idle { background: var(--warning); }
.status-dot.offline { background: var(--text-muted); }

/* Projects Mini Card */
.projects-mini-card {
  grid-column: span 12;
}

.card-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.card-header-row .card-title {
  margin-bottom: 0;
}

.btn-link {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-size: 0.875rem;
  transition: color var(--transition);
}

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

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

.project-mini-item {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-dark);
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  transition: all var(--transition);
  cursor: pointer;
}

.project-mini-item:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.project-mini-info {
  flex: 1;
}

.project-mini-name {
  font-weight: 600;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.project-mini-name a {
  color: var(--primary);
  font-size: 0.75rem;
}

.project-mini-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.project-progress-bar {
  height: 4px;
  background: var(--bg-card);
  border-radius: 0.125rem;
  overflow: hidden;
}

.project-progress-fill {
  height: 100%;
  background: var(--primary);
  transition: width 0.3s ease;
}

.project-progress-fill.critical { background: var(--danger); }
.project-progress-fill.high { background: var(--warning); }

/* Activity Card */
.activity-card {
  grid-column: span 12;
}

.activity-mini-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 200px;
  overflow-y: auto;
}

.activity-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--bg-dark);
  border-radius: var(--radius);
  font-size: 0.75rem;
}

.activity-time {
  color: var(--text-muted);
  white-space: nowrap;
  font-size: 0.7rem;
}

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

.activity-text {
  color: var(--text-secondary);
  flex: 1;
}

/* Empty States */
.empty-state {
  color: var(--text-muted);
  font-size: 0.875rem;
  text-align: center;
  padding: 2rem;
}

.empty-state-large {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 4rem 2rem;
  text-align: center;
}

.empty-icon {
  font-size: 4rem;
  opacity: 0.5;
}

.empty-state-large h3 {
  font-size: 1.25rem;
  color: var(--text-secondary);
}

.empty-state-large p {
  color: var(--text-muted);
  max-width: 400px;
}

/* ========================================
   Kanban View
   ======================================== */
.kanban-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.filter-group {
  display: flex;
  gap: 0.75rem;
}

.filter-select {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
}

.kanban-board {
  display: flex;
  gap: 1rem;
  min-height: calc(100vh - 250px);
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 1rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.kanban-board::-webkit-scrollbar {
  height: 8px;
}

.kanban-board::-webkit-scrollbar-track {
  background: var(--bg-dark);
  border-radius: var(--radius);
}

.kanban-board::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: var(--radius);
}

.kanban-board::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

.kanban-column {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  min-width: 320px;
  max-width: 360px;
  flex-shrink: 0;
  scroll-snap-align: start;
}

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

.column-title {
  font-weight: 600;
  font-size: 0.875rem;
}

.column-count {
  background: var(--bg-dark);
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.column-tasks {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  overflow-y: auto;
  min-height: 100px;
}

.column-tasks.drag-over {
  background: rgba(99, 102, 241, 0.1);
  border-radius: var(--radius);
}

/* Task Cards */
.task-card {
  background: var(--bg-dark);
  border-radius: var(--radius);
  padding: 0.875rem;
  cursor: grab;
  transition: all var(--transition);
  border: 1px solid transparent;
}

.task-card:hover {
  border-color: var(--border-light);
  transform: translateY(-1px);
}

.task-card.dragging {
  opacity: 0.5;
}

.task-card.priority-urgent { border-left: 3px solid var(--urgent); }
.task-card.priority-high { border-left: 3px solid var(--danger); }
.task-card.priority-medium { border-left: 3px solid var(--warning); }
.task-card.priority-low { border-left: 3px solid var(--text-muted); }

.task-title {
  font-weight: 500;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
}

.task-title:hover {
  color: var(--primary);
}

.task-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.task-agent {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.task-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.5rem;
}

.tag {
  background: var(--bg-card);
  padding: 0.125rem 0.5rem;
  border-radius: calc(var(--radius) / 2);
  font-size: 0.65rem;
  color: var(--text-secondary);
}

/* ========================================
   Agents View (Full)
   ======================================== */
.agents-full-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.agent-full-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  transition: all var(--transition);
}

.agent-full-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
}

.agent-full-card.working {
  border-color: var(--success);
  box-shadow: 0 0 30px var(--success-glow);
}

.agent-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.agent-avatar {
  font-size: 3rem;
}

.agent-info h3 {
  font-size: 1rem;
  font-weight: 600;
}

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

.agent-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.75rem;
  background: var(--bg-dark);
  border-radius: 9999px;
  font-size: 0.75rem;
  margin-top: 0.5rem;
}

.agent-current-task {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.agent-current-task h4 {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.agent-task-title {
  font-weight: 500;
  overflow-wrap: anywhere;
}

.agent-full-card {
  min-width: 0;
}

.agent-stats-row {
  display: flex;
  gap: 1.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.agent-stat {
  text-align: center;
}

.agent-stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
}

.agent-stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ========================================
   Projects View
   ======================================== */
.projects-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.projects-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
}

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

.project-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  transition: all var(--transition);
}

.project-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
}

.project-card.priority-critical {
  border-left: 4px solid var(--danger);
}

.project-card.priority-high {
  border-left: 4px solid var(--warning);
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.project-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.project-status-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
}

.project-status-badge.active {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
}

.project-status-badge.planning {
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary);
}

.project-status-badge.paused {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

.project-status-badge.completed {
  background: rgba(100, 116, 139, 0.15);
  color: var(--text-muted);
}

.project-description {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.project-agent {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.project-agent-emoji {
  font-size: 1.25rem;
}

.project-agent-info {
  display: flex;
  flex-direction: column;
}

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

.project-agent-role {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.project-progress {
  margin-bottom: 1rem;
}

.project-progress-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.75rem;
}

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

.project-progress-value {
  font-weight: 600;
}

.project-progress-bar-lg {
  height: 8px;
  background: var(--bg-dark);
  border-radius: calc(var(--radius) / 2);
  overflow: hidden;
}

.project-links {
  display: flex;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.875rem;
  background: var(--bg-dark);
  border-radius: var(--radius);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.75rem;
  transition: all var(--transition);
}

.project-link:hover {
  color: var(--primary);
  background: var(--bg-card-hover);
}

.project-link.primary {
  background: var(--primary);
  color: white;
}

.project-link.primary:hover {
  background: var(--primary-hover);
}

.project-tasks-summary {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* ========================================
   Ideas View
   ======================================== */
.ideas-container {
  max-width: 800px;
  margin: 0 auto;
}

.ideas-input-area {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.ideas-input-area textarea {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1rem;
  color: var(--text-primary);
  font-size: 1rem;
  resize: vertical;
}

.ideas-input-area textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.ideas-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.idea-item {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.25rem;
  border: 1px solid var(--border-color);
}

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

.idea-status {
  font-size: 0.75rem;
  color: var(--text-secondary);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  white-space: nowrap;
}

.idea-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.idea-feedback {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
}

.idea-feedback-title {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.idea-feedback-form {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
}

.idea-feedback-form textarea {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 0.6rem;
  color: var(--text-primary);
  font-size: 0.875rem;
  resize: vertical;
  min-width: 0;
}

.idea-feedback-list {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.idea-feedback-item {
  background: var(--bg-dark);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-lg);
  padding: 0.65rem;
}

.idea-feedback-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.idea-feedback-text {
  font-size: 0.875rem;
  white-space: pre-wrap;
}

.idea-feedback-empty {
  color: var(--text-muted);
  font-size: 0.875rem;
}

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

.idea-content {
  margin-bottom: 0.75rem;
}

.idea-markdown h1, .idea-markdown h2, .idea-markdown h3 {
  margin: 0.75rem 0 0.5rem;
}

.idea-markdown p {
  margin: 0.35rem 0;
  color: var(--text-secondary);
}

.idea-markdown ul {
  margin: 0.35rem 0 0.35rem 1.1rem;
}

.idea-markdown code {
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: calc(var(--radius) * 0.75);
  padding: 0.1rem 0.3rem;
}

.idea-markdown pre {
  margin-top: 0.6rem;
  white-space: pre-wrap;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-lg);
  padding: 0.75rem;
  font-size: 0.75rem;
  line-height: 1.5;
  overflow-x: auto;
}

.idea-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ========================================
   Activity Log View (Full)
   ======================================== */
.activity-full-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 800px;
}

.activity-full-item {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
}

.activity-full-time {
  color: var(--text-muted);
  font-size: 0.75rem;
  min-width: 80px;
}

.activity-full-agent {
  font-size: 1.25rem;
}

.activity-full-content {
  flex: 1;
}

.activity-full-action {
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.activity-full-details {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* ========================================
   Settings View
   ======================================== */
.settings-container {
  max-width: 600px;
}

.settings-section {
  margin-bottom: 2rem;
}

.settings-section h3 {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.about-card {
  display: flex;
  gap: 1.5rem;
  background: var(--bg-card);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}

.about-avatar {
  width: 80px;
  height: 80px;
  border-radius: var(--radius);
}

.about-info h4 {
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
}

.about-info p {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.about-desc {
  margin-top: 0.75rem;
  color: var(--text-secondary) !important;
}

/* ========================================
   Modal
   ======================================== */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 1rem;
}

.modal.open {
  display: flex;
}

.modal-content {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  animation: modalIn 0.2s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

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

.modal-header h3 {
  font-size: 1rem;
  font-weight: 600;
}

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

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

#task-form {
  padding: 1.5rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  margin-bottom: 0.375rem;
  color: var(--text-muted);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 0.75rem;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: inherit;
  transition: border-color var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-color);
}

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

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

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 0.1875rem;
}

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

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 1400px) {
  .dashboard-grid {
    grid-template-columns: repeat(6, 1fr);
  }
  
  .welcome-card { grid-column: span 6; }
  .stats-card { grid-column: span 6; }
  .breakdown-card { grid-column: span 6; }
  .cost-card { grid-column: span 6; }
  .active-work-card { grid-column: span 6; }
  .upcoming-card { grid-column: span 6; }
  .agents-card { grid-column: span 6; }  /* Full width at 1400px becomes half of 6-col = full row */
  .projects-mini-card { grid-column: span 6; }
  .activity-card { grid-column: span 6; }
}

@media (max-width: 1200px) {
  .kanban-column {
    min-width: 300px;
    max-width: 320px;
  }
}

@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    left: -100%;
    height: 100vh;
    transition: left var(--transition);
  }
  
  .sidebar.mobile-open {
    left: 0;
  }
  
  .mobile-menu-btn {
    display: flex;
  }
  
  .header-stats {
    display: none;
  }
  
  .kanban-column {
    min-width: 280px;
    max-width: 300px;
  }
  
  .welcome-avatar {
    display: none;
  }
}

@media (max-width: 600px) {
  .kanban-column {
    min-width: 260px;
    max-width: 280px;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .btn-text {
    display: none;
  }
}

/* Cost Card Styles */
.cost-card {
  background: linear-gradient(135deg, var(--card-bg) 0%, rgba(16, 185, 129, 0.05) 100%);
  grid-column: span 6;
  min-height: 200px;
}

.cost-card .card-title {
  margin-bottom: 1rem;
}

.cost-summary {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding-top: 0.5rem;
}

.cost-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: rgba(16, 185, 129, 0.1);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
}

.cost-label {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
}

.cost-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: #10b981;
}

.cost-breakdown {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  max-height: 180px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.cost-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.625rem 0.875rem;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  font-size: 0.875rem;
  transition: background 0.2s ease;
}

.cost-item:hover {
  background: var(--bg-tertiary, rgba(255,255,255,0.05));
}

.cost-agent {
  color: var(--text-primary);
  font-weight: 500;
}

.cost-amount {
  color: var(--text-secondary);
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
  font-size: 0.75rem;
}

@media (max-width: 768px) {
  /* Mobile dashboard: single column, tighter spacing, key cards above the fold */
  .view-container {
    padding: 1rem;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    width: 100%;
    max-width: 100%;
  }

  .card {
    padding: 1rem;
    min-width: 0;
  }

  /* Ensure priority cards take full width rows */
  .welcome-card,
  .stats-card,
  .breakdown-card,
  .cost-card,
  .active-work-card,
  .upcoming-card,
  .agents-card,
  .projects-mini-card,
  .activity-card {
    grid-column: 1 / -1 !important;
  }

  /* Prevent grids from forcing horizontal overflow */
  .projects-mini-list {
    grid-template-columns: 1fr;
  }

  .project-mini-item {
    min-width: 0;
  }

  .project-mini-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Reduce welcome card vertical footprint */
  .welcome-content h2 {
    font-size: 1.35rem;
  }

  .welcome-subtitle {
    margin-bottom: 0.75rem;
  }

  .card-title {
    margin-bottom: 0.75rem;
  }

  .progress-item {
    margin-bottom: 0.9rem;
  }

  .breakdown-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  /* Keep the breakdown widget dense */
  .breakdown-items {
    gap: 0.4rem;
  }

  .breakdown-chip {
    padding: 0.35rem 0.55rem;
    font-size: 0.78rem;
  }
}

/* Project Detail Modal */
.modal-lg {
  max-width: 800px;
  width: 95%;
}

.project-detail-content {
  padding: 1rem 0;
}

.project-detail-header {
  display: flex;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.project-detail-info {
  flex: 1;
}

.project-description {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.project-meta {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.status-badge, .priority-badge, .agent-badge {
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-xl);
  font-size: 0.75rem;
  font-weight: 500;
}

.status-badge {
  background: rgba(99, 102, 241, 0.2);
  color: #818cf8;
}
.status-badge.active { background: rgba(16, 185, 129, 0.2); color: #10b981; }
.status-badge.planning { background: rgba(99, 102, 241, 0.2); color: #6366f1; }
.status-badge.paused { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }
.status-badge.completed { background: rgba(100, 116, 139, 0.2); color: #94a3b8; }

.priority-badge {
  background: rgba(100, 116, 139, 0.2);
  color: #94a3b8;
}
.priority-badge.critical { background: rgba(239, 68, 68, 0.2); color: #ef4444; }
.priority-badge.high { background: rgba(249, 115, 22, 0.2); color: #f97316; }
.priority-badge.medium { background: rgba(234, 179, 8, 0.2); color: #eab308; }
.priority-badge.low { background: rgba(34, 197, 94, 0.2); color: #22c55e; }

.agent-badge {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
}

.project-links {
  display: flex;
  gap: 1rem;
}

.project-links a {
  color: var(--accent-primary);
  text-decoration: none;
  font-size: 0.875rem;
}

.project-links a:hover {
  text-decoration: underline;
}

.project-detail-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  min-width: 200px;
}

.stat-box {
  background: var(--bg-secondary);
  padding: 1rem;
  border-radius: var(--radius-lg);
  text-align: center;
}

.stat-box.done {
  background: rgba(16, 185, 129, 0.15);
}

.stat-box.active {
  background: rgba(59, 130, 246, 0.15);
}

.stat-box.pending {
  background: rgba(245, 158, 11, 0.15);
}

.stat-number {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.project-progress-section {
  margin-bottom: 1.5rem;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.progress-bar.large {
  height: 10px;
  border-radius: 5px;
}

.project-tasks-section h4 {
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.project-tasks-list {
  max-height: 300px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.project-task-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  transition: background 0.2s;
}

.project-task-item:hover {
  background: var(--bg-tertiary, rgba(255,255,255,0.08));
}

.project-task-status {
  font-size: 1rem;
}

.project-task-title {
  flex: 1;
  color: var(--text-primary);
  font-size: 0.875rem;
}

.project-task-item.done .project-task-title {
  text-decoration: line-through;
  color: var(--text-secondary);
}

.project-task-priority {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: calc(var(--radius) / 2);
  background: var(--bg-primary);
}

.project-task-agent {
  font-size: 0.875rem;
}

@media (max-width: 640px) {
  .project-detail-header {
    flex-direction: column;
  }
  
  .project-detail-stats {
    min-width: 100%;
  }
}

/* Project Feedback Section */
.project-feedback-section {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.project-feedback-section h4 {
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.feedback-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.feedback-form textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: transparent !important;
  background-color: rgba(255, 255, 255, 0.05) !important;
  color: #ffffff !important;
  font-family: inherit;
  font-size: 0.875rem;
  resize: vertical;
  min-height: 60px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.feedback-form textarea::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.feedback-form textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
}

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

.feedback-actions select {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: calc(var(--radius) * 0.75);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.875rem;
}

/* Modal Spacing Fixes */
.modal-content {
  padding: 1.5rem;
}

.modal-header {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
}

.project-detail-content {
  padding: 0;
}

.project-detail-header {
  padding: 1rem 0;
}

.project-detail-stats {
  gap: 1rem;
}

.stat-box {
  padding: 1.25rem;
}

.project-progress-section {
  padding: 1rem 0;
  margin: 0;
}

.project-tasks-section {
  padding-top: 1rem;
}

.project-tasks-section h4,
.project-feedback-section h4 {
  font-size: 1rem;
  font-weight: 600;
}

/* Breadcrumb Navigation */
.breadcrumb-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
}

.breadcrumb-nav a {
  color: var(--accent-primary);
  text-decoration: none;
}

.breadcrumb-nav a:hover {
  text-decoration: underline;
}

.breadcrumb-separator {
  color: var(--text-secondary);
}

#breadcrumb-project-name {
  color: var(--text-primary);
  font-weight: 500;
}

/* Project Detail Page */
.project-detail-page {
  max-width: 1200px;
}

.project-detail-header-page {
  margin-bottom: 2rem;
}

.project-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.project-title-row h2 {
  margin: 0;
  font-size: 1.75rem;
}

.project-stats-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.project-stats-row .stat-box {
  flex: 1;
  max-width: 180px;
}

.project-content-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
  margin-top: 2rem;
}

.project-content-grid .project-tasks-section,
.project-content-grid .project-feedback-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.project-content-grid h3 {
  margin: 0 0 1rem 0;
  font-size: 1rem;
  color: var(--text-primary);
}

.project-content-grid .project-tasks-list {
  max-height: 400px;
}

.feedback-hint {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

@media (max-width: 900px) {
  .project-content-grid {
    grid-template-columns: 1fr;
  }
  
  .project-stats-row {
    flex-wrap: wrap;
  }
  
  .project-stats-row .stat-box {
    flex: 1 1 45%;
    max-width: none;
  }
}

@media (max-width: 600px) {
  .project-title-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .project-stats-row .stat-box {
    flex: 1 1 100%;
  }
}

/* ================================
   Knowledge Base
   ================================ */

.kb-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 1rem;
  height: calc(100vh - 140px);
}

.kb-sidebar {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 0.75rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.kb-header h2 {
  margin: 0;
  font-size: 1.125rem;
}

.kb-sub {
  margin-top: 0.25rem;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.kb-controls {
  margin-top: 0.625rem;
}

.kb-list {
  margin-top: 0.625rem;
  overflow: auto;
  padding-right: 4px;
}

.kb-item {
  padding: 0.625rem;
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  cursor: pointer;
}

.kb-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

.kb-item.active {
  background: rgba(79, 70, 229, 0.12);
  border-color: rgba(79, 70, 229, 0.35);
}

.kb-item-title {
  font-weight: 600;
  font-size: 0.8125rem;
  line-height: 1.3;
}

.kb-item-meta {
  margin-top: 0.375rem;
  display: flex;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.6875rem;
}

.kb-item-tags {
  margin-top: 0.375rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.kb-content {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.kb-content-inner {
  height: 100%;
  overflow: auto;
  padding: 1rem;
}

.kb-article-header h2 {
  margin: 0;
}

.kb-article-sub {
  margin-top: 0.375rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.kb-markdown {
  margin-top: 0.75rem;
  white-space: pre-wrap;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-lg);
  padding: 0.75rem;
  font-size: 0.75rem;
  line-height: 1.5;
}

@media (max-width: 900px) {
  .kb-layout {
    grid-template-columns: 1fr;
    height: auto;
  }
}

/* Integration Status Cards */
.integration-status {
  max-width: 800px;
  margin: 2.5rem auto;
  text-align: center;
}

.status-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.875rem;
}

.status-card.warning {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.05);
}

.status-card .status-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 0.9375rem;
}

.status-card h3 {
  margin-bottom: 0.9375rem;
}

.status-card ol {
  line-height: 2;
}

.status-card code {
  font-family: Monaco, monospace;
  font-size: 0.75rem;
}

/* ============================================
   WORKFLOW STAGES - 7 Stage Product Development
   ============================================ */

.project-workflow-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin: 1.5rem 0;
}

.project-workflow-section h3 {
  margin-bottom: 1rem;
  color: var(--text-primary);
  font-size: 1.25rem;
}

.workflow-stages {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.workflow-stage {
  background: var(--bg-dark);
  border: 2px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1rem;
  position: relative;
  transition: all 0.2s ease;
}

.workflow-stage:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.workflow-stage.current {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.workflow-stage.completed {
  border-color: var(--success);
  opacity: 0.8;
}

.workflow-stage.pending {
  opacity: 0.6;
}

.stage-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.stage-icon {
  font-size: 1.5rem;
}

.stage-number {
  background: var(--bg-card);
  color: var(--text-secondary);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: bold;
}

.workflow-stage.current .stage-number {
  background: var(--primary);
  color: white;
}

.stage-status {
  margin-left: auto;
  font-size: 1.25rem;
}

.stage-name {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.stage-progress {
  height: 6px;
  background: var(--bg-card);
  border-radius: 0.1875rem;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.stage-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-hover));
  border-radius: 0.1875rem;
  transition: width 0.3s ease;
}

.stage-tasks-count {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.stage-approval-badge {
  background: var(--urgent);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius);
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 0.5rem;
  display: inline-block;
}

.workflow-approval-actions {
  background: var(--bg-card-hover);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
  margin-top: 1rem;
}

.approval-pending {
  color: var(--warning);
  margin-bottom: 0.5rem;
}

/* Stage Details Expansion */
.stage-details {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
}

.stage-section {
  margin-bottom: 0.75rem;
}

.stage-section-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
  font-weight: 600;
}

.stage-exit-criteria {
  list-style: none;
  padding: 0;
  margin: 0;
}

.stage-exit-criteria li {
  padding: 0.25rem 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.stage-exit-criteria li:before {
  content: '⭕';
  font-size: 0.75rem;
}

.stage-exit-criteria li.completed:before {
  content: '✅';
}

.stage-agents {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.stage-agent {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  font-size: 0.75rem;
}

.stage-artifacts {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stage-artifact {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.5rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.stage-artifact.completed {
  color: var(--success);
}

.stage-artifact a {
  color: var(--primary);
  text-decoration: none;
}

.stage-artifact a:hover {
  text-decoration: underline;
}

/* ============================================
   APPROVALS PAGE
   ============================================ */

.approvals-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
}

.approvals-container h2 {
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.approvals-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.approvals-section h3 {
  margin-bottom: 1rem;
  color: var(--text-primary);
  font-size: 1.125rem;
}

.approvals-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.approval-card {
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  transition: all 0.2s ease;
}

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

.approval-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

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

.approval-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.approval-meta {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.approval-description {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

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

.approval-actions .btn {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.approval-actions .btn-primary {
  background: var(--success);
  color: white;
}

.approval-actions .btn-primary:hover {
  background: #0ca678;
}

.approval-actions .btn-secondary {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.approval-actions .btn-secondary:hover {
  background: var(--bg-card-hover);
}

.nav-badge {
  background: var(--urgent);
  color: white;
  font-size: 0.75rem;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  margin-left: auto;
  font-weight: 600;
}

.approval-project-stage {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
}

.approval-project-stage .stage-icon {
  font-size: 1rem;
}

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

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

/* ============================================
   VIEW CONTROLS & SWITCHER
   ============================================ */

.view-controls {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
}

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

.view-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.view-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.view-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

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

.filter-input {
  padding: 0.5rem 0.75rem;
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.875rem;
  min-width: 200px;
}

.filter-input:focus {
  outline: none;
  border-color: var(--primary);
}

.filter-select {
  padding: 0.5rem 0.75rem;
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.875rem;
  cursor: pointer;
}

.filter-select:focus {
  outline: none;
  border-color: var(--primary);
}

/* ============================================
   LIST VIEW
   ============================================ */

.task-list-container {
  padding: 1rem;
  overflow-x: auto;
}

.task-list-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.task-list-table th {
  text-align: left;
  padding: 0.75rem;
  background: var(--bg-dark);
  color: var(--text-secondary);
  font-weight: 600;
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
}

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

.task-list-table tr:hover {
  background: var(--bg-card-hover);
}

.task-list-table .task-title {
  font-weight: 500;
  color: var(--text-primary);
}

.task-list-table .task-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.task-list-table .status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius);
  font-size: 0.75rem;
  font-weight: 500;
}

.task-list-table .status-badge.discovery { background: rgba(139, 92, 246, 0.2); color: #8b5cf6; }
.task-list-table .status-badge.backlog { background: rgba(99, 102, 241, 0.2); color: #6366f1; }
.task-list-table .status-badge.todo { background: rgba(59, 130, 246, 0.2); color: #3b82f6; }
.task-list-table .status-badge.in-progress { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }
.task-list-table .status-badge.review { background: rgba(236, 72, 153, 0.2); color: #ec4899; }
.task-list-table .status-badge.done { background: rgba(16, 185, 129, 0.2); color: #10b981; }

.task-list-table .priority-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
}

.task-list-table .priority-badge.urgent { color: #ef4444; }
.task-list-table .priority-badge.high { color: #f97316; }
.task-list-table .priority-badge.medium { color: #eab308; }
.task-list-table .priority-badge.low { color: #22c55e; }

.task-list-table .agent-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.task-list-table .agent-emoji {
  font-size: 1rem;
}

.task-list-table .due-date {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.task-list-table .due-date.overdue {
  color: #ef4444;
  font-weight: 500;
}

.task-list-table .actions-cell {
  display: flex;
  gap: 0.25rem;
}

.task-list-table .action-btn {
  padding: 0.25rem 0.5rem;
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.75rem;
}

.task-list-table .action-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

/* ============================================
   TIMELINE VIEW
   ============================================ */

.task-timeline-container {
  padding: 1rem;
  overflow-x: auto;
}

.timeline-header {
  position: sticky;
  top: 0;
  background: var(--bg-card);
  z-index: 10;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.timeline-dates {
  display: flex;
  gap: 0;
  min-width: fit-content;
}

.timeline-date {
  width: 60px;
  text-align: center;
  padding: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  border-right: 1px solid var(--border-color);
}

.timeline-date.today {
  background: rgba(99, 102, 241, 0.2);
  color: var(--primary);
  font-weight: 600;
}

.timeline-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: fit-content;
}

.timeline-row {
  display: flex;
  align-items: center;
  min-height: 40px;
  border-bottom: 1px solid var(--border-color);
}

.timeline-task-label {
  width: 250px;
  padding: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}

.timeline-task-bar-container {
  display: flex;
  position: relative;
  height: 30px;
}

.timeline-task-bar {
  position: absolute;
  height: 24px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  padding: 0 0.5rem;
  font-size: 0.75rem;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
  transition: opacity 0.2s;
}

.timeline-task-bar:hover {
  opacity: 0.9;
}

.timeline-task-bar.discovery { background: #8b5cf6; }
.timeline-task-bar.backlog { background: #6366f1; }
.timeline-task-bar.todo { background: #3b82f6; }
.timeline-task-bar.in-progress { background: #f59e0b; }
.timeline-task-bar.review { background: #ec4899; }
.timeline-task-bar.done { background: #10b981; }

/* ============================================
   HIERARCHY VIEW
   ============================================ */

.task-hierarchy-container {
  padding: 1rem;
  overflow-x: auto;
}

.hierarchy-tree {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.hierarchy-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s;
}

.hierarchy-item:hover {
  background: var(--bg-card-hover);
}

.hierarchy-item.indent-1 { padding-left: 1.5rem; }
.hierarchy-item.indent-2 { padding-left: 3rem; }
.hierarchy-item.indent-3 { padding-left: 4.5rem; }
.hierarchy-item.indent-4 { padding-left: 6rem; }

.hierarchy-toggle {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.hierarchy-toggle:hover {
  background: var(--bg-card-hover);
}

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

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

.hierarchy-title {
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hierarchy-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  gap: 0.5rem;
  margin-top: 0.125rem;
}

.hierarchy-status {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.hierarchy-children {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.hierarchy-children.collapsed {
  display: none;
}

/* =====================
   Project Artifacts Section
   ===================== */

.project-artifacts-section {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
}

.project-artifacts-section h3 {
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.artifacts-hint {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

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

.artifact-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.artifact-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.artifact-card h4 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.artifact-card .artifact-description {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 1rem;
  line-height: 1.4;
}

.artifact-card .artifact-meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.artifact-card .artifact-tag {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  padding: 0.25rem 0.5rem;
  border-radius: calc(var(--radius) / 2);
  font-size: 0.75rem;
}

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

.artifact-card .btn-view {
  flex: 1;
  padding: 0.5rem 1rem;
  background: var(--accent-primary);
  color: white;
  border: none;
  border-radius: calc(var(--radius) * 0.75);
  cursor: pointer;
  font-size: 0.875rem;
  text-decoration: none;
  text-align: center;
  transition: background 0.2s;
}

.artifact-card .btn-view:hover {
  background: var(--accent-hover);
}

.artifact-card .btn-view.btn-html {
  background: var(--accent-primary);
}

.artifact-card .btn-view.btn-html:hover {
  background: var(--accent-hover);
}

.artifacts-summary {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(16, 185, 129, 0.1));
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.artifacts-summary h4 {
  color: var(--accent-primary);
  margin-bottom: 0.75rem;
}

.artifacts-stats {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

.artifacts-stat {
  text-align: center;
}

.artifacts-stat .value {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--text-primary);
}

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

/* Artifact Feedback Styles */
.artifact-feedback {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

.artifact-feedback-buttons {
  display: flex;
  gap: 0.5rem;
}

.artifact-feedback-buttons button {
  flex: 0 1 auto;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-subtle);
  border-radius: calc(var(--radius) * 0.75);
  background: var(--bg-secondary);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 0.875rem;
  transition: all 0.2s;
}

.artifact-feedback-buttons .btn-approve:hover {
  background: rgba(16, 185, 129, 0.2);
  border-color: #10b981;
  color: #10b981;
}

.artifact-feedback-buttons .btn-changes:hover {
  background: rgba(245, 158, 11, 0.2);
  border-color: #f59e0b;
  color: #f59e0b;
}

.artifact-feedback-form {
  margin-top: 0.75rem;
}

.artifact-feedback-form textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-subtle);
  border-radius: calc(var(--radius) * 0.75);
  background: transparent !important;
  background-color: rgba(255, 255, 255, 0.05) !important;
  color: #ffffff !important;
  font-size: 0.875rem;
  resize: vertical;
  min-height: 80px;
  -webkit-appearance: none;
}

.artifact-feedback-form textarea::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.artifact-feedback-form textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.feedback-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

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

.artifact-status {
  margin-top: 0.75rem;
}

.status-approved {
  color: #10b981;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.status-changes {
  color: #f59e0b;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.feedback-text {
  margin-top: 0.5rem;
  padding: 0.75rem;
  background: rgba(245, 158, 11, 0.1);
  border-radius: calc(var(--radius) * 0.75);
  font-size: 0.875rem;
  color: var(--text-secondary);
  border-left: 3px solid #f59e0b;
}

.artifact-card.approved {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.05);
}

.artifact-card.approved .artifact-feedback-buttons {
  display: none;
}

.artifact-card.changes-requested {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.05);
}

.artifact-card.changes-requested .artifact-feedback-buttons {
  display: none;
}

/* Google Drive button style */
.artifact-card .btn-view.btn-gdrive {
  background: #4285f4;
}

.artifact-card .btn-view.btn-gdrive:hover {
  background: #3367d6;
}

/* ============================================
   CALENDAR VIEW STYLES
   ============================================ */

.calendar-container {
  padding: 0;
}

.calendar-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.calendar-title {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0;
}

.calendar-controls {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.calendar-select {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 0.5rem 0.875rem;
  border-radius: calc(var(--radius) * 0.75);
  font-size: 0.875rem;
  cursor: pointer;
}

.calendar-select:focus {
  outline: none;
  border-color: var(--primary);
}

.calendar-refresh-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: calc(var(--radius) * 0.75);
  cursor: pointer;
  font-size: 0.875rem;
  transition: background 0.2s ease;
}

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

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.625rem;
  margin-bottom: 1.875rem;
}

.calendar-events-panel {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.calendar-panel {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  border: 1px solid var(--border-color);
}

.panel-title {
  margin-bottom: 1rem;
  font-size: 1rem;
  font-weight: 600;
}

.panel-title-accent {
  color: var(--primary);
}

.panel-title-warning {
  color: var(--warning);
}

.events-list-container {
  max-height: 400px;
  overflow-y: auto;
}

.events-loading {
  color: var(--text-muted);
  text-align: center;
  padding: 2.5rem;
}

.calendar-info-bar {
  margin-top: 1.25rem;
  padding: 1rem;
  background: rgba(59, 130, 246, 0.1);
  border-radius: var(--radius);
  border-left: 4px solid var(--primary);
  font-size: 0.875rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.calendar-api-status {
  color: var(--text-muted);
}

/* ============================================
   MOBILE RESPONSIVE IMPROVEMENTS (375px target)
   ============================================ */

/* Calendar View Mobile Fixes */
@media (max-width: 768px) {
  /* Calendar container - prevent horizontal overflow */
  .calendar-container {
    overflow-x: hidden;
  }
  
  /* Calendar header - stack on mobile */
  .calendar-header-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    margin-bottom: 1rem;
  }
  
  .calendar-title {
    font-size: 1.25rem;
  }
  
  .calendar-controls {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .calendar-select,
  .calendar-refresh-btn {
    width: 100%;
    padding: 0.875rem;
    font-size: 1rem; /* Prevents iOS zoom */
  }
  
  /* Calendar grid - make scrollable on mobile */
  .calendar-grid {
    grid-template-columns: repeat(7, minmax(42px, 1fr));
    gap: 0.25rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    margin-bottom: 1.25rem;
    font-size: 0.75rem;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Events panel - single column stack */
  .calendar-events-panel {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .calendar-panel {
    padding: 1rem;
    border-radius: var(--radius);
  }
  
  .panel-title {
    font-size: 0.95rem;
    margin-bottom: 0.875rem;
  }
  
  .events-list-container {
    max-height: 280px;
  }
  
  /* Calendar info bar */
  .calendar-info-bar {
    padding: 0.875rem;
    font-size: 0.875rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
  
  .calendar-api-status {
    margin-left: 0;
  }
}

/* Additional mobile fixes for all views */
@media (max-width: 600px) {
  /* Header improvements */
  .header {
    padding: 0 0.75rem;
    height: auto;
    min-height: var(--header-height);
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }
  
  .header-left {
    flex: 1;
    min-width: 0;
  }
  
  .breadcrumb {
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .header-right {
    gap: 0.5rem;
  }
  
  .header-right .btn {
    padding: 0.5rem 0.75rem;
  }
  
  /* View container */
  .view-container {
    padding: 0.75rem;
  }
  
  /* Cards general */
  .card {
    padding: 0.875rem;
    border-radius: var(--radius);
  }
  
  .card-title {
    font-size: 0.875rem;
  }
  
  /* Welcome card mobile */
  .welcome-card {
    padding: 1rem;
  }
  
  .welcome-content h2 {
    font-size: 1.2rem !important;
  }
  
  .welcome-subtitle {
    font-size: 0.875rem;
  }
  
  .welcome-summary {
    font-size: 0.875rem;
  }
  
  /* Kanban mobile fixes */
  .view-controls {
    padding: 0.75rem;
  }
  
  .view-switcher {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
  }
  
  .view-btn {
    flex-shrink: 0;
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
  }
  
  .filter-group {
    width: 100%;
  }
  
  .filter-input,
  .filter-select {
    flex: 1 1 100%;
    min-width: 0;
    font-size: 1rem; /* Prevents iOS zoom on focus */
    padding: 0.75rem;
  }
  
  /* Kanban columns */
  .kanban-board {
    gap: 0.75rem;
    padding-bottom: 1rem;
    min-height: calc(100vh - 300px);
  }
  
  .kanban-column {
    min-width: 240px;
    max-width: 260px;
    padding: 0.75rem;
  }
  
  .column-header {
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
  }
  
  .column-title {
    font-size: 0.75rem;
  }
  
  .task-card {
    padding: 0.75rem;
  }
  
  .task-title {
    font-size: 0.75rem;
  }
  
  .task-meta {
    font-size: 0.7rem;
  }
  
  /* Agent cards */
  .agents-mini-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.5rem;
  }
  
  .agent-mini-card {
    padding: 0.75rem 0.5rem;
  }
  
  .agent-mini-emoji {
    font-size: 1.5rem;
  }
  
  .agent-mini-name {
    font-size: 0.65rem;
  }
  
  .agents-full-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .agent-full-card {
    padding: 1rem;
  }
  
  .agent-avatar {
    font-size: 2rem;
  }
  
  /* Projects grid */
  .projects-header {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }
  
  .projects-header h2 {
    font-size: 1rem;
  }
  
  .projects-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .project-card {
    padding: 1rem;
  }
  
  .project-title {
    font-size: 1rem;
  }
  
  .project-description {
    font-size: 0.75rem;
  }
  
  .project-links {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .project-link {
    padding: 0.4rem 0.6rem;
    font-size: 0.75rem;
  }
  
  /* Project detail page */
  .project-detail-page {
    padding: 0;
  }
  
  .project-title-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  
  .project-title-row h2 {
    font-size: 1.25rem;
  }
  
  .project-stats-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }
  
  .project-stats-row .stat-box {
    max-width: none;
    padding: 0.75rem;
  }
  
  .stat-number {
    font-size: 1.25rem;
  }
  
  .stat-label {
    font-size: 0.65rem;
  }
  
  /* Workflow stages */
  .workflow-stages {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  .workflow-stage {
    padding: 0.875rem;
  }
  
  .stage-name {
    font-size: 0.875rem;
  }
  
  /* Project kanban */
  .project-kanban-section {
    overflow: hidden;
  }
  
  .project-kanban {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 1rem;
  }
  
  .project-content-grid {
    gap: 1rem;
  }
  
  .project-content-grid .project-tasks-section,
  .project-content-grid .project-feedback-section {
    padding: 1rem;
  }
  
  /* Artifacts grid */
  .artifacts-grid {
    grid-template-columns: 1fr;
  }
  
  .artifact-card {
    padding: 1rem;
  }
  
  /* Modal fixes */
  .modal {
    padding: 0.5rem;
    align-items: flex-start;
    padding-top: 2rem;
  }
  
  .modal-content {
    max-height: calc(100vh - 3rem);
    border-radius: var(--radius-lg);
  }
  
  .modal-header {
    padding: 1rem;
  }
  
  .modal-header h3 {
    font-size: 1rem;
  }
  
  #task-form,
  #project-form {
    padding: 1rem;
  }
  
  .form-group label {
    font-size: 0.75rem;
  }
  
  .form-group input,
  .form-group select,
  .form-group textarea {
    font-size: 1rem; /* Prevents iOS zoom */
    padding: 0.875rem;
    border-radius: var(--radius);
  }
  
  .form-row {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  .form-actions {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .form-actions .btn {
    flex: 1 1 auto;
    min-width: 0;
    justify-content: center;
  }
  
  /* Ideas view */
  .ideas-container {
    padding: 0;
  }
  
  .ideas-input-area {
    gap: 0.75rem;
  }
  
  .ideas-input-area textarea {
    font-size: 1rem;
    padding: 0.875rem;
  }
  
  .idea-item {
    padding: 1rem;
  }
  
  .idea-header {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .idea-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  
  .idea-actions .btn {
    flex: 0 1 auto;
    text-align: center;
  }
  
  /* Knowledge base */
  .kb-layout {
    grid-template-columns: 1fr;
    height: auto;
    gap: 1rem;
  }
  
  .kb-sidebar {
    max-height: 50vh;
  }
  
  .kb-header h2 {
    font-size: 1rem;
  }
  
  /* Activity log */
  .activity-full-list {
    gap: 0.5rem;
  }
  
  .activity-full-item {
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.875rem;
  }
  
  .activity-full-time {
    min-width: auto;
  }
  
  /* Approvals */
  .approvals-container {
    padding: 0;
  }
  
  .approvals-section {
    padding: 1rem;
  }
  
  .approval-card {
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.875rem;
  }
  
  .approval-actions {
    width: 100%;
  }
  
  .approval-actions .btn {
    flex: 1;
  }
  
  /* Settings */
  .settings-container {
    padding: 0;
  }
  
  .about-card {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
    padding: 1rem;
  }
  
  .about-avatar {
    width: 60px;
    height: 60px;
  }
  
  /* List view table */
  .task-list-container {
    padding: 0.5rem;
  }
  
  .task-list-table {
    font-size: 0.75rem;
  }
  
  .task-list-table th,
  .task-list-table td {
    padding: 0.5rem;
  }
  
  /* Hide less important columns on mobile */
  .task-list-table th:nth-child(5),
  .task-list-table td:nth-child(5),
  .task-list-table th:nth-child(6),
  .task-list-table td:nth-child(6) {
    display: none;
  }
  
  /* Timeline view */
  .task-timeline-container {
    padding: 0.5rem;
  }
  
  .timeline-task-label {
    width: 150px;
    font-size: 0.75rem;
  }
  
  .timeline-date {
    width: 45px;
    font-size: 0.65rem;
    padding: 0.25rem;
  }
  
  /* Hierarchy view */
  .hierarchy-item {
    padding: 0.4rem 0.5rem;
  }
  
  .hierarchy-title {
    font-size: 0.875rem;
  }
  
  .hierarchy-meta {
    font-size: 0.7rem;
  }
  
  /* Breakdown grid mobile */
  .breakdown-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .breakdown-section {
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
  }
  
  .breakdown-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }
  
  /* Cost card */
  .cost-card {
    grid-column: 1 / -1 !important;
  }
  
  .cost-total {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }
  
  .cost-value {
    font-size: 1.5rem;
  }
  
  .cost-item {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
  }
}

/* Extra small screens (iPhone SE, etc.) */
@media (max-width: 375px) {
  .view-container {
    padding: 0.5rem;
  }
  
  .dashboard-grid {
    gap: 0.5rem;
  }
  
  .card {
    padding: 0.75rem;
  }
  
  .welcome-content h2 {
    font-size: 1rem !important;
  }
  
  .card-title {
    font-size: 0.75rem;
  }
  
  .kanban-column {
    min-width: 220px;
    max-width: 240px;
  }
  
  .header {
    padding: 0 0.5rem;
  }
  
  .breadcrumb {
    font-size: 0.875rem;
  }
  
  .btn-text {
    display: none;
  }
  
  .btn-icon {
    margin: 0;
  }
  
  /* Calendar specific for small screens */
  .calendar-grid {
    grid-template-columns: repeat(7, 38px);
    min-width: calc(7 * 38px + 6 * 4px);
  }
  
  .agents-mini-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .project-stats-row {
    grid-template-columns: 1fr 1fr;
  }
  
  .workflow-stage {
    padding: 0.75rem;
  }
  
  .stage-icon {
    font-size: 1.25rem;
  }
}

/* =====================================================
   UI FIXES - Feb 5 2026
   ===================================================== */

/* IDEAS PAGE - Full width, clean layout */
#view-ideas .ideas-container {
  max-width: none !important;
  width: 100% !important;
  padding: 0 1.5rem !important;
  height: calc(100vh - 80px) !important;
  display: flex !important;
  gap: 1.5rem !important;
}

#view-ideas .ideas-sidebar {
  width: 260px !important;
  min-width: 260px !important;
  background: var(--bg-card) !important;
  border-radius: var(--radius-lg) !important;
  padding: 1.25rem !important;
  border: 1px solid var(--border-color) !important;
  overflow-y: auto !important;
  flex-shrink: 0 !important;
}

#view-ideas .ideas-main {
  flex: 1 !important;
  min-width: 0 !important;
  display: flex !important;
  flex-direction: column !important;
}

#view-ideas .ideas-grouped-list,
#view-ideas #ideas-grouped-list {
  flex: 1 !important;
  overflow-y: auto !important;
  padding-right: 8px !important;
}

/* Ideas category buttons */
#view-ideas .ideas-sidebar button {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: none;
  border-radius: var(--radius);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  cursor: pointer;
  text-align: left;
  font-size: 0.875rem;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

#view-ideas .ideas-sidebar button:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

#view-ideas .ideas-sidebar button[style*="var(--accent)"] {
  background: var(--accent-primary) !important;
  color: white !important;
}

/* Ideas cards */
.idea-card {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--radius-lg) !important;
  padding: 1rem !important;
  transition: all 0.2s ease !important;
}

.idea-card:hover {
  border-color: var(--accent-primary) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15) !important;
}

/* IDEAS - Responsive */
@media (max-width: 900px) {
  #view-ideas .ideas-container {
    flex-direction: column !important;
    height: auto !important;
    min-height: calc(100vh - 80px) !important;
    padding: 0 0.75rem !important;
  }
  
  #view-ideas .ideas-sidebar {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    max-height: none !important;
    overflow-x: hidden !important;
    overflow-y: visible !important;
    padding: 0.75rem !important;
  }
  
  /* Stack sidebar sections vertically */
  #view-ideas .ideas-sidebar > * {
    width: 100% !important;
  }
  
  /* Category list - wrap into grid */
  #view-ideas .ideas-category-list {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.5rem !important;
  }
  
  #view-ideas .ideas-sidebar button {
    white-space: normal !important;
    font-size: 0.75rem !important;
    padding: 0.5rem !important;
  }
  
  /* Filters - side by side */
  #view-ideas .sidebar-section {
    margin-top: 0.75rem !important;
  }
  
  #view-ideas .filter-select {
    font-size: 0.75rem !important;
    padding: 0.5rem !important;
  }
  
  /* Hide section titles to save space */
  #view-ideas .sidebar-section-title {
    font-size: 0.75rem !important;
    margin-bottom: 0.375rem !important;
  }
}

/* =====================================================
   ARTIFACT BUTTONS - States, backgrounds, consistency
   ===================================================== */

.artifact-feedback-buttons {
  display: flex !important;
  gap: 0.5rem !important;
  margin-top: 0.75rem !important;
}

.artifact-feedback-buttons button {
  flex: 1 !important;
  padding: 0.625rem 1rem !important;
  border-radius: var(--radius) !important;
  font-size: 0.875rem !important;
  font-weight: 500 !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.375rem !important;
}

.artifact-feedback-buttons .btn-approve {
  background: rgba(16, 185, 129, 0.1) !important;
  border: 1px solid rgba(16, 185, 129, 0.3) !important;
  color: #10b981 !important;
}

.artifact-feedback-buttons .btn-approve:hover {
  background: rgba(16, 185, 129, 0.2) !important;
  border-color: #10b981 !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2) !important;
}

.artifact-feedback-buttons .btn-approve:active {
  transform: translateY(0) !important;
  box-shadow: none !important;
}

.artifact-feedback-buttons .btn-changes {
  background: rgba(245, 158, 11, 0.1) !important;
  border: 1px solid rgba(245, 158, 11, 0.3) !important;
  color: #f59e0b !important;
}

.artifact-feedback-buttons .btn-changes:hover {
  background: rgba(245, 158, 11, 0.2) !important;
  border-color: #f59e0b !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2) !important;
}

.artifact-feedback-buttons .btn-changes:active {
  transform: translateY(0) !important;
  box-shadow: none !important;
}

/* Artifact view buttons - consistent with rest of UI */
.artifact-card .artifact-actions a,
.artifact-card .btn-view {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.375rem !important;
  padding: 0.625rem 1rem !important;
  background: var(--accent-primary) !important;
  color: white !important;
  border: none !important;
  border-radius: var(--radius) !important;
  font-size: 0.875rem !important;
  font-weight: 500 !important;
  text-decoration: none !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}

.artifact-card .artifact-actions a:hover,
.artifact-card .btn-view:hover {
  background: var(--accent-hover) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(var(--accent-primary-rgb), 0.3) !important;
}

/* Artifact status badges */
.artifact-status {
  margin-top: 0.625rem !important;
  padding: 0.5rem 0.75rem !important;
  border-radius: calc(var(--radius) * 0.75) !important;
  font-size: 0.75rem !important;
  font-weight: 500 !important;
}

.artifact-status.approved {
  background: rgba(16, 185, 129, 0.1) !important;
  color: #10b981 !important;
  border: 1px solid rgba(16, 185, 129, 0.2) !important;
}

.artifact-status.changes-requested {
  background: rgba(245, 158, 11, 0.1) !important;
  color: #f59e0b !important;
  border: 1px solid rgba(245, 158, 11, 0.2) !important;
}

/* =====================================================
   MODAL FIXES - Button alignment, clean layout
   ===================================================== */

.modal-content {
  max-width: 540px !important;
}

.modal-header {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  padding: 1.25rem 1.5rem !important;
  border-bottom: 1px solid var(--border-color) !important;
}

.modal-header h3 {
  margin: 0 !important;
  font-size: 1.15rem !important;
  font-weight: 600 !important;
  flex: 1 !important;
}

.modal-close {
  width: 32px !important;
  height: 32px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: var(--bg-secondary) !important;
  border: none !important;
  border-radius: var(--radius) !important;
  color: var(--text-muted) !important;
  font-size: 1.25rem !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  flex-shrink: 0 !important;
}

.modal-close:hover {
  background: var(--bg-tertiary) !important;
  color: var(--text-primary) !important;
}

/* Modal form actions - right aligned */
.form-actions,
.modal-content .form-actions,
#task-form .form-actions,
#project-form .form-actions,
#idea-form .form-actions {
  display: flex !important;
  justify-content: flex-end !important;
  gap: 0.75rem !important;
  margin-top: 1.5rem !important;
  padding-top: 20px !important;
  border-top: 1px solid var(--border-color) !important;
}

.form-actions .btn,
.form-actions button {
  min-width: auto !important;
  width: auto !important;
  padding: 0.625rem 1.25rem !important;
}

/* Secondary button in modals */
.form-actions .btn-secondary,
.form-actions button[type="button"] {
  background: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-color) !important;
}

.form-actions .btn-secondary:hover,
.form-actions button[type="button"]:hover {
  background: var(--bg-tertiary) !important;
}

/* Primary button in modals */
.form-actions .btn-primary,
.form-actions button[type="submit"] {
  background: var(--accent-primary) !important;
  color: white !important;
  border: none !important;
}

.form-actions .btn-primary:hover,
.form-actions button[type="submit"]:hover {
  background: var(--accent-hover) !important;
}

/* =====================================================
   GENERAL RESPONSIVE IMPROVEMENTS
   ===================================================== */

@media (max-width: 768px) {
  .modal-content {
    margin: 1rem !important;
    max-width: calc(100% - 32px) !important;
    max-height: calc(100vh - 32px) !important;
  }
  
  .modal-header {
    padding: 1rem 1.25rem !important;
  }
  
  .form-actions {
    flex-direction: column-reverse !important;
  }
  
  .form-actions .btn,
  .form-actions button {
    width: 100% !important;
  }
  
  .artifact-feedback-buttons {
    flex-direction: column !important;
  }
  
  .artifact-feedback-buttons button {
    width: 100% !important;
  }
}

/* =====================================================
   ARTIFACTS GRID - Better layout
   ===================================================== */

.artifacts-grid,
#project-artifacts-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)) !important;
  gap: 1rem !important;
  margin-top: 1rem !important;
}

.artifact-card {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--radius-lg) !important;
  padding: 1.25rem !important;
  transition: all 0.2s ease !important;
}

.artifact-card:hover {
  border-color: var(--accent-primary) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
}

.artifact-card.approved {
  border-color: rgba(16, 185, 129, 0.4) !important;
  background: linear-gradient(135deg, var(--bg-card), rgba(16, 185, 129, 0.05)) !important;
}

.artifact-card.needs-changes {
  border-color: rgba(245, 158, 11, 0.4) !important;
  background: linear-gradient(135deg, var(--bg-card), rgba(245, 158, 11, 0.05)) !important;
}

@media (max-width: 600px) {
  .artifacts-grid,
  #project-artifacts-grid {
    grid-template-columns: 1fr !important;
  }
}

/* =====================================================
   IDEAS PAGE - Clean, Full-Width Layout
   ===================================================== */

#view-ideas {
  padding: 0 !important;
}

#view-ideas .ideas-container {
  display: flex;
  gap: 1.5rem;
  height: calc(100vh - 80px);
  padding: 1.25rem 1.5rem;
  max-width: none;
  width: 100%;
}

#view-ideas .ideas-sidebar {
  width: 280px;
  min-width: 280px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  border: 1px solid var(--border-color);
  overflow-y: auto;
  flex-shrink: 0;
}

#view-ideas .sidebar-section-title {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

#view-ideas .sidebar-section {
  margin-top: 1.25rem;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

#view-ideas .ideas-category-list {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

#view-ideas .filter-select {
  width: 100%;
  padding: 0.625rem 0.75rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.875rem;
  margin-bottom: 0.625rem;
  cursor: pointer;
}

#view-ideas .filter-select:focus {
  outline: none;
  border-color: var(--accent-primary);
}

#view-ideas .ideas-stats {
  font-size: 0.875rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

#view-ideas .ideas-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

#view-ideas .ideas-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

#view-ideas .ideas-header h2 {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
}

#view-ideas .ideas-header .btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

#view-ideas .ideas-search-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-size: 0.95rem;
  margin-bottom: 1rem;
  transition: border-color 0.2s;
}

#view-ideas .ideas-search-input:focus {
  outline: none;
  border-color: var(--accent-primary);
}

#view-ideas .ideas-search-input::placeholder {
  color: var(--text-muted);
}

#view-ideas .ideas-grouped-list {
  flex: 1;
  overflow-y: auto;
  padding-right: 8px;
}

#view-ideas .ideas-category-group {
  margin-bottom: 1.75rem;
}

#view-ideas .category-header {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 0.875rem;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

#view-ideas .category-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

#view-ideas .ideas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 0.875rem;
}

#view-ideas .loading-state {
  text-align: center;
  padding: 3.75rem 1.25rem;
  color: var(--text-muted);
}

/* Ideas responsive */
@media (max-width: 1024px) {
  #view-ideas .ideas-container {
    flex-direction: column;
    height: auto;
    min-height: calc(100vh - 80px);
  }
  
  #view-ideas .ideas-sidebar {
    width: 100%;
    min-width: 100%;
    max-height: none;
  }
  
  #view-ideas .sidebar-section {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: flex-start;
  }
  
  #view-ideas .sidebar-section-title {
    width: 100%;
  }
  
  #view-ideas .filter-select {
    flex: 1;
    min-width: 150px;
    margin-bottom: 0;
  }
  
  #view-ideas .ideas-category-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  #view-ideas .ideas-category-list button {
    flex: none;
  }
  
  #view-ideas .ideas-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

@media (max-width: 600px) {
  #view-ideas .ideas-container {
    padding: 1rem;
    gap: 1rem;
  }
  
  #view-ideas .ideas-header {
    flex-direction: column;
    gap: 0.75rem;
    align-items: stretch;
  }
  
  #view-ideas .ideas-header .btn {
    justify-content: center;
  }
  
  #view-ideas .ideas-grid {
    grid-template-columns: 1fr;
  }
}

/* Idea Modal specific fixes */
#idea-modal .modal-content {
  max-width: 600px;
}

#idea-modal .modal-header {
  padding: 1.25rem 1.5rem;
}

#idea-modal #idea-form {
  padding: 1.5rem;
}

#idea-modal .form-group {
  margin-bottom: 1rem;
}

#idea-modal .form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.375rem;
}

#idea-modal .form-group input,
#idea-modal .form-group select,
#idea-modal .form-group textarea {
  width: 100%;
  padding: 0.625rem 0.875rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.95rem;
}

#idea-modal .form-group input:focus,
#idea-modal .form-group select:focus,
#idea-modal .form-group textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
}

#idea-modal .form-row {
  display: grid;
  gap: 1rem;
}

#idea-modal .form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

/* ============================================
   UTILITY CLASSES - Design System v2
   Added: 2026-02-06
   ============================================ */

/* Spacing Utilities */
.p-0 { padding: 0; }
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }

.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }

.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }

.m-0 { margin: 0; }
.m-2 { margin: 0.5rem; }
.m-3 { margin: 0.75rem; }
.m-4 { margin: 1rem; }

.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }

.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }

/* Display Utilities */
.d-flex { display: flex; }
.d-grid { display: grid; }
.d-block { display: block; }
.d-none { display: none; }
.d-inline-flex { display: inline-flex; }

.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }

.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }

.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-start { justify-content: flex-start; }
.justify-end { justify-content: flex-end; }

/* Text Utilities */
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }

.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--primary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.truncate { 
  overflow: hidden; 
  text-overflow: ellipsis; 
  white-space: nowrap; 
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Background Utilities */
.bg-card { background: var(--bg-card); }
.bg-dark { background: var(--bg-dark); }
.bg-primary { background: var(--primary); }
.bg-success { background: var(--success); }
.bg-warning { background: var(--warning); }
.bg-danger { background: var(--danger); }

/* Border Utilities */
.border { border: 1px solid var(--border-color); }
.border-t { border-top: 1px solid var(--border-color); }
.border-b { border-bottom: 1px solid var(--border-color); }
.border-l { border-left: 1px solid var(--border-color); }
.border-r { border-right: 1px solid var(--border-color); }
.border-0 { border: none; }

.rounded { border-radius: var(--radius); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: 9999px; }

/* Shadow Utilities */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow { box-shadow: var(--shadow); }
.shadow-lg { box-shadow: var(--shadow-lg); }

/* Width/Height Utilities */
.w-full { width: 100%; }
.w-auto { width: auto; }
.h-full { height: 100%; }
.min-h-screen { min-height: 100vh; }

/* Cursor Utilities */
.cursor-pointer { cursor: pointer; }
.cursor-default { cursor: default; }

/* Transition Utilities */
.transition { transition: all var(--transition); }

/* Standardized Component Classes */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: 1rem;
}

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

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

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 9999px;
  background: var(--bg-card);
  color: var(--text-secondary);
}

.badge-primary { background: var(--primary); color: white; }
.badge-success { background: var(--success); color: white; }
.badge-warning { background: var(--warning); color: white; }
.badge-danger { background: var(--danger); color: white; }

/* Responsive visibility */
@media (max-width: 768px) {
  .hide-mobile { display: none !important; }
}
@media (min-width: 769px) {
  .hide-desktop { display: none !important; }
}

/* ========================================
   Utility Classes (2026-02-06 Overhaul)
   ======================================== */

/* State Classes */
.loading-state {
  color: var(--text-muted);
  text-align: center;
  padding: 1.25rem;
}

.empty-state {
  color: var(--text-muted);
  text-align: center;
  padding: 1.25rem;
}

.error-state {
  color: var(--danger);
  text-align: center;
  padding: 1.25rem;
}

.warning-state {
  color: var(--warning);
  text-align: center;
  padding: 1.25rem;
}

/* Event Cards */
.event-card {
  padding: 0.75rem;
  margin-bottom: 0.625rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  border-left: 3px solid var(--primary);
}

.event-card-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

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

/* Task Due Cards */
.task-due-card {
  padding: 0.75rem;
  margin-bottom: 0.625rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  border-left: 3px solid var(--warning);
}

/* Document Cards */
.doc-card {
  padding: 0.9375rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  transition: all var(--transition);
}

.doc-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary);
}

.doc-card-title {
  font-weight: 600;
  margin-bottom: 0.375rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

/* Idea Cards */
.idea-card {
  padding: 1rem;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  transition: all var(--transition);
}

.idea-card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

/* Tag Chips */
.tag-chip {
  display: inline-flex;
  padding: 0.125rem 0.5rem;
  font-size: 0.625rem;
  background: var(--bg-input);
  border-radius: 9999px;
  color: var(--text-muted);
}

/* Stat Boxes */
.stat-box-inline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.625rem;
  background: var(--bg-card);
  border-radius: var(--radius);
}

/* Grid Utilities */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; }

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* Flex Utilities */
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.flex-center { align-items: center; justify-content: center; }
.flex-between { justify-content: space-between; }
.gap-4 { gap: 0.25rem; }
.gap-8 { gap: 0.5rem; }
.gap-12 { gap: 0.75rem; }
.gap-16 { gap: 1rem; }

/* Text Utilities */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.75rem; }
.text-xs { font-size: 0.625rem; }
.font-semibold { font-weight: 600; }

/* Spacing */
.mt-12 { margin-top: 0.75rem; }
.mb-12 { margin-bottom: 0.75rem; }
.p-12 { padding: 0.75rem; }
.p-16 { padding: 1rem; }
.p-20 { padding: 1.25rem; }

/* Borders */
.rounded { border-radius: var(--radius); }
.rounded-lg { border-radius: var(--radius-lg); }
.border-left-primary { border-left: 3px solid var(--primary); }
.border-left-warning { border-left: 3px solid var(--warning); }
.border-left-success { border-left: 3px solid var(--success); }
.border-left-danger { border-left: 3px solid var(--danger); }

/* Gradient Cards */
.gradient-card {
  background: linear-gradient(135deg, var(--bg-card), rgba(99, 102, 241, 0.1));
  border-radius: var(--radius);
  padding: 0.75rem;
  text-align: center;
}

/* ========================================
   Additional Utility Classes (Phase 2)
   ======================================== */

/* Stat Row Item */
.stat-row-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.625rem;
  background: var(--bg-card);
  border-radius: calc(var(--radius) * 0.75);
}

/* Meta Text */
.meta-text {
  color: var(--text-muted);
  margin-bottom: 0.125rem;
}

.meta-text-sm {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Link Button */
.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3125rem;
  font-size: 0.75rem;
  padding: 0.5rem 0.875rem;
  text-decoration: none;
  border-radius: calc(var(--radius) * 0.75);
  font-weight: 500;
  transition: all var(--transition);
}

.link-btn:hover {
  background: var(--bg-card-hover);
}

/* Flex Row with Gap */
.flex-row-gap {
  display: flex;
  gap: 0.625rem;
  flex-wrap: wrap;
}

/* Empty State Variants */
.empty-state-lg {
  color: var(--text-muted);
  text-align: center;
  padding: 2.5rem;
  grid-column: 1 / -1;
}

.empty-state-xl {
  text-align: center;
  padding: 5rem 2.5rem;
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  border: 2px dashed var(--border-color);
}

/* Card Title */
.card-title-sm {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

/* Cursor Pointer */
.clickable {
  cursor: pointer;
}

/* Success Button Inline */
.btn-success-inline {
  padding: 0.5rem 0.75rem;
  border: none;
  border-radius: calc(var(--radius) * 0.75);
  background: var(--success);
  color: white;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 500;
}

.btn-success-inline:hover {
  opacity: 0.9;
}

/* Ghost Button Inline */
.btn-ghost-inline {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: calc(var(--radius) * 0.75);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.75rem;
}

.btn-ghost-inline:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

/* Additional accent color */
:root {
  --accent-purple: #8b5cf6;
}

/* Additional typography utilities */
.font-bold-lg { font-weight: 700; font-size: 1rem; }
.font-bold-md { font-weight: 700; font-size: 0.875rem; }
.font-bold-sm { font-weight: 700; font-size: 0.8125rem; }
.font-semibold-mb { font-weight: 600; margin-bottom: 0.5rem; }

/* Margin utilities */
.mb-30 { margin-bottom: 1.875rem; }
.mb-8 { margin-bottom: 0.5rem; }

/* Status badge in tasks */
.status-badge-inline {
  margin-left: 0.625rem;
  padding: 0.125rem 0.375rem;
  background: var(--primary);
  border-radius: calc(var(--radius) / 2);
  font-size: 0.625rem;
}

/* Tag badge small */
.tag-badge-sm {
  margin-left: 0.3125rem;
  padding: 0.125rem 0.375rem;
  background: var(--bg-card);
  border-radius: calc(var(--radius) / 2);
  font-size: 0.625rem;
}

/* Empty state box */
.empty-state-box {
  text-align: center;
  padding: 5rem 2.5rem;
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  border: 2px dashed var(--border-color);
}

/* Large icon display */
.icon-lg {
  font-size: 4rem;
  display: block;
  margin-bottom: 1.25rem;
}

/* ========================================
   MISSING CSS CLASSES FIX (2026-02-06)
   Deep audit revealed missing styles
   ======================================== */

/* === KANBAN CARD STYLES === */
.kanban-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: all var(--transition);
}

.kanban-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.kanban-card.priority-urgent {
  border-left: 3px solid var(--danger);
}

.kanban-card.priority-high {
  border-left: 3px solid var(--warning);
}

.kanban-card-title {
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
  line-height: 1.4;
  color: var(--text-primary);
}

.kanban-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.kanban-column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background: var(--bg-sidebar);
  border-radius: var(--radius) var(--radius) 0 0;
  border-bottom: 1px solid var(--border-color);
}

.kanban-column-content {
  padding: 0.5rem;
  min-height: 200px;
  max-height: calc(100vh - 300px);
  overflow-y: auto;
}

.kanban-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 0.375rem;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* === KNOWLEDGE BASE STYLES === */
.kb-article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-top: 0.75rem;
}

.kb-article-tags .tag {
  padding: 0.25rem 0.625rem;
  background: var(--bg-input);
  border-radius: 9999px;
  font-size: 0.6875rem;
  color: var(--text-muted);
}

/* === AGENT EXTRA STYLES === */
.agent-projects {
  margin-top: 0.75rem;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

.agent-projects-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.agent-progress {
  height: 4px;
  background: var(--bg-input);
  border-radius: 0.125rem;
  overflow: hidden;
  margin-top: 0.5rem;
}

.agent-progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 0.125rem;
  transition: width 0.3s ease;
}

.agent-util {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* === EMPTY STATE SMALL === */
.empty-state-small {
  color: var(--text-muted);
  font-size: 0.8125rem;
  text-align: center;
  padding: 1rem;
}

/* ========================================
   RESPONSIVE FIXES - Mobile Styles
   ======================================== */

/* === AGENTS VIEW MOBILE === */
@media (max-width: 768px) {
  .agents-full-grid {
    grid-template-columns: 1fr !important;
    gap: 0.75rem;
  }
  
  .agent-full-card {
    padding: 1rem;
  }
  
  .agent-header {
    flex-direction: column;
    text-align: center;
    gap: 0.75rem;
  }
  
  .agent-stats-row {
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* === PROJECTS VIEW MOBILE === */
@media (max-width: 768px) {
  .projects-grid {
    grid-template-columns: 1fr !important;
    gap: 0.75rem;
  }
  
  .projects-header {
    flex-direction: column;
    gap: 0.75rem;
    align-items: stretch;
  }
  
  .project-card {
    padding: 1rem;
  }
  
  .project-detail-page {
    padding: 0.75rem;
  }
  
  .project-stats-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }
  
  .project-kanban-section .kanban-board {
    flex-direction: column;
  }
  
  .project-kanban-section .kanban-column {
    width: 100%;
    min-width: unset;
  }
}

/* === APPROVALS VIEW MOBILE === */
@media (max-width: 768px) {
  .approvals-container {
    padding: 0.75rem;
  }
  
  .approvals-section {
    margin-bottom: 1.5rem;
  }
  
  .approval-card {
    padding: 0.75rem;
  }
  
  .approval-actions {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .approval-actions .btn {
    flex: 0 1 auto;
    width: auto;
  }
}

/* === ACTIVITY VIEW MOBILE === */
@media (max-width: 768px) {
  .activity-full-list {
    padding: 0.75rem;
  }
  
  .activity-item {
    padding: 0.75rem;
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .activity-time {
    font-size: 0.6875rem;
  }
}

/* === SETTINGS VIEW MOBILE === */
@media (max-width: 768px) {
  .settings-container {
    padding: 0.75rem;
  }
  
  .settings-section {
    padding: 1rem;
  }
  
  .about-card {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }
}

/* === DOCUMENTS VIEW MOBILE === */
@media (max-width: 768px) {
  .documents-container {
    padding: 0.75rem;
  }
  
  .documents-header {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .documents-grid {
    grid-template-columns: 1fr !important;
  }
  
  .pitch-decks-section {
    margin-top: 1.25rem;
  }
}

/* === KNOWLEDGE BASE VIEW MOBILE === */
@media (max-width: 768px) {
  .kb-layout {
    flex-direction: column;
  }
  
  .kb-sidebar {
    width: 100%;
    max-height: 40vh;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }
  
  .kb-content {
    min-height: 50vh;
  }
  
  .kb-list {
    max-height: 30vh;
  }
}

/* === CALENDAR VIEW MOBILE IMPROVEMENTS === */
@media (max-width: 768px) {
  .calendar-container {
    padding: 0.75rem;
  }
  
  .calendar-header-row {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .calendar-events-panel {
    flex-direction: column;
  }
  
  .calendar-panel {
    width: 100%;
  }
}

/* === KANBAN MOBILE IMPROVEMENTS === */
@media (max-width: 768px) {
  .kanban-board {
    flex-direction: column;
    gap: 1rem;
  }
  
  .kanban-column {
    width: 100%;
    min-width: unset;
    max-width: none;
  }
  
  .kanban-column-content {
    max-height: 300px;
  }
  
  .view-controls {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .view-switcher {
    width: 100%;
    overflow-x: auto;
  }
  
  .filter-group {
    flex-direction: column;
    width: 100%;
  }
  
  .filter-group select,
  .filter-group input {
    width: 100%;
  }
}

/* === IDEAS VIEW MOBILE IMPROVEMENTS === */
@media (max-width: 768px) {
  .ideas-container {
    flex-direction: column;
  }
  
  .ideas-sidebar {
    width: 100%;
    max-height: 40vh;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }
  
  .ideas-main {
    padding: 0.75rem;
  }
  
  .ideas-header {
    flex-direction: column;
    gap: 0.75rem;
    align-items: stretch;
  }
  
  .idea-card {
    padding: 0.75rem;
  }
}

/* === DASHBOARD MOBILE IMPROVEMENTS === */
@media (max-width: 768px) {
  .dashboard-grid {
    grid-template-columns: 1fr !important;
    gap: 0.75rem;
  }
  
  .welcome-card {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }
  
  .breakdown-grid {
    grid-template-columns: 1fr;
  }
  
  .agents-mini-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* === MODAL MOBILE === */
@media (max-width: 600px) {
  .modal-content {
    width: 95%;
    max-width: none;
    margin: 0.625rem;
    max-height: 90vh;
  }
  
  .form-row {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .form-actions {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .form-actions .btn {
    width: 100%;
  }
}

/* === HEADER MOBILE === */
@media (max-width: 600px) {
  .header {
    padding: 0.5rem 0.75rem;
  }
  
  .header-stats {
    display: none;
  }
  
  .header-right .btn .btn-text {
    display: none;
  }
  
  .header-right .btn .btn-icon {
    margin: 0;
  }
}

/* === TOUCH FRIENDLY === */
@media (max-width: 768px) {
  .btn, button {
    min-height: 44px;
    min-width: 44px;
  }
  
  .nav-item {
    min-height: 48px;
  }
  
  select, input {
    min-height: 44px;
  }
}

/* === ADDITIONAL UTILITY CLASSES === */
.logo-avatar-img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.hidden {
  display: none;
}

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

.flex-title {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9375rem;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.9375rem;
}

.form-actions-end {
  display: flex;
  gap: 0.625rem;
  justify-content: flex-end;
  margin-top: 1.25rem;
}

.slider-value {
  font-size: 0.75rem;
  color: var(--primary);
}

.doc-filter-select {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 0.5rem 0.75rem;
  border-radius: calc(var(--radius) * 0.75);
}

.modal-narrow {
  max-width: 600px;
}

/* === DOCUMENT CARD STYLES === */
.doc-card-styled {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 0.9375rem;
  border-left: 4px solid var(--primary);
}

.doc-card-icon {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.doc-card-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.625rem;
}

.doc-card-desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

/* === PITCH DECK CARD === */
.pitch-card-styled {
  background: linear-gradient(135deg, var(--bg-card), rgba(59, 130, 246, 0.15));
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  border: 1px solid var(--border-color);
}

.pitch-card-header {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 0.75rem;
}

.pitch-card-icon {
  font-size: 1.75rem;
}

.pitch-card-title {
  font-weight: 700;
  font-size: 1rem;
}

.pitch-card-tagline {
  font-size: 0.75rem;
  color: var(--primary);
}

.pitch-card-desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 0.9375rem;
}

/* === CATEGORY HEADER === */
.category-header-styled {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border-color);
}

.category-icon {
  font-size: 1.5rem;
}

/* === IDEA EMPTY STATE === */
.idea-empty-state {
  text-align: center;
  padding: 5rem 2.5rem;
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  border: 2px dashed var(--border-color);
}

.idea-empty-icon {
  font-size: 4rem;
  display: block;
  margin-bottom: 1.25rem;
}

.idea-empty-title {
  margin: 0 0 0.625rem 0;
  font-size: 1.25rem;
}

.idea-empty-desc {
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

/* === ERROR STATE FULL === */
.error-state-full {
  color: var(--danger);
  text-align: center;
  padding: 2.5rem;
  grid-column: 1 / -1;
}

/* === COST ITEM === */
.cost-item-bordered {
  border-top: 1px solid var(--border-color);
  margin-top: 0.5rem;
  padding-top: 0.5rem;
}

/* === ARTIFACTS SUMMARY === */
.artifacts-summary-full {
  grid-column: 1 / -1;
}

/* === STATUS BADGE SMALL === */
.status-tag {
  margin-left: 0.625rem;
  padding: 0.125rem 0.375rem;
  background: var(--primary);
  border-radius: calc(var(--radius) / 2);
  font-size: 0.625rem;
}

/* === SECTION HEADER SMALL === */
.section-header-sm {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 1rem 0 0.5rem;
}

/* === TAG CHIPS === */
.tag-chip {
  margin-left: 0.3125rem;
  padding: 0.125rem 0.375rem;
  background: var(--bg-card);
  border-radius: calc(var(--radius) / 2);
  font-size: 0.625rem;
}

/* ========================================
   IDEAS VIEW - MOBILE FIX (2026-02-06)
   Fixing right-side cutoff on mobile
   ======================================== */

/* Fix ideas grid for small screens */
@media (max-width: 480px) {
  .ideas-grid {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
  }
  
  .idea-card {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
    padding: 0.875rem !important;
  }
  
  /* Status badge positioning */
  .idea-card [style*="position:absolute"] {
    position: static !important;
    display: inline-block;
    margin-bottom: 0.5rem;
  }
  
  /* Stats grid - 2 columns on mobile instead of 4 */
  .idea-card [style*="grid-template-columns:repeat(4"] {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.5rem !important;
    font-size: 0.625rem !important;
  }
  
  /* Buttons - stay in row, wrap when needed */
  .idea-card [style*="display:flex"][style*="gap:0.5rem"][style*="border-top"] {
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 0.5rem !important;
  }
  
  .idea-card [style*="display:flex"][style*="gap:0.5rem"][style*="border-top"] a,
  .idea-card [style*="display:flex"][style*="gap:0.5rem"][style*="border-top"] button {
    width: auto !important;
    flex: 0 1 auto !important;
    text-align: center !important;
  }
  
  /* Title area - remove padding-right that was for absolute badge */
  .idea-card [style*="padding-right:4.375rem"] {
    padding-right: 0 !important;
  }
  
  /* Tags - wrap properly */
  .idea-card [style*="flex-wrap:wrap"] {
    gap: 0.25rem !important;
  }
  
  /* Description text */
  .idea-card h4 {
    font-size: 0.9375rem !important;
    word-break: break-word;
  }
  
  .idea-card p {
    font-size: 0.8125rem !important;
    word-break: break-word;
  }
}

/* Category header on mobile */
@media (max-width: 480px) {
  .category-header-styled,
  [class*="category-header"] {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
}

/* Ideas sidebar on very small screens */
@media (max-width: 400px) {
  .ideas-sidebar {
    padding: 0.5rem !important;
  }
  
  .ideas-sidebar button {
    padding: 0.5rem !important;
    font-size: 0.75rem !important;
  }
}

/* ========================================
   COMPREHENSIVE MOBILE FIXES - ALL VIEWS
   Fixing ALL potential overflow issues
   ======================================== */

/* === GLOBAL MOBILE OVERFLOW PREVENTION === */
@media (max-width: 768px) {
  /* Prevent ANY horizontal scroll */
  html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
  }
  
  .main-content {
    overflow-x: hidden !important;
    max-width: 100% !important;
  }
  
  /* All views should be contained */
  .view {
    overflow-x: hidden !important;
    max-width: 100% !important;
    padding: 0.75rem !important;
  }
}

/* === DASHBOARD VIEW MOBILE === */
@media (max-width: 600px) {
  .dashboard-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.75rem !important;
  }
  
  .welcome-card {
    flex-direction: column !important;
    text-align: center !important;
    padding: 1rem !important;
  }
  
  .welcome-card .avatar {
    margin: 0 auto 0.75rem !important;
  }
  
  .breakdown-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.5rem !important;
  }
  
  .breakdown-card {
    padding: 0.75rem !important;
  }
  
  .breakdown-card h3 {
    font-size: 0.875rem !important;
  }
  
  .agents-mini-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.5rem !important;
  }
  
  .agent-mini-card {
    padding: 0.5rem !important;
    font-size: 0.75rem !important;
  }
  
  .stat-card {
    padding: 0.75rem !important;
  }
  
  .stat-value {
    font-size: 1.5rem !important;
  }
}

/* === KANBAN VIEW MOBILE === */
@media (max-width: 768px) {
  .kanban-board {
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem !important;
    overflow-x: hidden !important;
  }
  
  .kanban-column {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }
  
  .kanban-column-content {
    max-height: 250px !important;
    overflow-y: auto !important;
  }
  
  .kanban-card {
    padding: 0.625rem !important;
  }
  
  .kanban-card-title {
    font-size: 0.8125rem !important;
  }
  
  .kanban-card-meta {
    font-size: 0.6875rem !important;
    flex-wrap: wrap !important;
  }
  
  .view-controls {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.5rem !important;
  }
  
  .view-switcher {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  
  .filter-group {
    flex-direction: column !important;
    gap: 0.5rem !important;
  }
  
  .filter-group select,
  .filter-group input {
    width: 100% !important;
    min-width: 0 !important;
  }
}

/* === AGENTS VIEW MOBILE === */
@media (max-width: 600px) {
  .agents-full-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.75rem !important;
  }
  
  .agent-full-card {
    padding: 0.875rem !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }
  
  .agent-header {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 0.5rem !important;
  }
  
  .agent-avatar {
    font-size: 2rem !important;
  }
  
  .agent-name {
    font-size: 1rem !important;
  }
  
  .agent-role {
    font-size: 0.75rem !important;
  }
  
  .agent-stats-row {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.5rem !important;
  }
  
  .agent-stat {
    padding: 0.5rem !important;
    text-align: center !important;
  }
  
  .agent-stat-value {
    font-size: 1rem !important;
  }
  
  .agent-stat-label {
    font-size: 0.625rem !important;
  }
  
  .agent-current-task {
    font-size: 0.75rem !important;
    padding: 0.5rem !important;
  }
}

/* === PROJECTS VIEW MOBILE === */
@media (max-width: 600px) {
  .projects-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.75rem !important;
  }
  
  .project-card {
    padding: 0.875rem !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }
  
  .project-card h3 {
    font-size: 1rem !important;
  }
  
  .project-stage-badge {
    font-size: 0.625rem !important;
    padding: 0.125rem 0.375rem !important;
  }
  
  .project-stats {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.375rem !important;
  }
  
  .project-stat {
    font-size: 0.6875rem !important;
  }
  
  /* Project detail page */
  .project-detail-page {
    padding: 0.75rem !important;
  }
  
  .project-detail-header {
    flex-direction: column !important;
    gap: 0.75rem !important;
  }
  
  .project-stats-row {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.5rem !important;
  }
  
  .workflow-stages {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding-bottom: 0.5rem !important;
  }
  
  .project-kanban-section .kanban-board {
    flex-direction: column !important;
  }
  
  .project-kanban-section .kanban-column {
    width: 100% !important;
    min-width: 0 !important;
  }
}

/* === CALENDAR VIEW MOBILE === */
@media (max-width: 600px) {
  .calendar-container {
    padding: 0.75rem !important;
  }
  
  .calendar-header-row {
    flex-direction: column !important;
    gap: 0.75rem !important;
    align-items: stretch !important;
  }
  
  .calendar-events-panel {
    flex-direction: column !important;
    gap: 0.75rem !important;
  }
  
  .calendar-panel {
    width: 100% !important;
    min-width: 0 !important;
  }
  
  .event-card {
    padding: 0.625rem !important;
  }
  
  .event-card h4 {
    font-size: 0.875rem !important;
  }
  
  .event-card p {
    font-size: 0.75rem !important;
  }
  
  .calendar-info-bar {
    flex-direction: column !important;
    text-align: center !important;
    gap: 0.25rem !important;
    font-size: 0.75rem !important;
  }
}

/* === DOCUMENTS VIEW MOBILE === */
@media (max-width: 600px) {
  .documents-container {
    padding: 0.75rem !important;
  }
  
  .documents-header {
    flex-direction: column !important;
    gap: 0.5rem !important;
    align-items: stretch !important;
  }
  
  .documents-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.75rem !important;
  }
  
  .doc-card,
  .doc-card-styled {
    padding: 0.875rem !important;
    max-width: 100% !important;
  }
  
  .pitch-decks-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.75rem !important;
  }
  
  .pitch-card,
  .pitch-card-styled {
    padding: 0.875rem !important;
    max-width: 100% !important;
  }
  
  .pitch-card-header {
    flex-wrap: wrap !important;
  }
  
  .pitch-card-title {
    font-size: 0.9375rem !important;
  }
  
  .pitch-card-desc {
    font-size: 0.75rem !important;
  }
}

/* === KNOWLEDGE BASE VIEW MOBILE === */
@media (max-width: 600px) {
  .kb-layout {
    flex-direction: column !important;
  }
  
  .kb-sidebar {
    width: 100% !important;
    max-height: 200px !important;
    border-right: none !important;
    border-bottom: 1px solid var(--border-color) !important;
    overflow-y: auto !important;
  }
  
  .kb-content {
    min-height: 300px !important;
    padding: 0.75rem !important;
  }
  
  .kb-search {
    margin-bottom: 0.5rem !important;
  }
  
  .kb-list {
    max-height: 150px !important;
  }
  
  .kb-item {
    padding: 0.5rem !important;
    font-size: 0.75rem !important;
  }
  
  .kb-article {
    padding: 0.75rem !important;
  }
  
  .kb-article h2 {
    font-size: 1.125rem !important;
  }
  
  .kb-article-tags {
    flex-wrap: wrap !important;
    gap: 0.25rem !important;
  }
}

/* === APPROVALS VIEW MOBILE === */
@media (max-width: 600px) {
  .approvals-container {
    padding: 0.75rem !important;
  }
  
  .approvals-section {
    margin-bottom: 1.5rem !important;
  }
  
  .approvals-section h3 {
    font-size: 1rem !important;
  }
  
  .approval-card {
    padding: 0.875rem !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }
  
  .approval-card h4 {
    font-size: 0.9375rem !important;
    word-break: break-word !important;
  }
  
  .approval-card p {
    font-size: 0.75rem !important;
  }
  
  .approval-meta {
    flex-wrap: wrap !important;
    gap: 0.375rem !important;
    font-size: 0.6875rem !important;
  }
  
  .approval-actions {
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 0.5rem !important;
  }
  
  .approval-actions .btn {
    flex: 0 1 auto !important;
    width: auto !important;
  }
}

/* === ACTIVITY VIEW MOBILE === */
@media (max-width: 600px) {
  .activity-full-list {
    padding: 0.75rem !important;
  }
  
  .activity-item {
    padding: 0.75rem !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.375rem !important;
  }
  
  .activity-icon {
    font-size: 1rem !important;
  }
  
  .activity-content {
    font-size: 0.8125rem !important;
    word-break: break-word !important;
  }
  
  .activity-time {
    font-size: 0.625rem !important;
    align-self: flex-end !important;
  }
  
  .activity-agent {
    font-size: 0.6875rem !important;
  }
}

/* === SETTINGS VIEW MOBILE === */
@media (max-width: 600px) {
  .settings-container {
    padding: 0.75rem !important;
  }
  
  .settings-section {
    padding: 0.875rem !important;
  }
  
  .settings-section h3 {
    font-size: 1rem !important;
  }
  
  .about-card {
    flex-direction: column !important;
    text-align: center !important;
    gap: 0.75rem !important;
  }
  
  .about-avatar {
    width: 60px !important;
    height: 60px !important;
    font-size: 2rem !important;
  }
  
  .about-info h2 {
    font-size: 1.125rem !important;
  }
  
  .settings-form .form-group {
    margin-bottom: 0.75rem !important;
  }
  
  .settings-form label {
    font-size: 0.8125rem !important;
  }
  
  .settings-form input,
  .settings-form select {
    font-size: 0.875rem !important;
    padding: 0.625rem !important;
  }
}

/* === MODALS MOBILE === */
@media (max-width: 600px) {
  .modal-content {
    width: 95% !important;
    max-width: none !important;
    margin: 0.5rem !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
  }
  
  .modal-header {
    padding: 0.75rem !important;
  }
  
  .modal-header h2 {
    font-size: 1.125rem !important;
  }
  
  .modal-body {
    padding: 0.75rem !important;
  }
  
  .form-row {
    flex-direction: column !important;
    gap: 0.75rem !important;
  }
  
  .form-group {
    width: 100% !important;
  }
  
  .form-actions {
    flex-direction: column !important;
    gap: 0.5rem !important;
  }
  
  .form-actions .btn {
    width: 100% !important;
  }
}

/* === HEADER MOBILE === */
@media (max-width: 600px) {
  .header {
    padding: 0.5rem 0.75rem !important;
  }
  
  .header h1 {
    font-size: 1rem !important;
  }
  
  .header-stats {
    display: none !important;
  }
  
  .header-right {
    gap: 0.375rem !important;
  }
  
  .header-right .btn {
    padding: 0.375rem 0.5rem !important;
    font-size: 0.75rem !important;
  }
  
  .header-right .btn .btn-text {
    display: none !important;
  }
}

/* === SIDEBAR MOBILE === */
@media (max-width: 768px) {
  .sidebar {
    position: fixed !important;
    left: -280px !important;
    transition: left 0.3s ease !important;
    z-index: 1000 !important;
  }
  
  .sidebar.open {
    left: 0 !important;
  }
  
  .sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
  }
  
  .sidebar.open + .sidebar-overlay {
    display: block;
  }
}

/* === ULTRA SMALL SCREENS (< 375px) === */
@media (max-width: 375px) {
  .view {
    padding: 0.5rem !important;
  }
  
  h1, .h1 {
    font-size: 1.25rem !important;
  }
  
  h2, .h2 {
    font-size: 1rem !important;
  }
  
  h3, .h3 {
    font-size: 0.9375rem !important;
  }
  
  .btn {
    padding: 0.5rem 0.75rem !important;
    font-size: 0.75rem !important;
  }
  
  .agents-mini-grid {
    grid-template-columns: 1fr !important;
  }
  
  .breakdown-chip {
    font-size: 0.625rem !important;
    padding: 0.25rem 0.375rem !important;
  }
}

/* ========================================
   CRITICAL FIX: REMOVE ALL MIN-WIDTHS ON MOBILE
   Root cause of horizontal overflow
   ======================================== */

@media (max-width: 768px) {
  /* Kill ALL min-widths that cause overflow */
  .kanban-column,
  .kanban-board > *,
  .sidebar,
  .kb-sidebar,
  .ideas-sidebar,
  .workflow-stage,
  .agent-mini-card,
  .project-card,
  .approval-card,
  .card,
  .breakdown-section,
  .calendar-panel,
  [class*="card"],
  [class*="column"],
  [class*="panel"],
  [class*="sidebar"] {
    min-width: 0 !important;
    max-width: 100% !important;
  }
  
  /* Force dashboard to single column */
  .dashboard-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.75rem !important;
  }
  
  .dashboard-grid > * {
    width: 100% !important;
    max-width: 100% !important;
    grid-column: unset !important;
  }
  
  /* Reset all grid-column spans */
  .welcome-card,
  .stats-card,
  .breakdown-card,
  .cost-card,
  .active-work-card,
  .upcoming-card,
  .agents-card,
  .projects-mini-card,
  .activity-card,
  .full-width {
    grid-column: 1 / -1 !important;
    width: 100% !important;
  }
  
  /* Breakdown grid - stack sections */
  .breakdown-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem !important;
  }
  
  .breakdown-section {
    width: 100% !important;
  }
  
  .breakdown-items {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.375rem !important;
  }
  
  .breakdown-chip {
    flex: 0 0 auto !important;
    max-width: 100% !important;
  }
  
  /* Kanban - must be vertical */
  .kanban-board {
    display: flex !important;
    flex-direction: column !important;
    overflow-x: hidden !important;
  }
  
  .kanban-column {
    width: 100% !important;
    min-width: 0 !important;
    flex: none !important;
  }
  
  /* View controls must wrap */
  .view-controls {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.5rem !important;
    width: 100% !important;
  }
  
  .view-switcher {
    width: 100% !important;
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
  }
  
  .filter-group {
    width: 100% !important;
    flex-direction: column !important;
    gap: 0.5rem !important;
  }
  
  .filter-group > * {
    width: 100% !important;
  }
  
  /* Projects grid */
  .projects-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.75rem !important;
  }
  
  /* Agents grid */
  .agents-full-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.75rem !important;
  }
  
  /* Calendar panels */
  .calendar-events-panel {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.75rem !important;
  }
  
  .calendar-panel {
    width: 100% !important;
  }
  
  /* Approvals */
  .approvals-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.75rem !important;
  }
  
  /* Workflow stages - horizontal scroll allowed here */
  .workflow-stages {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    display: flex !important;
    gap: 0.5rem !important;
    padding-bottom: 0.5rem !important;
  }
  
  .workflow-stage {
    flex: 0 0 auto !important;
    min-width: 120px !important;
  }
  
  /* Ensure main content doesn't overflow */
  .main-content,
  .view-container,
  .view {
    overflow-x: hidden !important;
    max-width: 100vw !important;
  }
}

/* Extra small - even more aggressive */
@media (max-width: 480px) {
  .agents-mini-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  
  .agent-mini-card {
    padding: 0.5rem !important;
  }
  
  .agent-mini-emoji {
    font-size: 1.25rem !important;
  }
  
  .agent-mini-name {
    font-size: 0.6875rem !important;
  }
  
  .card {
    padding: 0.75rem !important;
  }
  
  .card-title {
    font-size: 0.875rem !important;
  }
}

/* Fix white-space nowrap causing potential overflow */
@media (max-width: 768px) {
  .breakdown-chip,
  .nav-item,
  .btn,
  .tag,
  .badge,
  .stat-pill,
  .activity-text,
  .task-title,
  .agent-name {
    white-space: normal !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
  }
  
  /* Ensure text wraps in cards */
  .card h3,
  .card h4,
  .card p,
  .card span {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
  }
  
  /* No horizontal scroll on view */
  .view {
    overflow-x: hidden !important;
  }
  
  /* Tables should scroll horizontally if needed */
  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    max-width: 100%;
  }
}

/* ========================================
   FINAL MOBILE OVERRIDES - Specific fixes
   ======================================== */

@media (max-width: 768px) {
  /* Override kanban column min-width from 320px and 300px rules */
  .kanban-column {
    min-width: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    flex-shrink: 1 !important;
  }
  
  /* Calendar grid - make it scrollable horizontally */
  .calendar-grid {
    display: flex !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    gap: 0.25rem !important;
  }
  
  .calendar-day {
    flex: 0 0 auto !important;
    width: 38px !important;
  }
  
  /* Or hide calendar grid and show list on mobile */
  .calendar-week-view {
    overflow-x: auto !important;
    max-width: 100% !important;
  }
}

@media (max-width: 480px) {
  /* Even smaller - calendar days smaller */
  .calendar-day {
    width: 32px !important;
    font-size: 0.625rem !important;
  }
  
  .calendar-grid {
    gap: 0.125rem !important;
  }
}

/* ========================================
   FIX: Idea Card Buttons - Don't stack
   ======================================== */

@media (max-width: 768px) {
  /* Idea card button row - horizontal wrap, not vertical stack */
  .idea-card > div:last-child,
  .idea-card [style*="border-top"][style*="display:flex"] {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 0.5rem !important;
  }
  
  /* Individual buttons - consistent sizing */
  .idea-card button,
  .idea-card a[style*="border-radius"] {
    flex: 0 1 auto !important;
    min-width: auto !important;
    width: auto !important;
    padding: 0.5rem 0.75rem !important;
    font-size: 0.75rem !important;
  }
  
  /* If 3+ buttons, make them fit in 2 rows */
  .idea-card .btn-success-inline,
  .idea-card .btn-ghost-inline {
    flex: 0 1 calc(50% - 0.25rem) !important;
  }
}

/* Override the previous overly aggressive mobile rules for idea cards */
@media (max-width: 600px) {
  .idea-card [style*="display:flex"][style*="border-top"] {
    flex-direction: row !important;
    justify-content: flex-start !important;
  }
  
  .idea-card button,
  .idea-card a {
    width: auto !important;
    flex: 0 1 auto !important;
  }
}

/* Button inline styles */
.btn-success-inline {
  padding: 0.5rem 0.75rem;
  border: none;
  border-radius: 0.375rem;
  background: var(--success);
  color: white;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 500;
}

.btn-ghost-inline {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 0.375rem;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 500;
}

.btn-ghost-inline:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

/* ========================================
   COMPREHENSIVE BUTTON FIX - ALL VIEWS
   Buttons should be in ROWS, not stacked
   ======================================== */

/* Base button action container styles */
.approval-actions,
.artifact-actions,
.artifact-feedback-buttons,
.idea-actions,
.form-actions,
.modal-actions,
.card-actions,
.btn-group,
[class*="-actions"] {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Mobile: Keep buttons in rows, just smaller */
@media (max-width: 768px) {
  .approval-actions,
  .artifact-actions,
  .artifact-feedback-buttons,
  .idea-actions,
  .form-actions,
  .modal-actions,
  .card-actions,
  .btn-group,
  [class*="-actions"] {
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 0.5rem !important;
  }
  
  /* Buttons - natural width, don't stretch */
  .approval-actions .btn,
  .artifact-actions .btn,
  .artifact-feedback-buttons button,
  .idea-actions .btn,
  .form-actions .btn,
  .modal-actions .btn,
  .card-actions .btn,
  [class*="-actions"] .btn,
  [class*="-actions"] button,
  [class*="-actions"] a {
    flex: 0 1 auto !important;
    width: auto !important;
    min-width: fit-content !important;
    padding: 0.5rem 0.75rem !important;
    font-size: 0.75rem !important;
  }
  
  /* If only 2 buttons, each takes ~half */
  .approval-actions:has(.btn:nth-child(2):last-child) .btn,
  .form-actions:has(.btn:nth-child(2):last-child) .btn {
    flex: 1 1 calc(50% - 0.25rem) !important;
    min-width: 0 !important;
  }
}

/* Small mobile - even more compact */
@media (max-width: 480px) {
  .approval-actions .btn,
  .artifact-actions .btn,
  .idea-actions .btn,
  .form-actions .btn,
  [class*="-actions"] .btn,
  [class*="-actions"] button {
    padding: 0.5rem 0.625rem !important;
    font-size: 0.6875rem !important;
  }
}

/* Specific fix for idea card buttons */
.idea-card [style*="display:flex"][style*="border-top"] {
  flex-direction: row !important;
  flex-wrap: wrap !important;
}

.idea-card [style*="display:flex"][style*="border-top"] button,
.idea-card [style*="display:flex"][style*="border-top"] a {
  flex: 0 1 auto !important;
  width: auto !important;
}

/* Approval card specific */
.approval-card .approval-actions {
  margin-top: 0.75rem;
}

/* Artifact feedback buttons */
.artifact-feedback-buttons {
  flex-direction: row !important;
}

.artifact-feedback-buttons button {
  flex: 0 1 auto !important;
}

/* ========================================
   IDEAS SIDEBAR - COMPREHENSIVE MOBILE FIX
   ======================================== */

@media (max-width: 768px) {
  #view-ideas {
    overflow-x: hidden !important;
  }
  
  #view-ideas .ideas-container {
    overflow-x: hidden !important;
    max-width: 100% !important;
  }
  
  #view-ideas .ideas-sidebar {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }
  
  /* Category buttons in 2-column grid */
  #view-ideas .ideas-category-list {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.375rem !important;
  }
  
  #view-ideas .ideas-category-list button {
    font-size: 0.6875rem !important;
    padding: 0.5rem 0.375rem !important;
    white-space: normal !important;
    text-align: center !important;
    justify-content: center !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  
  /* Filter selects side by side */
  #view-ideas .sidebar-section {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.5rem !important;
  }
  
  #view-ideas .filter-select {
    flex: 1 1 calc(50% - 0.25rem) !important;
    min-width: 0 !important;
    font-size: 0.75rem !important;
  }
  
  /* Quick stats compact */
  #view-ideas .ideas-stats {
    font-size: 0.75rem !important;
  }
}

@media (max-width: 480px) {
  /* Single column for very small screens */
  #view-ideas .ideas-category-list {
    grid-template-columns: repeat(3, 1fr) !important;
  }
  
  #view-ideas .ideas-category-list button {
    font-size: 0.625rem !important;
    padding: 0.375rem !important;
  }
  
  #view-ideas .filter-select {
    flex: 1 1 100% !important;
  }
}
