/* =============================================
   NORTHPOLE — Executive Roadmap
   Premium Design System
   ============================================= */

:root {
  --navy-950: #060d1a;
  --navy-900: #0A1628;
  --navy-800: #0f2040;
  --navy-700: #162d55;

  --blue-500: #3B82F6;
  --blue-400: #4F8EF7;
  --blue-300: #7EB0FF;

  --purple-500: #8B5CF6;
  --purple-400: #a78bfa;

  --teal-500: #14B8A6;

  --milestone-color: #D97706;
  --milestone-bg: rgba(245, 158, 11, 0.1);
  --milestone-border: rgba(245, 158, 11, 0.3);
  --kpi-color: #6366F1;
  --kpi-bg: rgba(99, 102, 241, 0.1);
  --kpi-border: rgba(99, 102, 241, 0.3);

  --bg: #EEF2F9;
  --surface: #ffffff;
  --surface-2: #F5F7FC;
  --surface-3: #EEF2F9;
  --border: rgba(14, 30, 65, 0.07);
  --border-strong: rgba(14, 30, 65, 0.13);

  --text-primary: #0D1B35;
  --text-secondary: #4A5568;
  --text-tertiary: #8896A8;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 999px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.03);
  --shadow-md: 0 4px 16px rgba(10, 22, 40, 0.07), 0 1px 4px rgba(10, 22, 40, 0.04);
  --shadow-lg: 0 12px 40px rgba(10, 22, 40, 0.11), 0 4px 12px rgba(10, 22, 40, 0.05);
  --shadow-xl: 0 24px 64px rgba(10, 22, 40, 0.14), 0 8px 24px rgba(10, 22, 40, 0.07);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --transition: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font); background: var(--bg); color: var(--text-primary); min-height: 100vh; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: var(--font); border: none; background: none; }
ul { list-style: none; }

/* =============================================
   NAVIGATION
   ============================================= */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1400px; margin: 0 auto; padding: 0 32px;
  height: 60px; display: flex; align-items: center; justify-content: space-between;
}
.nav-brand { display: flex; align-items: center; gap: 10px; }
.nav-name {
  font-size: 18px; font-weight: 700; letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--blue-400), var(--purple-500));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.nav-right { display: flex; align-items: center; gap: 12px; }
