:root {
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --green: #16a34a;
  --red: #dc2626;
  --bg: #f4f6fb;
  --card-radius: 14px;
}
body {
  background: var(--bg);
  font-family: 'Segoe UI', Roboto, -apple-system, sans-serif;
}
.sidebar {
  min-height: 100vh;
  background: #111827;
  color: #e5e7eb;
}
.sidebar .brand {
  font-weight: 700;
  font-size: 1.25rem;
  color: #fff;
  padding: 1.2rem 1rem;
  display: block;
  text-decoration: none;
}
.sidebar a.nav-link {
  color: #cbd5e1;
  padding: .6rem 1.1rem;
  border-radius: 8px;
  margin: 2px 8px;
  font-size: .93rem;
}
.sidebar a.nav-link:hover, .sidebar a.nav-link.active {
  background: var(--brand);
  color: #fff;
}
.sidebar .nav-section {
  text-transform: uppercase;
  font-size: .7rem;
  color: #6b7280;
  padding: 1rem 1.1rem .3rem;
  letter-spacing: .05em;
}
.topbar {
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  padding: .8rem 1.5rem;
}
.card {
  border: none;
  border-radius: var(--card-radius);
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.kpi-card {
  border-radius: var(--card-radius);
  padding: 1.2rem;
  color: #fff;
}
.kpi-card.blue { background: linear-gradient(135deg,#2563eb,#1d4ed8); }
.kpi-card.green { background: linear-gradient(135deg,#16a34a,#15803d); }
.kpi-card.red { background: linear-gradient(135deg,#dc2626,#b91c1c); }
.kpi-card.purple { background: linear-gradient(135deg,#7c3aed,#6d28d9); }
.kpi-card .label { font-size: .8rem; opacity: .9; }
.kpi-card .value { font-size: 1.5rem; font-weight: 700; margin-top: .2rem; }
.badge-income { background: #dcfce7; color: #15803d; }
.badge-expense { background: #fee2e2; color: #b91c1c; }
.progress { border-radius: 20px; height: 10px; background:#e5e7eb; }
.progress-bar.bg-danger-soft { background: #f87171; }
.table thead th { font-size: .8rem; text-transform: uppercase; color: #6b7280; border-bottom: 2px solid #eee; }
.btn-brand { background: var(--brand); color: #fff; }
.btn-brand:hover { background: var(--brand-dark); color: #fff; }
.link-code-box {
  font-family: monospace;
  font-size: 1.6rem;
  letter-spacing: .3rem;
  background: #111827;
  color: #4ade80;
  padding: .8rem 1.2rem;
  border-radius: 10px;
  text-align: center;
}
@media (max-width: 767px) {
  .sidebar { min-height: auto; }
}

/* ============================================
   MOBILE OFFCANVAS MENU
   Bug lama: teks nav-link default berwarna gelap
   di atas background gelap (bg-dark) sehingga TAK TERLIHAT.
   Diperbaiki dengan styling eksplisit di bawah ini.
   ============================================ */
.mobile-offcanvas {
  background: #111827;
  width: 260px;
}
.mobile-offcanvas .offcanvas-header {
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.mobile-offcanvas .nav-link {
  color: #e5e7eb !important;
  padding: .75rem 1.25rem;
  font-size: .95rem;
  display: flex;
  align-items: center;
}
.mobile-offcanvas .nav-link:hover,
.mobile-offcanvas .nav-link.active {
  background: var(--brand);
  color: #fff !important;
}
.mobile-offcanvas .nav-section {
  text-transform: uppercase;
  font-size: .7rem;
  color: #6b7280;
  padding: 1rem 1.25rem .3rem;
  letter-spacing: .05em;
}

/* ============================================
   BOTTOM NAVIGATION BAR (mobile only)
   Selalu terlihat di bawah layar HP — supaya
   menu utama tidak perlu dicari lewat hamburger.
   ============================================ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 62px;
  background: #fff;
  border-top: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 1050;
  box-shadow: 0 -2px 10px rgba(0,0,0,.06);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: #6b7280;
  text-decoration: none;
  font-size: .65rem;
  flex: 1;
  height: 100%;
  padding-top: 4px;
}
.bottom-nav-item i {
  font-size: 1.25rem;
}
.bottom-nav-item.active {
  color: var(--brand);
}
.bottom-nav-item:hover {
  color: var(--brand);
  text-decoration: none;
}

/* Cegah kartu/tabel terpotong di layar sempit */
.content-area {
  overflow-x: hidden;
}
.kpi-card .value {
  font-size: 1.25rem;
  word-break: break-word;
}
@media (max-width: 400px) {
  .kpi-card .value { font-size: 1.1rem; }
  .kpi-card { padding: 1rem; }
}
.table-responsive {
  -webkit-overflow-scrolling: touch;
}
.modal-dialog {
  margin-left: auto;
  margin-right: auto;
}
