/* ==========================================================================
   DOMPETKU AI — DESIGN SYSTEM & RESPONSIVE PWA STYLESHEET
   Warna: Navy (#0B192C, #1E3E62), Putih (#FFFFFF, #F8FAFC), Emerald (#10B981)
   ========================================================================== */

:root {
  --primary: #10B981;
  --primary-dark: #059669;
  --primary-light: #D1FAE5;
  --navy-dark: #0B192C;
  --navy: #1E3E62;
  --navy-light: #2A527A;
  --navy-subtle: #F0F4F8;
  --bg-page: #F8FAFC;
  --bg-card: #FFFFFF;
  --text-main: #0F172A;
  --text-muted: #64748B;
  --text-light: #94A3B8;
  --border-color: #E2E8F0;
  --danger: #EF4444;
  --danger-light: #FEE2E2;
  --warning: #F59E0B;
  --warning-light: #FEF3C7;
  --info: #3B82F6;
  --info-light: #DBEAFE;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(11, 25, 44, 0.08);
  --shadow-lg: 0 10px 25px rgba(11, 25, 44, 0.12);
  
  --sidebar-width: 260px;
  --bottom-nav-height: 64px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at 10% 20%, rgba(16, 185, 129, 0.03) 0%, transparent 40%), radial-gradient(circle at 90% 10%, rgba(30, 62, 98, 0.05) 0%, transparent 40%), #F8FAFC;
}

/* ==========================================================================
   LAYOUT: DESKTOP SIDEBAR + MOBILE BOTTOM NAV
   ========================================================================== */

.app-wrapper {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* Sidebar (Desktop / Laptop) */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--navy-dark);
  color: #FFFFFF;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 100;
  box-shadow: 2px 0 10px rgba(0,0,0,0.15);
  transition: width 0.25s ease, opacity 0.2s ease, transform 0.25s ease;
}

.sidebar.collapsed {
  width: 0 !important;
  min-width: 0 !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  border: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.sidebar-header {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.brand-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}

.brand-text h1 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: -0.3px;
}

.brand-text span {
  font-size: 0.72rem;
  color: var(--primary);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.sidebar-nav {
  padding: 16px 12px;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-section-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-light);
  padding: 12px 12px 6px 12px;
  font-weight: 700;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: #CBD5E1;
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.nav-item:hover {
  background-color: var(--navy);
  color: #FFFFFF;
}

.nav-item.active {
  background: linear-gradient(90deg, var(--navy), var(--navy-light));
  color: #FFFFFF;
  border-left: 4px solid var(--primary);
  font-weight: 600;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
  background-color: rgba(0,0,0,0.2);
}

/* User Pill Profile */
.user-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background-color: rgba(255,255,255,0.06);
  border-radius: var(--radius-md);
}

.user-pill-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--navy-light);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

.avatar.suami {
  background: linear-gradient(135deg, #1E3E62, #0B192C);
  border: 2px solid var(--primary);
}

.avatar.istri {
  background: linear-gradient(135deg, #EC4899, #BE185D);
  border: 2px solid #F472B6;
}

.user-names {
  line-height: 1.2;
}

.user-names .name {
  font-weight: 600;
  font-size: 0.88rem;
  color: #FFFFFF;
}

.role-tag {
  display: inline-block;
  font-size: 0.68rem;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  font-weight: 600;
  text-transform: capitalize;
}

.role-tag.suami {
  background-color: rgba(16, 185, 129, 0.2);
  color: var(--primary);
}

.role-tag.istri {
  background-color: rgba(236, 72, 153, 0.2);
  color: #F472B6;
}

/* Main Content Area */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background-color: var(--bg-page);
}

/* Topbar Header */
.topbar {
  background-color: #FFFFFF;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.topbar-title h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--navy-dark);
}

.topbar-title p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Mobile Header (Shown on phone only) */
.mobile-header {
  display: none;
  background-color: var(--navy-dark);
  color: #FFFFFF;
  padding: 12px 16px;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
}

.mobile-header .brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mobile-header .brand h1 {
  font-size: 1.1rem;
  font-weight: 700;
}

/* Content Body */
.content-area {
  padding: 24px;
  flex: 1;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}

/* ==========================================================================
   MOBILE & RESPONSIVE BOTTOM NAVIGATION BAR
   ========================================================================== */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-height);
  background-color: #FFFFFF;
  border-top: 1px solid rgba(226, 232, 240, 0.9);
  z-index: 1000;
  box-shadow: 0 -4px 20px rgba(11, 25, 44, 0.08);
  padding-bottom: env(safe-area-inset-bottom);
}

