/* Shared by the dashboards: stats.html and visitors.html. */
:root {
  --bg: #f4f5f9;
  --card: #fff;
  --border: #e3e6ef;
  --grid: #eceef4;
  --text: #141a2e;
  --muted: #5f6880;
  --brand: #4b2bd6;
  --series-1: #2a78d6;
  --series-2: #eb6834;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); font-size: 14px; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 32px 16px 64px; }
header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
header h1 { font-size: 20px; margin: 0; }
header nav { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
header a { color: var(--brand); text-decoration: none; font-weight: 600; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 20px; }
.card h2 { font-size: 15px; margin: 0; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.sub { color: var(--muted); font-size: 12px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 12px; }
.tile { padding: 16px; }
.tile .label { color: var(--muted); font-size: 12px; font-weight: 600; }
.tile .value { font-size: clamp(20px, 5.5vw, 28px); overflow-wrap: anywhere; font-weight: 700; margin-top: 6px; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.tile .note { color: var(--muted); font-size: 12px; margin-top: 4px; min-height: 1em; }

.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: 240px; overflow: visible; }
.chart text { font-size: 11px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.tip { position: absolute; pointer-events: none; background: var(--text); color: #fff; border-radius: 8px; padding: 8px 10px; font-size: 12px; line-height: 1.5; white-space: nowrap; z-index: 1; }
.tip b { font-weight: 600; }
.tip i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; margin-right: 6px; }
details { margin-top: 12px; }
summary { cursor: pointer; color: var(--muted); font-size: 12px; }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; margin-top: 12px; }
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.bars .row { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; margin-bottom: 6px; }
.bars .row span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars .row span:last-child { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bars .track { height: 8px; background: var(--grid); border-radius: 4px; overflow: hidden; }
.bars .fill { height: 100%; background: var(--series-1); border-radius: 4px; transition: width .4s ease; }
.empty-note { color: var(--muted); font-size: 13px; }
