html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  display: flex;
  flex-direction: column;
  font-family: "Segoe UI", sans-serif;
}

main {
  flex: 1;
}

footer {
  background-color: #2e7d32;
  color: white;
  text-align: center;
  padding: 1px;
}

/* Header/Navbar */
.navbar {
  background-color: #2e7d32;
  padding: 15px 0;
  color: white;
}

.container {
  width: 90%;
  max-width: 1100px;
  margin: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  margin: 0;
}

.nav-links {
  list-style: none;
  padding: 0;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.nav-links li a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  font-size: clamp(14px, 2.5vw, 16px);
}

.nav-links li a.active,
.nav-links li a:hover {
  text-decoration: underline;
}

/* Hero Section */
.hero-section {
  text-align: center;
  padding: 40px 20px 20px;
  background-color: #d0efd3;
}

.hero-section h2 {
  margin: 0;
  font-size: 28px;
  color: #2e7d32;
}
.hero-sectionn {
  text-align: left;
  padding: 40px 20px 20px;
  background-color: white;
}

.hero-sectionn h2 {
  margin: 0;
  font-size: 28px;
  color: #2e7d32;
}
.hero-sectionn p {
  margin: 0;
  font-size: 15px;
  color: #7e867e;
}

.hero-sectionn h3 {
  margin: 0;
  font-size: 20px;
  color: #2e7d32;
}

.hero-section2 {
  text-align: left;
  padding: 40px 20px 20px;
  background-color: white;
}

.hero-section2 h3 {
  margin: 0;
  font-size: 20px;
  color: #2e7d32;
}

.logo-img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  border-radius: 50%;
  background-color: white;
  padding: 10px;
}

.header-kiri {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 40px;
}

.header-teks {
  color: white;
  margin: 0;
  padding: 0;
  justify-content: left;
  line-height: 1.2; /* NORMAL supaya tidak tumpuk */
}
.header-teks h1,
.header-teks h3,
.header-teks h4,
.header-teks p {
  margin: 0; /* hilangkan margin */
  padding: 2px 0; /* kasih sedikit padding biar ga terlalu nempel */
  line-height: 1.1; /* agak rapat */
}

@media (max-width: 768px) {
  .header-kiri {
    flex-direction: column;
    align-items: flex-start;
  }

  .container {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-links {
    margin-top: 10px;
    flex-wrap: wrap;
  }
}

.statistik-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin: 30px 20px;
  justify-content: center;
}

.card {
  flex: 1 1 250px;
  padding: 20px;
  border-radius: 12px;
  color: white;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  position: relative;
  transition: 0.3s;
}

.card:hover {
  transform: translateY(-5px);
}

.card h2 {
  font-size: 2em;
  margin: 0;
}

.card small {
  font-size: 0.6em;
  font-weight: normal;
}

.card p {
  margin: 8px 0 0;
  font-size: 1em;
}

