/* ========================================
   TableFlow - Styles
   ======================================== */

/* CSS Variables - Base (shared across themes) */
:root {
  /* Spacing */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  
  /* Typography */
  --font-family: 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', monospace;
  --font-size-xs: 11px;
  --font-size-sm: 13px;
  --font-size-md: 15px;
  --font-size-lg: 17px;
  --font-size-xl: 21px;
  
  /* Borders */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;

  /* Status Colors (consistent across themes) */
  --status-not-started: #6b7280;
  --status-started: #16a34a;
  --status-paused: #eab308;
  --status-blocked: #dc2626;
  --status-wfr: #f97316;
  --status-completed: #2563eb;
  
  /* Age Colors */
  --age-fresh: #16a34a;
  --age-warning: #ca8a04;
  --age-stale: #dc2626;
}

/* ========================================
   Theme: Clean (Default) - Neutral white/gray
   ======================================== */
:root, :root.theme-clean {
  --bg-primary: #ffffff;
  --bg-secondary: #fafafa;
  --bg-tertiary: #f5f5f5;
  --bg-hover: #eeeeee;
  --bg-project: #ffffff;
  --bg-section: #fafafa;
  --bg-expanded-group: #f8fafc;
  
  /* Essential columns (focus, description, notes) - clean white */
  --bg-essential: #ffffff;
  --bg-essential-hover: #fafafa;
  /* Supporting columns (status, age, priority, etc.) - subtle tint */
  --bg-supporting: #f8f9fa;
  --bg-supporting-hover: #f1f3f4;
  /* Selected row - clearly visible */
  --bg-selected-essential: #e0f2fe;
  --bg-selected-supporting: #dbeafe;
  /* Divider between essential and supporting */
  --border-divider: #d4d4d4;
  
  --text-primary: #1a1a1a;
  --text-secondary: #525252;
  --text-muted: #737373;
  --text-on-accent: #ffffff;
  
  --border-color: #e5e5e5;
  --border-light: #f0f0f0;
  --border-color-dark: #d4d4d4;
  --border-row: #e0e0e0;
  
  --accent-blue: #2563eb;
  --accent-blue-light: rgba(37, 99, 235, 0.1);
  --accent-green: #16a34a;
  --accent-yellow: #ca8a04;
  --accent-orange: #ea580c;
  --accent-red: #dc2626;
  --accent-purple: #7c3aed;
  
  --theme-tint: #f5f5f5;
  --theme-accent: #2563eb;
  
  --landing-gradient: linear-gradient(135deg, #ffffff 0%, #f5f5f5 100%);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
}

/* ========================================
   Theme: Ocean - Blue tints
   ======================================== */
:root.theme-ocean {
  --bg-primary: #ffffff;
  --bg-secondary: #f0f9ff;
  --bg-tertiary: #e0f2fe;
  --bg-hover: #bae6fd;
  --bg-project: #ffffff;
  --bg-section: #f0f9ff;
  --bg-expanded-group: #f0f9ff;
  
  --bg-essential: #ffffff;
  --bg-essential-hover: #f0f9ff;
  --bg-supporting: #f0f9ff;
  --bg-supporting-hover: #e0f2fe;
  --bg-selected-essential: #bae6fd;
  --bg-selected-supporting: #7dd3fc;
  --border-divider: #7dd3fc;
  
  --text-primary: #0c4a6e;
  --text-secondary: #0369a1;
  --text-muted: #0284c7;
  --text-on-accent: #ffffff;
  
  --border-color: #bae6fd;
  --border-light: #e0f2fe;
  --border-color-dark: #7dd3fc;
  --border-row: #bae6fd;
  
  --accent-blue: #0284c7;
  --accent-blue-light: rgba(2, 132, 199, 0.15);
  --accent-green: #059669;
  --accent-yellow: #ca8a04;
  --accent-orange: #ea580c;
  --accent-red: #dc2626;
  --accent-purple: #7c3aed;
  
  --theme-tint: #e0f2fe;
  --theme-accent: #0284c7;
  
  --landing-gradient: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  --shadow-sm: 0 1px 2px rgba(14, 116, 144, 0.08);
  --shadow-md: 0 4px 6px rgba(14, 116, 144, 0.1);
}

/* ========================================
   Theme: Forest - Green tints
   ======================================== */
:root.theme-forest {
  --bg-primary: #ffffff;
  --bg-secondary: #f0fdf4;
  --bg-tertiary: #dcfce7;
  --bg-hover: #bbf7d0;
  --bg-project: #ffffff;
  --bg-section: #f0fdf4;
  --bg-expanded-group: #f0fdf4;
  
  --bg-essential: #ffffff;
  --bg-essential-hover: #f0fdf4;
  --bg-supporting: #f0fdf4;
  --bg-supporting-hover: #dcfce7;
  --bg-selected-essential: #bbf7d0;
  --bg-selected-supporting: #86efac;
  --border-divider: #86efac;
  
  --text-primary: #14532d;
  --text-secondary: #166534;
  --text-muted: #15803d;
  --text-on-accent: #ffffff;
  
  --border-color: #bbf7d0;
  --border-light: #dcfce7;
  --border-color-dark: #86efac;
  --border-row: #bbf7d0;
  
  --accent-blue: #059669;
  --accent-blue-light: rgba(5, 150, 105, 0.15);
  --accent-green: #16a34a;
  --accent-yellow: #ca8a04;
  --accent-orange: #ea580c;
  --accent-red: #dc2626;
  --accent-purple: #7c3aed;
  
  --theme-tint: #dcfce7;
  --theme-accent: #16a34a;
  
  --landing-gradient: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  --shadow-sm: 0 1px 2px rgba(22, 101, 52, 0.08);
  --shadow-md: 0 4px 6px rgba(22, 101, 52, 0.1);
}

/* ========================================
   Theme: Sunset - Warm peach/orange tints
   ======================================== */
:root.theme-sunset {
  --bg-primary: #ffffff;
  --bg-secondary: #fff7ed;
  --bg-tertiary: #ffedd5;
  --bg-hover: #fed7aa;
  --bg-project: #ffffff;
  --bg-section: #fff7ed;
  --bg-expanded-group: #fff7ed;
  
  --bg-essential: #ffffff;
  --bg-essential-hover: #fff7ed;
  --bg-supporting: #fff7ed;
  --bg-supporting-hover: #ffedd5;
  --bg-selected-essential: #fed7aa;
  --bg-selected-supporting: #fdba74;
  --border-divider: #fdba74;
  
  --text-primary: #7c2d12;
  --text-secondary: #9a3412;
  --text-muted: #c2410c;
  --text-on-accent: #ffffff;
  
  --border-color: #fed7aa;
  --border-light: #ffedd5;
  --border-color-dark: #fdba74;
  --border-row: #fed7aa;
  
  --accent-blue: #ea580c;
  --accent-blue-light: rgba(234, 88, 12, 0.15);
  --accent-green: #16a34a;
  --accent-yellow: #ca8a04;
  --accent-orange: #ea580c;
  --accent-red: #dc2626;
  --accent-purple: #7c3aed;
  
  --theme-tint: #ffedd5;
  --theme-accent: #ea580c;
  
  --landing-gradient: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  --shadow-sm: 0 1px 2px rgba(154, 52, 18, 0.08);
  --shadow-md: 0 4px 6px rgba(154, 52, 18, 0.1);
}

/* ========================================
   Theme: Lavender - Purple tints
   ======================================== */
:root.theme-lavender {
  --bg-primary: #ffffff;
  --bg-secondary: #faf5ff;
  --bg-tertiary: #f3e8ff;
  --bg-hover: #e9d5ff;
  --bg-project: #ffffff;
  --bg-section: #faf5ff;
  --bg-expanded-group: #faf5ff;
  
  --bg-essential: #ffffff;
  --bg-essential-hover: #faf5ff;
  --bg-supporting: #faf5ff;
  --bg-supporting-hover: #f3e8ff;
  --bg-selected-essential: #e9d5ff;
  --bg-selected-supporting: #d8b4fe;
  --border-divider: #d8b4fe;
  
  --text-primary: #581c87;
  --text-secondary: #6b21a8;
  --text-muted: #7e22ce;
  --text-on-accent: #ffffff;
  
  --border-color: #e9d5ff;
  --border-light: #f3e8ff;
  --border-color-dark: #d8b4fe;
  --border-row: #e9d5ff;
  
  --accent-blue: #7c3aed;
  --accent-blue-light: rgba(124, 58, 237, 0.15);
  --accent-green: #16a34a;
  --accent-yellow: #ca8a04;
  --accent-orange: #ea580c;
  --accent-red: #dc2626;
  --accent-purple: #7c3aed;
  
  --theme-tint: #f3e8ff;
  --theme-accent: #7c3aed;
  
  --landing-gradient: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
  --shadow-sm: 0 1px 2px rgba(107, 33, 168, 0.08);
  --shadow-md: 0 4px 6px rgba(107, 33, 168, 0.1);
}

/* ========================================
   Reset & Base
   ======================================== */

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

html, body {
  height: 100%;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-md);
  color: var(--text-primary);
  background: var(--bg-primary);
  line-height: 1.5;
}

/* ========================================
   Landing Page
   ======================================== */

.landing-page {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background: var(--landing-gradient);
  padding-top: var(--spacing-xl);
  overflow-y: auto;
}

