/* The Visits card on /admin, and the number tiles it shares with /registration. */

.count-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.count-box { padding: 16px 18px; border: 1px solid #34403a; background: #0a1413; text-align: center; }
.count-box strong { display: block; font: 800 34px/1 var(--display); color: var(--teal); }
.count-label { display: block; margin-top: 4px; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: #8a938b; }
.count-extra { display: block; margin-top: 6px; font-size: 10px; color: #6f7a72; }

.stat-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) 42px; gap: 10px; align-items: center; margin-bottom: 6px; font-size: 13px; }
.stat-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--paper); }
.stat-bar { height: 8px; background: #16211f; border: 1px solid #22302d; }
.stat-bar i { display: block; height: 100%; background: var(--teal); }
.stat-row strong { text-align: right; font: 700 13px var(--mono); color: var(--yellow); }

/* days / weeks / months / years */
.stats-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 14px; }
.stats-working { font-size: 11px; color: var(--yellow); }

.grain-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.grain-btn {
  padding: 6px 12px; border: 1px solid #34403a; background: #0a1413; color: #8a938b;
  font: 700 10px var(--mono); letter-spacing: .14em; text-transform: uppercase; cursor: pointer;
}
.grain-btn:hover { color: var(--paper); border-color: #4a5a52; }
.grain-btn.current { border-color: var(--teal); color: var(--teal); }

.chart { margin-bottom: 20px; }
.chart-plot { display: flex; align-items: flex-end; justify-content: flex-start; gap: 4px; height: 190px; padding: 10px 6px 0; border: 1px solid #22302d; background: #0a1413; overflow-x: auto; }
.chart-col { flex: 1 1 0; min-width: 22px; max-width: 70px; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; padding: 0; border: 0; background: none; cursor: pointer; }
.chart-bars { flex: 1 1 auto; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 3px; height: 100%; }
/* A bar and its number are one column: the number rides the bar's top edge. */
.bar { flex: 1 1 0; max-width: 26px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.bar-value { font: 700 9px var(--mono); font-style: normal; line-height: 1.2; margin-bottom: 2px; }
.bar-fill { display: block; width: 100%; min-height: 2px; }
.bar.views .bar-fill { background: var(--teal); }
.bar.views .bar-value { color: var(--teal); }
.bar.visits .bar-fill { background: var(--yellow); opacity: .85; }
.bar.visits .bar-value { color: var(--yellow); }
.chart-col:hover .bar-fill { filter: brightness(1.25); }
.chart-col.current .chart-label { color: var(--paper); border-bottom: 1px solid var(--teal); }
.chart-label { font: 400 9px var(--mono); color: #6f7a72; letter-spacing: .04em; white-space: nowrap; }

.chart-legend { display: flex; gap: 16px; margin: 8px 0 0; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: #8a938b; }
.chart-legend span { display: flex; align-items: center; gap: 6px; }
.chart-legend span::before { content: ""; width: 10px; height: 10px; }
.chart-legend .key-views::before { background: var(--teal); }
.chart-legend .key-visits::before { background: var(--yellow); }

.bucket-title { margin-top: 0; }
.stats-fresh { margin-bottom: 4px; }
.stats-fresh.stale { color: var(--orange); }

@media (max-width: 800px) {
  .count-row { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: 110px minmax(0, 1fr) 36px; font-size: 12px; }
  .bar-value { font-size: 8px; }
  .bar { max-width: 18px; }
}
