:root {
  --bg: #f5f5f4;
  --surface: #ffffff;
  --border: #e7e5e4;
  --text: #1c1917;
  --text-muted: #78716c;
  --accent: #2563eb;
  --radius: 8px;

  --green: #16a34a;
  --green-bg: #f0fdf4;
  --yellow: #ca8a04;
  --yellow-bg: #fefce8;
  --red: #dc2626;
  --red-bg: #fef2f2;
  --gray: #57534e;
  --gray-bg: #fafaf9;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }

/* Layout */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  gap: 16px;
}

header h1 { font-size: 16px; font-weight: 600; }
header .quarter { font-size: 13px; color: var(--text-muted); }
header .back { font-size: 13px; color: var(--accent); cursor: pointer; }
header .back:hover { text-decoration: underline; }

main { max-width: 1100px; margin: 0 auto; padding: 32px; }

/* Overview grid */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.team-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition: box-shadow 0.15s;
}
.team-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }

.team-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.team-name { font-weight: 600; font-size: 15px; }

.readiness-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 99px;
  white-space: nowrap;
}
.readiness-badge.ready    { background: var(--green-bg); color: var(--green); }
.readiness-badge.partial  { background: var(--yellow-bg); color: var(--yellow); }
.readiness-badge.not-ready { background: var(--red-bg); color: var(--red); }
.readiness-badge.unknown  { background: var(--gray-bg); color: var(--gray); }

.team-card-stats {
  display: flex;
  gap: 20px;
  margin-top: 12px;
}

.stat { display: flex; flex-direction: column; gap: 2px; }
.stat-value { font-size: 22px; font-weight: 700; }
.stat-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

/* Team detail */
.team-detail { display: none; }

.section-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.initiatives-list { display: flex; flex-direction: column; gap: 16px; margin-top: 24px; }

.initiative-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.initiative-header {
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}
.initiative-header:hover { background: var(--bg); }

.initiative-title { font-weight: 600; font-size: 14px; }
.initiative-desc { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

.initiative-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.projects-list {
  border-top: 1px solid var(--border);
  padding: 0 20px 12px;
}

.project-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.project-row:last-child { border-bottom: none; }

.project-name { font-weight: 500; font-size: 13px; }
.project-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.project-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Tags */
.state-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.tag {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--bg);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.no-projects {
  padding: 12px 0;
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
}

/* Unlinked projects section */
.unlinked-section {
  margin-top: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.unlinked-header {
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--yellow-bg);
  border-bottom: 1px solid var(--border);
}
.unlinked-header .section-title { color: var(--yellow); margin: 0; }
.unlinked-body { padding: 0 20px 12px; }

/* Loading / error */
.loading, .error {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}
.error { color: var(--red); }

/* Summary bar */
.summary-bar {
  display: flex;
  gap: 24px;
  margin-bottom: 24px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.summary-item { display: flex; flex-direction: column; gap: 2px; }
.summary-value { font-size: 20px; font-weight: 700; }
.summary-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

/* Assessment: health dots */
.health-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}
.health-green  { background: var(--green); }
.health-yellow { background: var(--yellow); }
.health-red    { background: var(--red); }

/* Reported health tag */
.reported-health { font-weight: 500; }
.reported-onTrack { color: var(--green); border-color: #bbf7d0; background: var(--green-bg); }
.reported-atRisk  { color: var(--yellow); border-color: #fde68a; background: var(--yellow-bg); }
.reported-offTrack { color: var(--red); border-color: #fecaca; background: var(--red-bg); }

/* vs_reported badge */
.vs-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  line-height: 1;
}
.vs-lower  { background: var(--red-bg); color: var(--red); }
.vs-higher { background: var(--green-bg); color: var(--green); }

/* Initiative header layout */
.initiative-header { gap: 16px; align-items: flex-start; }
.initiative-header-left { flex: 1; min-width: 0; }
.initiative-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.assessment-rationale {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
  font-style: italic;
  line-height: 1.4;
}

/* Dimensions bar */
.dimensions-bar {
  display: flex;
  gap: 16px;
  padding: 10px 20px;
  background: var(--bg);
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.dimension {
  display: flex;
  align-items: center;
  gap: 6px;
}
.dim-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: capitalize;
  white-space: nowrap;
}
.dim-pips {
  display: flex;
  gap: 3px;
}
.dim-pip {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--border);
}
.dim-pip.filled { background: var(--accent); }

/* Project row with assessment */
.project-row-left { flex: 1; min-width: 0; }
.project-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.project-rationale {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
  font-style: italic;
  line-height: 1.4;
}

/* Scope labels */
.scope-label {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
}
.scope-expected { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.scope-stretch  { background: #fdf4ff; color: #7e22ce; border: 1px solid #e9d5ff; }

.empty {
  padding: 12px 0;
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
}

@media (max-width: 600px) {
  main { padding: 16px; }
  header { padding: 12px 16px; }
  .team-grid { grid-template-columns: 1fr; }
}