/* Theme Selector */
.theme-selector-wrapper {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.theme-label {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

.theme-selector {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: var(--spacing-xs) var(--spacing-sm);
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  cursor: pointer;
  min-width: 100px;
}

.theme-selector:hover {
  border-color: var(--theme-accent);
}

.theme-selector:focus {
  outline: none;
  border-color: var(--theme-accent);
  box-shadow: 0 0 0 2px var(--accent-blue-light);
}

.landing-container {
  max-width: 800px;
  padding: var(--spacing-xl);
  padding-bottom: calc(var(--spacing-xl) * 2);
  text-align: center;
}

.landing-top-bar {
  position: absolute;
  top: var(--spacing-lg);
  right: var(--spacing-lg);
}

.landing-header {
  margin-bottom: var(--spacing-xl);
}

.logo {
  font-size: 48px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--spacing-sm);
}

/* Light theme adjustments for logo */
:root.light-theme .logo {
  background: linear-gradient(135deg, #0550ae, #6639ba);
  -webkit-background-clip: text;
  background-clip: text;
}

.tagline {
  color: var(--text-secondary);
  font-size: var(--font-size-lg);
}

.create-team-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--spacing-xl);
  margin-bottom: var(--spacing-xl);
  box-shadow: var(--shadow-md);
}

.create-team-card h2 {
  margin-bottom: var(--spacing-sm);
}

.card-description {
  color: var(--text-secondary);
  margin-bottom: var(--spacing-lg);
}

.create-team-form {
  display: flex !important;
  flex-direction: row !important;
  gap: var(--spacing-md);
  justify-content: center;
  align-items: flex-end;
}

.create-team-form .form-group {
  width: 300px;
  flex-shrink: 0;
  text-align: left;
}

.create-team-form > .btn {
  height: 42px;
  flex-shrink: 0;
  margin-top: 0 !important;
}

.create-team-form label {
  display: block;
  margin-bottom: var(--spacing-xs);
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
}

.create-team-form input {
  width: 100%;
  height: 42px;
  padding: 0 var(--spacing-md);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--font-size-md);
  box-sizing: border-box;
}

.create-team-form input:focus {
  outline: none;
  border-color: var(--accent-blue);
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--spacing-lg);
  text-align: left;
}

.feature {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--spacing-lg);
}

.feature-icon {
  font-size: 24px;
  display: block;
  margin-bottom: var(--spacing-sm);
}

.feature h3 {
  font-size: var(--font-size-md);
  margin-bottom: var(--spacing-xs);
}

.feature p {
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
}

.landing-footer {
  margin-top: var(--spacing-xl);
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}

.result {
  margin-top: var(--spacing-md);
  padding: var(--spacing-md);
  background: rgba(63, 185, 80, 0.1);
  border: 1px solid var(--accent-green);
  border-radius: var(--radius-md);
}

.success-message {
  color: var(--accent-green);
}

.error {
  margin-top: var(--spacing-md);
  padding: var(--spacing-md);
  background: rgba(248, 81, 73, 0.1);
  border: 1px solid var(--accent-red);
  border-radius: var(--radius-md);
  color: var(--accent-red);
}

.hidden {
  display: none !important;
}

/* ========================================
   Buttons
   ======================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-sm) var(--spacing-md);
  font-size: var(--font-size-md);
  font-weight: 500;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s ease;
}

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

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: white;
}

.btn-primary:hover {
  background: #4c9aed;
}

.btn-danger {
  background: var(--accent-red);
  border-color: var(--accent-red);
  color: white;
}

.btn-danger:hover {
  background: #e64940;
}

.btn-icon {
  padding: var(--spacing-sm);
  background: transparent;
  border: none;
}

.btn-small {
  padding: var(--spacing-xs) var(--spacing-sm);
  font-size: var(--font-size-sm);
}

.btn-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

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

/* ========================================
   App Layout
   ======================================== */

.app-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-md) var(--spacing-lg);
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.header-left {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.team-name {
  font-size: var(--font-size-xl);
  font-weight: 600;
}

.team-stats {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  display: flex;
  gap: var(--spacing-sm);
}

.team-stats .stats-open {
  color: var(--accent-blue);
  font-weight: 500;
}

.team-stats .stats-completed {
  color: var(--text-muted);
}

.sync-status {
  font-size: 10px;
  color: var(--accent-green);
}

.sync-status.syncing {
  color: var(--accent-yellow);
  animation: pulse 1s infinite;
}

.sync-status.error {
  color: var(--accent-red);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.header-right {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

/* ========================================
   Views Bar (Saved Filters)
   ======================================== */

.views-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-md);
  padding: var(--spacing-xs) var(--spacing-lg);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}

.views-container {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  flex-wrap: wrap;
  overflow-x: auto;
}

.view-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  transition: all 0.15s ease;
  white-space: nowrap;
}

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

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

.view-btn.active.dirty::after {
  content: '*';
  margin-left: 2px;
  font-weight: bold;
}

.view-btn .view-icon {
  font-size: 12px;
}

.view-btn.reset-view {
  background: transparent;
  border-color: transparent;
  color: var(--text-muted);
}

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

.view-btn.new-view-btn {
  background: transparent;
  border: 1px dashed var(--border-color);
  color: var(--text-muted);
}

.view-btn.new-view-btn:hover {
  background: var(--bg-hover);
  border-style: solid;
  color: var(--accent-blue);
}

/* View action buttons (edit, update, delete) - shown on hover */
.view-btn .view-actions {
  display: none;
  margin-left: 4px;
  gap: 2px;
}

.view-btn:hover .view-actions,
.view-btn.active .view-actions {
  display: inline-flex;
}

.view-action-btn {
  background: none;
  border: none;
  padding: 2px;
  cursor: pointer;
  font-size: 10px;
  opacity: 0.7;
  border-radius: 2px;
  line-height: 1;
}

.view-action-btn:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.1);
}

.view-btn.active .view-action-btn {
  color: white;
}

.view-btn.active .view-action-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* View Preview in Modal */
.view-preview {
  margin-top: var(--spacing-md);
  padding: var(--spacing-sm);
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
}

