/* ==========================================================================
   EONera Roadmap — CSS Design System & Visual Aesthetics
   ========================================================================== */

:root {
  --bg-dark: #0a0f1d;
  --bg-card: rgba(15, 23, 42, 0.75);
  --bg-card-hover: rgba(30, 41, 59, 0.85);
  --border-color: rgba(255, 255, 255, 0.1);
  --border-highlight: rgba(255, 255, 255, 0.25);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --color-cyan: #06b6d4;
  --color-purple: #8b5cf6;
  --color-green: #10b981;
  --color-amber: #f59e0b;
  --color-rose: #f43f5e;
  --color-blue: #3b82f6;

  --gradient-cyan-blue: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
  --gradient-purple-pink: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
  --gradient-amber-rose: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
  --gradient-green-emerald: linear-gradient(135deg, #10b981 0%, #059669 100%);

  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 20px rgba(6, 182, 212, 0.25);

  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
}

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

body {
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(6, 182, 212, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 75%, rgba(139, 92, 246, 0.08) 0%, transparent 40%);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: var(--font-body);
  line-height: 1.6;
  min-height: 100vh;
  padding: 1.5rem;
}

.app-container {
  max-width: 1640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Glassmorphism utility */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-card:hover {
  border-color: var(--border-highlight);
  box-shadow: var(--shadow-lg);
}

/* Buttons */
.btn {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.775rem;
}

.btn-accent {
  background: var(--gradient-cyan-blue);
  color: white;
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
}
.btn-accent:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border-color: var(--border-color);
}
.btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-highlight);
}

.btn-danger {
  background: rgba(244, 63, 94, 0.15);
  color: #f43f5e;
  border-color: rgba(244, 63, 94, 0.3);
}
.btn-danger:hover {
  background: rgba(244, 63, 94, 0.3);
}

.btn-edit-toggle {
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
  border-color: rgba(139, 92, 246, 0.35);
}
.btn-edit-toggle:hover {
  background: rgba(139, 92, 246, 0.3);
  color: white;
}
.btn-edit-toggle.active {
  background: var(--gradient-purple-pink);
  color: white;
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.4);
}

/* Data Edit Tools Bar */
.data-edit-bar {
  display: none;
  justify-content: space-between;
  align-items: center;
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.35);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.25rem;
}
.data-edit-bar.active {
  display: flex;
}
.edit-mode-indicator {
  font-size: 0.85rem;
  font-weight: 700;
  color: #c084fc;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.edit-actions {
  display: flex;
  gap: 0.5rem;
}

/* Navbar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}

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

.logo-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--gradient-cyan-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: var(--shadow-glow);
}

.brand-text h1 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.brand-text h1 span {
  background: var(--gradient-cyan-blue);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-text .tagline {
  font-size: 0.85rem;
  color: var(--text-muted);
}

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

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.825rem;
  font-weight: 600;
}

.badge-start {
  background: rgba(6, 182, 212, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(6, 182, 212, 0.4);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.2);
}

.badge-accent {
  background: rgba(139, 92, 246, 0.15);
  color: #c084fc;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.badge-gold {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Hero Stats Bar */
.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

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

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.icon-cyan { background: rgba(6, 182, 212, 0.15); color: var(--color-cyan); }
.icon-purple { background: rgba(139, 92, 246, 0.15); color: var(--color-purple); }
.icon-green { background: rgba(16, 185, 129, 0.15); color: var(--color-green); }
.icon-amber { background: rgba(245, 158, 11, 0.15); color: var(--color-amber); }

.stat-content {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
}

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

/* Controls & View Tabs */
.controls-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  background: rgba(15, 23, 42, 0.8);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.view-tabs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 2px;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
  color: white;
  background: var(--gradient-cyan-blue);
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
}

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

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box i {
  position: absolute;
  left: 0.75rem;
  color: var(--text-dim);
  width: 16px;
  height: 16px;
}

.search-box input {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 0.5rem 0.75rem 0.5rem 2.25rem;
  font-size: 0.85rem;
  width: 220px;
  outline: none;
  transition: border-color 0.2s ease;
}

.search-box input:focus {
  border-color: var(--color-cyan);
}

.select-wrapper select {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
}

/* View Panels */
.view-panel {
  display: none;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.view-panel.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

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

.section-header h2 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
}

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

.scroll-hint {
  font-size: 0.775rem;
  font-weight: 600;
  color: #38bdf8;
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.3);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