.bottom-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-around;
  height: 100%;
  max-width: 540px;
  margin: 0 auto;
  padding: 0 4px;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.68rem;
  font-weight: 500;
  min-width: 54px;
  padding: 4px 0;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.bottom-nav-item svg {
  width: 22px;
  height: 22px;
  stroke-width: 2;
  transition: transform 0.15s ease, stroke 0.15s ease;
}

.bottom-nav-item:active svg {
  transform: scale(0.9);
}

.bottom-nav-item.active {
  color: var(--primary-dark);
  font-weight: 700;
}

.bottom-nav-item.active-highlight {
  color: var(--navy);
  font-weight: 700;
}

.bottom-nav-center {
  position: relative;
  top: -14px;
}

.fab-center-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10B981, #059669);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.45);
  text-decoration: none;
  border: 3px solid #FFFFFF;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  -webkit-tap-highlight-color: transparent;
}

.fab-center-btn:active {
  transform: scale(0.92);
}

/* ==========================================================================
   BOTTOM SHEET DRAWER (SEMUA MENU DOMPETKU LENGKAP)
   ========================================================================== */
.bottom-drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(11, 25, 44, 0.6);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.bottom-drawer-overlay.active {
  display: flex !important;
  opacity: 1;
  pointer-events: auto;
}

.bottom-drawer-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 560px;
  margin: 0 auto;
  max-height: 86vh;
  background: #FFFFFF;
  border-radius: 26px 26px 0 0;
  z-index: 10001;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.25);
  padding-bottom: max(16px, env(safe-area-inset-bottom));
}

.bottom-drawer-overlay.active .bottom-drawer-sheet {
  transform: translateY(0);
}

.drawer-drag-pill {
  width: 44px;
  height: 5px;
  background: #E2E8F0;
  border-radius: 999px;
  margin: 12px auto 6px auto;
  cursor: pointer;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px 14px 20px;
  border-bottom: 1px solid #F1F5F9;
}

.drawer-user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.drawer-user-info .avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.drawer-user-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.drawer-user-name {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--navy-dark);
  margin: 0;
}

.drawer-user-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.drawer-user-sub .role-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 9999px;
}

.drawer-user-sub .role-badge.kepala_keluarga {
  background: #DBEAFE;
  color: #1D4ED8;
}

.drawer-user-sub .role-badge.pasangan {
  background: #FCE7F3;
  color: #BE185D;
}

.drawer-user-sub .role-badge.anggota {
  background: #DCFCE7;
  color: #15803D;
}

.drawer-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #F1F5F9;
  border: none;
  font-size: 1.3rem;
  line-height: 1;
  color: #64748B;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.drawer-close-btn:hover {
  background: #E2E8F0;
  color: #0F172A;
}

.drawer-scroll-body {
  overflow-y: auto;
  padding: 16px 18px 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  -webkit-overflow-scrolling: touch;
}

.drawer-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.drawer-section-title {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #94A3B8;
  padding-left: 4px;
}

.drawer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

@media (max-width: 380px) {
  .drawer-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.drawer-menu-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 6px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 14px;
  text-decoration: none;
  color: var(--navy-dark);
  transition: all 0.15s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.drawer-menu-card:hover {
  background: #F1F5F9;
  border-color: #CBD5E1;
  transform: translateY(-2px);
}

.drawer-menu-card:active {
  transform: scale(0.95);
}

.drawer-menu-card.active {
  background: #ECFDF5;
  border-color: #A7F3D0;
  color: #059669;
  font-weight: 700;
}

.drawer-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  transition: transform 0.15s ease;
}