.view-preview h4 {
  margin: 0 0 var(--spacing-xs) 0;
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

.view-preview-content {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

.view-preview-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  margin-bottom: 4px;
}

.view-preview-item .label {
  color: var(--text-muted);
  min-width: 60px;
}

/* ========================================
   Filters Bar
   ======================================== */

.filters-bar {
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
  padding: var(--spacing-sm) var(--spacing-lg);
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
  overflow-x: auto;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  white-space: nowrap;
}

.filter-group label {
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
}

.filter-buttons {
  display: flex;
  gap: 2px;
}

.filter-btn {
  padding: var(--spacing-xs) var(--spacing-sm);
  font-size: var(--font-size-sm);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-btn:first-child {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.filter-btn:last-child {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

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

.filter-btn.active {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: white;
}

/* Include state - same as active */
.filter-btn.include {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: white;
}

/* Exclude (NOT) state - red with strikethrough */
.filter-btn.exclude {
  background: var(--status-blocked);
  border-color: var(--status-blocked);
  color: white;
  text-decoration: line-through;
}

.filter-btn.exclude::before {
  content: '¬';
  margin-right: 2px;
  font-weight: bold;
}

/* Status sort toggle button */
.status-sort-toggle {
  background: none;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 2px 6px;
  margin-left: 6px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-muted);
  vertical-align: middle;
  transition: all 0.15s ease;
}

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

.status-sort-toggle.active {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: white;
}

.filter-select {
  padding: var(--spacing-xs) var(--spacing-sm);
  font-size: var(--font-size-sm);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
}

.invert-checkbox {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  cursor: pointer;
}

.search-group {
  flex: 1;
  min-width: 150px;
  max-width: 300px;
}

.search-input {
  width: 100%;
  padding: var(--spacing-xs) var(--spacing-sm);
  font-size: var(--font-size-sm);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
}

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

/* Column Toggle Button */
.column-toggle {
  padding: var(--spacing-xs) var(--spacing-sm);
  font-size: var(--font-size-sm);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

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

.column-toggle.active {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: white;
}

/* Show/hide toggle text based on state */
.column-toggle .toggle-full {
  display: none;
}

.column-toggle.active .toggle-compact {
  display: none;
}

.column-toggle.active .toggle-full {
  display: inline;
}

/* Hidden columns in compact mode */
.compact-mode .col-blocked,
.compact-mode .cell-blocked,
.compact-mode .col-created,
.compact-mode .cell-created,
.compact-mode .col-modified,
.compact-mode .cell-modified {
  display: none;
}

/* Timestamp display */
.timestamp {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  white-space: nowrap;
}

.cell-created,
.cell-modified {
  text-align: center;
}

/* ========================================
   Main Content
   ======================================== */

.app-main {
  flex: 1;
  overflow-y: auto;
  padding: var(--spacing-lg);
}

.loading {
  text-align: center;
  padding: var(--spacing-xl);
  color: var(--text-secondary);
}

.empty-state {
  text-align: center;
  padding: var(--spacing-xl);
  color: var(--text-secondary);
}

.projects-container {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
}

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

.project-section {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.project-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-md) var(--spacing-lg);
  background: var(--bg-section);
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease;
}

.project-header:hover {
  background: var(--bg-hover);
}

.project-header-left {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.collapse-icon {
  color: var(--text-secondary);
  transition: transform 0.2s ease;
}

.project-section.collapsed .collapse-icon {
  transform: rotate(-90deg);
}

.project-name {
  font-size: var(--font-size-lg);
  font-weight: 600;
}

.project-name-input {
  font-size: var(--font-size-lg);
  font-weight: 600;
  background: var(--bg-secondary);
  border: 1px solid var(--accent-blue);
  border-radius: var(--radius-sm);
  padding: var(--spacing-xs) var(--spacing-sm);
  color: var(--text-primary);
}

.project-count {
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}

.project-stats,
.section-stats {
  display: inline-flex;
  gap: var(--spacing-sm);
  margin-left: var(--spacing-sm);
  font-size: var(--font-size-sm);
  font-weight: 400;
}

/* Filtered state indicator */
.project-stats.filtered,
.section-stats.filtered,
.team-stats.filtered {
  font-style: italic;
}

.project-stats.filtered::after,
.section-stats.filtered::after {
  content: '✱';
  font-size: 10px;
  color: var(--accent-blue);
  margin-left: 2px;
}

/* Merged view toggle button */
.merged-toggle {
  margin-left: var(--spacing-xs);
  font-size: 14px;
  opacity: 0.5;
  transition: opacity 0.15s ease;
}

.merged-toggle:hover {
  opacity: 1;
}

.merged-toggle.active {
  opacity: 1;
  color: var(--accent-blue);
}

/* Section label in merged view */
.cell-section {
  min-width: 70px;
  max-width: 100px;
}

.section-label {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Empty merged view message */
.empty-merged-view {
  padding: var(--spacing-lg);
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
}

/* Merged view project styling */
.project-section.merged-view .project-content {
  padding: var(--spacing-sm);
}

.stats-open {
  color: var(--accent-blue);
  background: var(--accent-blue-light);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
}

.stats-completed {
  color: var(--text-muted);
}

.project-header-right {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

/* Default Owner Dropdown */
.default-owner-container {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color-light);
  margin-right: var(--spacing-sm);
}

.default-owner-label {
  font-size: 12px;
  opacity: 0.7;
}

.default-owner-select {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 12px;
  padding: 2px 4px;
  cursor: pointer;
  max-width: 100px;
}

.default-owner-select:focus {
  outline: none;
}

.project-content {
  padding: var(--spacing-md);
  background: var(--bg-primary);
}

.project-section.collapsed .project-content {
  display: none;
}

/* ========================================
   Sections within Project
   ======================================== */

.section-container {
  margin-bottom: var(--spacing-md);
}

.section-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--bg-section);
  border-radius: var(--radius-sm);
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease;
}

.section-header:hover {
  background: var(--bg-hover);
}

.section-title {
  font-weight: 500;
}

.section-stats {
  flex: 1;
}

.section-title-input {
  flex: 1;
  font-weight: 500;
  background: var(--bg-secondary);
  border: 1px solid var(--accent-blue);
  border-radius: var(--radius-sm);
  padding: var(--spacing-xs) var(--spacing-sm);
  color: var(--text-primary);
}

.section-container.collapsed .tasks-table {
  display: none;
}

.section-actions {
  display: flex;
  gap: var(--spacing-xs);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.section-header:hover .section-actions {
  opacity: 1;
}

/* ========================================
   Tasks Table
   ======================================== */

.tasks-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: var(--spacing-sm);
}

.tasks-table th {
  text-align: left;
  padding: var(--spacing-sm) var(--spacing-md);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}

/* Essential column headers (focus, description, notes) */
.tasks-table th.col-focus,
.tasks-table th.col-description,
.tasks-table th.col-notes {
  background: var(--bg-essential);
}

/* Supporting column headers */
.tasks-table th.col-progress,
.tasks-table th.col-status,
.tasks-table th.col-age,
.tasks-table th.col-priority,
.tasks-table th.col-owner,
.tasks-table th.col-due,
.tasks-table th.col-blocked,
.tasks-table th.col-created,
.tasks-table th.col-modified,
.tasks-table th.col-actions {
  background: var(--bg-supporting);
}

.tasks-table td {
  padding: var(--spacing-sm) var(--spacing-md);
  vertical-align: top;
  border: none;
}

/* Essential columns - clean background */
.tasks-table td.cell-focus,
.tasks-table td.cell-description,
.tasks-table td.cell-notes {
  background: var(--bg-essential);
}

/* Supporting columns - subtle tinted background */
.tasks-table td.cell-progress,
.tasks-table td.cell-status,
.tasks-table td.cell-age,
.tasks-table td.cell-priority,
.tasks-table td.cell-owner,
.tasks-table td.cell-due,
.tasks-table td.cell-blocked,
.tasks-table td.cell-created,
.tasks-table td.cell-modified,
.tasks-table td.cell-actions {
  background: var(--bg-supporting);
}

/* Subtle row separator - just a thin line on hover transition */
.tasks-table tbody tr {
  border-bottom: 1px solid transparent;
  transition: border-color 0.1s ease;
}

.tasks-table tbody tr:not(:last-child) {
  border-bottom-color: var(--border-light);
}

/* Row hover and focus - different for each zone */
.tasks-table tr:hover td.cell-focus,
.tasks-table tr:hover td.cell-description,
.tasks-table tr:hover td.cell-notes,
.tasks-table tr:focus td.cell-focus,
.tasks-table tr:focus td.cell-description,
.tasks-table tr:focus td.cell-notes {
  background: var(--bg-essential-hover);
}

.tasks-table tr:hover td.cell-progress,
.tasks-table tr:hover td.cell-status,
.tasks-table tr:hover td.cell-age,
.tasks-table tr:hover td.cell-priority,
.tasks-table tr:hover td.cell-owner,
.tasks-table tr:hover td.cell-due,
.tasks-table tr:hover td.cell-blocked,
.tasks-table tr:hover td.cell-created,
.tasks-table tr:hover td.cell-modified,
.tasks-table tr:hover td.cell-actions,
.tasks-table tr:focus td.cell-progress,
.tasks-table tr:focus td.cell-status,
.tasks-table tr:focus td.cell-age,
.tasks-table tr:focus td.cell-priority,
.tasks-table tr:focus td.cell-owner,
.tasks-table tr:focus td.cell-due,
.tasks-table tr:focus td.cell-blocked,
.tasks-table tr:focus td.cell-created,
.tasks-table tr:focus td.cell-modified,
.tasks-table tr:focus td.cell-actions {
  background: var(--bg-supporting-hover);
}

/* Focus outline for keyboard navigation */
.tasks-table tr:focus {
  outline: none;
}

.tasks-table tr[tabindex] {
  cursor: pointer;
}

/* Selected row - very visible */
.tasks-table tr.selected td.cell-focus,
.tasks-table tr.selected td.cell-description,
.tasks-table tr.selected td.cell-notes {
  background: var(--bg-selected-essential) !important;
}

.tasks-table tr.selected td.cell-section,
.tasks-table tr.selected td.cell-progress,
.tasks-table tr.selected td.cell-status,
.tasks-table tr.selected td.cell-age,
.tasks-table tr.selected td.cell-priority,
.tasks-table tr.selected td.cell-owner,
.tasks-table tr.selected td.cell-due,
.tasks-table tr.selected td.cell-blocked,
.tasks-table tr.selected td.cell-created,
.tasks-table tr.selected td.cell-modified,
.tasks-table tr.selected td.cell-actions {
  background: var(--bg-selected-supporting) !important;
}

/* Selected row accent indicator */
.tasks-table tr.selected {
  position: relative;
}

.tasks-table tr.selected td:first-child {
  box-shadow: inset 3px 0 0 var(--theme-accent);
}

/* Expanded task with subtasks - subtle visual grouping */
.tasks-table tr.task-expanded {
  border-bottom-color: transparent;
}

/* Subtask rows - slightly different shade and indented */
.tasks-table tr.subtask-row td.cell-focus,
.tasks-table tr.subtask-row td.cell-description,
.tasks-table tr.subtask-row td.cell-notes {
  background: var(--bg-essential-hover);
}

/* Indent subtask rows with visual hierarchy indicator */
.tasks-table tr.subtask-row td.cell-focus {
  position: relative;
  padding-left: 28px;
}

.tasks-table tr.subtask-row td.cell-focus::before {
  content: '↳';
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 11px;
  opacity: 0.5;
}

.tasks-table tr.subtask-row td.cell-progress,
.tasks-table tr.subtask-row td.cell-status,
.tasks-table tr.subtask-row td.cell-age,
.tasks-table tr.subtask-row td.cell-priority,
.tasks-table tr.subtask-row td.cell-owner,
.tasks-table tr.subtask-row td.cell-due,
.tasks-table tr.subtask-row td.cell-blocked,
.tasks-table tr.subtask-row td.cell-created,
.tasks-table tr.subtask-row td.cell-modified,
.tasks-table tr.subtask-row td.cell-actions {
  background: var(--bg-supporting-hover);
}

/* Last subtask - restore normal separator */
.tasks-table tr.subtask-row.last-subtask {
  border-bottom-color: var(--border-color);
}

/* Column widths - optimized for readability */
.col-focus { width: 65px; max-width: 65px; min-width: 65px; text-align: center; }
.col-description { width: 40%; }
.col-notes { width: 20%; }
.col-status { width: 120px; min-width: 120px; }
.col-age { width: 70px; max-width: 70px; text-align: center; }
.col-due { width: 90px; min-width: 90px; text-align: center; }
.col-priority { width: 70px; min-width: 70px; text-align: center; }

/* Tighter padding for compact columns */
.tasks-table td.cell-age,
.tasks-table td.cell-due,
.tasks-table td.cell-priority,
.tasks-table th.col-age,
.tasks-table th.col-due,
.tasks-table th.col-priority {
  padding: var(--spacing-sm) 4px;
}
.col-owner { min-width: 140px; width: 140px; }

/* Due date display and dropdown */
.due-container {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2px;
}

.due-display {
  cursor: pointer;
  padding: 1px 3px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-blue);
}

.due-display:hover {
  background: var(--bg-hover);
}

/* Due date color classes */
.due-overdue {
  color: var(--status-blocked);
  background: rgba(220, 38, 38, 0.15);
}

.due-today {
  color: var(--status-wfr);
  background: rgba(249, 115, 22, 0.15);
}

.due-soon {
  color: #ca8a04;
}

.due-ok {
  color: var(--accent-blue);
}

/* Calendar wrapper and picker */
.due-calendar-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
}

.due-calendar-icon {
  font-size: 10px;
  opacity: 0.5;
  pointer-events: none;
  transition: opacity 0.1s;
}

.due-calendar-wrapper:hover .due-calendar-icon {
  opacity: 1;
}

.due-date-picker {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  border: none;
  background: transparent;
}

/* Style the native date picker trigger */
.due-date-picker::-webkit-calendar-picker-indicator {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  background: transparent;
}

/* Due dropdown */
.due-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1000;
  min-width: 120px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  margin-top: 4px;
}

