.stats { padding-block: 36px 48px; }
.stats-head { display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: 16px; margin-bottom: 22px; }
.stats h1 { margin: 0; font-size: clamp(2rem, 5vw, 3.125rem); line-height: 1.1; letter-spacing: -.035em; }
.stats h2 { margin: 0; font-size: 1.25rem; line-height: 1.3; letter-spacing: -.02em; }
.stats-head p, .stats-panel header p, .stats-auth p { margin: 6px 0 0; color: var(--muted); line-height: 1.5; }
.stats-controls { display: flex; flex-wrap: wrap; gap: 8px; }
.stats-button, .stats-controls select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 13px;
  background: var(--paper);
  font-size: .875rem;
}
.stats-button { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; font-weight: 650; }
.stats-button:hover:enabled, a.stats-button:hover { border-color: var(--blue); color: var(--dark-blue); }
.stats-button:disabled { color: var(--muted); opacity: .65; cursor: default; }
.stats-sign-in { color: var(--paper); background: var(--blue); border-color: var(--blue); }
a.stats-sign-in:hover { color: var(--paper); background: var(--dark-blue); }
.stats-notice { padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--muted); }
.stats-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 0 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
}
.stats-overview div { min-width: 0; padding: 16px 20px; }
.stats-overview div + div { border-left: 1px solid var(--line); }
.stats-overview dt { color: var(--muted); font-size: .875rem; }
.stats-overview dd { margin: 4px 0 0; font-size: 2rem; font-weight: 750; letter-spacing: -.035em; }
.stats-overview dd, .stats-panel :is(td, th):not(:first-child) { font-variant-numeric: tabular-nums; }
.stats-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 20px; align-items: start; }
.stats-panel { min-width: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.stats-panel header { padding: 18px 18px 13px; }
.stats-panel header p, .stats-empty, .stats-note { font-size: .875rem; }
.stats-panel table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.stats-panel :is(th, td) { padding: 10px 9px; text-align: right; border-top: 1px solid var(--line); }
.stats-panel thead th { color: var(--muted); font-weight: 650; background: #f8f9f6; }
.stats-panel :is(th, td):first-child { padding-left: 18px; text-align: left; overflow-wrap: anywhere; }
.stats-panel td:last-child, .stats-panel thead th:last-child { padding-right: 18px; }
.stats-panel tbody th { font-weight: 550; }
.stats-panel tbody tr:last-child > :first-child { border-bottom-left-radius: 12px; }
.stats-panel tbody tr:last-child > :last-child { border-bottom-right-radius: 12px; }
.shop-stats td:nth-child(2) { font-weight: 700; }
.stats-empty { margin: 0; padding: 13px 18px; color: var(--muted); border-top: 1px solid var(--line); }
.stats-pagination { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); font-size: .875rem; }
.stats-note { margin: 16px 0 0; color: var(--muted); line-height: 1.5; }
.stats-auth { max-width: 520px; margin: 24px auto; padding: 26px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.stats-auth h1 { margin-top: 22px; font-size: clamp(1.75rem, 5vw, 2.5rem); }
.stats-auth .stats-button { margin-top: 19px; }

@media (max-width: 860px) {
  .stats-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 490px) {
  .stats { padding-block: 24px 32px; }
  .stats-overview div { padding: 11px 9px; }
  .stats-overview dt { font-size: .75rem; min-height: 2.4em; }
  .stats-overview dd { font-size: 1.375rem; overflow-wrap: anywhere; }
  .stats-panel header { padding-inline: 12px; }
  .stats-panel :is(th, td) { padding-inline: 4px; }
  .stats-panel :is(th, td):first-child { padding-left: 12px; }
  .stats-panel td:last-child, .stats-panel thead th:last-child { padding-right: 12px; }
}
