/*
 * Halaman statistik publik: /statistik-pengunjung & /statistik-website.
 * Warna mengikuti --primary-color tema (lihat junastheme-master).
 */
.stats-page { padding: 0 0 96px; }
.stats-page .stats-intro { max-width: 720px; margin: 0 auto 32px; text-align: center; color: var(--text-color); }

/* style.css memaksa .row { margin: -20px !important } -> halaman bergeser 5px; pakai gutter 24px */
.stats-page .row { margin-left: -12px !important; margin-right: -12px !important; }
.stats-page .row > * { padding-left: 12px !important; padding-right: 12px !important; }

/* ---------- Panel umum ---------- */
.stats-panel {
  height: 100%;
  background: #fff;
  border: 1px solid var(--stoke-color);
  border-radius: 16px;
  padding: 20px 24px;
}
.stats-panel-title { margin: 0 0 16px; font-size: 18px; font-weight: 600; color: var(--heading-color); }
.stats-panel-title .muted { font-weight: 400; color: var(--text-color); }

/* ---------- Filter ---------- */
.stats-filter label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 600; color: var(--heading-color); }
.stats-filter .form-select {
  min-height: 48px; border: 1px solid var(--stoke-color); border-radius: 12px;
  color: var(--heading-color); box-shadow: none;
}
.stats-filter .form-select:focus { border-color: var(--primary-color); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-color) 18%, transparent); }
.stats-filter .tf-btn { width: 100%; min-height: 48px; padding: 10px 20px; }

/* ---------- Kartu angka ---------- */
.stats-card {
  position: relative; height: 100%;
  padding: 20px 22px;
  border: 1px solid var(--stoke-color); border-radius: 16px;
  background: #fff; color: var(--heading-color);
  transition: transform .2s ease, box-shadow .2s ease;
}
.stats-card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(36, 39, 44, .08); }
.stats-card .label { font-size: 14px; color: var(--text-color); }
.stats-card .value { margin: 6px 0 0; font-size: 34px; font-weight: 700; line-height: 1.1; color: var(--primary-color); font-variant-numeric: tabular-nums; }
.stats-card .unit { font-size: 13px; color: var(--text-color); }
.stats-card .split { display: flex; gap: 20px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--stoke-color); }
.stats-card .split div { display: flex; flex-direction: column; }
.stats-card .split strong { font-size: 16px; color: var(--heading-color); }
.stats-card .split span { font-size: 12px; color: var(--text-color); }
.stats-card .dot { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; vertical-align: middle; }
/* Kartu pertama (periode berjalan) disorot warna primary solid */
.stats-card.is-primary { background: var(--primary-color); border-color: var(--primary-color); color: #fff; }
.stats-card.is-primary .label, .stats-card.is-primary .unit,
.stats-card.is-primary .split span { color: rgba(255, 255, 255, .85); }
.stats-card.is-primary .value, .stats-card.is-primary .split strong { color: #fff; }
.stats-card.is-primary .split { border-top-color: rgba(255, 255, 255, .25); }

/* ---------- Grafik & tabel ---------- */
.stats-chart { position: relative; height: 380px; }
.stats-chart.is-small { height: 260px; }
.stats-table { width: 100%; margin: 0; font-size: 14px; table-layout: fixed; }
.stats-table th:last-child, .stats-table td:last-child { width: 96px; }
.stats-table td:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 12px; }
.stats-table td:first-child a { display: block !important; max-width: 100% !important; overflow: hidden; text-overflow: ellipsis; }
.stats-table th { padding: 0 0 10px; font-size: 13px; font-weight: 600; color: var(--text-color); border-bottom: 1px solid var(--stoke-color); }
.stats-table td { padding: 10px 0; border-bottom: 1px solid var(--stoke-color); color: var(--heading-color); }
.stats-table tr:last-child td { border-bottom: 0; }
.stats-table td a { color: var(--heading-color); }
.stats-table td a:hover { color: var(--primary-color); }
.stats-table .num { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stats-empty { padding: 32px 0; text-align: center; color: var(--text-color); font-size: 14px; }

@media (max-width: 767px) {
  .stats-chart { height: 300px; }
  .stats-card .value { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  .stats-card { transition: none; }
  .stats-card:hover { transform: none; }
}
