/* The system admin dashboard (admin/dashboards/show): stat tiles, then one
   monthly bar chart per statistic (see Admin::DashboardsHelper). Every
   chart is a single series, so one blue, named by its title. */
.admin-stats {
  --stat-bar: #2a78d6;
  --stat-bar-hover: #1b5fae;
  --stat-grid: #e5e7eb;
  --stat-axis: #9ca3af;
  --stat-ink-muted: #6b7280;
}

.admin-stats__tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 0.75rem;
}

.admin-stats__tile,
.admin-stats__chart {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 0.85rem 1rem;
}

.admin-stats__tile {
  display: block;
  color: inherit;
  text-decoration: none;
}

.admin-stats__tile:hover {
  border-color: var(--stat-bar);
  box-shadow: 0 2px 8px rgba(42, 120, 214, 0.12);
}

.admin-stats__tile p {
  margin: 0;
}

.admin-stats__label {
  color: var(--stat-ink-muted);
  font-size: 0.85rem;
}

.admin-stats__total {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.admin-stats__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 2rem 0 0.75rem;
}

/* By Month / By Week / By Day: tabs, the active one white. */
.admin-stats__periods {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.25rem;
  background: #e5e7eb;
  border-radius: 8px;
}

.admin-stats__period {
  padding: 0.35rem 0.85rem;
  border-radius: 6px;
  color: #374151;
  font-weight: 600;
  text-decoration: none;
}

.admin-stats__period:hover {
  color: #111827;
}

.admin-stats__period.is-active {
  background: #ffffff;
  color: #111827;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
}

.admin-stats__bar .subnav {
  margin: 0;
}

.admin-stats__charts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 520px), 1fr));
  gap: 0.75rem;
}

.admin-stats__chart h3 {
  margin: 0;
  font-size: 1rem;
}

.admin-stats__chart h3 a {
  color: inherit;
  text-decoration: none;
}

.admin-stats__chart h3 a:hover {
  color: var(--stat-bar);
  text-decoration: underline;
}

.admin-stats__chart .card-meta {
  margin: 0.1rem 0 0.5rem;
}

.stat-chart {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.stat-chart__grid {
  stroke: var(--stat-grid);
  stroke-width: 1;
}

.stat-chart__baseline {
  stroke: var(--stat-axis);
  stroke-width: 1;
}

.stat-chart__tick {
  fill: var(--stat-ink-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.stat-chart__hit {
  fill: transparent;
}

.stat-chart__bar {
  fill: var(--stat-bar);
}

.stat-chart__bucket {
  cursor: pointer;
}

.stat-chart__bucket:hover .stat-chart__hit {
  fill: rgba(42, 120, 214, 0.08);
}

.stat-chart__bucket:hover .stat-chart__bar {
  fill: var(--stat-bar-hover);
}

.admin-stats__table {
  margin-top: 1.5rem;
}

.admin-stats__table summary {
  cursor: pointer;
  font-weight: 600;
}

.admin-stats__table-scroll {
  overflow-x: auto;
  margin-top: 0.75rem;
}

.admin-stats__table table {
  border-collapse: collapse;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.admin-stats__table th,
.admin-stats__table td {
  padding: 0.35rem 0.6rem;
  border-bottom: 1px solid #e5e7eb;
  text-align: right;
  white-space: nowrap;
}

.admin-stats__table th:first-child {
  text-align: left;
}

/* A statistic's report (admin/reports/show). */
.admin-report__filter {
  margin: 0 0 1rem;
}

.admin-report table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.admin-report th,
.admin-report td {
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  vertical-align: top;
}

.admin-report th {
  color: var(--stat-ink-muted);
  font-weight: 600;
  white-space: nowrap;
}

.admin-report td.is-number {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.admin-report__scroll {
  overflow-x: auto;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
}

/* Who visits and from where (admin/visits/show). */
.admin-visits__section {
  margin-top: 1.75rem;
}

.admin-visits th.is-number,
.admin-visits td.is-number {
  text-align: center;
}

.admin-visits__section h2 {
  font-size: 1.1rem;
  margin: 0 0 0.5rem;
}

.admin-visits__credit {
  margin-top: 2rem;
}