.nav-file-name { font-size: 13px; color: var(--text-tertiary); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* =============================================
   BUTTONS
   ============================================= */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 600; border-radius: var(--radius-full);
  transition: all var(--transition); white-space: nowrap;
}
.btn--primary {
  background: linear-gradient(135deg, var(--blue-400), var(--purple-500));
  color: white; padding: 14px 28px; font-size: 15px;
  box-shadow: 0 4px 20px rgba(79, 142, 247, 0.35);
}
.btn--primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 8px 28px rgba(79, 142, 247, 0.45); }
.btn--primary:disabled { opacity: 0.45; cursor: not-allowed; }
.btn--ghost {
  background: transparent; color: var(--text-secondary);
  border: 1px solid var(--border-strong); padding: 7px 16px; font-size: 13px;
}
.btn--ghost:hover { background: var(--surface-2); color: var(--text-primary); }
.btn--danger-ghost { color: #EF4444; border-color: rgba(239,68,68,0.25); }
.btn--danger-ghost:hover { background: rgba(239,68,68,0.06); color: #DC2626; border-color: rgba(239,68,68,0.4); }
.btn--sm { padding: 6px 14px; font-size: 13px; }
.btn--lg { width: 100%; justify-content: center; margin-top: 20px; }
.btn-spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.3); border-top-color: white; border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* =============================================
   FLASH MESSAGES
   ============================================= */
.flash-container { max-width: 800px; margin: 20px auto 0; padding: 0 32px; }
.flash { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--radius-md); font-size: 14px; font-weight: 500; margin-bottom: 8px; }
.flash--error { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }
.flash--success { background: #F0FDF4; color: #166534; border: 1px solid #BBF7D0; }

/* =============================================
   MAIN CONTENT
   ============================================= */
.main-content { min-height: calc(100vh - 60px); }

/* =============================================
   HERO / LANDING
   ============================================= */
.hero {
  min-height: calc(100vh - 60px);
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden; padding: 60px 32px;
}
.hero-bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.hero-orb { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.3; }
.hero-orb--1 { width: 600px; height: 600px; background: radial-gradient(circle, #4F8EF7, transparent); top: -200px; right: -100px; }
.hero-orb--2 { width: 500px; height: 500px; background: radial-gradient(circle, #8B5CF6, transparent); bottom: -150px; left: -100px; }
.hero-orb--3 { width: 300px; height: 300px; background: radial-gradient(circle, #14B8A6, transparent); top: 50%; left: 50%; transform: translate(-50%, -50%); }
.hero-content { position: relative; z-index: 1; text-align: center; max-width: 680px; width: 100%; }
.hero-badge {
  display: inline-block; padding: 6px 16px;
  background: linear-gradient(135deg, rgba(79,142,247,0.1), rgba(139,92,246,0.1));
  border: 1px solid rgba(79,142,247,0.2); border-radius: var(--radius-full);
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--blue-400); margin-bottom: 24px;
}
.hero-title { font-size: clamp(40px, 6vw, 60px); font-weight: 800; letter-spacing: -0.04em; line-height: 1.1; margin-bottom: 20px; }
.hero-title--accent { background: linear-gradient(135deg, var(--blue-400), var(--purple-500)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero-sub { font-size: 17px; color: var(--text-secondary); line-height: 1.7; margin-bottom: 40px; }

/* Upload Card */
.upload-card { background: var(--surface); border-radius: var(--radius-xl); box-shadow: var(--shadow-xl); border: 1px solid var(--border); padding: 28px; text-align: left; margin-bottom: 32px; }
.dropzone { border: 2px dashed var(--border-strong); border-radius: var(--radius-lg); padding: 36px 24px; display: flex; flex-direction: column; align-items: center; gap: 12px; cursor: pointer; transition: all var(--transition); background: var(--surface-2); position: relative; }
.dropzone:hover, .dropzone--active { border-color: var(--blue-400); background: rgba(79,142,247,0.04); }
.dropzone-icon { color: var(--blue-400); opacity: 0.8; }
.dropzone-primary { display: block; font-size: 15px; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.dropzone-secondary { display: block; font-size: 13px; color: var(--text-tertiary); }
.dropzone-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; display: none; }
.file-preview { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px 16px; background: var(--surface-2); }
.file-preview-inner { display: flex; align-items: center; gap: 10px; }
.file-name { flex: 1; font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-remove { color: var(--text-tertiary); font-size: 12px; padding: 4px 8px; border-radius: var(--radius-sm); transition: all var(--transition); }
.file-remove:hover { background: #FEF2F2; color: #EF4444; }
.upload-hint { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border); }
.hint-cols { display: flex; gap: 24px; align-items: flex-start; }
.hint-col { flex: 1; }
.hint-divider { width: 1px; background: var(--border); align-self: stretch; }
.hint-label { display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-tertiary); margin-bottom: 10px; }
.hint-list { display: flex; flex-direction: column; gap: 6px; }
.hint-list li { font-size: 13px; color: var(--text-secondary); display: flex; align-items: center; gap: 8px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: var(--radius-full); font-size: 11px; font-weight: 600; }
.badge--milestone { background: var(--milestone-bg); color: var(--milestone-color); }
.badge--kpi { background: var(--kpi-bg); color: var(--kpi-color); }
.feature-row { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.feature-item { display: flex; align-items: center; gap: 10px; padding: 10px 18px; background: rgba(255,255,255,0.7); backdrop-filter: blur(10px); border: 1px solid var(--border); border-radius: var(--radius-full); font-size: 13px; font-weight: 500; color: var(--text-secondary); }
.feature-icon { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.feature-icon--blue { background: rgba(79,142,247,0.1); color: var(--blue-400); }
.feature-icon--purple { background: rgba(139,92,246,0.1); color: var(--purple-500); }
.feature-icon--teal { background: rgba(20,184,166,0.1); color: var(--teal-500); }

/* =============================================
   DASHBOARD LAYOUT
   ============================================= */
.dashboard { max-width: 1400px; margin: 0 auto; padding: 28px 32px 60px; }

/* Stats Bar */
.stats-bar {
  background: var(--navy-900); border-radius: var(--radius-xl); padding: 22px 36px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px; box-shadow: var(--shadow-lg);
}
.stat-card { flex: 1; text-align: center; padding: 0 24px; }
.stat-value {
  font-size: 40px; font-weight: 800; letter-spacing: -0.04em; color: white;
  line-height: 1; margin-bottom: 4px;
  background: linear-gradient(135deg, #fff, rgba(255,255,255,0.7));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.stat-label { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255,255,255,0.35); }
.stat-divider { width: 1px; height: 44px; background: rgba(255,255,255,0.1); }

/* =============================================
   CONTROL BAR
   ============================================= */
.control-bar {
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 14px 20px; margin-bottom: 20px; box-shadow: var(--shadow-sm);
}
.control-group { display: flex; align-items: center; gap: 10px; }
.control-group--right { margin-left: auto; }
.control-label { font-size: 11px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-tertiary); white-space: nowrap; }

.toggle-pill {
  display: flex; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-full); padding: 3px; gap: 2px;
}
.toggle-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: var(--radius-full);
  font-size: 13px; font-weight: 600; color: var(--text-secondary);
  transition: all var(--transition);
}
.toggle-btn:hover { color: var(--text-primary); }
.toggle-btn--active {
  background: var(--navy-900); color: white;
  box-shadow: 0 2px 8px rgba(10,22,40,0.2);
}

.search-bar { display: flex; align-items: center; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-full); padding: 7px 14px; gap: 7px; transition: all var(--transition); min-width: 180px; }
.search-bar:focus-within { border-color: var(--blue-400); box-shadow: 0 0 0 3px rgba(79,142,247,0.1); background: var(--surface); }
.search-icon { color: var(--text-tertiary); flex-shrink: 0; }
.search-input { border: none; outline: none; background: none; font-size: 13px; font-family: var(--font); color: var(--text-primary); width: 100%; }
.search-input::placeholder { color: var(--text-tertiary); }

/* Legend */
.legend-bar { display: flex; align-items: center; gap: 20px; margin-bottom: 20px; padding: 0 4px; }
.legend-item { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-tertiary); }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; }
.legend-dot--milestone { background: var(--milestone-color); box-shadow: 0 0 0 3px var(--milestone-bg); }
.legend-dot--kpi { background: var(--kpi-color); border-radius: 2px; box-shadow: 0 0 0 3px var(--kpi-bg); }

/* =============================================
   TIMELINE VIEW
   ============================================= */
.timeline-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

/* Rendered by JS */
.tl-header {
  background: var(--navy-900);
  padding: 0 0 0 220px;
  display: flex;
  position: relative;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.tl-axis {
  flex: 1;
  position: relative;
  height: 52px;
  min-width: 0;
}
.tl-month-label {
  position: absolute;
  bottom: 6px;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 500;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.04em;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
}
.tl-quarter-label {
  position: absolute;
  top: 8px;
  transform: translateX(3px); /* left-align just after the grid line */
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
}
.tl-year-label {
  position: absolute;
  top: 8px;
  transform: translateX(3px);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.85);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
}
.tl-grid-line {
  position: absolute;
  top: 0; bottom: 0;
  width: 1px;
  background: rgba(255,255,255,0.05);
  pointer-events: none;
}
.tl-grid-line--quarter {
  background: rgba(255,255,255,0.14);
}
.tl-grid-col--quarter {
  background: transparent;
  border-left: 1px dashed rgba(79,142,247,0.25);
  z-index: 2;
}

.tl-body { overflow-x: auto; }

.tl-lane {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--border);
  min-height: 72px;
  transition: background var(--transition);
}
.tl-lane:last-child { border-bottom: none; }
.tl-lane:hover { background: var(--surface-2); }
.tl-lane[data-hidden="true"] { display: none; }

.tl-lane-label {
  width: 220px;
  min-width: 220px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-right: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  left: 0;
  z-index: 2;
}
.tl-avatar {
  width: 36px; height: 36px; border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--blue-400), var(--purple-500));
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: white; flex-shrink: 0;
}
.tl-avatar--project {
  background: linear-gradient(135deg, var(--teal-500), var(--blue-400));
}
.tl-label-text { flex: 1; min-width: 0; }
.tl-label-name { font-size: 13px; font-weight: 700; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-label-sub { font-size: 11px; color: var(--text-tertiary); margin-top: 1px; }

.tl-lane-track {
  flex: 1;
  position: relative;
  min-height: 72px;
  padding: 10px 0;
}

.tl-grid-col {
  position: absolute;
  top: 0; bottom: 0;
  width: 1px;
  background: var(--border);
  pointer-events: none;
}
/* Weekly lines — very faint, dashed */
.tl-grid-col--week {
  background: transparent;
  border-left: 1px dashed rgba(0,0,0,0.07);
  z-index: 0;
}
/* Month lines — slightly stronger */
.tl-grid-col--month {
  background: rgba(0,0,0,0.09);
  z-index: 1;
}

/* Milestone marker on timeline */
.tl-milestone {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  cursor: pointer;
}
.tl-milestone-pin {
  width: 14px; height: 14px;
  background: var(--milestone-color);
  border: 2px solid white;
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--milestone-bg), 0 2px 8px rgba(0,0,0,0.15);
  transition: transform var(--transition);
  margin: 0 auto;
}
.tl-milestone:hover .tl-milestone-pin { transform: scale(1.4); }

.tl-milestone-tooltip {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--navy-900);
  color: white;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none; /* tooltip is info-only; click the pin to act */
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 10;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255,255,255,0.08);
}
.tl-milestone-tooltip::after {
  content: '';
  position: absolute;
  bottom: 100%; left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-bottom-color: var(--navy-900);
}
.tl-milestone:hover .tl-milestone-tooltip { opacity: 1; }
.tl-milestone-tooltip-title { font-weight: 700; margin-bottom: 3px; }
.tl-milestone-tooltip-date  { color: var(--milestone-color); font-size: 11px; }
.tl-milestone-tooltip-proj  { color: rgba(255,255,255,0.5); font-size: 11px; margin-top: 2px; }
.tl-tooltip-hint {
  display: flex; align-items: center; gap: 5px;
  margin-top: 8px; padding-top: 7px;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 10px; color: rgba(255,255,255,0.45);
  font-weight: 500; letter-spacing: 0.02em;
}
/* Delete btn inside tooltip — needs pointer-events */
.tl-milestone-tooltip .tl-delete-btn {
  pointer-events: auto;
  display: flex; align-items: center; gap: 4px;
  margin-top: 6px; padding: 3px 8px;
  border-radius: 4px; font-size: 10px; font-weight: 600;
  color: rgba(255,255,255,0.5); background: rgba(239,68,68,0.12);
  transition: all var(--transition); width: 100%; justify-content: center;
}
.tl-milestone-tooltip .tl-delete-btn:hover { background: rgba(239,68,68,0.3); color: #fff; }
/* Allow pointer-events on tooltip when it contains interactive elements */
.tl-milestone-tooltip:has(.tl-delete-btn) { pointer-events: auto; }
.tl-milestone:hover .tl-milestone-pin { transform: scale(1.35); cursor: pointer; }

/* KPI panel at bottom of timeline */
.tl-kpi-lane {
  background: var(--surface-2);
  border-top: 2px solid var(--kpi-border);
}
.tl-kpi-strip {
  flex: 1;
  padding: 10px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.tl-kpi-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: var(--kpi-bg);
  border: 1px solid var(--kpi-border);
  min-width: 0;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
  color: var(--kpi-color);
  white-space: nowrap;
}
.tl-kpi-chip-name { color: var(--text-secondary); }
.tl-kpi-chip-sep { color: var(--text-tertiary); }
.tl-kpi-chip-val { font-weight: 700; }

/* Today marker */
.tl-today-line {
  position: absolute;
  top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, #EF4444, rgba(239,68,68,0.2));
  z-index: 4;
  pointer-events: none;
}
.tl-today-badge {
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  background: #EF4444;
  color: white;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  white-space: nowrap;
  letter-spacing: 0.05em;
}

/* Empty timeline */
.tl-empty { padding: 60px; text-align: center; color: var(--text-tertiary); font-size: 14px; }

/* =============================================
   TIMELINE — LEADER TABLE LAYOUT (rowspan)
   ============================================= */
.tl-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

/* Leader column (merged / rowspan) */
.tl-td-leader {
  width: 120px;
  min-width: 120px;
  vertical-align: middle;
  background: var(--surface);
  border-right: 1px solid var(--border-strong);
  border-bottom: 2px solid var(--border-strong);
  position: sticky;
  left: 0;
  z-index: 3;
  padding: 0;
}
.tl-leader-cell-inner {
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  height: 100%;
}
.tl-leader-avatar {
  width: 38px; height: 38px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--blue-400), var(--purple-500));
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: white; flex-shrink: 0;
}
.tl-leader-cell-name {
  font-size: 12px; font-weight: 700;
  color: var(--text-primary);
  word-break: break-word;
  line-height: 1.3;
}
.tl-leader-cell-sub {
  font-size: 10px; color: var(--text-tertiary);
  font-weight: 500;
}

