/* ============================================================
   STATISTIK SECTION — beranda.html
   ============================================================ */

/* ── Container ─────────────────────────────────────────────── */
.stat-section {
  max-width: 1200px;
  margin: 48px auto 64px;
  padding: 0 24px;
  font-family: 'Roboto', Arial, sans-serif;
}

.stat-section__title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 24px;
}

/* ── Summary Cards ──────────────────────────────────────────── */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  border-radius: 10px;
  padding: 20px 20px 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  min-height: 120px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0,0,0,.12);
  transition: transform .18s, box-shadow .18s;
}
.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
}

.stat-card--blue   { background: #1e88e5; }
.stat-card--orange { background: #f59e0b; }
.stat-card--red    { background: #e53935; }
.stat-card--green  { background: #2e7d32; }

.stat-card__content {
  display: flex;
  flex-direction: column;
  padding-bottom: 14px;
  z-index: 1;
}

.stat-card__number {
  font-size: 2.6rem;
  font-weight: 900;
  color: #fff;
  line-height: 1;
  margin-bottom: 4px;
  letter-spacing: -1px;
}

.stat-card__label {
  font-size: .85rem;
  font-weight: 600;
  color: rgba(255,255,255,.9);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 12px;
}

.stat-card__link {
  display: inline-block;
  background: rgba(0,0,0,.18);
  color: #fff;
  font-size: .75rem;
  padding: 4px 10px;
  border-radius: 4px;
  text-decoration: none;
  transition: background .15s;
}
.stat-card__link:hover {
  background: rgba(0,0,0,.32);
}

.stat-card__icon {
  width: 80px;
  height: 80px;
  opacity: .55;
  flex-shrink: 0;
  margin-bottom: 10px;
}

/* ── Chart Panel (3 columns) ────────────────────────────────── */
.stat-panel {
  display: grid;
  grid-template-columns: 180px 1fr 240px;
  gap: 0;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 16px rgba(0,0,0,.08);
  overflow: hidden;
  min-height: 340px;
}

/* ── Sidebar ────────────────────────────────────────────────── */
.stat-sidebar {
  border-right: 1px solid #eee;
  display: flex;
  flex-direction: column;
}

.stat-sidebar__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  font-size: .85rem;
  font-weight: 700;
  color: #333;
  border-bottom: 1px solid #eee;
  cursor: default;
}

.stat-kec-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  flex: 1;
  max-height: 310px;
}

.stat-kec-list__loading {
  padding: 16px;
  color: #999;
  font-size: .8rem;
}

/* Kecamatan row */
.stat-kec-item {
  border-bottom: 1px solid #f0f0f0;
}

.stat-kec-item__btn {
  width: 100%;
  background: none;
  border: none;
  padding: 9px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .82rem;
  font-weight: 600;
  color: #333;
  cursor: pointer;
  text-align: left;
  transition: background .12s;
}
.stat-kec-item__btn:hover {
  background: #f5f5f5;
}

.stat-kec-item__chevron {
  width: 14px;
  height: 14px;
  transition: transform .2s;
  flex-shrink: 0;
  color: #999;
}
.stat-kec-item--open .stat-kec-item__chevron {
  transform: rotate(180deg);
}

/* Kelurahan sub-list */
.stat-kel-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: none;
  background: #fafafa;
}
.stat-kec-item--open .stat-kel-list {
  display: block;
}

.stat-kel-list li {
  padding: 6px 16px 6px 24px;
  font-size: .78rem;
  color: #555;
  border-bottom: 1px solid #f0f0f0;
}
.stat-kel-list li:last-child {
  border-bottom: none;
}

/* ── Bar Chart ──────────────────────────────────────────────── */
.stat-chart-wrap {
  padding: 20px 24px 16px;
  display: flex;
  flex-direction: column;
}

.stat-chart-wrap__heading {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: #999;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.stat-chart-wrap__total {
  font-size: 2.4rem;
  font-weight: 900;
  color: #1a1a2e;
  line-height: 1;
  margin-bottom: 16px;
}

.stat-chart-canvas-wrap {
  position: relative;
  flex: 1;
  min-height: 200px;
}

.stat-chart-canvas-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}

/* ── Per-Jenis Breakdown ────────────────────────────────────── */
.stat-breakdown {
  border-left: 1px solid #eee;
  padding: 20px 18px;
}

.stat-breakdown__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.stat-breakdown__loading {
  color: #999;
  font-size: .8rem;
}

.stat-breakdown__item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-breakdown__dot-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.stat-breakdown__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.stat-breakdown__jenis-name {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #444;
}

.stat-breakdown__count {
  font-size: 1.6rem;
  font-weight: 900;
  color: #1a1a2e;
  line-height: 1;
}

.stat-breakdown__loc {
  display: inline-block;
  font-size: .7rem;
  font-weight: 600;
  color: #fff;
  padding: 2px 8px;
  border-radius: 20px;
  margin-top: 2px;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .stat-cards {
    grid-template-columns: repeat(2, 1fr);
  }
  .stat-panel {
    grid-template-columns: 1fr;
  }
  .stat-sidebar {
    border-right: none;
    border-bottom: 1px solid #eee;
  }
  .stat-breakdown {
    border-left: none;
    border-top: 1px solid #eee;
  }
}

@media (max-width: 520px) {
  .stat-cards {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .stat-card__number {
    font-size: 2rem;
  }
  .stat-section__title {
    font-size: 1.2rem;
  }
}
