:root {
  --bg: #f6efe4;
  --bg-accent: #e0f0ea;
  --panel: rgba(255, 252, 247, 0.86);
  --panel-strong: #fffaf2;
  --text: #1f2933;
  --muted: #5b6772;
  --line: rgba(31, 41, 51, 0.1);
  --primary: #0c7c59;
  --warning: #b42318;
  --shadow: 0 20px 50px rgba(41, 52, 65, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Outfit", "Noto Sans SC", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(12, 124, 89, 0.16), transparent 28%),
    radial-gradient(circle at top right, rgba(217, 119, 6, 0.18), transparent 22%),
    linear-gradient(160deg, var(--bg) 0%, #f7f6f2 52%, var(--bg-accent) 100%);
  min-height: 100vh;
}

.page-shell {
  width: min(1240px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(255, 250, 242, 0.92), rgba(247, 255, 252, 0.9));
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--primary);
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1.05;
}

.hero-copy {
  max-width: 720px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
}

.hero-meta {
  min-width: 220px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(12, 124, 89, 0.16);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--primary);
  box-shadow: 0 0 0 8px rgba(12, 124, 89, 0.12);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  70% { transform: scale(1); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

#last-updated {
  margin: 14px 0 0;
  color: var(--muted);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.panel {
  padding: 22px;
  border-radius: 24px;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.metrics-panel {
  grid-column: span 7;
}

.insights-panel {
  grid-column: span 5;
}

.full-span {
  grid-column: 1 / -1;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}

.stacked-header {
  align-items: flex-start;
}

.panel-header h2 {
  margin: 0;
  font-size: 1.15rem;
}

.panel-caption {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.focus-actions,
.range-picker {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.refresh-button {
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  background: linear-gradient(135deg, var(--primary), #119c76);
  color: white;
  font: inherit;
  cursor: pointer;
  transition: transform 160ms ease;
  box-shadow: 0 12px 30px rgba(12, 124, 89, 0.24);
}

.refresh-button:hover {
  transform: translateY(-1px);
}

.ghost-button {
  border: 1px solid rgba(12, 124, 89, 0.18);
  border-radius: 999px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--primary);
  font: inherit;
  cursor: pointer;
}

.ghost-button.active {
  background: rgba(12, 124, 89, 0.12);
  border-color: rgba(12, 124, 89, 0.35);
  box-shadow: inset 0 0 0 1px rgba(12, 124, 89, 0.15);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.metric-card {
  padding: 18px;
  border-radius: 18px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
}

.metric-label {
  display: block;
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 12px;
}

.metric-card strong {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  line-height: 1;
}

.insights-list {
  display: grid;
  gap: 12px;
}

.insight-card {
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.58);
}

.insight-card h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.insight-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.insight-card.highlight {
  background: rgba(12, 124, 89, 0.08);
}

.insight-card.warning {
  background: rgba(180, 35, 24, 0.08);
}

.chart {
  width: 100%;
  height: 420px;
}

.focus-picker {
  margin-bottom: 16px;
}

.focus-picker-label {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.95rem;
}

.focus-member-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.member-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  cursor: pointer;
  user-select: none;
}

.member-chip input {
  margin: 0;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th,
td {
  text-align: left;
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

thead th {
  color: var(--muted);
  font-weight: 600;
}

tbody tr:hover {
  background: rgba(12, 124, 89, 0.04);
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: rgba(12, 124, 89, 0.1);
  color: var(--primary);
  font-weight: 700;
}

.member-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.rank-shift {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.rank-shift.up {
  color: var(--primary);
  background: rgba(12, 124, 89, 0.12);
}

.rank-shift.down {
  color: var(--warning);
  background: rgba(180, 35, 24, 0.12);
}

.positive {
  color: var(--primary);
}

.negative {
  color: var(--warning);
}

.neutral {
  color: var(--muted);
}

@media (max-width: 980px) {
  .hero {
    flex-direction: column;
  }

  .metrics-panel,
  .insights-panel {
    grid-column: 1 / -1;
  }

  .focus-actions,
  .range-picker {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100vw - 18px, 1240px);
    padding-top: 12px;
  }

  .hero,
  .panel {
    padding: 18px;
    border-radius: 20px;
  }

  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .chart {
    height: 320px;
  }

  table {
    font-size: 0.88rem;
  }
}