/* Project column */
.tl-td-project {
  width: 180px;
  min-width: 180px;
  vertical-align: middle;
  background: var(--surface);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  position: sticky;
  left: 120px;
  z-index: 2;
  padding: 0;
}
.tl-td-project--kpi {
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.tl-proj-cell-inner {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 9px;
}
.tl-proj-cell-inner--kpi {
  padding: 8px 14px;
  gap: 6px;
}
.tl-proj-avatar {
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--teal-500), var(--blue-400));
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: white; flex-shrink: 0;
}
.tl-proj-icon--kpi {
  width: 24px; height: 24px;
  border-radius: var(--radius-sm);
  background: var(--kpi-bg);
  border: 1px solid var(--kpi-border);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; flex-shrink: 0;
}
.tl-proj-label-name {
  font-size: 12px; font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 110px;
}
.tl-kpi-col-label {
  font-size: 10px; font-weight: 600;
  color: var(--kpi-color);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.8;
}

/* Track column (the actual timeline area) */
.tl-td-track {
  padding: 0;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.tl-td-track--kpi {
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

/* Table row hover */
.tl-tr:hover .tl-td-project { background: var(--surface-2); }
.tl-tr:hover .tl-td-track { background: rgba(79,142,247,0.02); }
.tl-tr--kpi:hover .tl-td-project--kpi { background: rgba(99,102,241,0.06); }
.tl-tr--kpi:hover .tl-td-track--kpi { background: rgba(99,102,241,0.04); }

/* Leader separator row */
.tl-tr--leader-sep td {
  border-bottom: 2px solid var(--border-strong) !important;
}

/* KPI rightmost column */
.tl-td-kpi {
  width: 220px;
  min-width: 220px;
  max-width: 260px;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
  border-left: 2px solid var(--kpi-border);
  background: linear-gradient(135deg, rgba(99,102,241,0.04), rgba(99,102,241,0.08));
  padding: 10px 12px;
  position: sticky;
  right: 0;
  z-index: 2;
}
.tl-kpi-col-strip {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tl-kpi-col-strip .tl-kpi-chip {
  font-size: 11px;
  max-width: 100%;
  overflow: hidden;
}
.tl-kpi-col-strip .tl-kpi-chip-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex-shrink: 1;
}
.tl-kpi-col-strip .tl-kpi-chip-val {
  white-space: nowrap;
  flex-shrink: 0;
}
.tl-kpi-col-empty {
  font-size: 13px;
  color: var(--border-strong);
  display: block;
  text-align: center;
}
.tl-tr:hover .tl-td-kpi {
  background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(99,102,241,0.14));
}

/* =============================================
   SWIMLANE VIEW
   ============================================= */
.swimlane-scroll {
  overflow-x: auto;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}
.swimlane-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  min-width: 900px;
}
.swim-th {
  padding: 14px 16px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: left;
  white-space: nowrap;
  background: var(--navy-900);
  color: rgba(255,255,255,0.55);
  border-right: 1px solid rgba(255,255,255,0.07);
  position: sticky;
  top: 0;
  z-index: 3;
}
.swim-th:last-child { border-right: none; }
.swim-th--label { width: 200px; min-width: 200px; color: rgba(255,255,255,0.4); position: sticky; left: 0; z-index: 4; background: var(--navy-800); }
.swim-th--quarter { min-width: 200px; color: rgba(255,255,255,0.7); }
.swim-th--kpi { min-width: 220px; color: rgba(160,140,255,0.85); background: rgba(99,102,241,0.08); }