.drawer-menu-title {
  font-size: 0.72rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.2;
}

.mobile-menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #FFFFFF;
  cursor: pointer;
  margin-right: 6px;
  padding: 0;
  transition: all 0.15s ease;
}

.mobile-menu-btn svg {
  width: 20px;
  height: 20px;
}

.mobile-menu-btn:active {
  transform: scale(0.92);
}

.fab-center-btn:active {
  transform: scale(0.92);
}

.fab-center-btn svg {
  width: 26px;
  height: 26px;
}

/* ==========================================================================
   UI COMPONENTS & CARDS
   ========================================================================== */

/* ==========================================================================
   LUXURY FINTECH DIGITAL WALLET HERO CARD
   ========================================================================== */

.luxury-wallet-card {
  background: radial-gradient(circle at 100% 0%, rgba(16, 185, 129, 0.2) 0%, transparent 50%),
              radial-gradient(circle at 0% 100%, rgba(30, 62, 98, 0.45) 0%, transparent 60%),
              linear-gradient(135deg, #071224 0%, #0F223D 50%, #09172B 100%);
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 20px 40px -15px rgba(11, 25, 44, 0.4), 0 0 24px rgba(16, 185, 129, 0.1);
  padding: 26px 28px;
  color: #FFFFFF;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.luxury-wallet-card:hover {
  box-shadow: 0 24px 50px -15px rgba(11, 25, 44, 0.5), 0 0 32px rgba(16, 185, 129, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
}

.luxury-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.luxury-card-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.luxury-card-chip {
  width: 38px;
  height: 28px;
  background: linear-gradient(135deg, #F59E0B, #D97706);
  border-radius: 6px;
  position: relative;
  box-shadow: inset 0 1px 2px rgba(255,255,255,0.4), 0 2px 4px rgba(0,0,0,0.25);
  border: 1px solid rgba(0,0,0,0.2);
}

.luxury-card-chip::after {
  content: '';
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 6px;
  right: 6px;
  border: 1px solid rgba(0,0,0,0.25);
  border-radius: 2px;
}

.luxury-card-contactless {
  color: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
}

.luxury-card-family {
  text-align: right;
}

.luxury-card-family .family-tag {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--primary);
  font-weight: 700;
  display: block;
}

.luxury-card-family h3 {
  font-size: 1.1rem;
  font-weight: 800;
  color: #FFFFFF;
  letter-spacing: -0.3px;
}

/* Balance Display */
.luxury-card-balance-wrap {
  margin-bottom: 24px;
}

.balance-label-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.balance-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.btn-toggle-eye {
  background: rgba(255, 255, 255, 0.12);
  border: none;
  border-radius: var(--radius-full);
  padding: 2px 8px;
  font-size: 0.75rem;
  cursor: pointer;
  color: #FFFFFF;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
}

.btn-toggle-eye:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.05);
}

.luxury-balance-number {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -1px;
  color: #FFFFFF;
  line-height: 1.1;
  text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.luxury-balance-hidden {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: 4px;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.1;
}

.luxury-balance-hidden.hidden, .luxury-balance-number.hidden {
  display: none;
}

/* Metrics row inside Card */
.luxury-card-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 18px;
}

.metric-pill {
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.metric-pill.income .metric-icon {
  background: rgba(16, 185, 129, 0.25);
  color: #34D399;
}

.metric-pill.expense .metric-icon {
  background: rgba(244, 63, 94, 0.25);
  color: #FB7185;
}

.metric-pill.budget .metric-icon {
  background: rgba(245, 158, 11, 0.25);
  color: #FBBF24;
}

.metric-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 800;
  flex-shrink: 0;
}

.metric-info {
  line-height: 1.2;
}

