/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #1e1e1e;
  --bg-card: #2a2a2a;
  --bg-hover: #333;
  --border: #3a3a3a;
  --text: #e0e0e0;
  --text-dim: #888;
  --accent: #5b9bd5;
  --green: #4caf50;
  --blue: #42a5f5;
  --orange: #ff9800;
  --purple: #ab47bc;
  --red: #ef5350;
  --gray: #757575;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

/* --- Nav --- */
#nav {
  display: flex;
  align-items: center;
  padding: 0 24px;
  height: 56px;
  background: #161616;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-portal {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 12px;
  letter-spacing: 0.1em;
  margin-right: 16px;
  padding: 6px 12px;
  border-radius: 6px;
  transition: all 0.15s;
}
.nav-portal:hover { color: var(--text); background: var(--bg-hover); }

.nav-brand {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 2px;
  color: var(--accent);
  margin-right: 32px;
}

.nav-links { display: flex; gap: 4px; }

.nav-link {
  color: var(--text-dim);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
}

.nav-link:hover { color: var(--text); background: var(--bg-hover); }
.nav-link.active { color: var(--text); background: var(--bg-card); }

/* --- Main --- */
#app { padding: 24px; max-width: 1400px; margin: 0 auto; }

/* --- Loading --- */
.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 60vh;
  gap: 16px;
  color: var(--text-dim);
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* --- Summary Cards --- */
.summary-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
}

.summary-card .label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.summary-card .value {
  font-size: 28px;
  font-weight: 700;
}

/* --- Section header --- */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title {
  font-size: 18px;
  font-weight: 600;
}

.back-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s;
}

.back-btn:hover { color: var(--text); border-color: var(--text-dim); }

/* --- Project cards grid --- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.15s;
}

.project-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.project-card .project-name {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.project-card .project-stage {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.project-card .project-team {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 12px;
}

.project-card .task-counts {
  display: flex;
  gap: 16px;
  font-size: 13px;
  margin-bottom: 12px;
}

.task-counts span { color: var(--text-dim); }
.task-counts strong { color: var(--text); }

/* --- Progress bar --- */
.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  display: flex;
}

.progress-bar .seg-completed { background: var(--green); }
.progress-bar .seg-in-progress { background: var(--blue); }
.progress-bar .seg-revision { background: var(--orange); }
.progress-bar .seg-needs-render { background: var(--purple); }
.progress-bar .seg-not-started { background: var(--gray); }

.progress-bar-large {
  height: 10px;
  border-radius: 5px;
  margin-bottom: 8px;
}

.progress-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--text-dim);
}

.progress-legend .dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}

/* --- Status badge --- */
.status-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-not-started { background: rgba(117,117,117,0.2); color: #aaa; }
.status-in-progress { background: rgba(66,165,245,0.2); color: var(--blue); }
.status-revision { background: rgba(255,152,0,0.2); color: var(--orange); }
.status-needs-render { background: rgba(171,71,188,0.2); color: var(--purple); }
.status-completed { background: rgba(76,175,80,0.2); color: var(--green); }

/* --- Version badge --- */
.version-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(91,155,213,0.15);
  color: var(--accent);
}

/* --- Task table --- */
.task-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.task-table th {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 2px solid var(--border);
  color: var(--text-dim);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

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

.task-table th .sort-arrow {
  margin-left: 4px;
  opacity: 0.3;
}

.task-table th.sorted .sort-arrow { opacity: 1; color: var(--accent); }

.task-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.task-table tr:hover td { background: rgba(255,255,255,0.02); }

/* --- Detail layout --- */
.detail-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
  margin-top: 20px;
}

.detail-main { min-width: 0; overflow-x: auto; }

.detail-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sidebar-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}

.sidebar-card h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 13px;
}

.stat-row .stat-label { color: var(--text-dim); }
.stat-row .stat-value { font-weight: 600; }

/* --- Pie chart (CSS conic-gradient) --- */
.pie-chart {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  margin: 0 auto 12px;
}

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

.team-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
}

.team-card .person-name {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
}

.team-card .person-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.team-card .person-stat {
  text-align: center;
}

.team-card .person-stat .num {
  font-size: 22px;
  font-weight: 700;
}

.team-card .person-stat .lbl {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
}

.team-card .project-breakdown {
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.team-card .project-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: 13px;
}