.due-option {
  padding: 8px 12px;
  cursor: pointer;
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  transition: background 0.1s;
}

.due-option:hover {
  background: var(--bg-hover);
}

.due-option:first-child {
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.due-option:last-child {
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.due-clear {
  color: var(--text-muted);
}

.due-divider {
  height: 1px;
  background: var(--border-color);
  margin: 4px 0;
}
.col-blocked { width: 120px; max-width: 120px; }
.col-created { width: 85px; max-width: 85px; }
.col-modified { width: 85px; max-width: 85px; }
.col-actions { width: 80px; max-width: 80px; }

/* Cell alignments */
.cell-focus { 
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}

.cell-focus > * {
  display: inline-block;
  vertical-align: middle;
}

.cell-focus .status-dot {
  margin-right: 4px;
}

/* Focus header */
.col-focus {
  cursor: help;
}

.focus-header {
  display: inline-block;
  width: 18px;
  height: 18px;
  line-height: 18px;
  font-weight: 700;
  font-size: 11px;
  text-align: center;
  color: white;
  background: var(--accent-blue);
  border-radius: 3px;
  vertical-align: middle;
}

/* Focus toggle */
.focus-toggle {
  display: inline-block;
  width: 18px;
  height: 18px;
  line-height: 18px;
  font-weight: 700;
  font-size: 11px;
  text-align: center;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  vertical-align: middle;
  user-select: none;
}

.focus-toggle:hover {
  color: var(--accent-blue);
  border-color: var(--accent-blue);
  background: rgba(88, 166, 255, 0.1);
}

.focus-toggle.focused {
  color: white;
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  animation: pulse-focus 2s ease-in-out infinite;
}

@keyframes pulse-focus {
  0%, 100% {
    box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.3);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(88, 166, 255, 0.5), 0 0 8px 2px rgba(88, 166, 255, 0.3);
  }
}
.cell-age { 
  text-align: center;
  position: relative;
  font-size: 11px;
}

.cell-due {
  text-align: center;
  font-size: 13px;
}

/* Reminder column */
.col-reminder { 
  width: 70px; 
  max-width: 70px; 
  text-align: center; 
}

.cell-reminder {
  text-align: center;
  font-size: 12px;
  padding: var(--spacing-sm) 4px;
}

.reminder-container {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  position: relative;
}

.reminder-placeholder {
  font-size: 12px;
  color: var(--text-muted);
  opacity: 0.4;
}

.reminder-container:hover .reminder-placeholder {
  opacity: 0.7;
}

.reminder-age {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: var(--radius-sm);
  transition: background-color 0.2s ease;
}

.reminder-age:hover {
  background: var(--bg-hover);
}

.reminder-age.reminder-overdue {
  color: var(--status-blocked);
  font-weight: 600;
  animation: glow-text 1.5s ease-in-out infinite;
}

@keyframes glow-text {
  0%, 100% { 
    text-shadow: 0 0 4px rgba(255, 100, 100, 0.5);
  }
  50% { 
    text-shadow: 0 0 8px rgba(255, 100, 100, 0.8), 0 0 12px rgba(255, 100, 100, 0.4);
  }
}

.reminder-ack-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  font-size: 10px;
  color: var(--status-started);
  background: transparent;
  border: 1px solid var(--status-started);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: 2px;
}

.reminder-ack-btn:hover {
  background: var(--status-started);
  color: white;
  transform: scale(1.1);
}

.reminder-select {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  cursor: pointer;
}

/* Add reminder column to supporting background */
.tasks-table th.col-reminder,
.tasks-table td.cell-reminder {
  background: var(--bg-supporting);
}

.tasks-table tr:hover td.cell-reminder,
.tasks-table tr:focus td.cell-reminder {
  background: var(--bg-supporting-hover);
}

.tasks-table tr.selected td.cell-reminder {
  background: var(--bg-selected-supporting) !important;
}

.tasks-table tr.subtask-row td.cell-reminder {
  background: var(--bg-supporting-hover);
}

/* Row glow effect for unacknowledged reminders */
.tasks-table tr.reminder-attention {
  box-shadow: inset 0 0 0 1px var(--accent-orange), 0 0 8px rgba(255, 165, 0, 0.3);
}

.age-display {
  cursor: help;
  border-bottom: 1px dotted var(--text-muted);
}

/* Custom age tooltip */
.age-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  min-width: 160px;
  padding: 10px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.1s ease, visibility 0.1s ease;
  pointer-events: none;
  margin-bottom: 6px;
}

.age-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--border-color);
}

.age-tooltip::before {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--bg-secondary);
  z-index: 1;
}

.cell-age:hover .age-tooltip {
  opacity: 1;
  visibility: visible;
}

.age-tooltip-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-light);
}

.age-tooltip-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 0;
  font-size: var(--font-size-sm);
}

.age-tooltip-status {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
}

.age-tooltip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.age-tooltip-time {
  font-weight: 500;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.age-tooltip-row.current {
  background: var(--bg-hover);
  margin: 0 -8px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

.age-tooltip-row.current .age-tooltip-status {
  font-weight: 600;
  color: var(--text-primary);
}
.cell-priority { text-align: center; }

/* Status indicator dot */
.status-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px var(--bg-primary);
}

.status-dot.status-not_started { background-color: var(--status-not-started); }
.status-dot.status-started { background-color: var(--status-started); }
.status-dot.status-paused { background-color: var(--status-paused); }
.status-dot.status-blocked { background-color: var(--status-blocked); }
.status-dot.status-wfr { background-color: var(--status-wfr); }
.status-dot.status-completed { background-color: var(--status-completed); }

/* Pulsating glow for In Progress tasks */
.status-dot.status-started {
  animation: pulse-inprogress 2s ease-in-out infinite;
}

@keyframes pulse-inprogress {
  0%, 100% {
    box-shadow: 0 0 4px 1px rgba(34, 197, 94, 0.4);
  }
  50% {
    box-shadow: 0 0 8px 3px rgba(34, 197, 94, 0.7);
  }
}

/* Smaller select for priority */
.cell-select-small {
  width: 55px;
  padding: 2px 4px;
  text-align: center;
}

/* ========================================
   Table Cells
   ======================================== */

.cell-actions {
  display: flex;
  gap: 4px;
  justify-content: center;
}

.action-btn {
  padding: 4px 8px;
  font-size: 16px;
  font-weight: bold;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  line-height: 1;
}

.action-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--text-muted);
}

/* Add subtask button */
.action-btn[data-action="add-subtask"] {
  color: var(--accent-blue);
}

.action-btn[data-action="add-subtask"]:hover {
  background: rgba(88, 166, 255, 0.1);
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

/* Delete button */
.action-btn[data-action="delete-task"] {
  color: var(--text-muted);
}

.action-btn[data-action="delete-task"]:hover {
  background: rgba(248, 81, 73, 0.1);
  border-color: var(--accent-red);
  color: var(--accent-red);
}

/* Move task dropdown */
.move-dropdown-container {
  position: relative;
  display: inline-block;
}

.move-dropdown {
  position: fixed; /* Use fixed to escape overflow:hidden clipping */
  z-index: 99999;
  min-width: 120px;
  max-height: 250px;
  overflow-y: auto;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.move-option {
  padding: 8px 12px;
  cursor: pointer;
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  transition: background 0.1s;
}

.move-option:hover {
  background: var(--bg-hover);
}

.move-option.current {
  color: var(--text-muted);
  font-style: italic;
}

.move-option[data-position="top"],
.move-option[data-position="bottom"] {
  font-weight: 500;
  color: var(--accent-blue);
}

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

.cell-description {
  position: relative;
  cursor: pointer;
}

.description-text {
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 3em; /* ~2 lines */
  overflow: hidden;
  position: relative;
}

/* Priority Indicators - subtle prefix before task description */
.priority-indicator {
  font-weight: 400;
  margin-right: 4px;
  font-size: 0.85em;
  opacity: 0.9;
}

.priority-p0 {
  color: #DC2626; /* Red */
  animation: pulse-priority 2s ease-in-out infinite;
}

.priority-p1 {
  color: #EA580C; /* Orange */
}

.priority-p2 {
  color: #B45309; /* Amber - darker for visibility */
}

@keyframes pulse-priority {
  0%, 100% { opacity: 0.9; }
  50% { opacity: 0.5; }
}

.description-text.truncated,
.description-text.expanded {
  cursor: pointer;
}

.description-text.truncated {
  position: relative;
  padding-bottom: 16px;
}

.description-text.truncated::after {
  content: '⋯ more';
  position: absolute;
  bottom: 0;
  left: 0;
  font-size: 11px;
  color: var(--accent-blue);
  background: linear-gradient(to right, var(--bg-section) 0%, var(--bg-section) 100%);
  padding-right: 4px;
}

.description-text.expanded {
  max-height: none;
  position: relative;
  padding-bottom: 16px;
}

.description-text.expanded::after {
  content: '⋯ less';
  position: absolute;
  bottom: 0;
  left: 0;
  font-size: 11px;
  color: var(--accent-blue);
}

/* Subtask count badge */
.subtask-count {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 500;
  color: var(--accent-blue);
  background: rgba(88, 166, 255, 0.1);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.subtask-count:hover {
  background: rgba(88, 166, 255, 0.2);
  color: var(--accent-blue);
  margin-top: 2px;
}

/* Hover effect for clickable descriptions */
tr:hover .description-text.truncated::after,
tr:hover .description-text.expanded::after {
  text-decoration: underline;
}

/* Double-click hint */
.description-text:hover::before {
  content: 'double-click to edit';
  position: absolute;
  top: -18px;
  left: 0;
  font-size: 10px;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity 0.2s;
}

.cell-description:hover .description-text::before {
  opacity: 1;
}

.description-input,
.notes-input {
  width: 100%;
  min-height: 80px;
  max-height: 400px;
  padding: var(--spacing-sm);
  background: var(--bg-tertiary);
  border: 1px solid var(--accent-blue);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: inherit;
  resize: none;
  overflow-y: auto;
  field-sizing: content; /* Modern browsers */
}

/* Edit hint shown below textarea */
.edit-hint {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  margin-top: 4px;
}

.edit-hint kbd {
  display: inline-block;
  padding: 1px 4px;
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 10px;
}

.cell-select {
  width: 100%;
  padding: var(--spacing-xs);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: var(--font-size-sm);
  cursor: pointer;
}

.cell-select:focus {
  border-color: var(--accent-blue);
  outline: none;
}

/* Status badges */
.status-badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: var(--font-size-xs);
  font-weight: 500;
  border-radius: 12px;
  text-transform: uppercase;
}

.status-not_started { background: var(--status-not-started); color: white; }
.status-started { background: var(--status-started); color: white; }
.status-paused { background: var(--status-paused); color: white; }
.status-blocked { background: var(--status-blocked); color: white; }
.status-wfr { background: var(--status-wfr); color: white; }
.status-completed { background: var(--status-completed); color: white; }

/* Priority badges (for badge-style display, not inline indicators) */
.priority-badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: var(--font-size-xs);
  font-weight: 600;
  border-radius: 4px;
}

.priority-badge.priority-p0 { background: var(--accent-red); color: white; }
.priority-badge.priority-p1 { background: var(--accent-orange); color: white; }
.priority-badge.priority-p2 { background: var(--accent-yellow); color: black; }
.priority-badge.priority-p3 { background: var(--text-muted); color: white; }

/* Age display */
.age-display {
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
}

.age-fresh { color: var(--age-fresh); }
.age-warning { color: var(--age-warning); }
.age-stale { color: var(--age-stale); }

/* Focus checkbox */
.focus-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--accent-blue);
}

