/* style.css — FDA Dashboard Design Tokens & Component Styles */

/* === CUSTOM PALETTE: Navy / Blue / Medical Regulatory === */
:root, [data-theme="light"] {
  --font-display: 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;

  --text-xs:   clamp(0.6875rem, 0.65rem + 0.2vw, 0.8125rem);
  --text-sm:   clamp(0.8125rem, 0.76rem + 0.26vw, 0.9375rem);
  --text-base: clamp(0.9375rem, 0.88rem + 0.3vw, 1.0625rem);
  --text-lg:   clamp(1.0625rem, 0.95rem + 0.55vw, 1.375rem);
  --text-xl:   clamp(1.375rem, 1rem + 1.2vw, 2rem);

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  --color-bg:             #F0F2F6;
  --color-surface:        #FFFFFF;
  --color-surface-2:      #F7F8FB;
  --color-surface-offset: #E8ECF2;
  --color-divider:        #D0D7E2;
  --color-border:         #BFC8D9;

  --color-text:           #1B2A4A;
  --color-text-muted:     #5A6A85;
  --color-text-faint:     #8E99AE;
  --color-text-inverse:   #FFFFFF;

  --color-primary:        #2E5090;
  --color-primary-hover:  #1F3A6E;
  --color-primary-active: #162B52;
  --color-primary-highlight: #D6E4F0;

  --color-success:        #1A7A3D;
  --color-success-highlight: #DCF0E3;
  --color-warning:        #C67A1A;
  --color-warning-highlight: #FDF0DC;
  --color-error:          #C23B3B;
  --color-error-highlight: #FCDEDE;
  --color-info:           #2E5090;
  --color-info-highlight: #D6E4F0;

  --status-complete:      #1A7A3D;
  --status-in-progress:   #2E5090;
  --status-blocked:       #C23B3B;
  --status-not-started:   #8E99AE;
  --status-waiting:       #C67A1A;
  --status-critical:      #C23B3B;
  --status-high:          #D97B1A;
  --status-medium:        #C6A21A;
  --status-low:           #1A7A3D;

  --radius-sm: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;
  --radius-full: 9999px;

  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  --shadow-sm: 0 1px 2px oklch(0.2 0.02 250 / 0.06);
  --shadow-md: 0 4px 12px oklch(0.2 0.02 250 / 0.08);
  --shadow-lg: 0 12px 32px oklch(0.2 0.02 250 / 0.12);

  --header-height: 56px;
  --kpi-height: 84px;
}

[data-theme="dark"] {
  --color-bg:             #0E1525;
  --color-surface:        #141C30;
  --color-surface-2:      #1A243B;
  --color-surface-offset: #111929;
  --color-divider:        #243050;
  --color-border:         #2D3A58;
  --color-text:           #D0D8E8;
  --color-text-muted:     #7889A8;
  --color-text-faint:     #4D5E7A;
  --color-text-inverse:   #0E1525;
  --color-primary:        #5B8CD0;
  --color-primary-hover:  #7AA3E0;
  --color-primary-active: #4A78BC;
  --color-primary-highlight: #1E2D4A;
  --color-success:        #3DAA65;
  --color-success-highlight: #162B1F;
  --color-warning:        #E09838;
  --color-warning-highlight: #2B2216;
  --color-error:          #E05555;
  --color-error-highlight: #2B1616;
  --color-info:           #5B8CD0;
  --color-info-highlight: #1E2D4A;
  --status-complete:      #3DAA65;
  --status-in-progress:   #5B8CD0;
  --status-blocked:       #E05555;
  --status-not-started:   #4D5E7A;
  --status-waiting:       #E09838;
  --status-critical:      #E05555;
  --status-high:          #E09838;
  --status-medium:        #D4B83A;
  --status-low:           #3DAA65;
  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.2);
  --shadow-md: 0 4px 12px oklch(0 0 0 / 0.3);
  --shadow-lg: 0 12px 32px oklch(0 0 0 / 0.4);
}

/* === LAYOUT === */
html, body { height: 100%; overflow: hidden; margin: 0; }

.dashboard {
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  height: 100dvh;
  font-variant-numeric: tabular-nums lining-nums;
}

/* === HEADER === */
.header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-divider);
  padding: 0 var(--space-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  z-index: 20;
}

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

.logo-mark {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.logo-mark svg { flex-shrink: 0; }

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.logo-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.01em;
}

.logo-subtitle {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-weight: 400;
}

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

.header-meta {
  text-align: right;
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  line-height: 1.3;
  display: none;
}

@media (min-width: 768px) {
  .header-meta { display: block; }
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-badge--at-risk {
  background: var(--color-error-highlight);
  color: var(--color-error);
}

.status-badge--on-track {
  background: var(--color-success-highlight);
  color: var(--color-success);
}

.theme-toggle {
  padding: var(--space-2);
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  transition: all var(--transition-interactive);
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  background: var(--color-surface-offset);
  color: var(--color-text);
}

/* === KPI ROW === */
.kpi-row {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-divider);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.kpi-row::-webkit-scrollbar { display: none; }

.kpi-card {
  flex: 0 0 auto;
  min-width: 120px;
  background: var(--color-bg);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.kpi-card--alert {
  border-color: var(--color-error);
  background: var(--color-error-highlight);
}

.kpi-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.kpi-value {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1;
}

.kpi-value--danger { color: var(--color-error); }
.kpi-value--success { color: var(--color-success); }
.kpi-value--warning { color: var(--color-warning); }

.kpi-ring {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.kpi-card-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* === TAB NAV === */
.tab-nav {
  display: flex;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-5);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-divider);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.tab-nav::-webkit-scrollbar { display: none; }

.tab-btn {
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-muted);
  white-space: nowrap;
  transition: all var(--transition-interactive);
  border: 1px solid transparent;
}

.tab-btn:hover {
  color: var(--color-text);
  background: var(--color-surface-offset);
}

.tab-btn--active {
  color: var(--color-primary);
  background: var(--color-primary-highlight);
  border-color: var(--color-primary);
  font-weight: 600;
}

/* === MAIN CONTENT === */
.main {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--space-5);
}