/* Gantt Chart View */
.quarter-legend {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  align-items: center;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.dot-tech { background: var(--color-cyan); }
.dot-comm { background: var(--color-purple); }
.dot-ip { background: var(--color-amber); }
.dot-funding { background: var(--color-green); }

/* SINGLE TOP HORIZONTAL SCROLLBAR */
.gantt-top-scrollbar-wrapper {
  overflow-x: auto;
  overflow-y: hidden;
  background: rgba(10, 15, 29, 0.98);
  border: 1px solid var(--border-color);
  border-bottom: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  height: 15px;
  scrollbar-width: thin;
  scrollbar-color: var(--color-cyan) rgba(15, 23, 42, 0.8);
  position: sticky;
  top: 0;
  z-index: 35;
  margin-bottom: -1px;
}

.gantt-top-scrollbar-wrapper::-webkit-scrollbar {
  height: 10px;
}
.gantt-top-scrollbar-wrapper::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.8);
  border-radius: var(--radius-full);
}
.gantt-top-scrollbar-wrapper::-webkit-scrollbar-thumb {
  background: var(--color-cyan);
  border-radius: var(--radius-full);
}
.gantt-top-scrollbar-wrapper::-webkit-scrollbar-thumb:hover {
  background: #38bdf8;
}

/* Gantt Container: SINGLE TOP HORIZONTAL SCROLLBAR (Bottom horizontal scrollbar hidden) */
.gantt-container {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  overflow-x: hidden; /* Hide bottom horizontal scrollbar */
  overflow-y: auto;   /* Keep vertical scrollbar */
  max-height: 700px;
  position: relative;
  box-shadow: var(--shadow-lg);
  scrollbar-width: thin;
  scrollbar-color: var(--color-cyan) rgba(15, 23, 42, 0.8);
  cursor: grab;
}

.gantt-container.panning {
  cursor: grabbing;
  user-select: none;
}

.gantt-container::-webkit-scrollbar {
  width: 10px;
  height: 0px; /* Hide bottom horizontal scrollbar in Webkit browsers */
}
.gantt-container::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.8);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.gantt-container::-webkit-scrollbar-thumb {
  background: var(--color-cyan);
  border-radius: var(--radius-full);
}

/* ==========================================================================
   21-MONTH GRID ARCHITECTURE (DUAL-AXIS STICKY HEADERS)
   Label Col: 220px Sticky Left & Top | 7 Quarters x 3 Months = 21 Months @ 180px min
   Total Timeline Width: 220px + (21 * 180px) = 4000px
   ========================================================================== */
.gantt-header-row {
  display: grid;
  grid-template-columns: 220px repeat(21, minmax(180px, 1fr));
  border-bottom: 2px solid var(--border-color);
  background: rgba(10, 15, 29, 0.98);
  backdrop-filter: blur(20px);
  min-width: 4000px;
  position: sticky;
  top: 0;
  z-index: 30; /* Sticky Top on Y-axis scrolling */
}

/* Corner Cell: Sticky TOP and LEFT */
.gantt-label-col {
  padding: 1rem;
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-right: 2px solid rgba(6, 182, 212, 0.4);
  display: flex;
  align-items: center;
  grid-column: 1 / span 1;
  position: sticky;
  left: 0;
  top: 0;
  z-index: 40; /* Top-Left corner anchor */
  background: rgba(15, 23, 42, 0.98);
  backdrop-filter: blur(16px);
  box-shadow: 4px 0 12px rgba(0, 0, 0, 0.4);
}

.gantt-q-col {
  padding: 0.6rem 0.4rem 0.75rem 0.4rem;
  border-right: 2px solid rgba(6, 182, 212, 0.4);
  text-align: center;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}
.gantt-q-col:last-child { border-right: none; }

.gantt-q-col.q-current {
  background: rgba(6, 182, 212, 0.08);
  border-left: 2px solid rgba(6, 182, 212, 0.5);
  border-right: 2px solid rgba(6, 182, 212, 0.5);
}

.q-start-tag {
  font-size: 0.575rem;
  font-weight: 800;
  background: var(--color-cyan);
  color: var(--bg-dark);
  padding: 2px 7px;
  border-radius: 3px;
  letter-spacing: 0.04em;
  margin-bottom: 3px;
  white-space: nowrap;
  display: inline-block;
}