/* Date input */
.date-input {
  padding: var(--spacing-xs);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: var(--font-size-sm);
}

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

/* Notes cell */
.cell-notes {
  cursor: pointer;
}

.notes-text {
  font-size: var(--font-size-base);
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 2.5em;
  overflow: hidden;
}

/* Expand notes when task description is expanded (using :has selector) */
tr:has(.description-text.expanded) .notes-text {
  max-height: none;
}

/* Fallback for task-expanded class */
.task-expanded .notes-text {
  max-height: none;
}

.notes-text:empty::before {
  content: '—';
  color: var(--text-muted);
}

.cell-notes:hover .notes-text:not(:empty)::after {
  content: ' (dbl-click to edit)';
  font-size: 10px;
  color: var(--text-muted);
}

.notes-input {
  width: 100%;
  min-height: 60px;
  padding: var(--spacing-sm);
  background: var(--bg-tertiary);
  border: 1px solid var(--accent-blue);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: var(--font-size-sm);
  resize: vertical;
}

/* Blocked by input */
.blocked-input {
  width: 100%;
  padding: var(--spacing-xs);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: var(--font-size-sm);
}

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

/* Add task row */
.add-task-row {
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--bg-essential) !important;
  border-top: 1px solid var(--border-light);
}

.add-task-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-xs) var(--spacing-sm);
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--font-size-sm);
  transition: color 0.15s ease;
}

.add-task-btn:hover {
  color: var(--theme-accent);
}


/* ========================================
   Modals
   ======================================== */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
}

.modal-content {
  position: relative;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-small {
  max-width: 400px;
}

.modal-large {
  width: 90%;
  max-width: 1200px;
  height: 90vh;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.modal-large .modal-body {
  flex: 1;
  overflow-y: auto;
}

/* ========================================
   Project Notes Modal
   ======================================== */

.notes-modal-body {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  padding: var(--spacing-lg);
}

.notes-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.notes-empty {
  text-align: center;
  padding: var(--spacing-xl) var(--spacing-lg);
  color: var(--text-muted);
  font-style: italic;
}

.note-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.note-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: var(--spacing-xs) var(--spacing-sm);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-light);
}

.toolbar-btn {
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  min-width: 28px;
  text-align: center;
}

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

.toolbar-divider {
  width: 1px;
  height: 16px;
  background: var(--border-color);
  margin: 0 var(--spacing-xs);
}

.note-content {
  min-height: 120px;
  padding: var(--spacing-md);
  font-size: var(--font-size-base);
  line-height: 1.6;
  color: var(--text-primary);
  outline: none;
}

.note-content:focus {
  background: var(--bg-primary);
}

.note-content p {
  margin: 0 0 var(--spacing-sm) 0;
}

.note-content p:last-child {
  margin-bottom: 0;
}

.note-content ul, .note-content ol {
  margin: 0 0 var(--spacing-sm) 0;
  padding-left: var(--spacing-lg);
}

.note-content a {
  color: var(--accent-blue);
  text-decoration: underline;
}

.note-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-xs) var(--spacing-sm);
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-light);
}

.note-timestamp {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

.note-delete-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
}

.note-delete-btn:hover {
  background: var(--status-blocked);
  color: white;
}

/* Project notes icon in header */
.project-notes-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

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

.project-notes-btn .notes-count {
  font-size: var(--font-size-sm);
  background: var(--accent-blue);
  color: white;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.modal-keyboard-help {
  max-width: 900px;
  width: 90%;
}

.keyboard-help-body {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
}

.shortcuts-section h3 {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: var(--spacing-sm);
  padding-bottom: var(--spacing-xs);
  border-bottom: 2px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.shortcuts-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.shortcuts-table tr {
  border-bottom: 1px solid var(--border-light);
}

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

.shortcuts-table td {
  padding: var(--spacing-sm) 0;
  vertical-align: middle;
}

.shortcuts-table td:first-child {
  white-space: nowrap;
  width: 280px;
  padding-right: 60px;
}

.shortcuts-table td:last-child {
  color: var(--text-primary);
  font-size: var(--font-size-sm);
}

kbd {
  display: inline-block;
  padding: 4px 8px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-primary);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 0 var(--border-color);
  min-width: 24px;
  text-align: center;
}

/* ========================================
   Report Modal
   ======================================== */

.modal-report {
  width: 90%;
  max-width: 1200px;
  height: 90vh;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.modal-report .modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

/* Report Controls */
.report-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-md) var(--spacing-lg);
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
  position: sticky;
  top: 0;
  z-index: 10;
}

.report-selectors {
  display: flex;
  gap: var(--spacing-lg);
  flex-wrap: wrap;
}

.report-selector-group {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.report-selector-group label {
  font-weight: 500;
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
}

.report-select {
  padding: var(--spacing-xs) var(--spacing-sm);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: var(--font-size-sm);
  cursor: pointer;
}

/* Legacy - keep for backward compat */
.report-duration {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.report-duration label {
  font-weight: 500;
  color: var(--text-secondary);
}

.report-duration-select {
  padding: var(--spacing-xs) var(--spacing-sm);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: var(--font-size-sm);
}

/* Report Tabs */
.report-tabs {
  display: flex;
  gap: var(--spacing-xs);
}

.report-tab {
  padding: var(--spacing-xs) var(--spacing-md);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: var(--font-size-sm);
  transition: all 0.15s ease;
}

.report-tab:hover:not(:disabled) {
  background: var(--bg-hover);
}

.report-tab.active {
  background: var(--accent-blue);
  color: white;
  border-color: var(--accent-blue);
}

.report-tab:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Owner Navigation */
.report-owner-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-xs);
  padding: var(--spacing-sm) var(--spacing-lg);
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-tertiary);
  position: sticky;
  top: 58px;
  z-index: 9;
}

.report-nav-btn {
  padding: var(--spacing-xs) var(--spacing-sm);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  color: var(--text-secondary);
  font-size: var(--font-size-xs);
  cursor: pointer;
  transition: all 0.15s ease;
}

.report-nav-btn:hover {
  background: var(--accent-blue);
  color: white;
  border-color: var(--accent-blue);
}

.report-nav-btn .nav-count {
  opacity: 0.7;
  font-size: 10px;
}

/* TL;DR Summary Section */
.tldr-section {
  padding: var(--spacing-md) var(--spacing-lg);
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

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

.tldr-title {
  font-weight: 600;
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

.tldr-legend {
  display: flex;
  gap: var(--spacing-md);
  font-size: 10px;
  color: var(--text-muted);
}

.tldr-legend span {
  display: flex;
  align-items: center;
  gap: 2px;
}

.tldr-legend .status-dot {
  width: 8px;
  height: 8px;
  min-width: 8px;
}

.tldr-rows {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.tldr-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-xs) var(--spacing-sm);
  background: var(--bg-primary);
  border: 1px solid var(--border-color-light);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.tldr-row:hover {
  background: var(--bg-hover);
  border-color: var(--accent-blue);
}

.tldr-name {
  font-weight: 500;
  font-size: var(--font-size-sm);
  min-width: 120px;
}

.tldr-badges {
  display: flex;
  gap: var(--spacing-sm);
  align-items: center;
}

.tldr-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 500;
  background: var(--bg-tertiary);
}

.tldr-badge .status-dot {
  width: 8px;
  height: 8px;
  min-width: 8px;
}

.tldr-touched {
  color: var(--accent-blue);
  font-weight: 600;
}

.tldr-completed .status-dot,
.tldr-inprogress .status-dot,
.tldr-stuck .status-dot,
.tldr-nomovement .status-dot {
  margin-right: 2px;
}

.tldr-stale {
  opacity: 0.5;
}

.tldr-stale-highlight {
  opacity: 1;
  background: rgba(251, 146, 60, 0.2);
  color: #ea580c;
  font-weight: 600;
}

.tldr-unack {
  opacity: 0.5;
}

.tldr-unack-highlight {
  opacity: 1;
  background: rgba(255, 100, 100, 0.15);
  color: var(--status-blocked);
  font-weight: 600;
  animation: glow-text 1.5s ease-in-out infinite;
}

/* Report Body */
.report-body {
  padding: var(--spacing-lg);
}

/* Owner Section */
.report-owner-section {
  margin-bottom: var(--spacing-xl);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  overflow: hidden;
}

.report-owner-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-md) var(--spacing-lg);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
}