.tab-panel {
  display: none;
  animation: fadeIn 200ms ease;
}

.tab-panel--active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* === SECTION HEADING === */
.section-heading {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: -0.01em;
  margin-bottom: var(--space-4);
}

.section-subheading {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-3);
}

/* === CARDS === */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

/* === TABLES === */
.table-wrap {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.table-scroll {
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-xs);
}

.data-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
}

.data-table th {
  background: var(--color-surface-2);
  color: var(--color-text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: var(--text-xs);
  padding: var(--space-2) var(--space-3);
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--color-divider);
  cursor: pointer;
  user-select: none;
}

.data-table th:hover {
  color: var(--color-text);
}

.data-table td {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--color-divider);
  color: var(--color-text);
  vertical-align: top;
}

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

.data-table tr:hover td {
  background: var(--color-surface-2);
}

.data-table tr.overdue td {
  background: var(--color-error-highlight);
}

/* === BADGES === */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 500;
  white-space: nowrap;
  line-height: 1.4;
}

.badge--complete { background: var(--color-success-highlight); color: var(--status-complete); }
.badge--in-progress { background: var(--color-info-highlight); color: var(--status-in-progress); }
.badge--blocked { background: var(--color-error-highlight); color: var(--status-blocked); }
.badge--not-started { background: var(--color-surface-offset); color: var(--status-not-started); }
.badge--waiting { background: var(--color-warning-highlight); color: var(--status-waiting); }
.badge--critical { background: var(--color-error-highlight); color: var(--status-critical); }
.badge--high { background: var(--color-warning-highlight); color: var(--status-high); }
.badge--medium { background: #FDF6DC; color: var(--status-medium); }
.badge--low { background: var(--color-success-highlight); color: var(--status-low); }
.badge--recent { background: var(--color-info-highlight); color: var(--color-primary); }
.badge--action { background: var(--color-warning-highlight); color: var(--color-warning); }

[data-theme="dark"] .badge--medium { background: #2B2616; }

/* Task size badges */
.badge--size-large { background: #F3E8FF; color: #7C3AED; font-weight: 600; }
.badge--size-medium { background: #E0F2FE; color: #0284C7; }
.badge--size-small { background: var(--color-surface-offset); color: var(--color-text-muted); }
[data-theme="dark"] .badge--size-large { background: #2E1065; color: #C084FC; }
[data-theme="dark"] .badge--size-medium { background: #0C2D48; color: #7DD3FC; }
[data-theme="dark"] .badge--size-small { background: var(--color-surface-offset); color: var(--color-text-muted); }

/* === AVATAR === */
.avatar {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  background: var(--color-primary-highlight);
  color: var(--color-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  flex-shrink: 0;
}

/* === FILTER BAR === */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  align-items: center;
}

.filter-input {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  background: var(--color-surface);
  color: var(--color-text);
  min-width: 180px;
  transition: border-color var(--transition-interactive);
}

.filter-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-primary-highlight);
}

.filter-select {
  padding: var(--space-1) var(--space-3);
  padding-right: var(--space-6);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  background: var(--color-surface);
  color: var(--color-text);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%235A6A85' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  cursor: pointer;
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.chip {
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--transition-interactive);
  background: transparent;
}

.chip:hover {
  background: var(--color-surface-offset);
  color: var(--color-text);
}

.chip--active {
  background: var(--color-primary-highlight);
  color: var(--color-primary);
  border-color: var(--color-primary);
}

/* === TREE VIEW === */
.tree-group {
  margin-bottom: var(--space-2);
}

.tree-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-interactive);
  user-select: none;
}

.tree-header:hover {
  background: var(--color-surface-2);
}

.tree-header--level-1 {
  background: var(--color-surface-offset);
  font-weight: 600;
  font-size: var(--text-sm);
}

.tree-header--level-2 {
  margin-left: var(--space-5);
  font-weight: 500;
  font-size: var(--text-xs);
}

.tree-header--level-3 {
  margin-left: var(--space-10);
  font-weight: 500;
  font-size: var(--text-xs);
  background: transparent;
  border-color: transparent;
}

.tree-header--level-4 {
  margin-left: calc(var(--space-10) + var(--space-5));
  font-weight: 500;
  font-size: var(--text-xs);
  background: transparent;
  border-color: transparent;
  opacity: 0.9;
}

.tree-chevron {
  width: 16px;
  height: 16px;
  transition: transform var(--transition-interactive);
  color: var(--color-text-faint);
  flex-shrink: 0;
}

.tree-chevron--open {
  transform: rotate(90deg);
}

.tree-children {
  display: none;
}

.tree-children--open {
  display: block;
}

.tree-progress {
  width: 80px;
  height: 4px;
  background: var(--color-surface-offset);
  border-radius: var(--radius-full);
  overflow: hidden;
  flex-shrink: 0;
}

.tree-progress-bar {
  height: 100%;
  background: var(--color-success);
  border-radius: var(--radius-full);
  transition: width 600ms cubic-bezier(0.16, 1, 0.3, 1);
}

.task-row {
  display: grid;
  grid-template-columns: 70px 1fr 130px auto auto 40px;
  gap: var(--space-2);
  align-items: start;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  border-bottom: 1px solid var(--color-divider);
  margin-left: calc(var(--space-10) + var(--space-8) + var(--space-3));
}

.task-row > span {
  min-width: 0;
}

.task-row:hover {
  background: var(--color-surface-2);
}

.task-row-wrap {
  position: relative;
}

.task-detail {
  display: none;
  margin-left: calc(var(--space-10) + var(--space-8) + var(--space-3) + 70px + var(--space-2));
  padding: var(--space-2) var(--space-3) var(--space-3);
  font-size: var(--text-xs);
  border-bottom: 1px solid var(--color-divider);
  background: var(--color-surface-2);
  border-left: 3px solid var(--color-primary);
}

.task-detail--open {
  display: block;
}

.task-detail-comment {
  color: var(--color-text-muted);
  line-height: 1.5;
  margin-bottom: var(--space-1);
}

.task-detail-comment strong {
  color: var(--color-text);
}

.task-detail-doc {
  color: var(--color-text-muted);
  line-height: 1.5;
}

.task-detail-doc a {
  color: var(--color-primary);
  text-decoration: underline;
}

/* Source reference citation */
.task-source-ref {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex-wrap: wrap;
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  padding: var(--space-1) 0;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-2);
  line-height: 1.5;
}
.task-source-ref svg {
  flex-shrink: 0;
  opacity: 0.6;
}
.task-source-label {
  color: var(--color-text-muted);
}
.task-source-date {
  color: var(--color-text-faint);
  font-style: italic;
}
[data-theme="dark"] .task-source-ref {
  border-bottom-color: var(--color-border);
}

.sp-link-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  opacity: 0.7;
  transition: opacity 120ms;
}