.metric-title {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.7);
  display: block;
  font-weight: 600;
}

.metric-val {
  font-size: 0.95rem;
  font-weight: 800;
  color: #FFFFFF;
}

/* Action Buttons inside Card */
.luxury-card-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.btn-luxury-action {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  padding: 14px 16px;
  color: #FFFFFF;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.btn-luxury-action:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.4);
}

.btn-luxury-action:active {
  transform: scale(0.97);
}

.btn-luxury-action.expense {
  background: linear-gradient(135deg, #F43F5E, #E11D48);
  box-shadow: 0 6px 16px rgba(244, 63, 94, 0.35);
}

.btn-luxury-action.income {
  background: linear-gradient(135deg, #10B981, #059669);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.35);
}

.btn-luxury-action.transfer {
  background: linear-gradient(135deg, #1E3E62, #0B192C);
  box-shadow: 0 6px 16px rgba(30, 62, 98, 0.35);
}

.btn-luxury-action .btn-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}

.btn-luxury-action .btn-text strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.2;
}

.btn-luxury-action .btn-text small {
  font-size: 0.72rem;
  opacity: 0.85;
  display: block;
}

@media (max-width: 768px) {
  .luxury-wallet-card {
    padding: 20px 18px;
    border-radius: 20px;
  }

  .luxury-balance-number {
    font-size: 1.85rem;
  }

  .luxury-card-metrics {
    grid-template-columns: 1fr;
    gap: 8px;
    padding-top: 14px;
    margin-bottom: 18px;
  }

  .luxury-card-actions {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .btn-luxury-action.transfer {
    grid-column: span 2;
  }

  .btn-luxury-action {
    padding: 10px 12px;
  }
}

/* Card Improvements */
.card {
  background-color: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  margin-bottom: 20px;
  transition: box-shadow 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Metric / Stat Cards Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: #FFFFFF;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.stat-card.hero-card {
  background: linear-gradient(135deg, var(--navy-dark), var(--navy));
  color: #FFFFFF;
  border: none;
  box-shadow: var(--shadow-md);
}

.stat-card.hero-card .stat-label {
  color: rgba(255, 255, 255, 0.8);
}

.stat-card.hero-card .stat-value {
  color: #FFFFFF;
}

.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.stat-icon.green {
  background-color: var(--primary-light);
  color: var(--primary-dark);
}

.stat-icon.red {
  background-color: var(--danger-light);
  color: var(--danger);
}

.stat-icon.navy {
  background-color: rgba(255,255,255,0.15);
  color: #FFFFFF;
}

.stat-icon.amber {
  background-color: var(--warning-light);
  color: var(--warning);
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--navy-dark);
  letter-spacing: -0.5px;
}

.stat-subtext {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 6px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  min-height: 44px; /* Ramah sentuhan */
}

.btn-primary {
  background-color: var(--primary);
  color: #FFFFFF;
}

.btn-primary:hover {
  background-color: var(--primary-dark);
}

.btn-navy {
  background-color: var(--navy);
  color: #FFFFFF;
}

.btn-navy:hover {
  background-color: var(--navy-dark);
}

.btn-outline {
  background-color: transparent;
  border-color: var(--border-color);
  color: var(--text-main);
}

.btn-outline:hover {
  background-color: var(--navy-subtle);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  min-height: 36px;
}

.btn-block {
  width: 100%;
}

/* Form Styles */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy-dark);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 12px 14px;
  font-size: 0.95rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  background-color: #FFFFFF;
  color: var(--text-main);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

/* Alerts / Flash Messages */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}

.alert-success {
  background-color: var(--primary-light);
  color: #065F46;
  border-left: 4px solid var(--primary);
}

.alert-danger {
  background-color: var(--danger-light);
  color: #991B1B;
  border-left: 4px solid var(--danger);
}

.alert-warning {
  background-color: var(--warning-light);
  color: #92400E;
  border-left: 4px solid var(--warning);
}