.swim-row { border-bottom: 1px solid var(--border); }
.swim-row:last-child { border-bottom: none; }
.swim-row:hover .swim-td:not(.swim-td--label) { background: var(--surface-2); }
.swim-row[data-hidden="true"] { display: none; }

.swim-td {
  padding: 14px 16px;
  vertical-align: top;
  border-right: 1px solid var(--border);
}
.swim-td:last-child { border-right: none; }
.swim-td--label {
  position: sticky; left: 0; z-index: 2;
  background: var(--surface);
  border-right: 2px solid var(--border-strong);
  width: 200px; min-width: 200px;
}
.swim-row:hover .swim-td--label { background: var(--surface); }
.swim-td--quarter { min-width: 200px; }
.swim-td--kpi { background: rgba(99,102,241,0.03); min-width: 220px; }

.swim-label-inner { display: flex; align-items: center; gap: 10px; }
.swim-avatar {
  width: 34px; height: 34px; border-radius: var(--radius-md); flex-shrink: 0;
  background: linear-gradient(135deg, var(--blue-400), var(--purple-500));
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: white;
}
.swim-avatar--project {
  background: linear-gradient(135deg, var(--teal-500), var(--blue-400));
  color: white;
}
.swim-name { font-size: 13px; font-weight: 700; color: var(--text-primary); line-height: 1.3; }

/* Swimlane cards */
.swim-card {
  padding: 9px 11px;
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: default;
}
.swim-card:last-child { margin-bottom: 0; }
.swim-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }

.swim-card--milestone {
  background: linear-gradient(135deg, rgba(245,158,11,0.06), rgba(245,158,11,0.12));
  border: 1px solid var(--milestone-border);
}
.swim-card--kpi {
  background: linear-gradient(135deg, rgba(99,102,241,0.06), rgba(99,102,241,0.12));
  border: 1px solid var(--kpi-border);
}

.swim-card-title { font-size: 12px; font-weight: 600; color: var(--text-primary); line-height: 1.4; margin-bottom: 4px; }
.swim-card-meta { display: flex; align-items: center; gap: 6px; }
.swim-date {
  font-size: 11px; font-weight: 700;
  color: var(--milestone-color);
  background: var(--milestone-bg);
  padding: 1px 7px; border-radius: var(--radius-full);
}
.swim-value {
  font-size: 11px; font-weight: 700;
  color: var(--kpi-color);
  background: var(--kpi-bg);
  padding: 1px 7px; border-radius: var(--radius-full);
}
.swim-card-proj { font-size: 10px; color: var(--text-tertiary); margin-top: 4px; }

/* Empty cell placeholder */
.swim-td--quarter:empty::after {
  content: '—';
  font-size: 13px;
  color: var(--border-strong);
  display: block;
  text-align: center;
  padding: 16px 0;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 900px) {
  .nav-inner { padding: 0 16px; }
  .dashboard { padding: 16px 12px 40px; }
  .stats-bar { padding: 16px 16px; }
  .stat-value { font-size: 28px; }
  .stat-card { padding: 0 10px; }
  .control-bar { gap: 12px; padding: 12px 16px; }
  .control-group--right { margin-left: 0; width: 100%; }
  .search-bar { width: 100%; }
  .tl-lane-label { width: 160px; min-width: 160px; }
  .tl-header { padding-left: 160px; }
}
@media (max-width: 600px) {
  .hero { padding: 40px 16px; }
  .hint-cols { flex-direction: column; }
  .hint-divider { display: none; }
  .feature-row { display: none; }
  .stat-divider { height: 28px; }
}

/* =============================================
   NAV USER PILL
   ============================================= */
.nav-user {
  display: flex; align-items: center; gap: 10px;
}
.nav-user-pill {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 12px 4px 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
}
.nav-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-400), var(--purple-500));
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: white; flex-shrink: 0;
}
.nav-user-info { display: flex; flex-direction: column; line-height: 1.2; }
.nav-user-name { font-size: 12px; font-weight: 600; color: var(--text-primary); }
.nav-role-badge {
  font-size: 10px; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase; padding: 1px 6px; border-radius: var(--radius-full);
}
.nav-role-badge--admin { background: rgba(79,142,247,0.12); color: var(--blue-400); }
.nav-role-badge--member { background: rgba(20,184,166,0.12); color: var(--teal-500); }

