/* ============================================================
   NASABAH PORTAL CSS – Koperasi Pinjaman Mandiri Jaya
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
  --green-dark:  #1B4332;
  --green-mid:   #2D6A4F;
  --green-light: #40916C;
  --green-soft:  #74C69D;
  --green-pale:  #D8F3DC;
  --gold:        #E9B94A;
  --gold-dark:   #C49A28;
  --white:       #FFFFFF;
  --bg:          #F2F7F4;
  --text-dark:   #1A2E1D;
  --text-mid:    #3D5A41;
  --text-light:  #6B8F72;
  --nav-h:       64px;
  --radius-sm:   8px;
  --radius-md:   14px;
  --radius-lg:   22px;
  --shadow-sm:   0 2px 8px rgba(0,0,0,0.07);
  --shadow-md:   0 8px 28px rgba(0,0,0,0.10);
  --shadow-lg:   0 20px 56px rgba(0,0,0,0.14);
  --transition:  all 0.3s cubic-bezier(0.4,0,0.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body { font-family: 'Plus Jakarta Sans', sans-serif; background: var(--bg); color: var(--text-dark); min-height: 100vh; }
a { text-decoration: none; color: inherit; }

/* ══ TOPNAV ══ */
.topnav {
  position: sticky; top: 0; z-index: 100;
  background: var(--green-dark);
  height: var(--nav-h);
  display: flex; align-items: center;
  box-shadow: 0 2px 16px rgba(0,0,0,0.18);
}
.topnav-inner {
  max-width: 1100px; margin: 0 auto; padding: 0 24px;
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.nav-brand { display: flex; align-items: center; gap: 10px; }
.nav-brand-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--gold), #F5A623);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center; font-size: 1.1rem;
}
.nav-brand-text .name { font-family: 'Playfair Display', serif; font-size: 0.95rem; font-weight: 700; color: #fff; line-height: 1.1; }
.nav-brand-text .sub  { font-size: 0.62rem; color: rgba(255,255,255,0.45); text-transform: uppercase; letter-spacing: 0.07em; }

.nav-user { display: flex; align-items: center; gap: 12px; }
.nav-user-info { text-align: right; }
.nav-user-info .nama  { font-size: 0.85rem; font-weight: 600; color: #fff; line-height: 1.2; }
.nav-user-info .nomor { font-size: 0.7rem; color: rgba(255,255,255,0.5); }
.nav-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), #F5A623);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem; font-weight: 700; color: var(--green-dark);
}
.nav-logout {
  padding: 7px 16px; border-radius: 50px;
  background: rgba(255,255,255,0.10); border: 1.5px solid rgba(255,255,255,0.22);
  color: rgba(255,255,255,0.85); font-size: 0.8rem; font-weight: 600;
  cursor: pointer; transition: var(--transition); display: flex; align-items: center; gap: 6px;
}
.nav-logout:hover { background: rgba(239,68,68,0.20); border-color: #FCA5A5; color: #FCA5A5; }

/* ══ PAGE WRAPPER ══ */
.portal-wrap { max-width: 1100px; margin: 0 auto; padding: 28px 24px; }

/* ══ HERO CARD (identitas nasabah) ══ */
.hero-card {
  background: linear-gradient(135deg, var(--green-dark) 0%, var(--green-mid) 60%, var(--green-light) 100%);
  border-radius: var(--radius-lg);
  padding: 32px 36px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  margin-bottom: 24px;
  position: relative; overflow: hidden;
}
.hero-card::before {
  content: '';
  position: absolute; top: -60px; right: -60px;
  width: 220px; height: 220px; border-radius: 50%;
  background: rgba(233,185,74,0.10); pointer-events: none;
}
.hero-card::after {
  content: '';
  position: absolute; bottom: -80px; left: 40%;
  width: 200px; height: 200px; border-radius: 50%;
  background: rgba(116,198,157,0.10); pointer-events: none;
}
.hero-left { position: relative; z-index: 1; }
.hero-left .greeting { font-size: 0.8rem; font-weight: 600; color: rgba(255,255,255,0.6); margin-bottom: 6px; letter-spacing: 0.06em; text-transform: uppercase; }
.hero-left h1 { font-family: 'Playfair Display', serif; font-size: 1.7rem; font-weight: 700; color: #fff; margin-bottom: 8px; line-height: 1.2; }
.hero-left .meta { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 4px; }
.hero-meta-item { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; color: rgba(255,255,255,0.65); }
.hero-meta-item i { color: var(--gold); }
.hero-right { position: relative; z-index: 1; text-align: right; flex-shrink: 0; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.12); border: 1.5px solid rgba(255,255,255,0.22);
  color: #fff; padding: 8px 16px; border-radius: 50px;
  font-size: 0.82rem; font-weight: 600;
}
.hero-badge i { color: var(--gold); }

/* ══ STAT CARDS ══ */
.stat-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--white); border-radius: var(--radius-md);
  padding: 20px; box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,0,0,0.04);
  transition: var(--transition); position: relative; overflow: hidden;
}
.stat-card::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0;
  height: 3px; background: var(--card-color, var(--green-soft));
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.sc-icon {
  width: 46px; height: 46px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem; margin-bottom: 14px;
}
.sc-label { font-size: 0.7rem; font-weight: 700; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 4px; }
.sc-value { font-family: 'Playfair Display', serif; font-size: 1.45rem; font-weight: 700; color: var(--text-dark); line-height: 1; margin-bottom: 5px; }
.sc-sub   { font-size: 0.73rem; color: var(--text-light); font-weight: 500; }