.report-owner-name {
  font-size: var(--font-size-lg);
  font-weight: 600;
  margin: 0;
}

.report-owner-touched {
  font-size: var(--font-size-sm);
  color: var(--accent-blue);
  font-weight: 600;
  padding: 2px 8px;
  background: rgba(59, 130, 246, 0.1);
  border-radius: var(--radius-sm);
}

.report-owner-total {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

/* Section Groups */
.report-section-group {
  padding: var(--spacing-md) var(--spacing-lg);
  border-bottom: 1px solid var(--border-color-light);
}

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

.report-section-title {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 var(--spacing-sm) 0;
}

/* Stat Items */
.report-stat {
  margin-bottom: var(--spacing-sm);
  border: 1px solid var(--border-color-light);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.report-stat:last-child {
  margin-bottom: 0;
}

.report-stat-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--bg-tertiary);
}

.report-stat.expandable .report-stat-header {
  cursor: pointer;
}

.report-stat.expandable .report-stat-header:hover {
  background: var(--bg-hover);
}

.report-stat-title {
  font-weight: 500;
  flex: 1;
}

.report-stat-value {
  font-weight: 700;
  font-size: var(--font-size-lg);
  color: var(--accent-blue);
  min-width: 40px;
  text-align: right;
}

.report-stat-dist {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  background: var(--bg-secondary);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

.report-expand-icon {
  font-size: 10px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.report-stat.expanded .report-expand-icon {
  transform: rotate(90deg);
}

/* Stat Details (Expandable) */
.report-stat-details {
  display: none;
  border-top: 1px solid var(--border-color-light);
  max-height: 300px;
  overflow-y: auto;
}

.report-stat.expanded .report-stat-details {
  display: block;
}

/* Task Item */
.report-task-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-md);
  padding: var(--spacing-sm) var(--spacing-md);
  border-bottom: 1px solid var(--border-color-light);
  font-size: var(--font-size-sm);
}

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

.report-task-item:hover {
  background: var(--bg-hover);
}

.report-task-name {
  flex: 1;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.report-task-meta {
  display: flex;
  gap: var(--spacing-md);
  color: var(--text-muted);
  font-size: var(--font-size-xs);
  flex-shrink: 0;
}

.report-task-location {
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.report-task-age {
  white-space: nowrap;
}

/* Extra Items */
.report-extra-item {
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-md);
  padding: var(--spacing-xs) 0;
  font-size: var(--font-size-sm);
}

.report-extra-label {
  font-weight: 500;
  color: var(--text-secondary);
  min-width: 120px;
}

.report-extra-value {
  color: var(--text-primary);
  flex: 1;
}

.report-status-breakdown {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  background: var(--bg-tertiary);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

/* Status dots in report */
.report-stat-title .status-dot,
.report-status-breakdown .status-dot {
  width: 10px;
  height: 10px;
  min-width: 10px;
  display: inline-block;
  vertical-align: middle;
  margin-right: 4px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-lg);
  border-bottom: 1px solid var(--border-color);
  gap: var(--spacing-md);
}

.modal-header h2 {
  font-size: var(--font-size-lg);
  flex: 1;
}

.modal-header .btn {
  flex-shrink: 0;
}

.modal-body {
  padding: var(--spacing-lg);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--spacing-sm);
  padding: var(--spacing-lg);
  border-top: 1px solid var(--border-color);
}

.form-group {
  margin-bottom: var(--spacing-md);
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label {
  display: block;
  margin-bottom: var(--spacing-xs);
  font-weight: 500;
}

.help-text {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  margin-bottom: var(--spacing-sm);
}

.input, .textarea {
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: var(--font-size-md);
}

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

.textarea {
  resize: vertical;
  min-height: 100px;
}

/* ========================================
   Drag and Drop
   ======================================== */

.dragging {
  opacity: 0.5;
}

.drag-over {
  border-top: 2px solid var(--accent-blue);
}

/* ========================================
   Toast Notifications
   ======================================== */

.toast-container {
  position: fixed;
  bottom: var(--spacing-lg);
  right: var(--spacing-lg);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.toast {
  padding: var(--spacing-md);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--font-size-sm);
  animation: slideIn 0.2s ease;
}

.toast.success {
  border-color: var(--accent-green);
}

.toast.error {
  border-color: var(--accent-red);
}

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

/* ========================================
   Keyboard Shortcuts Hint
   ======================================== */

.shortcuts-hint {
  position: fixed;
  bottom: var(--spacing-lg);
  left: var(--spacing-lg);
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.shortcuts-hint kbd {
  display: inline-block;
  padding: 2px 6px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  margin: 0 2px;
}

/* ========================================
   Fast Custom Tooltips (300ms delay)
   Uses JS tooltip element appended to body
   ======================================== */

.tooltip {
  position: fixed;
  padding: 6px 10px;
  background: #333;
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  border-radius: var(--radius-sm);
  pointer-events: none;
  z-index: 999999;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.tooltip.visible {
  opacity: 1;
}

.tooltip::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
}

.tooltip.above::after {
  top: 100%;
  border-top-color: #333;
}

.tooltip.below::after {
  bottom: 100%;
  border-bottom-color: #333;
}

/* ========================================
   Features Section (Landing Page & Modal)
   ======================================== */

.features-container {
  max-width: 800px;
  margin: 0 auto;
  padding: var(--spacing-lg) 0;
}

.features-modal {
  padding: 0;
}

.landing-features-section {
  margin-top: var(--spacing-xl);
  padding-top: var(--spacing-xl);
  border-top: 1px solid var(--border-color);
}

/* Header */
.features-header {
  text-align: center;
  margin-bottom: var(--spacing-xl);
}

.features-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 var(--spacing-sm) 0;
}

.features-subtitle {
  font-size: var(--font-size-lg);
  color: var(--text-secondary);
  margin: 0;
}

/* Philosophy Section */
.features-philosophy {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-xl);
  padding: var(--spacing-lg);
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border-left: 4px solid var(--accent-blue);
}

.philosophy-item h3 {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 var(--spacing-xs) 0;
}

.philosophy-item p {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}

/* Top Features - Full Width Cards */
.features-top {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-xl);
}

.feature-card {
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-md);
  padding: var(--spacing-lg);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover {
  border-color: var(--accent-blue);
  box-shadow: var(--shadow-sm);
}

.feature-icon {
  font-size: 2rem;
  line-height: 1;
  flex-shrink: 0;
  width: 50px;
  text-align: center;
}

.feature-content {
  flex: 1;
}

.feature-title {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 var(--spacing-xs) 0;
}

.feature-description {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.6;
}

/* More Features - Expandable */
.features-more {
  border-top: 1px solid var(--border-light);
  padding-top: var(--spacing-md);
}

.features-more-toggle {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--spacing-sm) 0;
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--text-secondary);
  transition: color 0.2s ease;
}

.features-more-toggle:hover {
  color: var(--text-primary);
}

.toggle-icon {
  font-size: var(--font-size-sm);
  transition: transform 0.2s ease;
}

.features-more.expanded .toggle-icon {
  transform: rotate(90deg);
}

.features-more-list {
  display: none;
  list-style: none;
  margin: var(--spacing-md) 0 0 0;
  padding: 0;
}

.features-more.expanded .features-more-list {
  display: block;
}

.features-more-list li {
  padding: var(--spacing-xs) 0;
  padding-left: var(--spacing-lg);
  position: relative;
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-light);
}

.features-more-list li:last-child {
  border-bottom: none;
}

.features-more-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent-blue);
  font-weight: bold;
}

/* ========================================
   Lock Screen & Password Protection
   ======================================== */

.lock-screen-modal {
  z-index: 100000;
}

.lock-screen-modal .modal-content {
  max-width: 360px;
  text-align: center;
}

.lock-backdrop {
  background: rgba(0, 0, 0, 0.9);
}

.lock-screen-content {
  padding: var(--spacing-xl);
}

.lock-icon {
  font-size: 48px;
  margin-bottom: var(--spacing-md);
}

.lock-screen-content h2 {
  font-size: var(--font-size-lg);
  margin: 0 0 var(--spacing-xs) 0;
  color: var(--text-primary);
}

.lock-screen-content p {
  color: var(--text-secondary);
  margin: 0 0 var(--spacing-lg) 0;
  font-size: var(--font-size-sm);
}

.lock-screen-content .form-group {
  margin-bottom: var(--spacing-md);
}

.lock-screen-content input {
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-md);
  font-size: var(--font-size-md);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  text-align: center;
}

.lock-screen-content input:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.2);
}

.btn-full {
  width: 100%;
}

.error-message {
  color: var(--accent-red);
  font-size: var(--font-size-sm);
  margin-bottom: var(--spacing-md);
  padding: var(--spacing-sm);
  background: rgba(239, 68, 68, 0.1);
  border-radius: var(--radius-sm);
}

/* Password Settings Modal */
#passwordSettingsModal .modal-content {
  max-width: 400px;
}

#passwordSettingsModal .form-group {
  margin-bottom: var(--spacing-md);
}

#passwordSettingsModal label {
  display: block;
  margin-bottom: var(--spacing-xs);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--text-secondary);
}

#passwordSettingsModal input {
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-md);
  font-size: var(--font-size-md);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

#passwordSettingsModal input:focus {
  outline: none;
  border-color: var(--accent-blue);
}