.sp-link-icon:hover {
  opacity: 1;
}

.assignee-task-wrap {
  position: relative;
}

.assignee-task-wrap .task-detail {
  margin-left: calc(60px + var(--space-2));
}

.task-id {
  color: var(--color-text-faint);
  font-family: monospace;
  font-size: 11px;
}

.task-title {
  color: var(--color-text);
  font-weight: 400;
  line-height: 1.4;
}

.task-snippet {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--color-text-faint);
  line-height: 1.35;
  margin-top: 2px;
  font-style: italic;
}

.task-assignee {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}

.blocker-icon {
  width: 14px;
  height: 14px;
  color: var(--color-error);
}

/* === OVERVIEW === */
.overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
  align-items: start;
}

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

.progress-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3) 0;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-xs);
  font-weight: 500;
}

.progress-bar-track {
  height: 8px;
  background: var(--color-surface-offset);
  border-radius: var(--radius-full);
  overflow: hidden;
}

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

.critical-callout {
  background: var(--color-error-highlight);
  border: 1px solid var(--color-error);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}

.critical-callout h3 {
  color: var(--color-error);
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-2);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.critical-item {
  font-size: var(--text-xs);
  color: var(--color-text);
  padding: var(--space-1) 0;
  border-bottom: 1px solid oklch(0 0 0 / 0.06);
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  flex-wrap: nowrap;
}
.critical-item .badge { flex-shrink: 0; white-space: nowrap; }

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

.activity-item {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-divider);
  font-size: var(--text-xs);
}

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

.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  flex-shrink: 0;
  margin-top: 4px;
}

.activity-text { color: var(--color-text); }
.activity-time { color: var(--color-text-faint); white-space: nowrap; }

/* === TEAM CARDS === */
.team-card {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.team-card-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
}

.team-card-role {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.team-card-email {
  font-size: var(--text-xs);
  color: var(--color-primary);
  text-decoration: none;
}

.team-card-email:hover { text-decoration: underline; }

.team-card-topics {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-top: var(--space-1);
}

.team-org-header {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  margin-top: var(--space-5);
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 2px solid var(--color-primary);
}

.team-org-header:first-child { margin-top: 0; }

/* === DECISIONS TIMELINE === */
.decision-entry {
  position: relative;
  padding-left: var(--space-6);
  padding-bottom: var(--space-5);
  border-left: 2px solid var(--color-divider);
  margin-left: var(--space-2);
}

.decision-entry::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 2px;
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
}

.decision-date {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin-bottom: var(--space-1);
}

.decision-text {
  font-size: var(--text-sm);
  color: var(--color-text);
  font-weight: 500;
  margin-bottom: var(--space-1);
}

.decision-meta {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* === EXPANDABLE TEXT === */
.expandable-text {
  cursor: pointer;
}

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

.expand-hint {
  color: var(--color-primary);
  font-size: var(--text-xs);
  cursor: pointer;
}

/* === CHANGE LOG EMPTY STATE === */
.empty-state {
  text-align: center;
  padding: var(--space-12);
  color: var(--color-text-faint);
}

.empty-state-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto var(--space-4);
  color: var(--color-text-faint);
  opacity: 0.5;
}

.empty-state-title {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

.empty-state-text {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}

/* === RISK SEVERITY CHART === */
.severity-chart {
  display: flex;
  gap: var(--space-2);
  align-items: flex-end;
  height: 120px;
  padding: var(--space-4) var(--space-3);
  justify-content: flex-start;
  max-width: 280px;
}

.severity-bar {
  flex: 0 0 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
}

.severity-bar-fill {
  width: 100%;
  max-width: 40px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: height 600ms cubic-bezier(0.16, 1, 0.3, 1);
}

.severity-bar-label {
  font-size: 10px;
  color: var(--color-text-muted);
  font-weight: 500;
}

/* Old mobile responsive block removed — see new block at bottom */

/* === PRINT === */
@media print {
  .header, .tab-nav, .theme-toggle, .filter-bar { display: none; }
  .main { overflow: visible; height: auto; }
  .tab-panel { display: block !important; page-break-inside: avoid; }
  .dashboard { display: block; height: auto; }
}

/* === DONUT CHART (SVG) === */
.donut-ring { fill: none; stroke: var(--color-surface-offset); }
.donut-segment { fill: none; stroke-linecap: round; }

/* === MISC === */
.text-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 600;
  background: var(--color-primary);
  color: var(--color-text-inverse);
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* === CONSULTANT SCORECARD === */
.scorecard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

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

.scorecard-card {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
}

.scorecard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 2px solid var(--color-primary);
}

.scorecard-name {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
}

