:root {
  --bg: #1f201e;
  --card: #2b2c2a;
  --card-soft: #30312f;
  --line: #3b3c39;
  --muted: #969893;
  --text: #f5f5f0;
  --green: #8dd477;
  --orange: #c68624;
  --blue: #1767ab;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 50% -20%, rgba(255, 255, 255, .035), transparent 34rem),
    var(--bg);
}

button {
  color: inherit;
  font: inherit;
}

.dashboard {
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: 24px 29px 18px;
}

.topbar,
.card-head,
.row-label,
.metric-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar {
  gap: 18px;
  margin-bottom: 20px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(20px, 2.4vw, 30px);
  line-height: 1.02;
  letter-spacing: 0;
}

.topbar p {
  margin-top: 4px;
  color: #d8d8d2;
  font-size: clamp(14px, 1.35vw, 17px);
  font-weight: 600;
}

.filters {
  display: flex;
  gap: 8px;
}

.filters button,
.actions button {
  min-height: 34px;
  border: 1px solid #444641;
  border-radius: 12px;
  background: linear-gradient(180deg, #2a2b29, #242523);
  box-shadow: inset 0 1px rgba(255, 255, 255, .08), 0 8px 20px rgba(0, 0, 0, .14);
  font-weight: 800;
}

.filters button {
  min-width: 43px;
  padding: 0 12px;
}

.card {
  border: 1px solid var(--line);
  border-radius: 13px;
  background: linear-gradient(180deg, var(--card-soft), var(--card));
  box-shadow: inset 0 1px rgba(255, 255, 255, .035), 0 24px 60px rgba(0, 0, 0, .1);
  padding: 17px 21px;
}

.card + .card,
.card-grid {
  margin-top: 15px;
}

.card-head {
  gap: 14px;
  margin-bottom: 12px;
}

.card-head h2 {
  font-size: 14px;
  line-height: 1.2;
  letter-spacing: 0;
}

.card-head span,
.row-label span:last-child,
.legend,
.metric-list span,
.stage-row > span {
  color: var(--muted);
}

.card-head span,
.row-label,
.legend,
.metric-list,
.stage-row > span {
  font-size: 12px;
  font-weight: 700;
}

.positive,
.ads-card .card-head span,
.funnel-row:last-child .row-label span:last-child {
  color: var(--green);
}

.revenue-main {
  display: flex;
  align-items: baseline;
  gap: 18px;
}

.revenue-value {
  font-size: clamp(36px, 4.2vw, 50px);
  line-height: .96;
  font-weight: 850;
  letter-spacing: 0;
}

.positive {
  font-size: 13px;
  font-weight: 850;
}

.trend-chart {
  display: block;
  width: 100%;
  height: 95px;
  margin: 8px 0 0;
  border-bottom: 1px solid #41433f;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding-top: 11px;
}

.stat-grid span {
  display: block;
  color: #c0c2bc;
  font-size: 12px;
  font-weight: 700;
}

.stat-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
  line-height: 1;
}

.funnel-list {
  display: grid;
  gap: 9px;
}

.row-label {
  gap: 16px;
  margin-bottom: 6px;
  color: #ddded8;
  line-height: 1.1;
}

.row-label strong {
  color: #f0f1ed;
}

.funnel-row:nth-child(3) .row-label span:last-child,
.stage-card p {
  color: #d8a84a;
}

.track,
.stage-track {
  overflow: hidden;
  background: #222320;
}

.track {
  height: 22px;
  border-radius: 10px;
}

.track i,
.stage-track i {
  display: block;
  height: 100%;
  transform-origin: left;
  animation: growX .75s ease-out both;
}

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

.mix-card,
.ads-card,
.health-card,
.stage-card {
  min-height: 240px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  border-radius: 3px;
  vertical-align: -1px;
}

.legend .orange {
  background: var(--orange);
}

.legend .blue {
  background: var(--blue);
}

.donut {
  width: min(150px, 58%);
  aspect-ratio: 1;
  margin: 13px auto 0;
  border-radius: 50%;
  position: relative;
  animation: donutIn .8s ease-out both;
}

.donut::after {
  content: "";
  position: absolute;
  inset: 28%;
  border-radius: inherit;
  background: var(--card);
}

.bar-chart {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  height: 150px;
  padding: 8px 3px 0;
  align-items: end;
}

.bar-group {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: #797b76;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.bars {
  height: 120px;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 7px;
}

.bars i {
  width: 8px;
  min-height: 5px;
  border-radius: 4px 4px 1px 1px;
  transform-origin: bottom;
  animation: growY .75s ease-out both;
}

.bars .ad {
  background: var(--orange);
}

.bars .rev {
  width: 18px;
  background: var(--blue);
}

.trend-area {
  animation: fadeUp .75s ease-out both;
}

.trend-line,
.trend-glow {
  stroke-dasharray: 1100;
  stroke-dashoffset: 1100;
  animation: drawLine .9s ease-out both;
}

@keyframes growX {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

@keyframes growY {
  from {
    transform: scaleY(0);
  }
  to {
    transform: scaleY(1);
  }
}

@keyframes drawLine {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes donutIn {
  from {
    opacity: 0;
    transform: scale(.92) rotate(-18deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}

.health-boxes {
  display: grid;
  grid-template-columns: 1fr .36fr .15fr;
  gap: 7px;
  margin: 4px 0 16px;
}

.health-boxes div {
  min-height: 50px;
  display: grid;
  place-items: center;
  align-content: center;
  border-radius: 10px;
  color: #262720;
}

.health-boxes strong {
  font-size: 18px;
  line-height: 1;
}

.health-boxes span {
  margin-top: 4px;
  font-size: 10px;
  font-weight: 800;
}

.metric-list {
  display: grid;
}

.metric-list div {
  min-height: 28px;
  border-top: 1px solid #3b3c38;
}

.metric-list strong {
  color: #f1f2ed;
}

.stage-list {
  display: grid;
  gap: 13px;
  margin-top: 22px;
}

.stage-row {
  display: grid;
  grid-template-columns: 78px 1fr;
  align-items: center;
  gap: 18px;
}

.stage-track {
  height: 32px;
  border-radius: 5px;
}

.stage-track i {
  border-radius: inherit;
}

.stage-card p {
  margin-top: 20px;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 15px;
}

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

.actions button {
  min-height: 35px;
  padding: 0 20px;
  font-size: 13px;
}

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

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 20px;
  }

  .filters {
    width: 100%;
  }

  .filters button {
    flex: 1;
    min-width: 0;
  }

  .card {
    padding: 22px;
  }

  .card-grid,
  .stat-grid {
    grid-template-columns: 1fr;
  }

  .stat-grid {
    gap: 15px;
  }

  .row-label {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .track {
    height: 28px;
  }

  .mix-card,
  .ads-card,
  .health-card,
  .stage-card {
    min-height: auto;
  }

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

  .stage-row {
    grid-template-columns: 80px 1fr;
    gap: 12px;
  }

  .actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}

@media (min-width: 641px) and (max-width: 980px) {
  .dashboard {
    padding-inline: 24px;
  }
}