.team-card .project-row .proj-name { color: var(--text-dim); }

/* --- Activity feed --- */
.activity-list { display: flex; flex-direction: column; gap: 8px; }

.activity-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
}

.activity-item .file-icon {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: rgba(91,155,213,0.15);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.activity-item .file-icon.render {
  background: rgba(76,175,80,0.15);
  color: var(--green);
}

.activity-item .file-info { flex: 1; min-width: 0; }
.activity-item .file-name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity-item .file-meta { font-size: 12px; color: var(--text-dim); }

/* --- Dropbox section in detail --- */
.dropbox-section {
  margin-top: 24px;
}

.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 8px;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
}

.file-item .f-icon {
  font-size: 18px;
  opacity: 0.6;
}

.file-item .f-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-item .f-size { color: var(--text-dim); font-size: 12px; white-space: nowrap; }

/* --- Detail header --- */
.detail-header {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
}

.detail-header h1 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
}

.detail-header .meta {
  font-size: 13px;
  color: var(--text-dim);
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.phase-badge {
  background: var(--blue);
  color: #fff;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* --- Timeline bar chart --- */
.timeline-chart {
  margin-top: 16px;
}

.timeline-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 12px;
}

.timeline-bar .bar-label {
  width: 160px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
  color: var(--text-dim);
}

.timeline-bar .bar-track {
  flex: 1;
  height: 16px;
  background: var(--border);
  border-radius: 3px;
  position: relative;
  overflow: hidden;
}

.timeline-bar .bar-fill {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: 3px;
}

/* --- Empty state --- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
}

.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.3; }

/* --- Health badges --- */
.health-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.health-on-track { background: rgba(76,175,80,0.2); color: var(--green); }
.health-at-risk { background: rgba(255,152,0,0.2); color: var(--orange); }
.health-behind { background: rgba(239,83,80,0.2); color: var(--red); }
.health-overdue { background: rgba(239,83,80,0.3); color: var(--red); }
.health-completed { background: rgba(76,175,80,0.2); color: var(--green); }
.health-no-deadline { background: rgba(117,117,117,0.2); color: var(--gray); }

/* --- Detected status badge --- */
.detected-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  border: 1px dashed var(--green);
  color: var(--green);
  background: rgba(76,175,80,0.08);
}

.detected-badge.in-progress {
  border-color: var(--blue);
  color: var(--blue);
  background: rgba(66,165,245,0.08);
}

.detected-badge.unknown {
  border-color: var(--gray);
  color: var(--gray);
  background: rgba(117,117,117,0.08);
}

.detected-badge.mismatch {
  border-color: var(--orange);
  color: var(--orange);
  background: rgba(255,152,0,0.12);
}

/* --- AI summary card --- */
.ai-summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 14px 16px;
  margin: 12px 0;
  font-size: 13px;
  line-height: 1.6;
}

.ai-summary-card .ai-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 4px;
}

.ai-summary-card .ai-text {
  color: var(--text);
}

.ai-summary-card .ai-priority {
  display: inline-block;
  margin-top: 6px;
  padding: 1px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.ai-priority.priority-low { background: rgba(76,175,80,0.15); color: var(--green); }
.ai-priority.priority-medium { background: rgba(66,165,245,0.15); color: var(--blue); }
.ai-priority.priority-high { background: rgba(255,152,0,0.15); color: var(--orange); }
.ai-priority.priority-critical { background: rgba(239,83,80,0.15); color: var(--red); }

/* --- Mismatch row highlight --- */
.task-table tr.mismatch td {
  border-left: 3px solid var(--orange);
  background: rgba(255,152,0,0.04);
}

.task-table tr.mismatch td:first-child {
  border-left: 3px solid var(--orange);
}

/* --- Health summary row --- */
.health-summary-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.health-summary-item {
  text-align: center;
}

.health-summary-item .hs-value {
  font-size: 22px;
  font-weight: 700;
}

.health-summary-item .hs-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
}

/* --- Refresh button --- */
.refresh-btn {
  background: none;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.15s;
}

.refresh-btn:hover {
  background: rgba(91,155,213,0.1);
}

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

/* --- Download Page --- */
.download-page { max-width: 800px; margin: 0 auto; }