.nav-manage-link {
  display: flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 600; color: var(--text-tertiary);
  padding: 5px 10px; border-radius: var(--radius-full);
  border: 1px solid var(--border); background: var(--surface-2);
  transition: all var(--transition);
}
.nav-manage-link:hover { color: var(--text-primary); background: var(--surface); }

/* =============================================
   ROLE BADGES (shared)
   ============================================= */
.role-badge {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase; padding: 3px 10px; border-radius: var(--radius-full);
  white-space: nowrap;
}
.role-badge--admin { background: rgba(79,142,247,0.12); color: var(--blue-400); border: 1px solid rgba(79,142,247,0.2); }
.role-badge--member { background: rgba(20,184,166,0.12); color: var(--teal-500); border: 1px solid rgba(20,184,166,0.2); }

/* =============================================
   LOGIN PAGE
   ============================================= */
.login-page {
  min-height: calc(100vh - 60px);
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden; padding: 40px 16px;
}
.login-bg { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.login-wrap { position: relative; z-index: 1; width: 100%; max-width: 420px; }
.login-card {
  background: var(--surface); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl); border: 1px solid var(--border); padding: 40px;
}
.login-header { text-align: center; margin-bottom: 32px; }
.login-logo {
  width: 56px; height: 56px; border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(79,142,247,0.1), rgba(139,92,246,0.1));
  border: 1px solid rgba(79,142,247,0.2);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
}
.login-title { font-size: 24px; font-weight: 800; letter-spacing: -0.03em; color: var(--text-primary); margin-bottom: 4px; }
.login-sub { font-size: 13px; color: var(--text-tertiary); }

.login-form { display: flex; flex-direction: column; gap: 16px; }

/* Form fields */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 12px; font-weight: 700; letter-spacing: 0.04em; color: var(--text-secondary); text-transform: uppercase; }
.field-input-wrap { position: relative; }
.field-input {
  width: 100%; padding: 10px 14px; font-size: 14px; font-family: var(--font);
  color: var(--text-primary); background: var(--surface-2);
  border: 1px solid var(--border-strong); border-radius: var(--radius-md);
  outline: none; transition: all var(--transition);
}
.field-input-wrap .field-input { padding-right: 40px; }
.field-input:focus { border-color: var(--blue-400); background: var(--surface); box-shadow: 0 0 0 3px rgba(79,142,247,0.1); }
.field-input::placeholder { color: var(--text-tertiary); }
.field-select { appearance: none; cursor: pointer; }
.field-eye {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-tertiary); padding: 4px; transition: color var(--transition);
}
.field-eye:hover { color: var(--text-primary); }

.btn--login { width: 100%; justify-content: center; margin-top: 4px; padding: 12px 24px; font-size: 14px; }

.login-roles {
  margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 10px;
}
.role-item { display: flex; align-items: center; gap: 10px; }
.role-desc { font-size: 12px; color: var(--text-tertiary); }

/* =============================================
   ADMIN PAGE
   ============================================= */
.admin-page { max-width: 1100px; margin: 0 auto; padding: 32px; }
.admin-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 28px; }
.admin-title { font-size: 24px; font-weight: 800; letter-spacing: -0.03em; color: var(--text-primary); margin-bottom: 4px; }
.admin-sub { font-size: 14px; color: var(--text-tertiary); }

.admin-grid { display: grid; grid-template-columns: 1fr 380px; gap: 20px; }
@media (max-width: 800px) { .admin-grid { grid-template-columns: 1fr; } }

