:root {
  --page-plane:      #f9f9f7;
  --surface-1:       #fcfcfb;
  --text-primary:    #0b0b0b;
  --text-secondary:  #52514e;
  --text-muted:      #898781;
  --gridline:        #e1e0d9;
  --border:          rgba(11,11,11,0.10);
  --series-1:        #2a78d6; /* blue */
  --series-3:        #1baf7a; /* aqua */
  --status-good:     #0ca30c;
  --status-warning:  #fab219;
  --status-serious:  #ec835a;
  --status-critical: #d03b3b;
}

:root[data-theme="dark"] {
  --page-plane:      #0d0d0d;
  --surface-1:       #1a1a19;
  --text-primary:    #ffffff;
  --text-secondary:  #c3c2b7;
  --text-muted:      #898781;
  --gridline:        #2c2c2a;
  --border:          rgba(255,255,255,0.10);
  --series-1:        #3987e5;
  --series-3:        #199e70;
  --status-good:     #0ca30c;
  --status-warning:  #fab219;
  --status-serious:  #ec835a;
  --status-critical: #e66767;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--page-plane);
  color: var(--text-primary);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  border-bottom: 1px solid var(--border);
}

.topbar-title { display: flex; align-items: baseline; gap: 10px; }
.topbar-title h1 { font-size: 20px; margin: 0; }
.topbar .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--status-good);
  display: inline-block;
}
.subtitle { color: var(--text-muted); font-size: 13px; }
.generated-at { color: var(--text-muted); font-size: 12px; }

main { padding: 24px 28px 48px; max-width: 1200px; margin: 0 auto; }

.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.kpi-tile {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
}
.kpi-value { font-size: 28px; font-weight: 600; line-height: 1.1; }
.kpi-label { color: var(--text-secondary); font-size: 12px; margin-top: 4px; }

.panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 16px;
}

.panel {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
}
.panel h2 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  margin: 0 0 14px;
}
.empty-state { color: var(--text-muted); font-size: 13px; }

/* milestones */
.milestone { margin-bottom: 16px; }
.milestone:last-child { margin-bottom: 0; }
.milestone-head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 13px; margin-bottom: 6px;
}
.milestone-name { font-weight: 600; }
.milestone-count { color: var(--text-muted); }
.progress-track {
  background: var(--gridline);
  border-radius: 999px;
  height: 6px;
  overflow: hidden;
}
.progress-fill {
  background: var(--series-1);
  height: 100%;
  border-radius: 999px 0 0 999px;
}
.milestone-due { color: var(--text-muted); font-size: 11px; margin-top: 4px; }

/* activity list */
.activity-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--gridline);
  font-size: 13px;
}
.activity-row:last-child { border-bottom: none; }
.activity-title { flex: 1; }
.activity-time { color: var(--text-muted); font-size: 11px; white-space: nowrap; }

.status-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.status-chip .swatch { width: 7px; height: 7px; border-radius: 50%; }
.status-open        { color: var(--text-muted); background: var(--gridline); }
.status-open .swatch        { background: var(--text-muted); }
.status-in-progress  { color: var(--status-warning); background: color-mix(in srgb, var(--status-warning) 15%, transparent); }
.status-in-progress .swatch { background: var(--status-warning); }
.status-in-review    { color: var(--series-1); background: color-mix(in srgb, var(--series-1) 15%, transparent); }
.status-in-review .swatch   { background: var(--series-1); }
.status-pending       { color: var(--series-3); background: color-mix(in srgb, var(--series-3) 15%, transparent); }
.status-pending .swatch      { background: var(--series-3); }
.status-done          { color: var(--status-good); background: color-mix(in srgb, var(--status-good) 15%, transparent); }
.status-done .swatch         { background: var(--status-good); }

/* deployments */
.deploy-row {
  padding: 10px 0;
  border-bottom: 1px solid var(--gridline);
  font-size: 13px;
}
.deploy-row:last-child { border-bottom: none; }
.deploy-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.deploy-label { font-weight: 600; }
.deploy-url { color: var(--series-1); text-decoration: none; font-size: 12px; word-break: break-all; }
.deploy-url:hover { text-decoration: underline; }
.reach-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.reach-chip .swatch { width: 7px; height: 7px; border-radius: 50%; }
.reach-yes { color: var(--status-good); }
.reach-yes .swatch { background: var(--status-good); }
.reach-no { color: var(--status-critical); }
.reach-no .swatch { background: var(--status-critical); }

/* notes */
.note { margin-bottom: 14px; font-size: 13px; }
.note:last-child { margin-bottom: 0; }
.note-title { font-weight: 600; margin-bottom: 4px; }
.note-body { color: var(--text-secondary); white-space: pre-wrap; }

footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 11px;
  padding: 16px;
  border-top: 1px solid var(--border);
}
footer code { color: var(--text-secondary); }