.download-hero {
  text-align: center;
  padding: 48px 24px;
  background: linear-gradient(135deg, rgba(91,155,213,0.12) 0%, rgba(91,155,213,0.04) 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  margin-bottom: 32px;
}

.download-hero h1 {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.download-subtitle {
  color: var(--text-dim);
  font-size: 16px;
  margin-bottom: 24px;
}

.download-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 36px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s;
  cursor: pointer;
}

.download-btn:hover {
  background: #4a8bc4;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(91,155,213,0.3);
}

.download-size {
  font-size: 12px;
  font-weight: 400;
  opacity: 0.8;
}

.install-steps { margin-bottom: 32px; }
.install-steps h2, .install-details h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.step-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  position: relative;
}

.step-card h3 { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.step-card p { font-size: 13px; color: var(--text-dim); line-height: 1.6; }

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
}

.install-details { margin-bottom: 32px; }

.included-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.included-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
}

.included-card h3 { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.included-card p { font-size: 13px; color: var(--text-dim); line-height: 1.5; }

.included-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: rgba(0,0,200,0.15);
  color: #9999ff;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 800;
  flex-shrink: 0;
}

.included-icon.ae {
  background: rgba(150,100,255,0.15);
  color: #b088ff;
}

.requirements-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.req-item {
  padding: 10px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
}

.install-note {
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  font-size: 13px;
}

/* --- Guide Page --- */
.guide-page { max-width: 800px; margin: 0 auto; }

.guide-header {
  margin-bottom: 24px;
}

.guide-header h1 {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 8px;
}

.guide-intro {
  font-size: 15px;
  color: var(--text-dim);
  line-height: 1.6;
}

.guide-toc {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 32px;
}

.guide-toc h2 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.toc-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.toc-links a {
  color: var(--accent);
  text-decoration: none;
  font-size: 14px;
  padding: 6px 12px;
  border-radius: 6px;
  transition: background 0.1s;
}

.toc-links a:hover {
  background: var(--bg-hover);
}

.guide-section {
  margin-bottom: 40px;
  padding-top: 8px;
}

.guide-section > h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}

.guide-section-intro {
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 16px;
  line-height: 1.6;
}

.guide-block {
  margin-bottom: 20px;
}

.guide-block h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.guide-block p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 8px;
}

.guide-block ul, .guide-block ol {
  padding-left: 20px;
  margin-bottom: 8px;
}

.guide-block li {
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 4px;
}

.guide-block li ul { margin-top: 4px; }

.guide-steps {
  padding-left: 20px;
}

.guide-steps > li {
  margin-bottom: 8px;
}

.guide-path {
  display: inline-block;
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin: 8px 0;
}

.guide-callout {
  padding: 14px 18px;
  background: rgba(91,155,213,0.08);
  border: 1px solid rgba(91,155,213,0.2);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.6;
  margin: 16px 0;
}

.guide-callout.important {
  background: rgba(255,152,0,0.08);
  border-color: rgba(255,152,0,0.2);
  border-left-color: var(--orange);
}

.stage-flow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: 12px 0;
}

.stage-item {
  padding: 6px 12px;
  background: rgba(91,155,213,0.1);
  border: 1px solid rgba(91,155,213,0.2);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}

.stage-arrow {
  color: var(--text-dim);
  font-size: 14px;
}

.category-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.cat-badge {
  padding: 6px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
}

.cat-badge strong { color: var(--text); margin-right: 4px; }

.voice-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.voice-item {
  padding: 10px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
}