.q-title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--color-cyan);
}
.q-dates {
  font-size: 0.775rem;
  color: var(--text-muted);
}

/* Multi-Quarter / Month Spanning Gantt Rows */
.gantt-row {
  display: grid;
  grid-template-columns: 220px repeat(21, minmax(180px, 1fr));
  border-bottom: 1px solid var(--border-color);
  min-height: 120px;
  min-width: 4000px;
  position: relative;
}

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

/* Sticky Workstream Header on Left */
.ws-header {
  grid-column: 1 / span 1;
  padding: 1.25rem 1rem;
  border-right: 2px solid rgba(6, 182, 212, 0.4);
  background: rgba(15, 23, 42, 0.98);
  backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: sticky;
  left: 0;
  z-index: 10; /* Sticky Left on X-axis scrolling */
  box-shadow: 4px 0 12px rgba(0, 0, 0, 0.4);
}

.ws-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.975rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ws-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* 21-Month Grid Background & Spanning Cards */
.gantt-row-tracks {
  grid-column: 2 / span 21;
  display: grid;
  grid-template-columns: repeat(21, minmax(180px, 1fr));
  position: relative;
  padding: 0.85rem 0;
  gap: 10px 0;
  align-content: center;
}

/* Background Guidelines for Months & Quarters */
.gantt-row-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(21, minmax(180px, 1fr));
  pointer-events: none;
  z-index: 1;
}

/* Month Cell Background & Borders */
.gantt-m-bg {
  border-right: 1px dashed rgba(255, 255, 255, 0.08);
}

/* Quarter Boundary Line (Brighter & Thicker Line every 3 months) */
.gantt-m-bg.q-boundary {
  border-right: 2px solid rgba(6, 182, 212, 0.35);
}

.gantt-m-bg.q-current-bg {
  background: rgba(6, 182, 212, 0.04);
}

/* Task Bar on Expanded 180px Month Grid */
.task-card-span {
  background: rgba(30, 41, 59, 0.95);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  z-index: 3;
  margin: 4px 6px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.task-card-span:hover {
  transform: translateY(-2px);
  border-color: var(--color-cyan);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
  z-index: 4;
}

.task-card-span.tech { border-left: 4px solid var(--color-cyan); }
.task-card-span.comm { border-left: 4px solid var(--color-purple); }
.task-card-span.ip { border-left: 4px solid var(--color-amber); }
.task-card-span.funding { border-left: 4px solid var(--color-green); }

.task-span-badge {
  font-size: 0.625rem;
  font-weight: 700;
  color: var(--color-cyan);
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
}

/* Title text clamped to MAXIMUM 3 ROWS with no hyphenation */
.task-title {
  font-size: 0.775rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: normal;
  hyphens: none;
}

.task-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
}

.tag {
  font-size: 0.625rem;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 600;
  white-space: nowrap;
}
.tag-tvl { background: rgba(6, 182, 212, 0.2); color: #38bdf8; }
.tag-warning { background: rgba(244, 63, 94, 0.2); color: #f43f5e; }
.tag-ms { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }

/* Edit Buttons overlay on Task Card */
.task-actions {
  display: none;
  position: absolute;
  top: 4px;
  right: 4px;
  gap: 2px;
}
.edit-mode-active .task-actions {
  display: flex;
}
.task-action-btn {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: none;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.65rem;
}
.task-action-btn:hover { background: var(--color-cyan); }
.task-action-btn.btn-del:hover { background: var(--color-rose); }

/* Add Task Button inside Workstream Track */
.track-add-btn {
  display: none;
  font-size: 0.75rem;
  padding: 6px 12px;
  background: rgba(6, 182, 212, 0.15);
  color: var(--color-cyan);
  border: 1px dashed rgba(6, 182, 212, 0.4);
  border-radius: var(--radius-sm);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  gap: 4px;
  grid-column: 1 / -1;
  z-index: 3;
}
.edit-mode-active .track-add-btn {
  display: flex;
}

/* VIEW 2: MILESTONE LADDER */
.milestone-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.25rem;
}

.milestone-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
  overflow: hidden;
  transition: all 0.2s ease;
}

.milestone-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--gradient-cyan-blue);
}

.milestone-card.highlight::before {
  background: var(--gradient-amber-rose);
}

.milestone-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-highlight);
  box-shadow: var(--shadow-lg);
}

.ms-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ms-number {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--color-cyan);
}