.card.orange {
  background: linear-gradient(45deg, #fca311, #d97706);
}

.card.blue {
  background: linear-gradient(45deg, #3b82f6, #1d4ed8);
}

.card.red {
  background: linear-gradient(45deg, #ef4444, #b91c1c);
}

.card.green {
  background: linear-gradient(45deg, #10b981, #047857);
}

.card-container {
  display: flex;
  flex-wrap: wrap;
  gap: 50px;
  margin: 20px 20px;
  justify-content: left;
}

.dusun-card {
  background: linear-gradient(45deg, #29b166, #77c097);
  color: white;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  max-width: 300px;
  width: 100%;
  flex: 1 1 260px;
  text-align: center;
  position: relative;
  transition: 0.3s;
}

.dusun-card:hover {
  transform: translateY(-5px);
}

.dusun-card h2 {
  color: white;
  margin: 0;
  font-size: 2em;
}

.dusun-card h2 small {
  font-size: 0.6em;
  font-weight: normal;
}

.dusun-card p {
  color: white;
  font-size: 1.2em;
  margin: 8px 0;
}

.sub-box {
  background: rgba(0, 0, 0, 0.1);
  padding: 8px;
  border-radius: 8px;
  font-size: 0.95em;
  margin-top: 10px;
  text-align: center;
}

.table-dusun {
  flex: 1 1 60%;
  border-collapse: collapse;
  font-family: Arial, sans-serif;
  width: 100%;
  margin-top: 10px;
}

.table-dusun th,
.table-dusun td {
  border: 1px solid #c5e1a5;
  padding: 10px 14px;
  text-align: center;
}

.table-dusun thead {
  background-color: #a5d6a7;
  color: #1b5e20;
}

.table-dusun tfoot {
  background-color: #c8e6c9;
  font-weight: bold;
  color: #1b5e20;
}

.table-dusun2 {
  width: 150%;
  border-collapse: collapse;
  font-family: Arial, sans-serif;
  font-size: 0.95em;
  margin-top: 10px;
}

.table-dusun2 th,
.table-dusun2 td {
  padding: 10px 14px;
  border: 1px solid #ccc;
  text-align: center;
}

.table-dusun2 thead {
  background-color: #a5d6a7;
  color: #1b5e20;
}

.table-dusun2 tfoot {
  background-color: #c8e6c9;
  font-weight: bold;
  color: #1b5e20;
}

.table-chart-container {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 20px;
}

.summary-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: left;
}

.summary-card {
  display: flex;
  margin: 5px;
  justify-content: space-between;
  align-items: center;
  max-width: 300px;
  width: 100%;
  padding: 20px;
  border-radius: 12px;
  color: white;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  position: relative;
  transition: 0.3s;
}

.summary-card .card-content h2 {
  font-size: 28px;
  margin: 0;
  color: white;
}

.summary-card .card-content p {
  margin: 4px 0 0;
  font-size: 17px;
  color: white;
}

.summary-card .card-icon {
  position: absolute;
  right: 20px;
  bottom: 20px;
  font-size: 90px; /* Ukuran ikon diperbesar */
  opacity: 0.15; /* Supaya ikon besar tidak terlalu mengganggu */
  pointer-events: none; /* Tidak bisa diklik */
}

.summary-card:hover {
  transform: translateY(-5px);
}

.summary-card.blue {
  background: linear-gradient(45deg, #3b82f6, #2563eb);
}

.summary-card.green {
  background: linear-gradient(45deg, #10b981, #059669);
}

.summary-card.orange {
  background: linear-gradient(45deg, #f59e0b, #d97706);
}

#usiaPieChart {
  max-width: 100%;
  height: auto;
}

/* ======= Tambahan Responsif Umum ======= */

@media (max-width: 992px) {
  .container {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-links {
    margin-top: 10px;
    gap: 10px;
  }

  .statistik-wrapper,
  .card-container,
  .summary-cards {
    justify-content: center;
  }

  .table-chart-container {
    flex-direction: column;
    gap: 20px;
  }

  .summary-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px;
  }

  .summary-card .card-icon {
    position: static;
    font-size: 60px;
    opacity: 0.1;
    margin-top: 10px;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 10px;
  }

  .logo-img {
    width: 50px;
    height: 50px;
  }

  .hero-section h2,
  .hero-sectionn h2,
  .hero-sectionn h3,
  .hero-section2 h3 {
    font-size: 20px;
  }

  .card h2,
  .dusun-card h2,
  .summary-card .card-content h2 {
    font-size: 1.4em;
  }

  .card p,
  .dusun-card p,
  .summary-card .card-content p {
    font-size: 1em;
  }

  .nav-links {
    font-size: 15px;
  }

  .nav-links li {
    margin-bottom: 5px;
  }

  .table-dusun,
  .table-dusun2 {
    display: block;
    overflow-x: auto;
    width: 100%;
  }

  .table-dusun table,
  .table-dusun2 table {
    width: 100%;
    min-width: 600px;
  }
}

@media (max-width: 480px) {
  .nav-links {
    font-size: 14px;
  }

  .card,
  .dusun-card,
  .summary-card {
    padding: 15px;
  }

  .card h2,
  .dusun-card h2,
  .summary-card .card-content h2 {
    font-size: 1.2em;
  }

  .summary-card .card-icon {
    font-size: 40px;
  }

  .hero-section,
  .hero-sectionn,
  .hero-section2 {
    padding: 20px 10px;
  }
}

@media (max-width: 768px) {
  .header-teks h1 {
    font-size: 20px;
  }

  .header-teks h3 {
    font-size: 16px;
  }

  .header-teks h4 {
    font-size: 14px;
  }

  .header-teks p {
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .header-teks h1 {
    font-size: 18px;
  }

  .header-teks h3 {
    font-size: 15px;
  }

  .header-teks h4 {
    font-size: 13px;
  }

  .header-teks p {
    font-size: 11px;
  }
}
