/* ============================================================
   SLIP DOA BANGSA - GAYA KHUSUS APLIKASI
   (di atas Bootstrap 5.3; tema hijau sesuai identitas lama)
   ============================================================ */

:root {
  --slip-green:       #15803d;
  --slip-green-dark:  #166534;
  --slip-green-soft:  #dcfce7;
  --slip-bg:          #f4fbf6;
  --slip-border:      #e5e7eb;
  --slip-sidebar-w:   264px;
}

body {
  background: var(--slip-bg);
  color: #0f172a;
  font-size: 14.5px;
}

/* ---------- Kerangka layout ---------- */
.app-wrapper { display: flex; min-height: 100vh; }
.app-main {
  flex-grow: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ---------- Sidebar ---------- */
.app-sidebar {
  width: var(--slip-sidebar-w);
  background: #fff;
  display: flex;
  flex-direction: column;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 16px;
  border-bottom: 1px solid var(--slip-border);
}
.sidebar-brand .brand-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--slip-green);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.sidebar-brand h1 { font-size: 17px; font-weight: 700; margin: 0; color: #111827; }
.sidebar-brand p  { font-size: 11px; color: #9ca3af; margin: 2px 0 0; }

.sidebar-nav { padding: 10px 12px; overflow-y: auto; }
.nav-group-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #9ca3af;
  margin: 14px 8px 6px;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: #4b5563;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 2px;
  border-right: 4px solid transparent;
}
.sidebar-link i { font-size: 16px; color: #6b7280; width: 20px; text-align: center; }
.sidebar-link:hover { background: #f3f4f6; color: #111827; }
.sidebar-link.active {
  background: var(--slip-green);
  color: #fff;
  border-right-color: #86efac;
}
.sidebar-link.active i { color: #fff; }

.sidebar-foot {
  padding: 12px;
  border-top: 1px solid var(--slip-border);
  background: #f9fafb;
}
.sidebar-user { display: flex; align-items: center; gap: 10px; }
.sidebar-user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--slip-green-soft);
  color: var(--slip-green-dark);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sidebar-user-info { min-width: 0; line-height: 1.2; }
.sidebar-user-info strong { display: block; font-size: 13px; color: #111827; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-info span   { font-size: 11px; color: #9ca3af; }
.btn-logout {
  margin-left: auto;
  color: #6b7280;
  font-size: 18px;
  padding: 6px;
  border-radius: 8px;
}
.btn-logout:hover { color: #b91c1c; background: #fee2e2; }

/* Sidebar md ke atas: tampil tetap (offcanvas-md jadi normal) */
@media (min-width: 768px) {
  .app-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    border-right: 1px solid var(--slip-border);
    flex-shrink: 0;
    transform: none !important;
    visibility: visible !important;
  }
}

/* ---------- Topbar ---------- */
.app-topbar {
  background: #fff;
  border-bottom: 1px solid var(--slip-border);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 1020;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.topbar-title   { font-size: 18px; font-weight: 700; color: #111827; margin: 0; }
.topbar-subtitle{ font-size: 11.5px; color: #9ca3af; margin: 1px 0 0; }
.topbar-clock   { font-size: 17px; font-weight: 700; font-family: var(--bs-font-monospace); color: var(--slip-green); }
.topbar-date    { font-size: 11.5px; color: #6b7280; }
.topbar-user    { font-size: 12px; font-weight: 600; color: var(--slip-green-dark); margin-top: 2px; }
.dot-online {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #22c55e;
  margin-right: 4px;
}

/* ---------- Konten ---------- */
.app-content {
  padding: 20px;
  flex-grow: 1;
}
@media (min-width: 768px) { .app-content { padding: 26px 30px; } }

.app-footer {
  background: #fff;
  border-top: 1px solid var(--slip-border);
  padding: 12px 20px;
  font-size: 12px;
  color: #6b7280;
  display: flex;
  justify-content: space-between;
}

/* ---------- Kartu & statistik ---------- */
.card { border-radius: 14px; }
.stat-card {
  border: 1px solid var(--slip-border);
  border-radius: 14px;
  background: #fff;
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
  height: 100%;
}
.stat-card .stat-icon {
  width: 52px; height: 52px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.stat-card .stat-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #6b7280;
  margin: 0 0 2px;
}
.stat-card .stat-value { font-size: 22px; font-weight: 700; color: #111827; margin: 0; }
/* Nilai rupiah panjang di kartu sempit: kecilkan & boleh pindah baris */
.stat-card .stat-value.stat-value-sm {
  font-size: 17px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

/* Variant bertumpuk (ikon di atas, nilai lebar penuh) - dipakai kartu
   dashboard yang memuat angka rupiah panjang */
.stat-card.stat-card-stack { display: block; }
.stat-card.stat-card-stack .stat-icon {
  width: 44px; height: 44px;
  font-size: 19px;
  margin-bottom: 10px;
}
.stat-card.stat-card-stack .stat-value {
  font-size: 18px;
  white-space: nowrap;
}
.stat-icon.bg-green-soft  { background: #dcfce7; color: #16a34a; }
.stat-icon.bg-orange-soft { background: #ffedd5; color: #ea580c; }
.stat-icon.bg-red-soft    { background: #fee2e2; color: #dc2626; }
.stat-icon.bg-blue-soft   { background: #dbeafe; color: #2563eb; }
.stat-icon.bg-yellow-soft { background: #fef9c3; color: #ca8a04; }
.stat-icon.bg-purple-soft { background: #f3e8ff; color: #9333ea; }

/* ---------- Placeholder modul (Fase 1) ---------- */
.placeholder-panel { max-width: 760px; margin: 0 auto; }
.placeholder-icon {
  width: 72px; height: 72px;
  margin: 0 auto;
  border-radius: 20px;
  background: var(--slip-green-soft);
  color: var(--slip-green);
  display: flex; align-items: center; justify-content: center;
  font-size: 30px;
}

/* ---------- Login ---------- */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #f0fdf4 0%, #eff6ff 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card {
  width: 100%;
  max-width: 420px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid #f3f4f6;
  box-shadow: 0 20px 45px rgba(15, 23, 42, .12);
}
.login-head {
  background: var(--slip-green-dark);
  color: #fff;
  padding: 34px 24px;
  text-align: center;
}
.login-head .login-icon {
  width: 64px; height: 64px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: #fff;
  color: var(--slip-green-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .15);
}
.login-head h1 { font-size: 22px; font-weight: 700; margin: 0; letter-spacing: .02em; }
.login-head p  { font-size: 12.5px; color: #bbf7d0; margin: 4px 0 0; }

/* ---------- Tabel umum (dipakai modul fase berikutnya) ---------- */
.table-slip { font-size: 13px; }
.table-slip thead th {
  background: var(--slip-green-soft);
  color: #166534;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}
.badge-status-Lancar   { background: #dcfce7; color: #15803d; }
.badge-status-DPK      { background: #fef9c3; color: #a16207; }
.badge-status-KL       { background: #ffedd5; color: #c2410c; }
.badge-status-Diragukan{ background: #fef3c7; color: #b45309; }
.badge-status-Macet    { background: #fee2e2; color: #b91c1c; }
.badge-status-Lunas    { background: #dcfce7; color: #15803d; }
.badge-status-Belum    { background: #ffedd5; color: #c2410c; }
.badge-status-Seharusnya { background: #fee2e2; color: #b91c1c; }
.badge-status-Restruk  { background: #f3e8ff; color: #7e22ce; }

/* ---------- Banner laporan WhatsApp (Dashboard, aktif penuh Fase 6) ---------- */
.wa-banner {
  background: linear-gradient(135deg, #075e54 0%, #128c7e 55%, #25d366 100%);
  color: #fff;
  border-radius: 14px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.wa-banner .wa-icon {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .18);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
}
.wa-banner h3 { font-size: 16px; font-weight: 700; margin: 0; }
.wa-banner p  { font-size: 12px; color: #d1fae5; margin: 2px 0 0; }
.wa-banner .btn { color: #128c7e; }

/* ---------- Modal pratinjau laporan WA (Fase 6, porting sistem lama) ---------- */
.wa-chat-bg {
  background-color: #ECE5DD;
  background-image: radial-gradient(rgba(0, 0, 0, .045) 1px, transparent 1px);
  background-size: 14px 14px;
}
.wa-bubble-out {
  position: relative;
  background: #DCF8C6;
  border-radius: 10px;
  box-shadow: 0 1px .5px rgba(0, 0, 0, .13);
}
.wa-bubble-out::after {
  content: '';
  position: absolute;
  top: 0; right: -7px;
  width: 0; height: 0;
  border-top: 8px solid #DCF8C6;
  border-left: 8px solid transparent;
}
.wa-preview-text {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 13px;
  line-height: 1.55;
  color: #111b21;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---------- Chip ringkasan status (Rekapitulasi Fase 4) ---------- */
.chip-status {
  border-radius: 10px;
  border: 1px solid;
  padding: 10px 14px;
  height: 100%;
}
.chip-status h3 {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  opacity: .75;
  margin: 0 0 2px;
}
.chip-status p { font-size: 20px; font-weight: 700; margin: 0; }
.chip-Lancar    { background: #f0fdf4; border-color: #bbf7d0; color: #15803d; }
.chip-DPK       { background: #fefce8; border-color: #fef08a; color: #a16207; }
.chip-KL        { background: #fff7ed; border-color: #fed7aa; color: #c2410c; }
.chip-Diragukan { background: #fef3c7; border-color: #fde68a; color: #b45309; }
.chip-Macet     { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.chip-DTL       { background: #f9fafb; border-color: #e5e7eb; color: #6b7280; }

/* ---------- Kartu NPF (Rekapitulasi) ---------- */
.npf-card { border-radius: 14px; border: 1px solid var(--slip-border); background: #fff; padding: 20px 22px; height: 100%; }
.npf-card h3 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #6b7280;
  margin: 0 0 4px;
}
.npf-card .npf-nilai { font-size: 34px; font-weight: 700; line-height: 1.1; }
.npf-card small { color: #9ca3af; font-size: 10.5px; }

/* ---------- Kotak riwayat siklus (Kartu Pembayaran) ---------- */
.box-siklus { background: #eef2ff; border: 1px solid #e0e7ff; border-radius: 12px; padding: 14px 16px; }
.box-siklus h4 { font-size: 13px; font-weight: 700; color: #4338ca; margin: 0 0 8px; }
.box-siklus .baris-siklus {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12.5px; padding: 5px 0;
  border-bottom: 1px dashed #c7d2fe;
}
.box-siklus .baris-siklus:last-of-type { border-bottom: 0; }

/* ---------- Utilitas ---------- */
.text-truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.fw-600 { font-weight: 600; }