.admin-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-xl); box-shadow: var(--shadow-md); overflow: hidden;
}
.admin-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.admin-card-title { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.admin-count {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--navy-900); color: white;
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

.user-list { padding: 8px; }
.user-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius-md);
  transition: background var(--transition);
}
.user-row:hover { background: var(--surface-2); }
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--blue-400), var(--purple-500));
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: white;
}
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.user-username { font-size: 11px; color: var(--text-tertiary); margin-top: 1px; }
.user-actions { display: flex; gap: 4px; }
.icon-btn {
  width: 30px; height: 30px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-tertiary); transition: all var(--transition);
}
.icon-btn:hover { background: var(--surface-3); color: var(--text-primary); }
.icon-btn--danger:hover { background: #FEF2F2; color: #EF4444; }

.add-user-form { padding: 20px; display: flex; flex-direction: column; gap: 14px; }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(10,22,40,0.5);
  z-index: 200; display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-card {
  background: var(--surface); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl); border: 1px solid var(--border);
  padding: 28px; width: 100%; max-width: 380px;
}
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.modal-title { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.modal-close { color: var(--text-tertiary); font-size: 14px; padding: 4px 8px; border-radius: var(--radius-sm); transition: all var(--transition); }
.modal-close:hover { background: var(--surface-2); color: var(--text-primary); }
.modal-sub { font-size: 13px; color: var(--text-tertiary); }
.modal-card--wide { max-width: 560px; padding: 28px; }

/* =============================================
   SWIM CARD UPDATES (actions)
   ============================================= */
.swim-card { position: relative; flex-direction: column; gap: 0; padding: 0; overflow: hidden; }
.swim-card-inner { padding: 8px 10px; flex: 1; }
.swim-card-actions {
  display: flex; align-items: center; gap: 4px;
  padding: 4px 8px 5px;
  border-top: 1px solid rgba(0,0,0,0.06);
  background: rgba(0,0,0,0.02);
  opacity: 0;
  transition: opacity var(--transition);
}
.swim-card:hover .swim-card-actions { opacity: 1; }
.swim-comment-btn, .swim-delete-btn {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 6px; border-radius: 4px; font-size: 10px; font-weight: 600;
  color: var(--text-tertiary); transition: all var(--transition);
}
.swim-comment-btn:hover { background: rgba(79,142,247,0.1); color: var(--blue-400); }
.swim-delete-btn:hover  { background: rgba(239,68,68,0.1);  color: #EF4444; }
.swim-comment-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 14px; height: 14px; border-radius: 7px;
  background: var(--blue-400); color: white; font-size: 9px; font-weight: 700;
  padding: 0 3px;
}

/* =============================================
   TIMELINE TOOLTIP ACTIONS
   ============================================= */
.tl-tooltip-actions {
  display: flex; gap: 6px; margin-top: 8px; padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.tl-comment-btn, .tl-delete-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 5px; font-size: 10px; font-weight: 600;
  color: rgba(255,255,255,0.7); background: rgba(255,255,255,0.1);
  transition: all var(--transition); white-space: nowrap;
}
.tl-comment-btn:hover { background: rgba(79,142,247,0.3); color: #fff; }
.tl-delete-btn:hover  { background: rgba(239,68,68,0.3);  color: #fff; }
.tl-comment-dot {
  position: absolute; top: -6px; right: -6px;
  min-width: 16px; height: 16px; border-radius: 8px;
  background: var(--blue-400); color: white;
  font-size: 9px; font-weight: 700; display: flex; align-items: center; justify-content: center;
  padding: 0 4px; border: 2px solid white; pointer-events: none;
}
.tl-milestone-pin--manual { border-color: var(--blue-400); background: white; }
.tl-milestone-pin--manual::after { background: var(--blue-400); }
.tl-kpi-chip { align-items: center; gap: 4px; cursor: pointer; }
.tl-kpi-chip:hover { background: var(--kpi-bg); border-color: var(--kpi-color); }
.tl-kpi-chip-icon { color: var(--text-tertiary); flex-shrink: 0; opacity: 0; transition: opacity var(--transition); }
.tl-kpi-chip:hover .tl-kpi-chip-icon { opacity: 1; }
.tl-kpi-comment-count--inline {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 14px; height: 14px; border-radius: 7px;
  background: var(--kpi-color); color: white; font-size: 9px; font-weight: 700; padding: 0 3px;
}
.tl-kpi-comment-btn {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 5px; border-radius: 4px; font-size: 10px;
  color: var(--text-tertiary); transition: all var(--transition);
  margin-left: 2px;
}
.tl-kpi-comment-btn:hover { background: rgba(79,142,247,0.1); color: var(--blue-400); }
.tl-kpi-comment-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 13px; height: 13px; border-radius: 7px;
  background: var(--blue-400); color: white; font-size: 9px; font-weight: 700;
  padding: 0 2px;
}
.tl-kpi-delete-btn {
  display: inline-flex; align-items: center; padding: 2px 5px;
  border-radius: 4px; color: var(--text-tertiary); transition: all var(--transition);
}
.tl-kpi-delete-btn:hover { background: rgba(239,68,68,0.1); color: #EF4444; }

/* =============================================
   COMMENT PANEL (slide-over)
   ============================================= */
.cp-overlay {
  position: fixed; inset: 0; background: rgba(10,22,40,0.35);
  z-index: 300; opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease;
}
.cp-overlay--visible { opacity: 1; pointer-events: auto; }

.cp-panel {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 400px; max-width: 100vw;
  background: var(--surface);
  box-shadow: -8px 0 40px rgba(10,22,40,0.12);
  border-left: 1px solid var(--border);
  z-index: 301;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  display: flex; flex-direction: column;
}
.cp-panel--open { transform: translateX(0); }

.cp-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 20px 20px 14px; border-bottom: 1px solid var(--border);
  background: var(--surface-2); gap: 12px;
}
.cp-header-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.cp-type-badge {
  display: inline-flex; align-items: center;
  font-size: 10px; font-weight: 800; letter-spacing: 0.06em;
  text-transform: uppercase; padding: 2px 8px; border-radius: var(--radius-full);
  width: fit-content;
}
.cp-type-badge--milestone { background: var(--milestone-bg); color: var(--milestone-color); border: 1px solid var(--milestone-border); }
.cp-type-badge--kpi       { background: var(--kpi-bg);       color: var(--kpi-color);       border: 1px solid var(--kpi-border); }
.cp-title {
  font-size: 15px; font-weight: 700; color: var(--text-primary);
  line-height: 1.35; word-break: break-word;
}
.cp-close {
  width: 30px; height: 30px; border-radius: var(--radius-sm); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-tertiary); transition: all var(--transition); margin-top: -2px;
}
.cp-close:hover { background: var(--surface-3); color: var(--text-primary); }

.cp-meta-row {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 12px 20px; border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.cp-meta-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 500; color: var(--text-secondary);
  background: var(--surface); border: 1px solid var(--border);
  padding: 3px 10px; border-radius: var(--radius-full);
}
.cp-meta-chip--target { background: rgba(79,142,247,0.05); border-color: rgba(79,142,247,0.2); color: var(--blue-400); font-weight: 600; }
.cp-meta-chip--manual { background: rgba(139,92,246,0.07); border-color: rgba(139,92,246,0.2); color: var(--purple-500); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }

.cp-thread {
  flex: 1; overflow-y: auto; padding: 16px 20px;
  display: flex; flex-direction: column; gap: 16px;
}
.cp-loading, .cp-empty {
  font-size: 13px; color: var(--text-tertiary);
  text-align: center; padding: 32px 0; line-height: 1.6;
}

.cp-comment { display: flex; gap: 10px; align-items: flex-start; }
.cp-comment-avatar {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--blue-400), var(--purple-500));
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: white;
}
.cp-comment-body { flex: 1; min-width: 0; }
.cp-comment-header {
  display: flex; align-items: center; gap: 8px; margin-bottom: 5px; flex-wrap: wrap;
}
.cp-comment-author { font-size: 12px; font-weight: 700; color: var(--text-primary); }
.cp-comment-time   { font-size: 11px; color: var(--text-tertiary); }
.cp-comment-delete {
  margin-left: auto; display: flex; align-items: center; padding: 2px 5px;
  border-radius: 4px; color: var(--text-tertiary); transition: all var(--transition);
}
.cp-comment-delete:hover { background: rgba(239,68,68,0.1); color: #EF4444; }
.cp-comment-text {
  font-size: 13px; color: var(--text-secondary); line-height: 1.6;
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 10px 12px; border-radius: 0 var(--radius-md) var(--radius-md) var(--radius-md);
  word-break: break-word;
}

.cp-compose {
  padding: 14px 20px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}
.cp-textarea {
  width: 100%; padding: 10px 12px; font-size: 13px; font-family: var(--font);
  color: var(--text-primary); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-md);
  resize: none; outline: none; transition: border-color var(--transition);
  line-height: 1.5;
}
.cp-textarea:focus { border-color: var(--blue-400); box-shadow: 0 0 0 3px rgba(79,142,247,0.1); }
.cp-compose-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 10px;
}
.cp-compose-hint { font-size: 11px; color: var(--text-tertiary); }