.c-green { --card-color: var(--green-soft); }
.c-gold  { --card-color: var(--gold); }
.c-blue  { --card-color: #60A5FA; }
.c-red   { --card-color: #F87171; }
.bg-green { background: var(--green-pale); color: var(--green-mid); }
.bg-gold  { background: #FEF3C7; color: #D97706; }
.bg-blue  { background: #EFF6FF; color: #3B82F6; }
.bg-red   { background: #FEF2F2; color: #EF4444; }

/* ══ CONTENT GRID ══ */
.content-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 20px; }
.content-grid.full { grid-template-columns: 1fr; }

/* ══ PANEL ══ */
.panel {
  background: var(--white); border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm); border: 1px solid rgba(0,0,0,0.04);
  overflow: hidden; margin-bottom: 20px;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 12px; border-bottom: 1px solid #F0F4F1;
}
.panel-title { font-size: 0.92rem; font-weight: 700; color: var(--text-dark); display: flex; align-items: center; gap: 8px; }
.panel-title i { color: var(--green-mid); }
.panel-link { font-size: 0.78rem; color: var(--green-mid); font-weight: 600; padding: 5px 12px; border: 1.5px solid var(--green-soft); border-radius: 50px; transition: var(--transition); }
.panel-link:hover { background: var(--green-pale); }
.panel-body { padding: 16px 20px; }

/* ══ TAGIHAN TABLE ══ */
.tagihan-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.tagihan-table thead th {
  background: #F6FAF7; color: var(--text-light);
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em;
  padding: 9px 14px; text-align: left; border-bottom: 1px solid #E8F0EA; white-space: nowrap;
}
.tagihan-table tbody tr { border-bottom: 1px solid #F0F4F1; transition: background 0.15s; }
.tagihan-table tbody tr:last-child { border-bottom: none; }
.tagihan-table tbody tr:hover { background: #F9FCF9; }
.tagihan-table td { padding: 11px 14px; vertical-align: middle; }

/* ══ BADGE STATUS ══ */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.68rem; font-weight: 700; padding: 3px 9px; border-radius: 50px; white-space: nowrap;
}
.badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.b-lunas     { background: #D1FAE5; color: #059669; }
.b-belum     { background: #FEF3C7; color: #D97706; }
.b-terlambat { background: #FEE2E2; color: #DC2626; }
.b-berjalan  { background: #DBEAFE; color: #2563EB; }
.b-lunas-pin { background: #F3F4F6; color: #6B7280; }

/* ══ TAGIHAN ITEM (card list) ══ */
.tagihan-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; background: #F8FCF9; border-radius: var(--radius-sm);
  border: 1.5px solid #E8F0EA; margin-bottom: 10px; transition: var(--transition);
}
.tagihan-item:last-child { margin-bottom: 0; }
.tagihan-item:hover { background: var(--green-pale); border-color: var(--green-soft); }
.tagihan-item.urgent { background: #FFF7ED; border-color: #FDE68A; }
.tagihan-item.overdue { background: #FEF2F2; border-color: #FCA5A5; }

.ti-no {
  width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; font-weight: 800; color: var(--green-dark);
  background: var(--green-pale);
}
.ti-no.urgent { background: #FEF3C7; color: #D97706; }
.ti-no.overdue { background: #FEE2E2; color: #DC2626; }

.ti-body { flex: 1; min-width: 0; }
.ti-pinjaman { font-size: 0.78rem; color: var(--text-light); margin-bottom: 2px; }
.ti-jatuh { font-size: 0.85rem; font-weight: 600; color: var(--text-dark); }
.ti-jatuh .late { color: #DC2626; font-size: 0.75rem; font-weight: 700; margin-left: 6px; }

.ti-right { text-align: right; flex-shrink: 0; }
.ti-nominal { font-size: 0.92rem; font-weight: 800; color: var(--green-dark); }
.ti-nominal.overdue { color: #DC2626; }
.ti-denda { font-size: 0.72rem; color: #DC2626; font-weight: 600; }

/* ══ RIWAYAT ITEM ══ */
.riwayat-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid #F0F4F1;
}
.riwayat-item:last-child { border-bottom: none; }
.ri-icon {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 1rem;
}
.ri-body { flex: 1; min-width: 0; }
.ri-label { font-size: 0.83rem; font-weight: 600; color: var(--text-dark); }
.ri-sub   { font-size: 0.72rem; color: var(--text-light); margin-top: 1px; }
.ri-right { text-align: right; flex-shrink: 0; }
.ri-nominal { font-size: 0.88rem; font-weight: 700; color: var(--green-dark); }
.ri-tgl     { font-size: 0.70rem; color: var(--text-light); }

/* ══ NOTIFIKASI ══ */
.notif-item {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; border-radius: var(--radius-sm); margin-bottom: 10px;
}
.notif-item:last-child { margin-bottom: 0; }
.notif-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; }
.notif-body h4 { font-size: 0.85rem; font-weight: 700; margin-bottom: 4px; }
.notif-body p  { font-size: 0.78rem; line-height: 1.6; }
.notif-time    { font-size: 0.68rem; color: var(--text-light); margin-top: 4px; }

.notif-info    { background: #EFF6FF; border: 1px solid #BFDBFE; }
.notif-info .notif-icon { background: #DBEAFE; color: #2563EB; }
.notif-info h4 { color: #1E40AF; }
.notif-info p  { color: #3B82F6; }

.notif-warning { background: #FFFBEB; border: 1px solid #FDE68A; }
.notif-warning .notif-icon { background: #FEF3C7; color: #D97706; }
.notif-warning h4 { color: #92400E; }
.notif-warning p  { color: #D97706; }

.notif-success { background: #F0FDF4; border: 1px solid #86EFAC; }
.notif-success .notif-icon { background: #D1FAE5; color: #059669; }
.notif-success h4 { color: #065F46; }
.notif-success p  { color: #059669; }

/* ══ PROGRESS PINJAMAN ══ */
.pinjaman-progress { padding: 0; }
.pp-item {
  background: #F8FCF9; border-radius: var(--radius-sm);
  padding: 16px; margin-bottom: 12px; border: 1.5px solid #E8F0EA;
  transition: var(--transition);
}
.pp-item:last-child { margin-bottom: 0; }
.pp-item:hover { border-color: var(--green-soft); }
.pp-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.pp-no { font-size: 0.78rem; font-weight: 700; color: var(--green-dark); }
.pp-pokok { font-size: 0.78rem; color: var(--text-light); }
.pp-bar-wrap { height: 8px; background: #E8F0EA; border-radius: 50px; overflow: hidden; margin-bottom: 8px; }
.pp-bar { height: 100%; border-radius: 50px; background: linear-gradient(90deg, var(--green-mid), var(--green-soft)); transition: width 1.2s ease; }
.pp-footer { display: flex; justify-content: space-between; font-size: 0.73rem; color: var(--text-light); }
.pp-footer strong { color: var(--green-dark); }

/* ══ EMPTY STATE ══ */
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-light); }
.empty-state .es-icon { font-size: 2.6rem; margin-bottom: 10px; opacity: 0.5; }
.empty-state h3 { font-size: 0.95rem; font-weight: 700; color: var(--text-mid); margin-bottom: 5px; }
.empty-state p  { font-size: 0.83rem; }

/* ══ RESPONSIVE ══ */
@media (max-width: 900px) {
  .stat-grid    { grid-template-columns: 1fr 1fr; }
  .content-grid { grid-template-columns: 1fr; }
  .hero-card    { flex-direction: column; align-items: flex-start; }
  .hero-right   { text-align: left; }
}
@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .portal-wrap { padding: 16px 14px; }
  .hero-card { padding: 22px 20px; }
}