.scorecard-stats {
  display: flex;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.scorecard-stat {
  text-align: center;
  flex: 1;
  padding: var(--space-3);
  background: var(--color-bg);
  border-radius: var(--radius-md);
}

.scorecard-stat-value {
  font-size: var(--text-lg);
  font-weight: 700;
  line-height: 1;
}

.scorecard-stat-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

.scorecard-section {
  margin-bottom: var(--space-3);
}

.scorecard-section-title {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.scorecard-item {
  font-size: var(--text-xs);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-1);
  line-height: 1.4;
}

.scorecard-item--delivered {
  background: var(--color-success-highlight);
  color: var(--color-text);
  border-left: 3px solid var(--color-success);
}

.scorecard-item--overdue {
  background: var(--color-error-highlight);
  color: var(--color-text);
  border-left: 3px solid var(--color-error);
}

.scorecard-item--pending {
  background: var(--color-warning-highlight);
  color: var(--color-text);
  border-left: 3px solid var(--color-warning);
}

/* === GAUGE === */
.gauge-container {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) 0;
}

.gauge-bar {
  flex: 1;
  height: 10px;
  background: var(--color-surface-offset);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.gauge-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 800ms cubic-bezier(0.16, 1, 0.3, 1);
}

.gauge-label {
  font-size: var(--text-xs);
  font-weight: 600;
  min-width: 40px;
  text-align: right;
}

/* === ASSIGNEE VIEW === */
.assignee-group {
  margin-bottom: var(--space-4);
}

.assignee-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--color-surface-offset);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-1);
  user-select: none;
  transition: background var(--transition-interactive);
}

.assignee-header:hover {
  background: var(--color-surface-2);
}

.assignee-task-list {
  border-left: 2px solid var(--color-divider);
  margin-left: var(--space-4);
  padding-left: var(--space-3);
}

.assignee-task-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) 0;
  font-size: var(--text-xs);
  border-bottom: 1px solid var(--color-divider);
}

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

/* === OVERVIEW CONSULTANT HEALTH === */
.consultant-health {
  display: flex;
  gap: var(--space-4);
  margin-top: var(--space-3);
}

.consultant-health-item {
  flex: 1;
  padding: var(--space-3);
  background: var(--color-bg);
  border-radius: var(--radius-md);
}

.consultant-health-name {
  font-size: var(--text-xs);
  font-weight: 600;
  margin-bottom: var(--space-1);
}

.consultant-health-rate {
  font-size: var(--text-lg);
  font-weight: 700;
}

/* === MOBILE ADJUSTMENTS FOR NEW LEVELS === */
/* === MEETING PREP TAB === */
.meeting-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-4);
  border-bottom: 2px solid var(--color-primary);
}

.meeting-title {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 var(--space-1) 0;
  letter-spacing: -0.02em;
}

.meeting-subtitle {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.meeting-stats {
  display: flex;
  gap: var(--space-4);
}

.meeting-stat {
  text-align: center;
  min-width: 64px;
}

.meeting-stat-value {
  font-size: var(--text-lg);
  font-weight: 700;
  line-height: 1;
}

.meeting-stat-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

.meeting-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  align-items: start;
}

@media (max-width: 768px) {
  .meeting-grid { grid-template-columns: 1fr; }
  .meeting-stats { flex-wrap: wrap; gap: var(--space-3); }
}

.meeting-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.meeting-section {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.meeting-section--decisions {
  border-color: var(--color-error);
}

.meeting-section--actions {
  border-color: var(--color-warning);
}

.meeting-section--risks {
  border-color: var(--color-error);
}

.meeting-section--consultants {
  border-color: var(--color-primary);
}

.meeting-section-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  background: var(--color-surface-2);
  border-bottom: 1px solid var(--color-divider);
}

.meeting-section-body {
  padding: var(--space-3) var(--space-4);
}

.meeting-empty {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  padding: var(--space-2) 0;
  font-style: italic;
}

.meeting-item {
  padding: var(--space-3);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-2);
  background: var(--color-bg);
  border-left: 3px solid var(--color-text-faint);
}

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

.meeting-item--critical {
  border-left-color: var(--color-error);
  background: var(--color-error-highlight);
}

.meeting-item--high {
  border-left-color: var(--color-warning);
  background: var(--color-warning-highlight);
}

.meeting-item--medium {
  border-left-color: var(--status-medium);
}

.meeting-item--low {
  border-left-color: var(--color-success);
}

.meeting-item--waiting {
  border-left-color: var(--color-warning);
  background: var(--color-warning-highlight);
}

.meeting-item-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-1);
}

.meeting-item-id {
  font-family: monospace;
  font-size: 11px;
  color: var(--color-text-faint);
}

.meeting-item-assignee {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-left: auto;
}

.meeting-item-title {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: var(--space-1);
}

.meeting-item-blocker {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  color: var(--color-error);
  margin-bottom: var(--space-1);
}

.meeting-item-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  color: var(--color-primary);
  text-decoration: none;
}

.meeting-item-link:hover {
  text-decoration: underline;
}

.meeting-table th,
.meeting-table td {
  font-size: var(--text-xs);
}

.meeting-consultant-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