.alert-info {
  background-color: var(--info-light);
  color: #1E40AF;
  border-left: 4px solid var(--info);
}

/* Offline Banner */
#offline-banner {
  display: none;
  background-color: #EF4444;
  color: #FFFFFF;
  text-align: center;
  padding: 8px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 200;
}

/* PWA Install Banner */
#pwa-install-banner {
  display: none;
  background: linear-gradient(90deg, var(--navy-dark), var(--navy));
  color: #FFFFFF;
  padding: 12px 20px;
  align-items: center;
  justify-content: space-between;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  box-shadow: var(--shadow-md);
}

/* Quick Input Box (One Handed) */
.quick-input-card {
  background: #FFFFFF;
  border: 2px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.12);
  margin-bottom: 24px;
}

.quick-input-textarea {
  width: 100%;
  border: none;
  font-size: 1.2rem;
  font-weight: 500;
  resize: none;
  outline: none;
  color: var(--navy-dark);
  font-family: inherit;
  min-height: 80px;
}

.quick-preview-box {
  background-color: var(--navy-subtle);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-top: 14px;
  display: none;
}

/* Transaction List Table / Cards */
.transaction-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.15s ease;
}

.transaction-item:last-child {
  border-bottom: none;
}

.transaction-item:hover {
  background-color: var(--navy-subtle);
}

.trans-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.trans-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.trans-info .title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
}

.trans-info .meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.trans-amount {
  text-align: right;
}

.trans-amount .amount {
  font-size: 1rem;
  font-weight: 700;
}

.trans-amount .amount.income {
  color: var(--primary-dark);
}

.trans-amount .amount.expense {
  color: var(--danger);
}

.trans-amount .amount.transfer {
  color: var(--navy);
}

.trans-amount .account-name {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Transaction Actions (Edit & Delete Pill Buttons) */
.trans-right-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}