.modal-actions {
  display: flex;
  gap: var(--spacing-sm);
  justify-content: space-between;
  margin-top: var(--spacing-lg);
}

.modal-actions .btn {
  flex: 1;
}

/* Security button indicator */
#securityBtn.has-password::after {
  content: '✓';
  position: absolute;
  top: -2px;
  right: -2px;
  font-size: 10px;
  color: var(--status-completed);
}

#securityBtn {
  position: relative;
}

/* ========================================
   Task Roulette
   ======================================== */

.roulette-container {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-xs) var(--spacing-md);
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-sm);
  min-height: 36px;
  overflow: hidden;
  position: relative;
}

.roulette-container.team-roulette {
  margin: 0 var(--spacing-lg) var(--spacing-md);
  background: linear-gradient(135deg, rgba(88, 166, 255, 0.1) 0%, rgba(88, 166, 255, 0.05) 100%);
  border-color: var(--accent-blue);
}

.roulette-icon {
  font-size: 18px;
  flex-shrink: 0;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.roulette-icon:hover {
  transform: scale(1.1);
}

.roulette-icon.spinning {
  animation: dice-spin 0.5s ease-out;
}

@keyframes dice-spin {
  0% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(90deg) scale(1.2); }
  50% { transform: rotate(180deg) scale(1); }
  75% { transform: rotate(270deg) scale(1.2); }
  100% { transform: rotate(360deg) scale(1); }
}

.roulette-content {
  flex: 1;
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  min-width: 0;
  overflow: hidden;
}

.roulette-task {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  cursor: pointer;
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--radius-sm);
  transition: background 0.15s ease;
}

.roulette-task:hover {
  background: var(--bg-hover);
}

.roulette-task-name {
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.roulette-task.animating .roulette-task-name {
  animation: slot-machine 0.6s ease-out;
}

@keyframes slot-machine {
  0% {
    opacity: 0;
    transform: translateY(-20px);
  }
  20% {
    opacity: 0.3;
    transform: translateY(-10px);
  }
  40% {
    opacity: 0.5;
    transform: translateY(5px);
  }
  60% {
    opacity: 0.7;
    transform: translateY(-3px);
  }
  80% {
    opacity: 0.9;
    transform: translateY(1px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.roulette-meta {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  flex-shrink: 0;
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

.roulette-location {
  white-space: nowrap;
  color: var(--text-muted);
  font-style: italic;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.roulette-modified {
  white-space: nowrap;
}

.roulette-why {
  cursor: help;
  font-size: 14px;
  opacity: 0.7;
  transition: opacity 0.15s ease;
}

.roulette-why:hover {
  opacity: 1;
}

.roulette-empty {
  color: var(--text-muted);
  font-style: italic;
  font-size: var(--font-size-sm);
}

.roulette-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: all 0.15s ease;
}

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

.roulette-toggle.active {
  color: var(--accent-blue);
}

/* Project header roulette toggle */
.project-roulette-toggle {
  font-size: 14px;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.15s ease;
  margin-left: var(--spacing-xs);
}

.project-roulette-toggle:hover {
  opacity: 1;
}

.project-roulette-toggle.active {
  opacity: 1;
}

/* Team roulette in filter bar */
.team-roulette-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  transition: all 0.15s ease;
}

.team-roulette-toggle:hover {
  background: var(--bg-hover);
  border-color: var(--accent-blue);
}

.team-roulette-toggle.active {
  background: rgba(88, 166, 255, 0.1);
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

/* Why tooltip styling */
.roulette-why-tooltip {
  position: fixed;
  background: #333;
  color: white;
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  max-width: 280px;
  z-index: 99999;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  pointer-events: none;
}

.roulette-why-tooltip ul {
  margin: 0;
  padding: 0 0 0 var(--spacing-md);
  list-style: none;
}

.roulette-why-tooltip li {
  padding: 2px 0;
}

.roulette-why-tooltip li::before {
  content: "•";
  margin-right: 6px;
  color: var(--accent-blue);
}

/* Shimmer effect for refresh */
.roulette-container.refreshing::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.1) 50%,
    transparent 100%
  );
  animation: shimmer 0.6s ease-out;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* Roulette highlight when navigating to task */
.roulette-highlight {
  animation: roulette-pulse 2s ease-out;
}

@keyframes roulette-pulse {
  0% {
    background: rgba(88, 166, 255, 0.4) !important;
    box-shadow: 0 0 0 2px var(--accent-blue);
  }
  50% {
    background: rgba(88, 166, 255, 0.2) !important;
  }
  100% {
    background: transparent;
    box-shadow: none;
  }
}

/* Hide team roulette when disabled */
.roulette-container.hidden {
  display: none;
}

/* Project-level roulette */
.project-roulette {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-xs) var(--spacing-md);
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
  border: 1px solid var(--border-light);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  margin: 0 var(--spacing-sm) var(--spacing-xs);
  min-height: 32px;
  overflow: hidden;
  position: relative;
  font-size: var(--font-size-sm);
}

.project-roulette.hidden {
  display: none;
}

.project-roulette .roulette-icon {
  font-size: 14px;
}

.project-roulette .roulette-task-name {
  font-size: var(--font-size-sm);
}

.project-roulette .roulette-meta {
  font-size: 11px;
}

.project-roulette .roulette-why {
  font-size: 12px;
}

/* ======================================
   REMINDER NOTIFICATIONS
   ====================================== */

/* Reminder button in header */
.reminder-notification-btn {
  position: relative;
}

.reminder-bell-icon {
  font-size: 16px;
}

.reminder-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: var(--status-blocked);
  color: white;
  font-size: 10px;
  font-weight: 600;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulse-badge 2s ease-in-out infinite;
}

.reminder-badge.hidden {
  display: none;
}

@keyframes pulse-badge {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* Reminder modal */
.modal-medium {
  max-width: 700px;
  width: 90%;
}

.reminder-modal-controls {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin-right: auto;
  margin-left: var(--spacing-lg);
}

.reminder-sort-label {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

#reminderContent {
  max-height: 70vh;
  overflow-y: auto;
}

/* Reminder list */
.reminder-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.reminder-list-empty {
  text-align: center;
  padding: var(--spacing-xl);
  color: var(--text-muted);
  font-style: italic;
}

.reminder-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

.reminder-item:hover {
  border-color: var(--accent-blue);
  background: var(--bg-hover);
}

.reminder-item.reminder-unacked {
  border-color: var(--status-blocked);
  background: rgba(255, 100, 100, 0.05);
}

.reminder-item-bell {
  font-size: 18px;
  opacity: 0.6;
}

.reminder-item.reminder-unacked .reminder-item-bell {
  opacity: 1;
  animation: pulse-reminder 1.5s ease-in-out infinite;
}

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

.reminder-item-task {
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reminder-item-task:hover {
  color: var(--accent-blue);
  text-decoration: underline;
}

.reminder-item-location {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reminder-item-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-size: var(--font-size-sm);
}

.reminder-item-time {
  color: var(--text-secondary);
}

.reminder-item.reminder-unacked .reminder-item-time {
  color: var(--status-blocked);
  font-weight: 600;
}

.reminder-item-interval {
  color: var(--text-muted);
  font-size: 11px;
}

.reminder-item-ack {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  font-size: 14px;
  color: var(--status-started);
  background: transparent;
  border: 2px solid var(--status-started);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
}

.reminder-item-ack:hover {
  background: var(--status-started);
  color: white;
  transform: scale(1.1);
}

.reminder-item-ack.acked {
  background: var(--status-started);
  color: white;
  opacity: 0.5;
  cursor: default;
}

/* Reminder stats in item */
.reminder-item-stats {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Reminder help text */
.reminder-help-text {
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-md);
  background: var(--bg-hover);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  line-height: 1.5;
  border-left: 3px solid var(--accent-blue);
}

/* ============================================
   STALE TASKS MODAL
   ============================================ */

.stale-filters {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-md);
}

.stale-filter-row {
  display: flex;
  gap: var(--spacing-md);
  flex-wrap: wrap;
  align-items: flex-end;
}

.stale-filter-group {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  min-width: 140px;
}

.stale-filter-group label {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stale-filter-group select {
  padding: var(--spacing-xs) var(--spacing-sm);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: var(--font-size-sm);
  cursor: pointer;
}

.stale-toggles {
  gap: var(--spacing-lg);
}

.stale-toggle {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  cursor: pointer;
}

.stale-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.stale-stats {
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--bg-hover);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin-bottom: var(--spacing-md);
}

.stale-stats strong {
  color: var(--text-primary);
}

.stale-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 60vh;
  overflow-y: auto;
}

.stale-task-row {
  display: grid;
  /* status | description | location | owner | priority | reminder | age */
  grid-template-columns: 24px 1fr 180px 90px 36px 60px 65px;
  gap: var(--spacing-sm);
  align-items: center;
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.stale-task-row:hover {
  background: var(--bg-hover);
}

.stale-status {
  display: flex;
  align-items: center;
  justify-content: center;
}

.stale-description {
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stale-subtask-indicator {
  color: var(--text-muted);
  margin-right: var(--spacing-xs);
}

.stale-location {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stale-owner {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stale-priority {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  font-weight: 600;
}

.stale-reminder {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  white-space: nowrap;
  text-align: center;
}

.stale-reminder .reminder-overdue {
  color: var(--status-blocked);
}

.stale-reminder .reminder-unacked {
  font-weight: 600;
  animation: glow-text 1.5s ease-in-out infinite;
}

.stale-age {
  font-size: var(--font-size-sm);
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  text-align: right;
  white-space: nowrap;
}

/* Heatmap colors - 5-level gradient from green to red */
.heatmap-green {
  background: rgba(34, 197, 94, 0.25);
  color: #15803d;
}

.heatmap-lime {
  background: rgba(132, 204, 22, 0.25);
  color: #4d7c0f;
}

.heatmap-yellow {
  background: rgba(250, 204, 21, 0.3);
  color: #ca8a04;
}

.heatmap-orange {
  background: rgba(251, 146, 60, 0.3);
  color: #ea580c;
}

.heatmap-red {
  background: rgba(239, 68, 68, 0.25);
  color: #dc2626;
  font-weight: 700;
}

.heatmap-gray {
  background: rgba(156, 163, 175, 0.2);
  color: #6b7280;
}

/* Age badge styling - rounded pill with heatmap color */
.age-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

/* Empty state */
.stale-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-xxl);
  text-align: center;
}

.stale-empty-icon {
  font-size: 48px;
  margin-bottom: var(--spacing-md);
}

.stale-empty-title {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--spacing-xs);
}

.stale-empty-text {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

/* Flash highlight animation for navigated task */
@keyframes flash-highlight {
  0% { background-color: var(--accent-blue); }
  100% { background-color: transparent; }
}

/* ============================================
   AUDIT TRAIL MODAL
   ============================================ */

.audit-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-md);
  align-items: flex-end;
}

.audit-filter-group {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  min-width: 120px;
}

.audit-filter-group label {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.audit-select {
  padding: var(--spacing-xs) var(--spacing-sm);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: var(--font-size-sm);
  cursor: pointer;
}

.audit-toggle-group {
  flex-direction: row;
  align-items: center;
  gap: var(--spacing-sm);
}

.audit-toggle-label {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  cursor: pointer;
}

.audit-toggle-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.audit-toggle-hint {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.audit-stats {
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--bg-hover);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin-bottom: var(--spacing-md);
}

.audit-stats strong {
  color: var(--text-primary);
}

.audit-stat-item {
  color: var(--text-muted);
}

.audit-list {
  max-height: 60vh;
  overflow-y: auto;
}

.audit-day-group {
  margin-bottom: var(--spacing-md);
}

.audit-day-header {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-secondary);
  padding: var(--spacing-xs) var(--spacing-sm);
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  margin-bottom: var(--spacing-xs);
  position: sticky;
  top: 0;
  z-index: 1;
}

.audit-day-changes {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.audit-change-row {
  display: grid;
  grid-template-columns: 70px minmax(180px, auto) 100px 1fr;
  gap: var(--spacing-sm);
  align-items: center;
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.audit-change-row:hover {
  background: var(--bg-hover);
}

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

.audit-action {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  font-size: var(--font-size-sm);
}

.audit-action-icon {
  font-size: 14px;
  width: 18px;
  text-align: center;
}

.audit-action-details {
  color: var(--text-secondary);
}

.audit-action-details .status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 2px;
  vertical-align: middle;
}

.audit-owner {
  font-size: var(--font-size-xs);
  color: var(--accent-blue);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.audit-task-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  overflow: hidden;
}

.audit-task-desc {
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.audit-task-location {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.audit-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-xxl);
  text-align: center;
  color: var(--text-muted);
}

.audit-empty p {
  margin: var(--spacing-xs) 0;
}

.audit-empty-hint {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

.flash-highlight {
  animation: flash-highlight 1.5s ease-out;
}

/* ============================================
   PROGRESS TRACKING
   ============================================ */

/* Progress color variables */
:root {
  --progress-0: #6b7280;    /* Gray */
  --progress-30: #f97316;   /* Orange */
  --progress-60: #eab308;   /* Yellow */
  --progress-90: #84cc16;   /* Lime */
  --progress-100: #22c55e;  /* Green */
}

/* Progress column */
.col-progress {
  width: 80px;
  max-width: 80px;
}

.cell-progress {
  cursor: pointer;
  padding: 4px !important;
  vertical-align: middle !important;
}

/* Mini progress bar in table */
.mini-progress-container {
  display: flex;
  align-items: center;
  gap: 4px;
  position: relative;
}

.mini-progress-bar {
  width: 100%;
  height: 20px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border: 1px solid var(--border-color-light);
}

.mini-progress-text {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  text-shadow: 0 0 2px var(--bg-primary);
  z-index: 1;
}

.progress-comments-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--accent-blue);
  color: white;
  font-size: 9px;
  font-weight: 600;
  padding: 1px 4px;
  border-radius: 8px;
  min-width: 14px;
  text-align: center;
}

/* Progress Modal */
.modal-progress {
  max-width: 800px;
  width: 90%;
  max-height: 85vh;
}

.modal-progress .modal-body {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
  padding: var(--spacing-lg);
  overflow-y: auto;
}

/* Progress Selector */
.progress-selector-container {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
}

.progress-bar-selector {
  display: flex;
  gap: 0;
  margin-bottom: var(--spacing-md);
}

.progress-level-btn {
  flex: 1;
  padding: 12px 4px;
  border: none;
  background: var(--bg-tertiary);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  border-right: 1px solid var(--border-color);
}

.progress-level-btn:first-child {
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.progress-level-btn:last-child {
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  border-right: none;
}

.progress-level-btn:hover {
  background: var(--bg-hover);
}

.progress-level-btn.active {
  background: var(--progress-60);
  color: black;
}

.progress-level-btn.active[data-level="0"],
.progress-level-btn.active[data-level="10"],
.progress-level-btn.active[data-level="20"],
.progress-level-btn.active[data-level="30"] {
  background: var(--progress-30);
  color: white;
}

.progress-level-btn.active[data-level="40"],
.progress-level-btn.active[data-level="50"],
.progress-level-btn.active[data-level="60"] {
  background: var(--progress-60);
  color: black;
}

.progress-level-btn.active[data-level="70"],
.progress-level-btn.active[data-level="80"],
.progress-level-btn.active[data-level="90"] {
  background: var(--progress-90);
  color: black;
}

.progress-level-btn.active[data-level="100"] {
  background: var(--progress-100);
  color: white;
}

.progress-level-btn.current {
  box-shadow: inset 0 0 0 2px var(--accent-blue);
}

.progress-level-btn.milestone {
  font-weight: 700;
}

.progress-current-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-md);
}