@media (max-width: 640px) {
  .meeting-consultant-grid { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════
   IDE CRITICAL PATH TAB
   ═══════════════════════════════════════════ */

/* Lane color CSS custom properties */
:root, [data-theme="light"] {
  --lane-clinical: #2E5090;
  --lane-software: #1A7A3D;
  --lane-design: #7B68EE;
  --lane-risk: #C67A1A;
  --lane-compliance: #C23B3B;
}

[data-theme="dark"] {
  --lane-clinical: #5B8CD0;
  --lane-software: #3DAA65;
  --lane-design: #9D8FFF;
  --lane-risk: #E09838;
  --lane-compliance: #E05555;
}

/* Header */
.cp-header {
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-4);
  border-bottom: 2px solid var(--color-primary);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* Summary row */
.cp-summary-row {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
  overflow-x: auto;
  padding-bottom: var(--space-1);
  scrollbar-width: none;
}
.cp-summary-row::-webkit-scrollbar { display: none; }

.cp-lane-card {
  flex: 1 0 140px;
  min-width: 140px;
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.cp-lane-card-bar {
  height: 3px;
  width: 100%;
}

.cp-lane-card-body {
  padding: var(--space-3);
}

.cp-lane-card-name {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cp-lane-card-stats {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-1);
}

.cp-lane-card-count {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1;
}

.cp-lane-card-pct {
  font-weight: 600;
  margin-left: auto;
}

.cp-lane-card-lead {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cp-lane-card-weeks {
  font-size: 10px;
  color: var(--color-text-faint);
  margin-top: var(--space-1);
}

/* Readiness gauge card */
.cp-readiness-card {
  flex: 0 0 160px;
  min-width: 140px;
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.cp-readiness-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: var(--space-1);
}

.cp-readiness-value {
  font-size: var(--text-xl);
  font-weight: 700;
  line-height: 1;
  margin-bottom: var(--space-2);
}

.cp-readiness-bar {
  width: 100%;
  height: 6px;
  background: var(--color-surface-offset);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--space-1);
}

.cp-readiness-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 800ms cubic-bezier(0.16, 1, 0.3, 1);
}

.cp-readiness-meta {
  font-size: 10px;
  color: var(--color-text-muted);
}

.cp-readiness-target {
  font-size: 10px;
  color: var(--color-text-faint);
  margin-top: 2px;
}

/* Section spacing */
.cp-section {
  margin-bottom: var(--space-5);
}

/* ── GANTT ── */
.cp-gantt-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.cp-gantt {
  min-width: 700px;
}

.cp-gantt-header {
  display: grid;
  grid-template-columns: 160px repeat(6, 1fr);
  border-bottom: 1px solid var(--color-divider);
  background: var(--color-surface-2);
}

.cp-gantt-corner {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
}

.cp-gantt-week {
  padding: var(--space-2) var(--space-2);
  text-align: center;
  border-left: 1px solid var(--color-divider);
}

.cp-gantt-week--current {
  background: var(--color-primary-highlight);
}

.cp-gantt-week-num {
  display: block;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text);
}

.cp-gantt-week-date {
  display: block;
  font-size: 10px;
  color: var(--color-text-faint);
}

.cp-gantt-body {
  position: relative;
}

.cp-gantt-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  border-bottom: 1px solid var(--color-divider);
  min-height: 48px;
}

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

.cp-gantt-lane-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  border-right: 1px solid var(--color-divider);
}

.cp-gantt-lane-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.cp-gantt-lane-name {
  font-weight: 500;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cp-gantt-lane-count {
  font-size: 10px;
  color: var(--color-text-faint);
  margin-left: auto;
  flex-shrink: 0;
}

.cp-gantt-lane-track {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  align-items: stretch;
  position: relative;
}

.cp-gantt-cell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  align-content: center;
  gap: 3px;
  padding: var(--space-1) var(--space-1);
  min-height: 40px;
  position: relative;
  border-right: 1px solid var(--color-divider);
}

.cp-gantt-cell--active {
  border-right-color: rgba(128, 128, 128, 0.15);
}

[data-theme="dark"] .cp-gantt-cell--active {
  /* inline background is set per-lane */
}

.cp-gantt-cell-count {
  position: absolute;
  bottom: 1px;
  right: 4px;
  font-size: 9px;
  font-weight: 600;
  color: var(--color-text-faint);
  font-variant-numeric: tabular-nums;
}

/* ── Gantt dots: status-colored ── */
.cp-gantt-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
  cursor: default;
  transition: transform 120ms ease;
}
.cp-gantt-dot:hover {
  transform: scale(1.6);
  z-index: 5;
}

/* Not started: hollow white / light outline */
.cp-gantt-dot.dot-notstarted {
  background: transparent;
  border: 1.5px solid var(--color-text-faint);
}

/* In progress: blue fill */
.cp-gantt-dot.dot-active {
  background: var(--status-in-progress);
  border: 1.5px solid var(--status-in-progress);
}

/* Complete: green fill */
.cp-gantt-dot.dot-complete {
  background: var(--status-complete);
  border: 1.5px solid var(--status-complete);
}

/* Overdue: red fill */
.cp-gantt-dot.dot-overdue {
  background: var(--color-error);
  border: 1.5px solid var(--color-error);
}

/* Blocked: gray fill */
.cp-gantt-dot.dot-blocked {
  background: var(--color-text-faint);
  border: 1.5px solid var(--color-text-faint);
}

/* ── Gantt legend ── */
.cp-gantt-legend {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-2) 0;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.cp-gantt-legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.cp-gantt-legend .cp-gantt-dot {
  width: 8px;
  height: 8px;
}

/* Gate markers */
.cp-gantt-gates {
  display: grid;
  grid-template-columns: 160px repeat(6, 1fr);
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 1;
}

.cp-gantt-gate {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: var(--space-1);
}

.cp-gantt-gate::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: var(--gate-color, var(--color-text-faint));
  opacity: 0.35;
  border-style: dashed;
}

.cp-gantt-gate-diamond {
  width: 10px;
  height: 10px;
  background: var(--gate-color, var(--color-text-faint));
  transform: rotate(45deg);
  flex-shrink: 0;
  z-index: 2;
  border: 1px solid var(--color-surface);
}

.cp-gantt-gate-label {
  font-size: 9px;
  font-weight: 600;
  color: var(--gate-color, var(--color-text-faint));
  writing-mode: vertical-lr;
  transform: rotate(180deg);
  margin-top: var(--space-2);
  white-space: nowrap;
  z-index: 2;
}

/* Today marker */
.cp-gantt-today {
  display: grid;
  grid-template-columns: 160px repeat(6, 1fr);
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 0;
}

