:root {
  --primary: #1a5f4a;
  --primary-dark: #0f3d2f;
  --bg: #f7f8f6;
  --card: #ffffff;
  --border: #e1e4e0;
  --text: #1f2622;
  --muted: #6b7570;
  --danger: #b3261e;
  --warn: #b7791f;
  --success: #1a5f4a;
  --radius: 10px;
}
* { box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 0;
  line-height: 1.5;
}
.topbar {
  background: var(--primary-dark);
  color: #fff;
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.topbar a { color: #fff; text-decoration: none; font-weight: 600; }
.topbar .nav a { margin-left: 16px; font-weight: 400; font-size: 14px; opacity: 0.9; }

.container { max-width: 640px; margin: 24px auto; padding: 0 16px; }
.wide { max-width: 1000px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 18px; margin: 0 0 12px; }
.muted { color: var(--muted); font-size: 14px; }

label { display: block; font-size: 13px; font-weight: 600; margin: 14px 0 6px; color: var(--text); }
input[type=text], input[type=tel], input[type=number], input[type=password],
input[type=date], input[type=email], select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  background: #fff;
}
input[type=file] { width: 100%; padding: 8px 0; }
input:focus, select:focus { outline: none; border-color: var(--primary); }

.radio-group { display: flex; gap: 16px; margin-top: 6px; }
.radio-group label { display: flex; align-items: center; gap: 6px; font-weight: 400; margin: 0; }
.radio-group input { width: auto; }

button, .btn {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 11px 20px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  margin-top: 18px;
}
button:hover, .btn:hover { background: var(--primary-dark); }
button.secondary, .btn.secondary { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
button.danger, .btn.danger { background: var(--danger); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

.error { color: var(--danger); font-size: 14px; background: #fdecea; padding: 10px 12px; border-radius: 8px; margin: 10px 0; }
.success { color: var(--success); font-size: 14px; background: #eaf5ee; padding: 10px 12px; border-radius: 8px; margin: 10px 0; }
.info-box { background: #eef6f2; border: 1px solid #c9e3d6; border-radius: 8px; padding: 14px; margin: 14px 0; font-size: 14px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
th { background: #f0f2ef; font-weight: 600; }
tr:hover { background: #fafbfa; }

.badge { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge.paid { background: #e2f3e8; color: #1a5f4a; }
.badge.unpaid { background: #fdecea; color: #b3261e; }
.badge.pending { background: #fdf3e2; color: #b7791f; }
.badge.approved { background: #e2f3e8; color: #1a5f4a; }
.badge.rejected { background: #fdecea; color: #b3261e; }
.badge.duplicate { background: #f0e6fb; color: #6b3fa0; }
.badge.exempt { background: #eceff1; color: #607d8b; }

.auth-box { max-width: 380px; margin: 60px auto; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; }

.stat-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.stat { flex: 1; min-width: 120px; background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 14px; text-align: center; }
.stat .num { font-size: 26px; font-weight: 700; color: var(--primary); }
.stat .label { font-size: 12px; color: var(--muted); }

.search-bar { display: flex; gap: 8px; margin-bottom: 16px; }
.search-bar input { flex: 1; }
.search-bar button { margin-top: 0; }

.filter-tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-tabs a { padding: 6px 14px; border-radius: 20px; background: #eceff1; color: var(--text); text-decoration: none; font-size: 13px; }
.filter-tabs a.active { background: var(--primary); color: #fff; }

.thumb { max-width: 100px; border-radius: 6px; border: 1px solid var(--border); cursor: pointer; }

@media (max-width: 600px) {
  .container { padding: 0 12px; }
  .stat-row { gap: 8px; }
}

/* Modal popup for the rest of the payment form */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 61, 47, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}
.modal-box {
  background: #fff;
  border-radius: var(--radius);
  padding: 24px;
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}
.modal-close {
  position: absolute;
  top: 14px; right: 16px;
  background: none;
  border: none;
  font-size: 22px;
  color: var(--muted);
  cursor: pointer;
  margin: 0;
  padding: 0;
  line-height: 1;
}
.modal-close:hover { color: var(--text); background: none; }
.modal-subject { font-size: 14px; color: var(--muted); margin-bottom: 4px; }

/* Recent paid units list */
.recent-list { list-style: none; padding: 0; margin: 10px 0; }
.recent-list li {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.recent-list li:last-child { border-bottom: none; }
.recent-unit { font-weight: 600; }

.recent-list li span:last-child { display: flex; align-items: center; gap: 8px; }

.see-more-tab {
  display: inline-block;
  margin-top: 10px;
  padding: 8px 20px;
  border-radius: 20px;
  background: #eceff1;
  color: var(--primary-dark);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
}
.see-more-tab:hover { background: var(--primary); color: #fff; }

.text-center { text-align: center; }

.status-result {
  margin-top: 14px;
  padding: 16px;
  border-radius: 8px;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
}
.status-result.paid { background: #e2f3e8; color: #1a5f4a; }
.status-result.unpaid { background: #fdecea; color: #b3261e; }
.status-result.exempt { background: #eceff1; color: #607d8b; }
.status-result.notfound { background: #fdf3e2; color: #b7791f; }