.progress-percentage {
  font-size: var(--font-size-xxl);
  font-weight: 700;
  color: var(--text-primary);
}

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

/* Progress Comments Section */
.progress-comments-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 200px;
}

.progress-comments-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-md);
  padding-bottom: var(--spacing-sm);
  border-bottom: 1px solid var(--border-color-light);
}

.progress-comments-header h3 {
  font-size: var(--font-size-md);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.progress-comments-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.progress-comments-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-xl);
  text-align: center;
  color: var(--text-muted);
}

.progress-comments-empty .hint {
  font-size: var(--font-size-sm);
  margin-top: var(--spacing-xs);
}

/* Progress Comment Card */
.progress-comment-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.progress-comment-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: 6px var(--spacing-md);
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-color-light);
}

.progress-comment-progress {
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
}

.progress-comment-timestamp {
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-right: auto;
}

.progress-comment-toolbar-inline {
  display: flex;
  align-items: center;
  gap: 2px;
}

.progress-comment-toolbar-inline .toolbar-btn {
  padding: 2px 6px;
  font-size: 11px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color-light);
  border-radius: var(--radius-sm);
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.15s;
}

.progress-comment-toolbar-inline .toolbar-btn:hover {
  opacity: 1;
  background: var(--bg-primary);
}

.progress-comment-delete-btn {
  background: none;
  border: none;
  padding: 2px 6px;
  cursor: pointer;
  opacity: 0.4;
  font-size: 12px;
  transition: opacity 0.15s;
  flex-shrink: 0;
}

.progress-comment-delete-btn:hover {
  opacity: 1;
}

.progress-comment-content {
  padding: var(--spacing-sm) var(--spacing-md);
  min-height: 60px;
  font-size: var(--font-size-sm);
  line-height: 1.5;
  outline: none;
}

.progress-comment-content:focus {
  background: var(--bg-primary);
}

.progress-comment-content:empty::before {
  content: 'Add your progress update...';
  color: var(--text-muted);
}

/* ============================================
   SCOPE FILTER
   ============================================ */

/* Scope filter button */
.scope-filter-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: var(--font-size-sm);
  transition: all 0.15s ease;
}

.scope-filter-btn:hover {
  background: var(--bg-hover);
  border-color: var(--theme-accent);
}

.scope-filter-btn.active {
  background: var(--theme-accent);
  color: white;
  border-color: var(--theme-accent);
}

.scope-badge {
  font-size: 10px;
  font-weight: 600;
  background: var(--bg-primary);
  color: var(--text-primary);
  padding: 1px 5px;
  border-radius: 8px;
}

.scope-filter-btn.active .scope-badge {
  background: rgba(255, 255, 255, 0.3);
  color: white;
}

/* Scope modal */
.modal-scope {
  max-width: 500px;
}

.modal-scope .modal-body {
  padding: var(--spacing-md);
  max-height: 70vh;
  display: flex;
  flex-direction: column;
}

.scope-actions {
  display: flex;
  gap: var(--spacing-sm);
  padding-bottom: var(--spacing-md);
  border-bottom: 1px solid var(--border-color-light);
  margin-bottom: var(--spacing-md);
}

.scope-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.scope-empty {
  text-align: center;
  padding: var(--spacing-xl);
  color: var(--text-muted);
}

/* Project in scope list */
.scope-project {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color-light);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.scope-project-header {
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--bg-tertiary);
}

.scope-checkbox-label {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  cursor: pointer;
}

.scope-checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--theme-accent);
}

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

.scope-section-count {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

/* Sections in scope list */
.scope-sections {
  padding: var(--spacing-sm) var(--spacing-md);
  padding-left: calc(var(--spacing-md) + 24px);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  border-top: 1px solid var(--border-color-light);
}

.scope-section-item {
  padding: var(--spacing-xs) 0;
}

.scope-section-name {
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
}

.scope-section-item:hover .scope-section-name {
  color: var(--text-primary);
}

