* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, Segoe UI, Roboto, sans-serif;
  background: #f4f4f2;
  color: #222;
}
.hidden { display: none !important; }

.login-box {
  max-width: 360px;
  margin: 80px auto;
  padding: 24px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.login-box h1 { font-size: 18px; text-align: center; }
.login-box input, .login-box button {
  width: 100%;
  padding: 12px;
  margin-top: 10px;
  border-radius: 8px;
  border: 1px solid #ddd;
  font-size: 15px;
}
.login-box button {
  background: #185fa5;
  color: #fff;
  border: none;
  font-weight: 500;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: #fff;
  border-bottom: 1px solid #e5e5e5;
  position: sticky;
  top: 0;
  z-index: 10;
}
header h1 { font-size: 16px; margin: 0; }
.header-user { font-size: 13px; color: #666; }

.layout { display: flex; flex-direction: column; }
main {
  padding: 16px;
  padding-bottom: 90px; /* ruang untuk bottom-nav mobile */
  max-width: 640px;
  margin: 0 auto;
  width: 100%;
}

.card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.card h2 { font-size: 15px; margin-top: 0; }
.card-header-row { display: flex; justify-content: space-between; align-items: center; }
.card-header-row select { padding: 6px 8px; border-radius: 6px; border: 1px solid #ddd; }

/* Bottom nav (mobile) */
.nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  display: flex;
  background: #fff;
  border-top: 1px solid #e5e5e5;
  z-index: 20;
}
.nav-item {
  flex: 1;
  border: none;
  background: none;
  padding: 8px 2px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 10.5px;
  color: #888;
}
.nav-item.active { color: #185fa5; font-weight: 600; }
.nav-icon { font-size: 18px; }

/* Desktop: sidebar */
@media (min-width: 860px) {
  .layout { flex-direction: row; max-width: 1000px; margin: 0 auto; }
  .nav {
    position: sticky;
    top: 57px;
    height: calc(100vh - 57px);
    flex-direction: column;
    width: 200px;
    border-top: none;
    border-right: 1px solid #e5e5e5;
    padding-top: 12px;
  }
  .nav-item {
    flex-direction: row;
    justify-content: flex-start;
    gap: 10px;
    padding: 12px 20px;
    font-size: 14px;
  }
  main { padding-bottom: 16px; }
}

form label { display: block; font-size: 13px; color: #555; margin-top: 10px; }
form input, form select {
  width: 100%;
  padding: 10px;
  margin-top: 4px;
  border-radius: 8px;
  border: 1px solid #ddd;
  font-size: 15px;
}
form button, .btn-danger {
  width: 100%;
  margin-top: 14px;
  padding: 12px;
  background: #0f6e56;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 500;
}
.btn-danger { background: #a32d2d; }
.error { color: #a32d2d; font-size: 13px; }
#formPesan, #hpPesan, #userPesan, #gantiPasswordPesan { font-size: 13px; margin-top: 8px; }

.saldo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.saldo-card { background: #f4f4f2; border-radius: 8px; padding: 10px; }
.saldo-card .nama { font-size: 12px; color: #666; }
.saldo-card .nilai { font-size: 15px; font-weight: 500; margin-top: 4px; }

.trx-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #eee;
  font-size: 14px;
  gap: 10px;
}
.trx-row:last-child { border-bottom: none; }
.trx-row .kanan { text-align: right; white-space: nowrap; }
.trx-row .untung { color: #0f6e56; font-size: 12px; }
.trx-row .btn-hapus {
  border: none; background: none; color: #a32d2d; font-size: 12px; cursor: pointer; padding: 0; margin-top: 4px;
}

.hp-row { padding: 10px 0; border-bottom: 1px solid #eee; font-size: 14px; }
.hp-row:last-child { border-bottom: none; }
.hp-row-top { display: flex; justify-content: space-between; }
.hp-badge { font-size: 11px; padding: 2px 8px; border-radius: 20px; }
.hp-badge.piutang { background: #e3f2ec; color: #0f6e56; }
.hp-badge.hutang { background: #fbe9e7; color: #a32d2d; }
.hp-badge.lunas { background: #eee; color: #888; }
.hp-sisa { font-size: 12px; color: #666; margin-top: 4px; }
.hp-actions { margin-top: 8px; display: flex; gap: 8px; }
.hp-actions input { width: 120px; padding: 6px 8px; border-radius: 6px; border: 1px solid #ddd; }
.hp-actions button { padding: 6px 10px; border-radius: 6px; border: none; background: #185fa5; color: #fff; font-size: 12px; }

.tabs-mini { display: flex; gap: 8px; margin-bottom: 12px; }
.mini-tab { flex: 1; padding: 8px; border-radius: 8px; border: 1px solid #ddd; background: #fff; font-size: 13px; }
.mini-tab.active { background: #185fa5; color: #fff; border-color: #185fa5; }
.periode-input { margin-bottom: 10px; }
.periode-input label { font-size: 13px; color: #555; }
.periode-input input { width: 100%; padding: 10px; margin-top: 4px; border-radius: 8px; border: 1px solid #ddd; }
#btnMuatLaporan, #btnExportCsv {
  width: 100%; margin-top: 6px; padding: 12px; background: #185fa5; color: #fff; border: none; border-radius: 8px; font-weight: 500;
}
.laporan-hasil { margin-top: 16px; }
.lap-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #eee; font-size: 14px; }
.lap-total { display: flex; justify-content: space-between; padding: 10px 0; font-weight: 600; font-size: 15px; }

.user-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid #eee; font-size: 14px; }
.user-row:last-child { border-bottom: none; }
.user-role { font-size: 11px; color: #666; }
.user-actions { display: flex; gap: 6px; }
.user-actions button { padding: 5px 8px; border-radius: 6px; border: 1px solid #ddd; background: #fff; font-size: 12px; }