/* =============================================
   ADD ITEM MODAL
   ============================================= */
.add-item-tabs {
  display: flex; gap: 6px; margin-bottom: 20px;
  padding: 4px; background: var(--surface-2);
  border-radius: var(--radius-md); border: 1px solid var(--border);
}
.add-tab {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; color: var(--text-tertiary);
  transition: all var(--transition);
}
.add-tab--active { background: var(--surface); color: var(--text-primary); box-shadow: var(--shadow-sm); }
.add-item-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.add-item-form { display: flex; flex-direction: column; gap: 14px; }
.add-item-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.req { color: #EF4444; font-weight: 700; }

/* =============================================
   FAB BUTTON
   ============================================= */
.fab {
  position: fixed; bottom: 32px; right: 32px; z-index: 100;
  width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-400), var(--purple-500));
  color: white; box-shadow: 0 8px 24px rgba(79,142,247,0.4);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition); cursor: pointer;
}
.fab:hover { transform: scale(1.08); box-shadow: 0 12px 32px rgba(79,142,247,0.5); }
.fab:active { transform: scale(0.97); }

/* =============================================
   TOAST NOTIFICATIONS
   ============================================= */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(12px);
  display: flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--radius-full);
  font-size: 13px; font-weight: 600; color: white;
  opacity: 0; transition: all 0.3s ease; z-index: 500;
  pointer-events: none; white-space: nowrap;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}
.toast--success { background: #10B981; }
.toast--error   { background: #EF4444; }
.toast--visible { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 640px) {
  .cp-panel { width: 100vw; }
  .add-item-row { grid-template-columns: 1fr; }
  .fab { bottom: 20px; right: 20px; width: 46px; height: 46px; }
}

/* =============================================
   TIMELINE — LEADER SECTION HEADER
   ============================================= */
.tl-leader-hdr {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0;
  margin-top: 10px;
  height: 36px;
}
.tl-leader-hdr-label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px 0 16px;
  width: 220px;
  min-width: 220px;
  background: var(--navy-900);
  height: 100%;
  border-right: 1px solid rgba(255,255,255,0.1);
}
.tl-leader-hdr-name {
  font-size: 13px;
  font-weight: 800;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tl-leader-hdr-meta {
  font-size: 10px;
  color: rgba(255,255,255,0.4);
  white-space: nowrap;
  margin-left: auto;
  letter-spacing: 0.02em;
}
.tl-leader-hdr-rule {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(79,142,247,0.4), transparent);
  margin-top: 1px;
}

/* Project sub-row label */
.tl-lane--project .tl-lane-label {
  padding-left: 36px; /* indent under leader */
}
.tl-lane-label--project { background: var(--surface-2); }
.tl-proj-icon {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--surface-3, rgba(79,142,247,0.08));
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: var(--text-tertiary);
}

/* =============================================
   WEEK GRID VIEW
   ============================================= */
.wg-wrap { padding: 0 0 40px; }
.wg-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.wg-table {
  border-collapse: collapse;
  width: max-content;
  min-width: 100%;
  font-family: var(--font);
}

/* Header */
.wg-th {
  background: var(--navy-900);
  color: rgba(255,255,255,0.7);
  font-size: 11px;
  font-weight: 700;
  padding: 0;
  border-right: 1px solid rgba(255,255,255,0.07);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 10;
}
.wg-th--label {
  text-align: left;
  padding: 10px 16px;
  min-width: 200px;
  width: 200px;
  position: sticky;
  left: 0;
  z-index: 20;
  background: var(--navy-900);
  border-right: 2px solid rgba(255,255,255,0.12);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.4);
}
.wg-th--week {
  min-width: 110px;
  width: 110px;
  text-align: center;
}
.wg-th--current { background: rgba(79,142,247,0.15); }
.wg-th--kpi {
  min-width: 180px;
  text-align: left;
  padding: 10px 12px;
  border-left: 2px solid rgba(99,102,241,0.25);
  background: rgba(99,102,241,0.06);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(99,102,241,0.7);
}

.wg-week-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 6px;
  gap: 2px;
}
.wg-week-month { font-size: 10px; color: rgba(255,255,255,0.4); text-transform: uppercase; letter-spacing: 0.06em; }
.wg-week-dates { font-size: 12px; font-weight: 700; color: rgba(255,255,255,0.85); }
.wg-now-badge {
  font-size: 9px; font-weight: 800; letter-spacing: 0.08em;
  background: var(--blue-400); color: white;
  padding: 1px 6px; border-radius: 10px; margin-top: 2px;
  text-transform: uppercase;
}

/* Rows */
.wg-row { border-bottom: 1px solid var(--border); }
.wg-row[data-hidden="true"] { display: none; }
.wg-row:hover .wg-td { background: rgba(79,142,247,0.03); }

.wg-td {
  vertical-align: top;
  padding: 8px 6px;
  border-right: 1px solid var(--border);
  min-height: 56px;
}
.wg-td--label {
  padding: 8px 12px;
  background: var(--surface);
  position: sticky;
  left: 0;
  z-index: 5;
  border-right: 2px solid var(--border-strong);
}
.wg-td--current { background: rgba(79,142,247,0.04); }
.wg-td--kpi {
  border-left: 2px solid rgba(99,102,241,0.15);
  background: rgba(99,102,241,0.02);
  vertical-align: top;
  padding: 8px 10px;
}

.wg-label-inner { display: flex; align-items: center; gap: 10px; }
.wg-avatar {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--blue-400), var(--purple-500));
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: white;
}
.wg-avatar--project {
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(79,142,247,0.1), rgba(139,92,246,0.1));
  border: 1px solid var(--border);
  color: var(--text-tertiary);
}
.wg-label-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }

