.statsPage{
  width:100%;
}

.statsHero{
  display:grid;
  grid-template-columns:minmax(0,1fr) 220px;
  gap:20px;
  align-items:stretch;
  margin-bottom:18px;
}

.eyebrow{
  margin:0 0 8px;
  color:var(--primary);
  font-size:12px;
  font-weight:800;
  letter-spacing:.14em;
  text-transform:uppercase;
}

.statsHero h1{
  margin:0;
  font-size:clamp(36px, 6vw, 68px);
  line-height:.95;
  letter-spacing:-.055em;
}

.heroText{
  max-width:680px;
  margin:16px 0 0;
  color:var(--text-secondary);
  font-size:16px;
  line-height:1.6;
}

.statsTotalCard{
  border:1px solid rgba(37,99,235,.18);
  border-radius:22px;
  padding:20px;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  background:linear-gradient(135deg,#fff,#eaf2ff);
  box-shadow:var(--shadow-sm);
}

.statsTotalLabel,
.statsTotalCard span:last-child{
  color:var(--text-secondary);
  font-size:12px;
  font-weight:700;
}

.statsTotalCard strong{
  font-size:54px;
  letter-spacing:-.06em;
}

.statsControls{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  justify-content:space-between;
  align-items:center;
  margin-bottom:18px;
  padding:12px;
  border:1px solid var(--border-color);
  border-radius:18px;
  background:rgba(255,255,255,.86);
}

.rangeButtons{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.rangeBtn,
.applyBtn{
  border:1px solid var(--border-color);
  background:#fff;
  color:var(--text-primary);
  border-radius:999px;
  padding:9px 14px;
  font-weight:800;
  cursor:pointer;
}

.rangeBtn.active,
.applyBtn{
  border-color:rgba(37,99,235,.35);
  background:var(--primary);
  color:#fff;
}

.customRange{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:end;
}

.customRange label{
  display:flex;
  flex-direction:column;
  gap:4px;
  color:var(--text-secondary);
  font-size:11px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.08em;
}

.customRange input{
  height:36px;
  border:1px solid var(--border-color);
  border-radius:10px;
  padding:0 10px;
  color:var(--text-primary);
  background:#fff;
}

.statsStatus{
  min-height:22px;
  margin-bottom:14px;
  color:var(--text-secondary);
  font-size:13px;
}

.statsStatus.error{
  color:var(--danger);
}

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

.statsCard{
  min-width:0;
  border:1px solid var(--border-color);
  border-radius:22px;
  background:rgba(255,255,255,.92);
  box-shadow:var(--shadow-sm);
  padding:18px;
}

.statsCardWide{
  grid-column:1 / -1;
}

.statsCardHeader{
  display:flex;
  justify-content:space-between;
  gap:14px;
  margin-bottom:16px;
}

.statsCard h2{
  margin:0;
  font-size:18px;
}

.statsCard p{
  margin:4px 0 0;
  color:var(--text-secondary);
  font-size:13px;
}

.verticalChart{
  min-height:260px;
  display:flex;
  align-items:end;
  gap:8px;
  overflow-x:auto;
  padding:14px 4px 2px;
}

.vBar{
  min-width:36px;
  flex:1 0 36px;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:8px;
}

.vBarTrack{
  width:100%;
  height:190px;
  display:flex;
  align-items:end;
  border-radius:999px;
  background:#eff6ff;
  overflow:hidden;
}

.vBarFill{
  width:100%;
  min-height:3px;
  height:var(--bar-height);
  border-radius:999px 999px 0 0;
  background:linear-gradient(180deg,#2563eb,#60a5fa);
}

.vBarValue{
  color:var(--text-primary);
  font-size:12px;
  font-weight:800;
}

.vBarLabel{
  color:var(--text-secondary);
  font-size:11px;
  white-space:nowrap;
}

.hourChart .vBar{
  min-width:32px;
  flex-basis:32px;
}

.horizontalChart{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.hRow{
  display:grid;
  grid-template-columns:minmax(72px,110px) minmax(0,1fr) 44px;
  gap:10px;
  align-items:center;
}

.hLabel{
  color:var(--text-primary);
  font-size:13px;
  font-weight:800;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.hTrack{
  height:12px;
  border-radius:999px;
  background:var(--gray-200);
  overflow:hidden;
}

.hFill{
  height:100%;
  width:var(--bar-width);
  min-width:3px;
  border-radius:999px;
  background:linear-gradient(90deg,#2563eb,#93c5fd);
}

.stageChart .hFill{
  background:linear-gradient(90deg,#0f172a,#64748b);
}

.hValue{
  text-align:right;
  color:var(--text-primary);
  font-weight:800;
  font-size:13px;
}

.emptyChart{
  padding:24px;
  border:1px dashed var(--border-color);
  border-radius:16px;
  color:var(--text-secondary);
  text-align:center;
  background:var(--bg-secondary);
}

@media (max-width:860px){
  .statsHero{
    grid-template-columns:1fr;
  }

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

@media (max-width:560px){
  .app{
    padding:12px;
  }

  .statsControls{
    align-items:stretch;
  }

  .rangeButtons,
  .customRange{
    width:100%;
  }

  .rangeBtn{
    flex:1 1 auto;
  }

  .hRow{
    grid-template-columns:68px minmax(0,1fr) 34px;
  }
}
