:root {
  --ink: #1f2933;
  --muted: #65727f;
  --paper: #f6f3ee;
  --surface: #ffffff;
  --line: #d8d3c7;
  --teal: #245d60;
  --teal-2: #2f7775;
  --copper: #b46a37;
  --gold: #d6a33d;
  --green: #3f7a54;
  --red: #b94b45;
  --sidebar: #172927;
  --shadow: 0 18px 45px rgba(31, 41, 51, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(36, 93, 96, 0.07), rgba(180, 106, 55, 0.07)),
    var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
a {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 28px 22px;
  color: #f7f3ea;
  background:
    radial-gradient(circle at 20% 0%, rgba(214, 163, 61, 0.16), transparent 28%),
    linear-gradient(180deg, #172927 0%, #0f1b1a 100%);
}

.brand-block {
  display: flex;
  gap: 14px;
  align-items: center;
}

.brand-mark {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 1px solid rgba(214, 163, 61, 0.55);
  background: rgba(214, 163, 61, 0.12);
  border-radius: 8px;
  color: #f6d58c;
  font-weight: 800;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--copper);
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar .eyebrow {
  color: #d7b46c;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.1;
}

h1 {
  font-size: 1.1rem;
}

h2 {
  font-size: clamp(1.9rem, 3vw, 3rem);
  letter-spacing: 0;
}

h3 {
  font-size: 1.05rem;
}

.nav-list {
  display: grid;
  gap: 7px;
}

.nav-list a {
  display: block;
  padding: 11px 12px;
  border-radius: 7px;
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
}

.nav-list a.active,
.nav-list a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.10);
}

.side-note {
  margin-top: auto;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
}

.side-note strong,
.side-note span {
  display: block;
}

.side-note span:not(.status-dot) {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.82rem;
}

.status-dot {
  width: 10px;
  height: 10px;
  margin-top: 4px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 5px rgba(214, 163, 61, 0.14);
}

.dashboard {
  padding: 32px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 24px;
}

.lede {
  max-width: 780px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 1rem;
}

.topbar-actions {
  display: flex;
  gap: 10px;
}

.icon-button,
.primary-button {
  min-height: 42px;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
}

.icon-button {
  width: 42px;
  color: var(--teal);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.primary-button {
  padding: 0 16px;
  color: #fff;
  background: var(--teal);
  box-shadow: var(--shadow);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.kpi-card,
.panel {
  border: 1px solid rgba(36, 93, 96, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
}

.kpi-card {
  padding: 16px;
}

.kpi-card span,
.reward-grid span,
.muted {
  color: var(--muted);
}

.kpi-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1.8rem;
}

.kpi-card small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

.kpi-card.highlight {
  color: #fff;
  background: linear-gradient(135deg, var(--teal), #183a3b);
}

.kpi-card.highlight span,
.kpi-card.highlight small {
  color: rgba(255, 255, 255, 0.76);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(340px, 0.75fr);
  gap: 18px;
}

.panel {
  padding: 18px;
}

.panel.wide {
  grid-column: 1 / -1;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--teal);
  background: rgba(36, 93, 96, 0.10);
  font-size: 0.76rem;
  font-weight: 800;
}

.badge.locked {
  color: #8a5a20;
  background: rgba(214, 163, 61, 0.18);
}

.funnel {
  display: grid;
  grid-template-columns: repeat(6, minmax(105px, 1fr));
  gap: 10px;
}

.funnel-step {
  min-height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 12px;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(180deg, var(--teal-2), var(--teal));
}

.funnel-step strong {
  font-size: 1.45rem;
}

.funnel-step span {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.78rem;
}

.line-chart {
  width: 100%;
  min-height: 230px;
}

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

.source-row {
  display: grid;
  grid-template-columns: 110px 1fr 54px;
  gap: 10px;
  align-items: center;
}

.bar {
  height: 11px;
  overflow: hidden;
  border-radius: 999px;
  background: #ebe5d8;
}

.bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--copper), var(--gold));
}

.leaderboard {
  display: grid;
  gap: 10px;
}

.leader-row {
  display: grid;
  grid-template-columns: 34px 1fr 72px;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 7px;
  background: #f7f4ed;
}

.rank {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--teal);
  font-weight: 800;
}

.progress {
  height: 7px;
  margin-top: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #e3ded2;
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--gold);
}

.reward-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.reward-grid div {
  padding: 12px;
  border-radius: 7px;
  background: #f7f4ed;
}

.reward-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 1.35rem;
}

.alerts {
  display: grid;
  gap: 10px;
}

.alert {
  padding: 12px;
  border-left: 4px solid var(--gold);
  border-radius: 7px;
  background: #fff8e8;
}

.alert.warning {
  border-left-color: var(--red);
  background: #fff0ed;
}

.alert strong {
  display: block;
  margin-bottom: 3px;
}

.action-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
  counter-reset: actions;
}

.action-list li {
  counter-increment: actions;
  padding: 14px;
  border-radius: 8px;
  background: #f7f4ed;
}

.action-list li::before {
  content: counter(actions);
  display: grid;
  width: 26px;
  height: 26px;
  margin-bottom: 10px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--copper);
  font-size: 0.82rem;
  font-weight: 800;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .nav-list {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .kpi-grid {
    grid-template-columns: repeat(3, 1fr);
  }

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

@media (max-width: 760px) {
  .dashboard {
    padding: 20px;
  }

  .topbar,
  .panel-heading {
    flex-direction: column;
  }

  .nav-list,
  .kpi-grid,
  .funnel,
  .action-list {
    grid-template-columns: 1fr;
  }
}