.milestone-card.highlight .ms-number {
  color: var(--color-amber);
}

.ms-date {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.4);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.ms-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
}

.ms-proof {
  font-size: 0.8rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  border-left: 2px solid var(--text-dim);
}

.ms-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* VIEW 3: FINANCIAL BREAKDOWN */
.financial-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 1.5rem;
}

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

.chart-box {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.chart-box h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.donut-chart-container {
  position: relative;
  width: 220px;
  height: 220px;
  margin: 1rem 0;
}

.donut {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.donut-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.donut-center .amount {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-main);
}

.donut-center .subtext {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.funding-leverage-box {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-top: 1.25rem;
  text-align: left;
}

.leverage-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #fbbf24;
  margin-bottom: 0.4rem;
}

.leverage-header h4 {
  font-size: 0.9rem;
  font-weight: 700;
}

.funding-leverage-box p {
  font-size: 0.775rem;
  color: var(--text-muted);
  line-height: 1.45;
}

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

.budget-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
}

.budget-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.budget-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.budget-amount {
  font-size: 1.1rem;
  font-weight: 800;
  font-family: var(--font-heading);
  color: var(--color-cyan);
}

.progress-bar-bg {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.budget-covers {
  font-size: 0.825rem;
  color: var(--text-muted);
}

/* VIEW 4: TRL/TVL PROGRESSION */
.tvl-stepper-container {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
}

.tvl-ladder {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: relative;
}

.tvl-ladder::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 28px;
  width: 4px;
  background: var(--gradient-cyan-blue);
  opacity: 0.3;
}

.tvl-step {
  display: flex;
  gap: 1.5rem;
  position: relative;
  z-index: 1;
}

.step-node {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--bg-dark);
  border: 3px solid var(--color-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1rem;
  color: var(--color-cyan);
  flex-shrink: 0;
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.3);
}

.tvl-step.completed .step-node {
  background: var(--color-cyan);
  color: var(--bg-dark);
}

.step-body {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  flex-grow: 1;
}

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

.step-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
}

.step-timing {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-cyan);
  background: rgba(6, 182, 212, 0.1);
  padding: 2px 10px;
  border-radius: var(--radius-full);
}

.step-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* VIEW 5: BASELINE */
.baseline-layout-full {
  display: grid;
  grid-template-columns: 1fr;
}

.baseline-card {
  padding: 1.5rem;
}

.baseline-card h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.baseline-table-wrapper {
  overflow-x: auto;
}

.baseline-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.baseline-table th, .baseline-table td {
  padding: 0.85rem;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
}

.baseline-table th {
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  background: rgba(0, 0, 0, 0.3);
}

/* Modal Window & Form Editing */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1.5rem;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  max-width: 650px;
  width: 100%;
  padding: 2rem;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--text-main);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease;
}

.modal-close:hover {
  background: rgba(244, 63, 94, 0.3);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-group input, .form-group textarea, .form-group select {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 0.6rem 0.75rem;
  font-family: var(--font-body);
  font-size: 0.875rem;
  outline: none;
}

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

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

.modal-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

/* Edit Mode Buttons on Cards */
.edit-only-btn {
  display: none;
}
.edit-mode-active .edit-only-btn {
  display: inline-flex;
}
.edit-only-col {
  display: none;
}
.edit-mode-active .edit-only-col {
  display: table-cell;
}

/* Footer */
.footer {
  text-align: center;
  padding: 1.5rem 0;
  font-size: 0.8rem;
  color: var(--text-dim);
  border-top: 1px solid var(--border-color);
  margin-top: 2rem;
}
/* Password Gate */
#passwordGate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.pw-box {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2.5rem 2rem;
  max-width: 380px;
  width: 100%;
  text-align: center;
}

.pw-logo {
  width: 56px;
  height: 56px;
  margin: 0 auto 1.25rem;
  border-radius: var(--radius-full);
  background: var(--gradient-cyan-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: var(--shadow-glow);
}

.pw-box h1 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.pw-box h1 span {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

.pw-box p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

#pwForm {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

#pwInput {
  width: 100%;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.9rem;
}

#pwInput:focus {
  outline: none;
  border-color: var(--color-cyan);
}

#pwForm .btn {
  justify-content: center;
}

#pwError {
  display: none;
  color: var(--color-rose);
  font-size: 0.8rem;
  margin-top: 0.75rem;
  margin-bottom: 0;
}