.cp-gantt-today::after {
  content: '';
  grid-column: 2; /* First week column */
  position: relative;
  width: 2px;
  left: 15%;
  background: var(--color-error);
  opacity: 0.5;
}

.cp-gantt-today-label {
  display: none;
}

/* ── GATES ROW ── */
.cp-gates-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}

.cp-gate-card {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.cp-gate-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  border-left: 4px solid var(--color-primary);
  background: var(--color-surface-2);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text);
}

.cp-gate-card-name {
  font-weight: 600;
}

.cp-gate-card-body {
  padding: var(--space-3) var(--space-4);
}

.cp-gate-card-row {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--space-1);
  line-height: 1.5;
}

.cp-gate-card-row strong {
  color: var(--color-text);
}

.cp-gate-card-remaining {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  margin-top: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid var(--color-divider);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.cp-gate-card-remaining-num {
  font-size: var(--text-lg);
  font-weight: 700;
  line-height: 1;
}

/* ── BOTTOM GRID (Lane Details + Assignee Load) ── */
.cp-bottom-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: var(--space-4);
  align-items: start;
}

/* ── LANE ACCORDION ── */
.cp-lane-accordion {
  margin-bottom: var(--space-2);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  background: var(--color-surface);
}

.cp-lane-accordion-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
  user-select: none;
  transition: background var(--transition-interactive);
  background: var(--color-surface);
}

.cp-lane-accordion-header:hover {
  background: var(--color-surface-2);
}

.cp-lane-accordion-color {
  width: 4px;
  height: 20px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.cp-lane-accordion-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cp-lane-accordion-breakdown {
  display: flex;
  gap: var(--space-3);
  font-size: var(--text-xs);
  flex-shrink: 0;
}

.cp-lane-accordion-body {
  display: none;
  border-top: 1px solid var(--color-divider);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.cp-lane-accordion-body--open {
  display: block;
}

/* Task table header inside accordion */
.cp-task-table-header {
  display: grid;
  grid-template-columns: 70px 1fr 130px auto auto auto 40px;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--color-surface-2);
  border-bottom: 1px solid var(--color-divider);
}

/* Task rows inside accordion */
.cp-task-row {
  display: grid;
  grid-template-columns: 70px 1fr 130px auto auto auto 40px;
  gap: var(--space-2);
  align-items: start;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  border-bottom: 1px solid var(--color-divider);
}

.cp-task-row > span {
  min-width: 0;
}

.cp-task-row:hover {
  background: var(--color-surface-2);
}

.cp-task-title {
  color: var(--color-text);
  font-weight: 400;
  line-height: 1.4;
}

.cp-task-row-wrap:last-child .cp-task-row {
  border-bottom: none;
}

/* Task detail (same pattern as existing) */
.cp-task-detail {
  display: none;
  padding: var(--space-2) var(--space-3) var(--space-3);
  padding-left: calc(70px + var(--space-2) + var(--space-3));
  font-size: var(--text-xs);
  border-bottom: 1px solid var(--color-divider);
  background: var(--color-surface-2);
  border-left: 3px solid var(--color-primary);
}

.cp-task-detail--open {
  display: block;
}

/* ── WEEK GROUP (inside lane accordion) ── */
.cp-week-group {
  margin-bottom: var(--space-1);
}

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

.cp-week-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--color-surface-2);
  border-bottom: 1px solid var(--color-divider);
  font-size: var(--text-xs);
  position: sticky;
  top: 0;
  z-index: 2;
}

.cp-week-label {
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
}

.cp-week-pill {
  display: inline-flex;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}

.cp-week-pill--complete {
  background: var(--color-success-highlight);
  color: var(--color-success);
}

.cp-week-pill--active {
  background: var(--color-info-highlight);
  color: var(--color-info);
}

.cp-week-pill--overdue {
  background: var(--color-error-highlight);
  color: var(--color-error);
}

.cp-week-pill--blocked {
  background: var(--color-surface-offset);
  color: var(--color-text-faint);
}

/* Dependency indicator in task rows */
.cp-task-deps {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 10px;
  color: var(--color-text-faint);
  margin-left: var(--space-2);
  white-space: nowrap;
  opacity: 0.8;
}

.cp-task-deps svg {
  opacity: 0.5;
}

/* ── ASSIGNEE LOAD MATRIX ── */
.cp-load-matrix {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  box-shadow: var(--shadow-sm);
  -webkit-overflow-scrolling: touch;
}

.cp-load-matrix .data-table th {
  padding: var(--space-2) var(--space-2);
  text-align: center;
}

.cp-load-matrix .data-table td {
  padding: var(--space-2) var(--space-2);
  text-align: center;
}

.cp-load-name {
  text-align: left !important;
  font-weight: 500;
  white-space: nowrap;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cp-load-total {
  font-weight: 700;
  color: var(--color-text);
}

.cp-load-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 600;
  color: #fff;
}

.cp-load-dot--empty {
  background: transparent !important;
  color: var(--color-text-faint) !important;
}

.cp-load-lane-head {
  display: inline-block;
  padding: 1px var(--space-1);
  border-radius: var(--radius-sm);
  font-size: 9px;
  color: #fff;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  white-space: nowrap;
}

.cp-load-critical {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
  background: var(--color-error);
  color: #fff;
}

/* ── BY PERSON SECTION ── */
.cp-person-section-desc {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin-bottom: var(--space-3);
}

.cp-person-group {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-2);
  overflow: hidden;
}

.cp-person-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--color-surface-1);
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid transparent;
  transition: background 120ms;
}

.cp-person-header:hover {
  background: var(--color-surface-2);
}

.cp-person-header .tree-chevron {
  width: 14px;
  height: 14px;
}

.cp-person-name {
  font-weight: 600;
  font-size: var(--text-sm);
  flex-shrink: 0;
}

.cp-person-summary {
  font-size: var(--text-xs);
  display: flex;
  gap: var(--space-2);
  margin-left: auto;
}