.faq-item {
  margin-bottom: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.faq-q {
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}

.faq-a {
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.6;
}

/* --- Skeleton loading --- */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton-text {
  height: 14px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--border) 25%, rgba(255,255,255,0.06) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.skeleton-text.large { height: 28px; margin-top: 8px; }

.skeleton-circle {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  flex-shrink: 0;
  background: linear-gradient(90deg, var(--border) 25%, rgba(255,255,255,0.06) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* --- Project card structure --- */
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.card-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.card-team { color: var(--text-dim); }

/* --- MGX progress (compact) --- */
.mgx-progress { margin: 6px 0; }

.mgx-progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.mgx-progress-value { font-weight: 600; }
.mgx-progress-value.mgx-done { color: var(--green); }
.mgx-progress-value.mgx-mid { color: var(--accent); }
.mgx-progress-value.mgx-low { color: var(--orange); }

.mgx-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s;
}
.mgx-bar.mgx-done { background: var(--green); }
.mgx-bar.mgx-mid { background: var(--accent); }
.mgx-bar.mgx-low { background: var(--orange); }

/* --- Premiere info (compact) --- */
.premiere-info {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  background: rgba(91,155,213,0.06);
  border-radius: 4px;
  font-size: 11px;
  margin: 4px 0;
}

.premiere-label {
  color: var(--accent);
  font-weight: 700;
  font-size: 10px;
}

.premiere-meta {
  color: var(--text-dim);
}

/* --- Summary value sub --- */
.value-sub {
  font-size: 16px;
  font-weight: 400;
  color: var(--text-dim);
  margin-left: 4px;
}

/* --- Health summary card (compact) --- */
.health-summary-card .health-dots {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 4px;
}

.health-dot {
  font-size: 13px;
  font-weight: 600;
}

/* --- Dim nav link (System) --- */
.nav-link-dim { opacity: 0.5; }
.nav-link-dim:hover { opacity: 0.8; }
.nav-link-dim.active { opacity: 1; }

/* --- Person link in team cards --- */
.person-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s;
}
.person-link:hover { color: var(--accent); }

/* --- Filter bar --- */
.filter-bar {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  flex-wrap: wrap;
  align-items: end;
}

.filter-bar label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
}

.filter-bar select {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 13px;
  cursor: pointer;
}

.filter-bar select:hover { border-color: var(--text-dim); }

/* --- Provider badge --- */
.provider-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* --- Event type label --- */
.event-type-label {
  font-weight: 500;
  margin-right: 6px;
}

/* --- History timeline (project detail) --- */
.history-timeline {
  position: relative;
  padding-left: 20px;
  margin-top: 8px;
}

.history-timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.history-node {
  position: relative;
  padding: 8px 0 8px 16px;
}

.history-dot {
  position: absolute;
  left: -16px;
  top: 14px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
}

.history-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
}

.history-time {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.history-metrics {
  display: flex;
  gap: 16px;
  font-size: 13px;
  flex-wrap: wrap;
}

.history-metrics .delta {
  font-size: 11px;
  font-weight: 600;
}

.history-metrics .delta.up { color: var(--green); }
.history-metrics .delta.down { color: var(--red); }

/* --- System status card --- */
.system-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
}

.system-card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}

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

/* --- User attribution --- */
.file-modified-by {
  font-size: 11px;
  color: var(--accent);
  font-weight: 500;
}

/* --- Clickable file items --- */
.file-item.clickable {
  cursor: pointer;
  transition: all 0.15s;
}
.file-item.clickable:hover {
  border-color: var(--accent);
  background: var(--bg-hover);
}

/* --- File revision modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.15s ease;
}

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

.modal-panel {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 1;
}

.modal-header h2 {
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  margin-right: 12px;
}

.modal-close {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
}

.modal-close:hover {
  color: var(--text);
  border-color: var(--text-dim);
}

.modal-body {
  padding: 20px;
}

.revision-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.revision-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
}

.revision-item .rev-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.revision-item .rev-date {
  font-weight: 500;
}

.revision-item .rev-user {
  font-size: 12px;
  color: var(--accent);
}

.revision-item .rev-size {
  font-size: 12px;
  color: var(--text-dim);
  text-align: right;
  white-space: nowrap;
}

.revision-item .rev-delta {
  font-size: 11px;
  font-weight: 600;
}

.revision-item .rev-delta.up { color: var(--green); }
.revision-item .rev-delta.down { color: var(--red); }

/* --- Recent Events card --- */
.event-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}

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

.event-actor {
  color: var(--accent);
  font-weight: 500;
  white-space: nowrap;
}

.event-action {
  color: var(--text-dim);
}

.event-asset {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.event-time {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
}

/* --- Responsive --- */
@media (max-width: 900px) {
  .detail-layout {
    grid-template-columns: 1fr;
  }
  .summary-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  #app { padding: 16px; }
  .project-grid { grid-template-columns: 1fr; }
  .team-grid { grid-template-columns: 1fr; }
  .summary-row { grid-template-columns: 1fr; }
  .steps-grid { grid-template-columns: 1fr; }
  .included-grid { grid-template-columns: 1fr; }
  .stage-flow { justify-content: center; }
}