.trans-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-pill-edit, .btn-pill-delete {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-pill-edit {
  background-color: #F1F5F9;
  color: var(--navy);
  border-color: #CBD5E1;
}

.btn-pill-edit:hover {
  background-color: #DBEAFE;
  color: #1D4ED8;
  border-color: #93C5FD;
  transform: translateY(-1px);
}

.btn-pill-delete {
  background-color: #FFF1F2;
  color: #E11D48;
  border-color: #FECDD3;
}

.btn-pill-delete:hover {
  background-color: #FEE2E2;
  color: #BE123C;
  border-color: #FCA5A5;
  transform: translateY(-1px);
}

.btn-action {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
  background-color: #FFFFFF;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
}

.btn-action-edit:hover {
  background-color: var(--info-light);
  color: var(--info);
  border-color: var(--info);
  transform: translateY(-1px);
}

.btn-action-delete:hover {
  background-color: var(--danger-light);
  color: var(--danger);
  border-color: var(--danger);
  transform: translateY(-1px);
}

/* Hero Action Cards Bar (Super Cepat & Keren) */
.action-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.action-card {
  padding: 16px 20px;
  border-radius: var(--radius-md);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.action-card:hover {
  transform: translateY(-3px);
}

.action-card.expense {
  background: linear-gradient(135deg, #F43F5E, #E11D48);
  box-shadow: 0 8px 20px rgba(244, 63, 94, 0.28);
}

.action-card.expense:hover {
  box-shadow: 0 12px 26px rgba(244, 63, 94, 0.38);
}

.action-card.income {
  background: linear-gradient(135deg, #10B981, #059669);
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.28);
}

.action-card.income:hover {
  box-shadow: 0 12px 26px rgba(16, 185, 129, 0.38);
}

.action-card.transfer {
  background: linear-gradient(135deg, #1E3E62, #0B192C);
  box-shadow: 0 8px 20px rgba(30, 62, 98, 0.28);
}

.action-card.transfer:hover {
  box-shadow: 0 12px 26px rgba(30, 62, 98, 0.38);
}

.action-card-info h4 {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.2;
}

.action-card-info p {
  font-size: 0.78rem;
  opacity: 0.9;
  margin-top: 2px;
}

.action-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
  backdrop-filter: blur(4px);
}

/* Interactive Category Chips */
.category-chips-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 180px;
  overflow-y: auto;
  padding: 4px 2px;
  margin-bottom: 16px;
}

.category-chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--navy-subtle);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.category-chip-btn:hover {
  background: #E2E8F0;
  border-color: #CBD5E1;
  transform: translateY(-1px);
}

.category-chip-btn.active.expense {
  background: linear-gradient(135deg, #EF4444, #DC2626);
  color: #FFFFFF;
  border-color: #EF4444;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.category-chip-btn.active.income {
  background: linear-gradient(135deg, #10B981, #059669);
  color: #FFFFFF;
  border-color: #10B981;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Modal Overlay & Card (Glassmorphism & Sleek Design) */
.modal-overlay {
  display: none !important;
  position: fixed;
  inset: 0;
  background-color: rgba(11, 25, 44, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 999999 !important;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.2s ease-out;
  pointer-events: none;
}

.modal-overlay.active {
  display: flex !important;
  pointer-events: auto !important;
}

.modal-window {
  background: #FFFFFF;
  width: 100%;
  max-width: 520px;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 40px rgba(11, 25, 44, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.3);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 92vh;
  animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto !important;
  position: relative;
  z-index: 1000000 !important;
}

.btn, .preset-chip, .category-chip-btn, .type-segmented-btn, .btn-pill-edit, .btn-pill-delete, .drawer-menu-card, .bottom-nav-item {
  cursor: pointer !important;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(30px) scale(0.97); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.modal-header {
  padding: 18px 24px;
  background: linear-gradient(135deg, var(--navy-dark), var(--navy));
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close-btn {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #FFFFFF;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
}

/* Modern Segmented Control for Transaction Type */
.type-segmented-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  background: var(--navy-subtle);
  padding: 4px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  border: 1px solid var(--border-color);
}

.type-segmented-btn {
  padding: 10px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.type-segmented-btn.active.expense {
  background: #FFFFFF;
  color: var(--danger);
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.15);
}

.type-segmented-btn.active.income {
  background: #FFFFFF;
  color: var(--primary-dark);
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.15);
}

.type-segmented-btn.active.transfer {
  background: #FFFFFF;
  color: var(--navy);
  box-shadow: 0 2px 6px rgba(30, 62, 98, 0.15);
}

/* Big Amount Input Display */
.amount-display-box {
  background: #F8FAFC;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 12px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.amount-display-box:focus-within {
  border-color: var(--primary);
  background: #FFFFFF;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.12);
}

.amount-prefix {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.amount-input-large {
  width: 100%;
  border: none;
  background: transparent;
  font-size: 2rem;
  font-weight: 800;
  color: var(--navy-dark);
  outline: none;
  letter-spacing: -0.5px;
}

/* Fast Preset Amount Chips */
.preset-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.preset-chip {
  padding: 6px 12px;
  background: var(--navy-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
}

.preset-chip:hover {
  background: #E2E8F0;
  transform: translateY(-1px);
}

.preset-chip:active {
  background: var(--primary-light);
  color: var(--primary-dark);
  border-color: var(--primary);
}

/* Confirmation Box for Delete */
.confirm-box {
  text-align: center;
  padding: 24px;
}

.confirm-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--danger-light);
  color: var(--danger);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin: 0 auto 16px;
}

/* Responsive Breakpoints & Desktop Laptop / Mobile Optimization */

/* Tablet & Laptop Layar Kecil (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  :root {
    --sidebar-width: 220px;
  }

  .sidebar {
    display: flex !important;
    width: 220px !important;
  }

  .sidebar-header {
    padding: 16px 14px;
  }

  .nav-item {
    padding: 8px 10px;
    font-size: 0.84rem;
    gap: 8px;
  }

  .nav-item svg {
    width: 18px;
    height: 18px;
  }

  .topbar {
    display: flex !important;
    padding: 12px 16px;
  }

  .mobile-header {
    display: none !important;
  }

  .bottom-nav {
    display: none !important;
  }
}

/* Mobile HP Devices (<= 768px) */
@media (max-width: 768px) {
  html, body {
    overflow-x: hidden;
    width: 100%;
  }

  .sidebar {
    display: none !important; /* Sembunyikan sidebar hanya di layar HP */
  }

  .mobile-header {
    display: flex !important;
    background-color: var(--navy-dark);
    color: #FFFFFF;
    padding: 10px 14px;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 90;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    padding-top: max(10px, env(safe-area-inset-top));
  }

  .mobile-header .brand {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
  }

  .brand-title-wrap {
    line-height: 1.1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .brand-title-wrap h1 {
    font-size: 0.98rem;
    font-weight: 800;
    color: #FFFFFF;
    margin: 0;
    letter-spacing: -0.3px;
  }

  .brand-title-wrap .brand-sub {
    font-size: 0.62rem;
    color: var(--primary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
  }

  .mobile-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
  }

  .mobile-icon-btn.wa {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(37, 211, 102, 0.18);
    border: 1px solid rgba(37, 211, 102, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    text-decoration: none;
    color: #FFFFFF;
  }

  .mobile-quick-add {
    padding: 5px 12px;
    font-size: 0.78rem;
    border-radius: 99px;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.35);
    white-space: nowrap;
  }

  .mobile-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.82rem;
    overflow: hidden;
    border: 2px solid rgba(255,255,255,0.25);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    flex-shrink: 0;
    color: #FFFFFF;
  }

  .mobile-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .bottom-nav {
    display: block !important;
    height: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px)) !important;
    padding-bottom: max(6px, env(safe-area-inset-bottom));
    visibility: visible !important;
    opacity: 1 !important;
  }

  .bottom-nav-inner {
    display: flex !important;
  }

  .content-area {
    padding: 12px 14px;
    padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 12px) + 24px); /* Berikan ruang aman untuk bottom nav */
    max-width: 100%;
    overflow-x: hidden;
  }

  .topbar {
    display: none;
  }

  .card {
    padding: 16px 14px;
    margin-bottom: 14px;
    border-radius: 16px;
  }

  .card-grid {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  .luxury-wallet-card {
    padding: 18px 16px;
    border-radius: 20px;
    margin-bottom: 16px;
  }

  .luxury-balance-number {
    font-size: 1.65rem;
    word-break: break-word;
  }

  .luxury-card-metrics {
    grid-template-columns: 1fr;
    gap: 6px;
    padding-top: 12px;
    margin-bottom: 14px;
  }

  .metric-pill {
    padding: 8px 10px;
    border-radius: 10px;
  }

  .luxury-card-actions {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .btn-luxury-action.transfer {
    grid-column: span 1;
  }

  .btn-luxury-action {
    padding: 9px 10px;
    gap: 8px;
    border-radius: 12px;
  }

  .btn-luxury-action .btn-icon {
    font-size: 1.25rem;
  }

  .btn-luxury-action .btn-text strong {
    font-size: 0.82rem;
  }

  .btn-luxury-action .btn-text small {
    font-size: 0.65rem;
  }

  /* Form controls: 16px mencegah auto-zoom iOS Safari */
  .form-control, input, select, textarea {
    font-size: 16px !important;
  }

  .trans-right-wrap {
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
  }

  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
  }
}

/* Extra Small Phones (iPhone SE, Galaxy A series, <= 380px) */
@media (max-width: 380px) {
  .content-area {
    padding: 10px 10px;
  }

  .luxury-wallet-card {
    padding: 16px 12px;
  }

  .luxury-balance-number {
    font-size: 1.45rem;
  }

  .bottom-nav-item span {
    font-size: 0.62rem;
  }

  .fab-center-btn {
    width: 48px;
    height: 48px;
  }
}