.cp-person-task-header {
  display: grid;
  grid-template-columns: 14px 70px 1fr 50px auto auto auto;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--color-divider);
  background: var(--color-surface-2);
}

.cp-person-task {
  display: grid;
  grid-template-columns: 14px 70px 1fr 50px auto auto auto;
  gap: var(--space-2);
  align-items: start;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  border-bottom: 1px solid var(--color-divider);
}

.cp-person-task > span {
  min-width: 0;
}

.cp-person-task:hover {
  background: var(--color-surface-2);
}

.cp-person-task-wrap:last-child .cp-person-task {
  border-bottom: none;
}

.cp-person-lane-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  margin-top: 3px;
}

.cp-person-task-title {
  color: var(--color-text);
  line-height: 1.4;
}

.cp-person-week {
  font-size: 11px;
  color: var(--color-text-muted);
  font-weight: 500;
  white-space: nowrap;
}

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .cp-bottom-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .cp-gates-row {
    grid-template-columns: 1fr;
  }

  .cp-summary-row {
    flex-wrap: nowrap;
  }

  .cp-lane-accordion-breakdown {
    display: none;
  }

  .cp-task-row {
    grid-template-columns: 60px 1fr 80px;
  }

  .cp-task-row .task-assignee,
  .cp-task-row > span:nth-child(5),
  .cp-task-row > span:nth-child(6),
  .cp-task-row > span:nth-child(7) {
    display: none;
  }

  .cp-task-table-header {
    grid-template-columns: 60px 1fr 80px;
  }

  .cp-person-task,
  .cp-person-task-header {
    grid-template-columns: 14px 60px 1fr 80px;
  }

  .cp-person-task > span:nth-child(5),
  .cp-person-task > span:nth-child(6),
  .cp-person-task > span:nth-child(7),
  .cp-person-task-header > span:nth-child(5),
  .cp-person-task-header > span:nth-child(6),
  .cp-person-task-header > span:nth-child(7) {
    display: none;
  }

  .cp-task-table-header > span:nth-child(3),
  .cp-task-table-header > span:nth-child(5),
  .cp-task-table-header > span:nth-child(6),
  .cp-task-table-header > span:nth-child(7) {
    display: none;
  }

  .cp-task-detail {
    padding-left: calc(60px + var(--space-2) + var(--space-3));
  }
}

.meeting-consultant-card {
  padding: var(--space-3);
  background: var(--color-bg);
  border-radius: var(--radius-md);
}

.meeting-consultant-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.meeting-consultant-rate {
  font-weight: 700;
  margin-left: var(--space-2);
}

.meeting-consultant-label {
  font-size: var(--text-xs);
  font-weight: 600;
  margin-bottom: var(--space-1);
}

.meeting-consultant-list {
  font-size: var(--text-xs);
  color: var(--color-text);
  padding-left: var(--space-5);
  margin: 0;
  line-height: 1.6;
}

.meeting-person-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-2);
}

.meeting-person-card {
  padding: var(--space-2) var(--space-3);
  background: var(--color-bg);
  border-radius: var(--radius-md);
}

.meeting-person-name {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text);
}

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

.meeting-person-blocked {
  font-size: 10px;
  color: var(--color-error);
  font-weight: 600;
}

.meeting-change-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-1) 0;
  font-size: var(--text-xs);
  border-bottom: 1px solid var(--color-divider);
}

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

.meeting-change-type {
  flex-shrink: 0;
}

