* {
  box-sizing: border-box;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  margin: 0;
  padding: 0;
  background: #e8f5e9; /* hijau muda lembut */
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1100px;
  margin: 30px auto;
  background: #ffffff;
  padding: 20px 25px 40px;
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.06);
  border: 1px solid #c8e6c9;
}

h1 {
  text-align: center;
  margin-bottom: 20px;
  color: #1b5e20;
  font-size: 1.5rem; /* Ukuran font sedikit disesuaikan */
}

h2, h3 {
  color: #2e7d32;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 15px;
  flex-wrap: wrap; /* Agar tombol turun ke bawah jika layar sempit */
  justify-content: center; /* Tombol rata tengah di mobile */
}

.tab-button {
  border: none;
  padding: 10px 16px; /* Padding sedikit lebih besar untuk sentuhan jari */
  border-radius: 999px;
  background: #c8e6c9;
  cursor: pointer;
  font-size: 0.9rem;
  color: #1b5e20;
  transition: background 0.2s, transform 0.1s;
  flex: 1 1 auto; /* Tombol fleksibel mengisi ruang */
  text-align: center;
  min-width: 120px; /* Lebar minimal agar teks tidak terpotong */
}

.tab-button:hover {
  background: #a5d6a7;
  transform: translateY(-1px);
}

.tab-button.active {
  background: #2e7d32;
  color: #ffffff;
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* Card */
.card {
  margin-top: 10px;
  padding: 15px;
  border-radius: 12px;
  background: #f9fff9;
  border: 1px solid #c8e6c9;
  /* Penting untuk tabel di mobile: */
  overflow-x: auto; 
}

/* Form */
.form-row, .filter-row {
  display: flex;
  flex-direction: column;
  margin-bottom: 12px; /* Jarak antar input lebih lega */
}

label {
  font-size: 0.85rem;
  margin-bottom: 6px;
  color: #33691e;
  font-weight: 500;
}

input[type="text"],
input[type="number"],
input[type="date"],
select {
  padding: 10px; /* Padding lebih besar untuk jari */
  border-radius: 8px;
  border: 1px solid #a5d6a7;
  font-size: 1rem; /* Font 16px mencegah zoom otomatis di iOS */
  outline: none;
  transition: border 0.15s, box-shadow 0.15s;
  width: 100%; /* Memastikan input memenuhi lebar layar */
  background-color: #fff;
}

input:focus,
select:focus {
  border-color: #2e7d32;
  box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

/* Buttons */
button[type="submit"], #btn-filter, #btn-reset {
  padding: 10px 20px;
  border-radius: 999px;
  border: none;
  background: #2e7d32;
  color: #ffffff;
  cursor: pointer;
  font-size: 0.95rem;
  margin-top: 10px;
  margin-right: 5px;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  width: 100%; /* Tombol penuh di mobile untuk kemudahan akses */
}

/* Agar tombol filter dan reset berdampingan di desktop, tapi stack di mobile */
@media (min-width: 600px) {
  button[type="submit"], #btn-filter, #btn-reset {
    width: auto;
  }
}

button:hover {
  background: #1b5e20;
  box-shadow: 0 4px 10px rgba(27, 94, 32, 0.35);
  transform: translateY(-1px);
}

/* Tabel */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-top: 8px;
  white-space: nowrap; /* Mencegah teks tabel turun baris berantakan */
}

th, td {
  padding: 10px 8px; /* Padding tabel lebih lega */
  border: 1px solid #dcedc8;
}

th {
  background: #c8e6c9;
  color: #1b5e20;
  text-align: left;
}

tr:nth-child(even) { background: #f1f8e9; }

/* Pesan */
.message {
  font-size: 0.85rem;
  margin-top: 10px;
  font-weight: 500;
}

.message.error { color: #c62828; }
.message.success { color: #2e7d32; }

/* --- RESPONSIVE MEDIA QUERIES --- */

/* Tablet & Mobile (Layar di bawah 768px) */
@media screen and (max-width: 768px) {
  .container {
    margin: 10px;
    padding: 15px;
    border-radius: 12px;
  }

  h1 {
    font-size: 1.25rem;
    margin-bottom: 15px;
  }
  
  .tabs {
    gap: 6px;
  }
  
  .tab-button {
    font-size: 0.85rem;
    padding: 8px 12px;
  }
}