/* Chips inside cells */
.wg-chip {
  margin-bottom: 5px;
  padding: 6px 9px;
  border-radius: var(--radius-md);
  font-size: 11px;
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid transparent;
}
.wg-chip:last-child { margin-bottom: 0; }
.wg-chip--milestone {
  background: var(--milestone-bg);
  border-color: var(--milestone-border);
  color: var(--milestone-color);
}
.wg-chip--milestone:hover { background: rgba(245,158,11,0.18); border-color: var(--milestone-color); }
.wg-chip--kpi {
  background: var(--kpi-bg);
  border-color: var(--kpi-border);
  color: var(--kpi-color);
}
.wg-chip--kpi:hover { background: rgba(99,102,241,0.18); border-color: var(--kpi-color); }

.wg-chip-title { font-weight: 700; font-size: 11px; line-height: 1.3; }
.wg-chip-date  { font-size: 10px; opacity: 0.7; margin-top: 2px; }
.wg-chip-val   { font-size: 10px; opacity: 0.7; margin-top: 2px; }
.wg-chip-comment { font-size: 10px; margin-top: 3px; opacity: 0.6; }

/* =============================================
   ANALYTICS VIEW
   ============================================= */
#analyticsWrap { padding: 28px 0 60px; }

.an-grid {
  display: grid;
  grid-template-columns: 340px 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 20px;
}

/* Card base */
.an-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.an-card-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.an-card-count {
  background: var(--surface-3);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  text-transform: none;
  letter-spacing: 0;
}

/* Donut card */
.an-card--donut { grid-row: 1; grid-column: 1; }
.an-donut-wrap { display: flex; align-items: center; gap: 24px; }
.an-donut-svg { width: 120px; height: 120px; flex-shrink: 0; }
.an-donut-num {
  font-size: 18px;
  font-weight: 800;
  fill: var(--text-primary);
  font-family: var(--font);
}
.an-donut-label {
  font-size: 9px;
  fill: var(--text-tertiary);
  font-family: var(--font);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.an-legend { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.an-legend-row { display: flex; align-items: center; gap: 8px; }
.an-legend-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.an-legend-name { font-size: 12px; color: var(--text-secondary); flex: 1; }
.an-legend-val { font-size: 13px; font-weight: 700; color: var(--text-primary); }

/* Bar chart card */
.an-card--bar { grid-row: 1; grid-column: 2; }
.an-bars { display: flex; flex-direction: column; gap: 12px; }
.an-bar-row { display: flex; align-items: center; gap: 10px; }
.an-bar-label { font-size: 12px; font-weight: 600; color: var(--text-secondary); width: 72px; flex-shrink: 0; }
.an-bar-track {
  flex: 1;
  height: 10px;
  background: var(--surface-3);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.an-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.5s cubic-bezier(0.4,0,0.2,1);
}
.an-bar-fill--blue   { background: linear-gradient(90deg, var(--blue-400), var(--purple-500)); }
.an-bar-fill--amber  { background: linear-gradient(90deg, #F59E0B, #D97706); }
.an-bar-fill--purple { background: linear-gradient(90deg, var(--purple-400), var(--kpi-color)); }
.an-bar-count { font-size: 12px; font-weight: 700; color: var(--text-primary); width: 24px; text-align: right; }
.an-empty { font-size: 13px; color: var(--text-tertiary); padding: 8px 0; }

/* Leader overview card */
.an-card--leaders { grid-row: 1; grid-column: 3; }
.an-leader-rows { display: flex; flex-direction: column; gap: 16px; }
.an-leader-row { display: flex; align-items: flex-start; gap: 12px; }
.an-leader-avatar {
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--blue-400), var(--purple-500));
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: white; flex-shrink: 0;
}
.an-leader-info { width: 90px; flex-shrink: 0; }
.an-leader-name { font-size: 12px; font-weight: 700; color: var(--text-primary); line-height: 1.3; }
.an-leader-sub  { font-size: 10px; color: var(--text-tertiary); margin-top: 2px; }
.an-leader-bars { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.an-mini-bar-row { display: flex; align-items: center; gap: 6px; }
.an-mini-label { font-size: 10px; color: var(--text-tertiary); width: 56px; flex-shrink: 0; }
.an-mini-track {
  flex: 1; height: 6px;
  background: var(--surface-3);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.an-mini-count { font-size: 11px; font-weight: 700; color: var(--text-secondary); width: 20px; text-align: right; }
.an-overdue-badge {
  display: inline-block;
  margin-top: 4px;
  font-size: 10px; font-weight: 700;
  color: #EF4444;
  background: rgba(239,68,68,0.08);
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

/* Project health card */
.an-card--projects { grid-row: 2; grid-column: 1 / 4; }
.an-proj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.an-proj-card {
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  transition: box-shadow var(--transition), transform var(--transition);
}
.an-proj-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.an-proj-card--at-risk  { border-left: 3px solid #EF4444; }
.an-proj-card--on-track { border-left: 3px solid #10B981; }
.an-proj-card--kpi-only { border-left: 3px solid var(--kpi-color); }
.an-proj-name   { font-size: 13px; font-weight: 700; color: var(--text-primary); margin-bottom: 3px; }
.an-proj-leader { font-size: 11px; color: var(--text-tertiary); margin-bottom: 8px; }
.an-proj-stats  { display: flex; gap: 10px; margin-bottom: 8px; }
.an-proj-stat   { font-size: 11px; color: var(--text-secondary); }
.an-proj-stat strong { color: var(--text-primary); }
.an-proj-health {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600;
}
.an-health-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }

/* KPI table card */
.an-card--kpis { grid-row: 3; grid-column: 1 / 4; }
.an-kpi-table { width: 100%; border-collapse: collapse; }
.an-kpi-table th {
  text-align: left; font-size: 11px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-tertiary);
  padding: 0 12px 10px 0;
  border-bottom: 1px solid var(--border);
}
.an-kpi-table td {
  padding: 10px 12px 10px 0;
  font-size: 12px; color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.an-kpi-table tr:last-child td { border-bottom: none; }
.an-kpi-init { font-weight: 600; color: var(--text-primary); }
.an-kpi-pill {
  display: inline-block;
  background: var(--kpi-bg);
  border: 1px solid var(--kpi-border);
  color: var(--kpi-color);
  font-size: 11px; font-weight: 700;
  padding: 2px 9px;
  border-radius: var(--radius-full);
}