/* === MEETING PREP EXPANDABLE DETAIL PANELS (Morgan point 9) === */
.meeting-item--expandable {
  cursor: pointer;
  transition: background 0.15s ease;
}
.meeting-item--expandable:hover {
  background: var(--color-surface-2);
}
.meeting-expand-icon {
  flex-shrink: 0;
  opacity: 0.4;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.meeting-expand-icon--open {
  transform: rotate(90deg);
  opacity: 0.7;
}
.meeting-item-detail {
  display: none;
  padding: var(--space-3) var(--space-4);
  margin-top: var(--space-2);
  background: var(--color-surface-2);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--color-primary);
  font-size: var(--text-xs);
  line-height: 1.6;
  animation: slideDown 0.2s ease;
}
.meeting-item-detail--open {
  display: block;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.meeting-detail-context {
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}
.meeting-detail-context strong {
  color: var(--color-text);
}
.meeting-detail-doc {
  margin-bottom: var(--space-1);
}
.meeting-detail-doc a {
  color: var(--color-primary);
  text-decoration: none;
}
.meeting-detail-doc a:hover {
  text-decoration: underline;
}
.meeting-detail-desc {
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}
.meeting-person-item-wrap {
  margin-bottom: 2px;
}
.meeting-person-item--expandable {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.meeting-person-item--expandable:hover {
  background: var(--color-surface-2);
  border-radius: var(--radius-sm);
}
.meeting-person-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 3px var(--space-2);
  font-size: var(--text-xs);
}

/* === MOBILE ADJUSTMENTS FOR NEW LEVELS === */
@media (max-width: 640px) {
  .task-row {
    grid-template-columns: 60px 1fr 70px;
    margin-left: var(--space-8);
  }
  .task-row .task-assignee,
  .task-row .task-due,
  .task-row .task-priority,
  .task-row .task-blocker { display: none; }
  .task-detail {
    margin-left: calc(var(--space-8) + 60px + var(--space-2));
  }
  .tree-header--level-3 { margin-left: var(--space-6); }
  .tree-header--level-4 { margin-left: var(--space-8); }
  .main { padding: var(--space-3); }
  .kpi-row { padding: var(--space-2) var(--space-3); gap: var(--space-2); }
  .kpi-card { min-width: 100px; padding: var(--space-2) var(--space-3); }
  .tree-header--level-2 { margin-left: var(--space-3); }
  .card-grid { grid-template-columns: 1fr; }
  .scorecard-grid { grid-template-columns: 1fr; }
}


/* ─── Clickable ID badges ─── */
.clickable-id {
  display: inline-block;
  font-family: var(--font-mono, 'SF Mono', 'Fira Code', monospace);
  font-size: 11px;
  font-weight: 600;
  color: var(--color-primary, #3b82f6);
  background: color-mix(in oklch, var(--color-primary, #3b82f6) 8%, transparent);
  border: 1px solid color-mix(in oklch, var(--color-primary, #3b82f6) 20%, transparent);
  padding: 2px 7px;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
  line-height: 1.4;
}
.clickable-id:hover {
  background: color-mix(in oklch, var(--color-primary, #3b82f6) 16%, transparent);
  border-color: color-mix(in oklch, var(--color-primary, #3b82f6) 40%, transparent);
  transform: translateY(-1px);
}
.clickable-id:active {
  transform: translateY(0);
}

/* ─── Detail Popup Overlay ─── */
.detail-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.detail-popup-overlay--open {
  opacity: 1;
  pointer-events: auto;
}

.detail-popup {
  background: var(--color-surface-1, #fff);
  border: 1px solid var(--color-divider, #e2e8f0);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15), 0 4px 16px rgba(0,0,0,0.08);
  width: 90%;
  max-width: 560px;
  max-height: 80vh;
  overflow-y: auto;
  transform: translateY(20px) scale(0.97);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.detail-popup-overlay--open .detail-popup {
  transform: translateY(0) scale(1);
}

.detail-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--color-divider, #e2e8f0);
  position: sticky;
  top: 0;
  background: var(--color-surface-1, #fff);
  z-index: 1;
}

.detail-popup-id {
  font-family: var(--font-mono, 'SF Mono', monospace);
  font-size: 14px;
  font-weight: 700;
  color: var(--color-primary, #3b82f6);
}

.detail-popup-close {
  background: none;
  border: none;
  font-size: 22px;
  color: var(--color-text-muted, #94a3b8);
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.15s;
}
.detail-popup-close:hover {
  color: var(--color-text, #1e293b);
}

.detail-popup-body {
  padding: 16px 20px 20px;
}

.popup-row {
  display: flex;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid color-mix(in oklch, var(--color-divider, #e2e8f0) 50%, transparent);
  font-size: 13px;
  line-height: 1.5;
}
.popup-row:last-child {
  border-bottom: none;
}

.popup-label {
  flex-shrink: 0;
  width: 100px;
  font-weight: 600;
  color: var(--color-text-muted, #64748b);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding-top: 2px;
}

.popup-value {
  flex: 1;
  min-width: 0;
  color: var(--color-text, #1e293b);
  word-wrap: break-word;
}
.popup-value--warn {
  color: var(--color-error, #ef4444);
}

.popup-quote {
  margin: 12px 0;
  padding: 12px 16px;
  background: color-mix(in oklch, var(--color-surface-2, #f1f5f9) 80%, transparent);
  border-left: 3px solid var(--color-primary, #3b82f6);
  border-radius: 0 6px 6px 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--color-text-muted, #64748b);
  font-style: italic;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.popup-doc-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--color-primary, #3b82f6);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s;
}
.popup-doc-link:hover {
  text-decoration: underline;
  color: color-mix(in oklch, var(--color-primary, #3b82f6) 80%, black);
}

/* ─── Inline quote in table rows ─── */
.inline-quote {
  font-size: 11px;
  color: var(--color-text-faint, #94a3b8);
  font-style: italic;
  margin-top: 4px;
  padding: 4px 8px;
  border-left: 2px solid color-mix(in oklch, var(--color-primary, #3b82f6) 30%, transparent);
  background: color-mix(in oklch, var(--color-surface-2, #f1f5f9) 50%, transparent);
  border-radius: 0 4px 4px 0;
  line-height: 1.4;
}

.inline-source {
  font-size: 11px;
  color: var(--color-text-faint, #94a3b8);
  font-style: italic;
}

.inline-progress {
  font-size: 11px;
  color: var(--color-text-muted, #64748b);
  padding: 2px 0;
  border-left: 2px solid var(--color-success, #22c55e);
  padding-left: 8px;
}

.progress-note-row td {
  padding-top: 0 !important;
  padding-bottom: 4px !important;
  border-bottom: 1px solid var(--color-divider, #e2e8f0) !important;
}

.source-ref-row td {
  padding-top: 0 !important;
  padding-bottom: 4px !important;
}

/* ─── Doc link cells in tables ─── */
.doc-link-cell {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--color-primary, #3b82f6);
  text-decoration: none;
  font-size: 12px;
  transition: color 0.15s;
}
.doc-link-cell:hover {
  text-decoration: underline;
}
.doc-link-cell svg {
  flex-shrink: 0;
}

/* ─── Comment quote cell (full text, wrap) ─── */
.comment-quote-cell {
  font-size: 12px;
  line-height: 1.5;
  white-space: normal;
  word-wrap: break-word;
  max-width: 400px;
  color: var(--color-text, #1e293b);
}

/* ─── Decision entry updates ─── */
.decision-entry-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.decision-rationale {
  margin-top: var(--space-2, 8px);
  font-size: var(--text-xs, 12px);
  color: var(--color-text-muted, #64748b);
  border-left: 2px solid var(--color-divider, #e2e8f0);
  padding-left: var(--space-3, 12px);
  line-height: 1.5;
}

/* ─── Dark mode adjustments ─── */
[data-theme="dark"] .detail-popup {
  background: var(--color-surface-1, #1e293b);
  border-color: var(--color-divider, #334155);
  box-shadow: 0 20px 60px rgba(0,0,0,0.4), 0 4px 16px rgba(0,0,0,0.2);
}
[data-theme="dark"] .detail-popup-header {
  background: var(--color-surface-1, #1e293b);
}
[data-theme="dark"] .detail-popup-overlay {
  background: rgba(0, 0, 0, 0.6);
}
