/* ============================================================
   FINSERA DESIGN SYSTEM — Glassmorphism Edition
   Version: 1.0.0
   Updated: 2026-03-24

   File ini adalah sumber kebenaran visual untuk seluruh halaman
   Finsera. Import di setiap halaman HTML:
   <link rel="stylesheet" href="css/finsera-design-system.css">
   ============================================================ */

/* ──────────────────────────────────────────────────────────────
   1. CSS CUSTOM PROPERTIES (DESIGN TOKENS)
   ────────────────────────────────────────────────────────────── */

:root {
  /* ── Brand Colors ── */
  --navy:         #082654;
  --navy-light:   #0e3470;
  --navy-mid:     #163d7a;
  --navy-dark:    #051a3a;
  --bg:           #f5f3ef;
  --cyan:         #0cb9d9;
  --cyan-light:   #3dd4f0;
  --cyan-dark:    #0a96b0;
  --mint:         #77eba3;
  --green:        #2ecc71;
  --red:          #e74c3c;
  --amber:        #f39c12;
  --muted:        #8a9ab5;
  --card:         #ffffff;
  --text:         #0a1628;
  --text-muted:   #6b7a99;

  /* ── Semantic Colors ── */
  --color-success:   #2ecc71;
  --color-warning:   #f39c12;
  --color-error:     #e74c3c;
  --color-info:      #0cb9d9;
  --color-income:    #77eba3;
  --color-expense:   #ff8080;
  --color-transfer:  #f39c12;

  /* ── Glassmorphism Tokens ── */
  --glass-bg:             rgba(255, 255, 255, 0.08);
  --glass-bg-light:       rgba(255, 255, 255, 0.12);
  --glass-bg-medium:      rgba(255, 255, 255, 0.16);
  --glass-bg-heavy:       rgba(255, 255, 255, 0.22);
  --glass-bg-white:       rgba(255, 255, 255, 0.75);
  --glass-bg-white-heavy: rgba(255, 255, 255, 0.88);
  --glass-border:         rgba(255, 255, 255, 0.12);
  --glass-border-light:   rgba(255, 255, 255, 0.18);
  --glass-border-heavy:   rgba(255, 255, 255, 0.25);
  --glass-blur:           16px;
  --glass-blur-heavy:     24px;
  --glass-blur-light:     8px;

  /* ── Typography ── */
  --font-heading: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body:    'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:    'JetBrains Mono', 'SF Mono', Consolas, monospace;

  --text-xs:   0.6875rem;   /* 11px */
  --text-sm:   0.8125rem;   /* 13px */
  --text-base: 0.9375rem;   /* 15px */
  --text-lg:   1.0625rem;   /* 17px */
  --text-xl:   1.125rem;    /* 18px */
  --text-2xl:  1.375rem;    /* 22px */
  --text-3xl:  1.75rem;     /* 28px */
  --text-4xl:  2rem;        /* 32px */

  /* ── Spacing (4px base grid) ── */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;

  /* ── Border Radius ── */
  --radius-sm:   8px;
  --radius-md:   12px;
  --radius-lg:   16px;
  --radius-xl:   20px;
  --radius-2xl:  24px;
  --radius-full: 9999px;

  /* ── Shadows — Multi-layer premium ── */
  --shadow-card:      0 2px 8px rgba(8, 38, 84, 0.06),
                      0 1px 2px rgba(8, 38, 84, 0.04);
  --shadow-card-md:   0 4px 16px rgba(8, 38, 84, 0.08),
                      0 2px 4px rgba(8, 38, 84, 0.04);
  --shadow-card-lg:   0 8px 32px rgba(8, 38, 84, 0.12),
                      0 2px 8px rgba(8, 38, 84, 0.06);
  --shadow-card-xl:   0 12px 48px rgba(8, 38, 84, 0.16),
                      0 4px 12px rgba(8, 38, 84, 0.08);
  --shadow-hero:      0 8px 32px rgba(8, 38, 84, 0.35),
                      0 2px 8px rgba(8, 38, 84, 0.15);
  --shadow-glow-cyan: 0 4px 24px rgba(12, 185, 217, 0.25),
                      0 0px 8px rgba(12, 185, 217, 0.15);
  --shadow-glow-mint: 0 4px 24px rgba(119, 235, 163, 0.2);
  --shadow-bottom-nav: 0 -4px 20px rgba(8, 38, 84, 0.08),
                       0 -1px 4px rgba(8, 38, 84, 0.03);

  /* ── Gradients ── */
  --gradient-navy:       linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
  --gradient-navy-full:  linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 60%, var(--navy-mid) 100%);
  --gradient-hero:       linear-gradient(135deg, var(--navy-light), var(--navy-mid));
  --gradient-cyan:       linear-gradient(135deg, var(--cyan), #0891b2);
  --gradient-mint:       linear-gradient(135deg, var(--mint), var(--green));
  --gradient-gold:       linear-gradient(135deg, #f0c84a, #e8a000);

  /* ── Transitions ── */
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast:   120ms;
  --duration-normal: 200ms;
  --duration-slow:   300ms;

  /* ── Safe Area ── */
  --safe-top:    env(safe-area-inset-top,    0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left:   env(safe-area-inset-left,   0px);
  --safe-right:  env(safe-area-inset-right,  0px);

  /* ── Layout ── */
  --nav-h:      72px;
  --topbar-h:   auto;
  --max-width:  430px;
}


/* ──────────────────────────────────────────────────────────────
   2. BASE RESET & TYPOGRAPHY
   ────────────────────────────────────────────────────────────── */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html, body {
  font-family: var(--font-heading);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  overflow-x: hidden;
}

/* iOS zoom prevention */
input, select, textarea {
  font-size: 16px;
}

/* Touch target minimum */
button, a {
  min-height: 44px;
  min-width: 44px;
}

/* Smooth scrolling */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}


/* ──────────────────────────────────────────────────────────────
   3. TYPOGRAPHY SCALE — Angka Keuangan
   ────────────────────────────────────────────────────────────── */

/* Kelas khusus untuk menampilkan angka keuangan (saldo, total, dll)
   Menggunakan font Roboto (--font-body) dengan weight bold
   untuk readability angka yang optimal */

.amount-xl {
  font-family: var(--font-body);
  font-size: var(--text-4xl);
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.1;
}

.amount-lg {
  font-family: var(--font-body);
  font-size: var(--text-2xl);
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.amount-md {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 700;
  letter-spacing: -0.3px;
  line-height: 1.3;
}

.amount-sm {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 700;
  line-height: 1.3;
}

/* Warna semantik untuk angka */
.amount-positive { color: var(--color-income); }
.amount-negative { color: var(--color-expense); }
.amount-neutral  { color: var(--text); }
.amount-white    { color: #fff; }


/* ──────────────────────────────────────────────────────────────
   4. CARDS — Standard & Glassmorphism
   ────────────────────────────────────────────────────────────── */

/* ── Standard White Card ──
   Digunakan untuk: list item, form container, content sections
   di atas background --bg (cream) */

.card {
  background: var(--card);
  border-radius: var(--radius-xl);
  padding: var(--space-5) var(--space-5);
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(8, 38, 84, 0.04);
  transition: transform var(--duration-normal) var(--ease-out),
              box-shadow var(--duration-normal) var(--ease-out);
}

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

.card--interactive {
  cursor: pointer;
}

.card--interactive:active {
  transform: scale(0.98);
}

.card--compact {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
}

.card--flush {
  padding: 0;
  overflow: hidden;
}

/* ── Glassmorphism Card ──
   HANYA digunakan di atas background gelap (navy gradient, hero section).
   Jangan pakai di atas background --bg (cream) — kontras akan jelek.

   Hierarki glass:
   .card-glass          → subtle (default, di atas hero/navy)
   .card-glass--medium  → lebih visible
   .card-glass--heavy   → paling opaque, untuk card hero utama
   .card-glass--white   → untuk overlay di atas konten biasa
*/

.card-glass {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-radius: var(--radius-xl);
  border: 1px solid var(--glass-border);
  padding: var(--space-5) var(--space-5);
  transition: transform var(--duration-normal) var(--ease-out),
              box-shadow var(--duration-normal) var(--ease-out),
              background var(--duration-normal) var(--ease-out);
}

.card-glass--medium {
  background: var(--glass-bg-medium);
  border-color: var(--glass-border-light);
}

.card-glass--heavy {
  background: var(--glass-bg-heavy);
  border-color: var(--glass-border-heavy);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.card-glass--white {
  background: var(--glass-bg-white);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: var(--shadow-card-md);
}

.card-glass--white-heavy {
  background: var(--glass-bg-white-heavy);
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: var(--shadow-card-lg);
}

.card-glass:hover {
  background: var(--glass-bg-light);
}

.card-glass--interactive {
  cursor: pointer;
}

.card-glass--interactive:active {
  transform: scale(0.98);
}

/* Fallback untuk browser tanpa backdrop-filter (IE, old Firefox) */
@supports not (backdrop-filter: blur(1px)) {
  .card-glass {
    background: rgba(14, 52, 112, 0.85);
  }
  .card-glass--medium {
    background: rgba(14, 52, 112, 0.8);
  }
  .card-glass--heavy {
    background: rgba(14, 52, 112, 0.75);
  }
  .card-glass--white {
    background: rgba(255, 255, 255, 0.92);
  }
}


/* ──────────────────────────────────────────────────────────────
   5. BUTTONS
   ────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  border: none;
  border-radius: var(--radius-lg);
  font-family: var(--font-heading);
  font-weight: 700;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
}

.btn i[data-lucide] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ── Sizes ── */
.btn--sm {
  height: 36px;
  padding: 0 var(--space-3);
  font-size: var(--text-sm);
  border-radius: var(--radius-sm);
  min-height: 36px !important;
}

.btn--md {
  height: 44px;
  padding: 0 var(--space-5);
  font-size: var(--text-base);
}

.btn--lg {
  height: 52px;
  padding: 0 var(--space-6);
  font-size: var(--text-lg);
  border-radius: var(--radius-lg);
}

.btn--full {
  width: 100%;
}

/* ── Variants ── */

/* Primary: Aksi utama per halaman */
.btn-primary {
  background: var(--navy);
  color: #fff;
}

.btn-primary:hover {
  background: var(--navy-light);
}

.btn-primary:active {
  background: var(--navy-dark);
  transform: scale(0.98);
}

/* Primary Cyan: CTA menonjol (save, confirm) */
.btn-primary-cyan {
  background: var(--cyan);
  color: #fff;
}

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

.btn-primary-cyan:active {
  transform: scale(0.98);
}

/* Secondary: Aksi sekunder */
.btn-secondary {
  background: transparent;
  color: var(--navy);
  border: 1.5px solid var(--navy);
}

.btn-secondary:hover {
  background: rgba(8, 38, 84, 0.06);
}

.btn-secondary:active {
  background: rgba(8, 38, 84, 0.1);
  transform: scale(0.98);
}

/* Ghost: Aksi tersier / dalam list */
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: none;
}

.btn-ghost:hover {
  background: rgba(8, 38, 84, 0.04);
  color: var(--text);
}

.btn-ghost:active {
  background: rgba(8, 38, 84, 0.08);
}

/* Danger: Aksi destruktif */
.btn-danger {
  background: var(--red);
  color: #fff;
}

.btn-danger:hover {
  background: #c0392b;
}

.btn-danger:active {
  background: #a93226;
  transform: scale(0.98);
}

/* Danger Ghost */
.btn-danger-ghost {
  background: transparent;
  color: var(--red);
  border: none;
}

.btn-danger-ghost:hover {
  background: rgba(231, 76, 60, 0.08);
}

/* Soft / Muted */
.btn-soft {
  background: rgba(8, 38, 84, 0.06);
  color: var(--navy);
}

.btn-soft:hover {
  background: rgba(8, 38, 84, 0.1);
}

/* Gold (Premium CTA) */
.btn-gold {
  background: var(--gradient-gold);
  color: #fff;
}

.btn-gold:hover {
  filter: brightness(1.05);
}

/* ── States ── */
.btn:disabled,
.btn--disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn--loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn--loading::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: btn-spin 0.6s linear infinite;
}

@keyframes btn-spin {
  to { transform: rotate(360deg); }
}


/* ──────────────────────────────────────────────────────────────
   6. HERO / HEADER — Navy Gradient Section
   ────────────────────────────────────────────────────────────── */

.header-navy {
  background: var(--gradient-navy);
  position: relative;
  overflow: hidden;
}

/* Dekorasi lingkaran abstrak di header */
.header-navy::before {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: var(--navy-light);
  top: -100px;
  right: -80px;
  opacity: 0.5;
}

.header-navy::after {
  content: '';
  position: absolute;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: var(--cyan);
  bottom: -60px;
  left: 30px;
  opacity: 0.12;
}

/* Hero balance card — glassmorphism di atas navy gradient */
.hero-balance-card {
  background: var(--glass-bg-medium);
  backdrop-filter: blur(var(--glass-blur-heavy));
  -webkit-backdrop-filter: blur(var(--glass-blur-heavy));
  border-radius: var(--radius-xl);
  padding: var(--space-5) var(--space-6);
  border: 1px solid var(--glass-border-light);
  box-shadow: var(--shadow-hero);
  position: relative;
  z-index: 10;
}

/* Inner glow effect */
.hero-balance-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    135deg,
    rgba(12, 185, 217, 0.08) 0%,
    transparent 50%,
    rgba(119, 235, 163, 0.04) 100%
  );
  pointer-events: none;
}

@supports not (backdrop-filter: blur(1px)) {
  .hero-balance-card {
    background: rgba(14, 52, 112, 0.9);
  }
}


/* ──────────────────────────────────────────────────────────────
   7. TOPBAR — Sticky Navigation Bar
   ────────────────────────────────────────────────────────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--gradient-navy-full);
  padding: calc(var(--safe-top) + 14px) calc(var(--safe-right) + 16px) 14px calc(var(--safe-left) + 16px);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.topbar-back {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
  transition: background var(--duration-fast);
}

.topbar-back:active {
  background: var(--glass-bg-medium);
}

.topbar-back i { width: 18px; height: 18px; stroke: #fff; }

.topbar-info { flex: 1; }
.topbar-title { font-size: var(--text-lg); font-weight: 700; color: #fff; }
.topbar-sub   { font-size: var(--text-xs); color: rgba(255, 255, 255, 0.6); font-weight: 500; margin-top: 1px; }


/* ──────────────────────────────────────────────────────────────
   8. BOTTOM NAVIGATION BAR
   ────────────────────────────────────────────────────────────── */

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: var(--card);
  border-top: 1px solid rgba(8, 38, 84, 0.06);
  display: flex;
  height: calc(var(--nav-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  box-shadow: var(--shadow-bottom-nav);
}

/* Centered bottom nav for max-width layouts */
.bottom-nav--centered {
  left: 50%;
  transform: translateX(-50%);
  max-width: var(--max-width);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  gap: 4px;
  min-height: 44px;
  transition: opacity var(--duration-fast);
  position: relative;
}

.nav-item:active { opacity: 0.7; }

.nav-item i[data-lucide] {
  width: 22px;
  height: 22px;
  stroke: var(--muted);
  transition: stroke var(--duration-normal);
}

.nav-item.active i[data-lucide] {
  stroke: var(--cyan);
}

.nav-lbl {
  font-size: var(--text-xs);
  font-weight: 600;
  font-family: var(--font-heading);
  color: var(--muted);
  line-height: 1;
}

.nav-item.active .nav-lbl {
  color: var(--cyan);
}

/* Active indicator dot */
.nav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  width: 24px;
  height: 3px;
  border-radius: 0 0 var(--radius-full) var(--radius-full);
  background: var(--cyan);
}


/* ──────────────────────────────────────────────────────────────
   9. BADGES
   ────────────────────────────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-heading);
  letter-spacing: 0.5px;
  white-space: nowrap;
}

/* ── Tier Badges ── */
.badge-free {
  background: rgba(138, 154, 181, 0.12);
  color: var(--muted);
}

.badge-premium {
  background: rgba(12, 185, 217, 0.12);
  color: var(--cyan);
}

.badge-update-pass {
  background: rgba(46, 204, 113, 0.12);
  color: var(--green);
}

.badge-popular {
  background: rgba(12, 185, 217, 0.12);
  color: var(--cyan);
}

.badge-soon {
  background: rgba(243, 156, 18, 0.12);
  color: var(--amber);
}

/* ── Status Badges ── */
.badge-income {
  background: rgba(119, 235, 163, 0.15);
  color: var(--green);
}

.badge-expense {
  background: rgba(231, 76, 60, 0.1);
  color: var(--red);
}

.badge-transfer {
  background: rgba(243, 156, 18, 0.1);
  color: var(--amber);
}

/* ── Alert Badges ── */
.badge-warn {
  background: #fff3cd;
  color: #856404;
}

.badge-over {
  background: #fde8e8;
  color: #c0392b;
}

.badge-success {
  background: rgba(46, 204, 113, 0.12);
  color: var(--green);
}


/* ──────────────────────────────────────────────────────────────
   10. FORM INPUTS & SELECTS
   ────────────────────────────────────────────────────────────── */

.input-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.input-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text);
}

.input-label--optional::after {
  content: ' (opsional)';
  font-weight: 400;
  color: var(--muted);
}

.input,
.select {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid rgba(8, 38, 84, 0.1);
  border-radius: var(--radius-lg);
  font-family: var(--font-heading);
  font-size: 16px; /* Prevent iOS zoom */
  background: var(--card);
  color: var(--text);
  outline: none;
  transition: border-color var(--duration-normal),
              box-shadow var(--duration-normal);
  -webkit-appearance: none;
  appearance: none;
}

.input:focus,
.select:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(12, 185, 217, 0.12);
}

.input--error,
.select--error {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.input--success {
  border-color: var(--green);
}

.input:disabled,
.select:disabled {
  background: var(--bg);
  color: var(--muted);
  cursor: not-allowed;
}

.input::placeholder {
  color: var(--muted);
  opacity: 0.7;
}

.input-helper {
  font-size: var(--text-xs);
  color: var(--muted);
  font-family: var(--font-body);
}

.input-error-msg {
  font-size: var(--text-xs);
  color: var(--red);
  font-family: var(--font-body);
  font-weight: 500;
}

/* Select arrow */
.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%238a9ab5' viewBox='0 0 16 16'%3E%3Cpath d='M4.646 5.646a.5.5 0 01.708 0L8 8.293l2.646-2.647a.5.5 0 01.708.708l-3 3a.5.5 0 01-.708 0l-3-3a.5.5 0 010-.708z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}


/* ──────────────────────────────────────────────────────────────
   11. SKELETON LOADING SHIMMER
   ────────────────────────────────────────────────────────────── */

.skeleton {
  background: linear-gradient(90deg,
    #eef0f5 25%,
    #e4e7ef 50%,
    #eef0f5 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: var(--radius-sm);
  color: transparent !important;
}

/* Skeleton di atas background gelap (navy) */
.skeleton--dark {
  background: linear-gradient(90deg,
    rgba(255, 255, 255, 0.06) 25%,
    rgba(255, 255, 255, 0.12) 50%,
    rgba(255, 255, 255, 0.06) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Skeleton presets */
.skeleton-text {
  height: 14px;
  width: 100%;
  margin-bottom: var(--space-2);
}

.skeleton-text--short {
  width: 60%;
}

.skeleton-text--xs {
  width: 40%;
}

.skeleton-circle {
  border-radius: 50%;
}

.skeleton-card {
  height: 80px;
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-2);
}


/* ──────────────────────────────────────────────────────────────
   12. MICRO-ANIMATION UTILITIES
   ────────────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: no-preference) {

  .animate-fade-in {
    animation: fadeIn var(--duration-slow) var(--ease-out) both;
  }

  .animate-fade-in-up {
    animation: fadeInUp var(--duration-slow) var(--ease-out) both;
  }

  .animate-slide-up {
    animation: slideUp var(--duration-slow) var(--ease-out) both;
  }

  .animate-slide-down {
    animation: slideDown var(--duration-slow) var(--ease-out) both;
  }

  .animate-scale-in {
    animation: scaleIn var(--duration-slow) var(--ease-spring) both;
  }

  .animate-pulse {
    animation: pulse 2s ease-in-out infinite;
  }

  /* Staggered children — tambahkan ke parent container */
  .animate-stagger > * {
    animation: fadeInUp var(--duration-slow) var(--ease-out) both;
  }
  .animate-stagger > *:nth-child(1)  { animation-delay: 0ms; }
  .animate-stagger > *:nth-child(2)  { animation-delay: 50ms; }
  .animate-stagger > *:nth-child(3)  { animation-delay: 100ms; }
  .animate-stagger > *:nth-child(4)  { animation-delay: 150ms; }
  .animate-stagger > *:nth-child(5)  { animation-delay: 200ms; }
  .animate-stagger > *:nth-child(6)  { animation-delay: 250ms; }
  .animate-stagger > *:nth-child(7)  { animation-delay: 300ms; }
  .animate-stagger > *:nth-child(8)  { animation-delay: 350ms; }
  .animate-stagger > *:nth-child(9)  { animation-delay: 400ms; }
  .animate-stagger > *:nth-child(10) { animation-delay: 450ms; }

}

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

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

@keyframes slideDown {
  from { transform: translateY(-100%); }
  to   { transform: translateY(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.6; }
}

/* Number counter — untuk di-trigger via JS
   Tambahkan class 'counting' saat animasi berjalan */
.number-counter {
  display: inline-block;
  transition: transform 0.1s var(--ease-out);
}

.number-counter.counting {
  transform: scale(1.02);
}


/* ──────────────────────────────────────────────────────────────
   13. TOAST / NOTIFICATION
   ────────────────────────────────────────────────────────────── */

.toast {
  position: fixed;
  top: calc(var(--safe-top) + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(-80px);
  z-index: 10000;
  padding: 12px 20px;
  border-radius: var(--radius-lg);
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 600;
  white-space: nowrap;
  max-width: 90vw;
  pointer-events: none;
  transition: transform var(--duration-slow) var(--ease-spring);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* Toast variants */
.toast--default {
  background: var(--navy);
  color: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.toast--success {
  background: var(--green);
  color: #fff;
  box-shadow: 0 4px 16px rgba(46, 204, 113, 0.3);
}

.toast--error {
  background: var(--red);
  color: #fff;
  box-shadow: 0 4px 16px rgba(231, 76, 60, 0.3);
}

.toast--warning {
  background: var(--amber);
  color: #fff;
  box-shadow: 0 4px 16px rgba(243, 156, 18, 0.3);
}

/* Bottom toast (di atas bottom nav) */
.toast--bottom {
  top: auto;
  bottom: calc(var(--nav-h) + var(--safe-bottom) + 16px);
  transform: translateX(-50%) translateY(80px);
}

.toast--bottom.show {
  transform: translateX(-50%) translateY(0);
}


/* ──────────────────────────────────────────────────────────────
   14. MODAL / BOTTOM-SHEET / OVERLAY
   ────────────────────────────────────────────────────────────── */

/* ── Backdrop ── */
.overlay-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 38, 84, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 500;
  opacity: 0;
  transition: opacity var(--duration-normal);
  pointer-events: none;
}

.overlay-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* ── Center Modal ── */
.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  z-index: 501;
  background: var(--card);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  width: calc(100% - 32px);
  max-width: 400px;
  max-height: calc(100dvh - 64px);
  overflow-y: auto;
  box-shadow: var(--shadow-card-xl);
  opacity: 0;
  transition: opacity var(--duration-normal),
              transform var(--duration-normal) var(--ease-out);
  pointer-events: none;
}

.modal.active {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
}

.modal-title {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--space-3);
}

.modal-body {
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-family: var(--font-body);
  line-height: 1.6;
  margin-bottom: var(--space-6);
}

.modal-actions {
  display: flex;
  gap: var(--space-3);
}

.modal-actions .btn {
  flex: 1;
}

/* ── Bottom Sheet ── */
.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 501;
  background: var(--card);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: var(--space-6) var(--space-4) calc(var(--safe-bottom) + var(--space-6));
  max-height: 85dvh;
  overflow-y: auto;
  box-shadow: 0 -8px 32px rgba(8, 38, 84, 0.15);
  transform: translateY(100%);
  transition: transform var(--duration-slow) var(--ease-out);
}

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

/* Bottom sheet drag handle */
.bottom-sheet::before {
  content: '';
  display: block;
  width: 36px;
  height: 4px;
  background: rgba(8, 38, 84, 0.15);
  border-radius: var(--radius-full);
  margin: 0 auto var(--space-5);
}


/* ──────────────────────────────────────────────────────────────
   15. EMPTY STATE
   ────────────────────────────────────────────────────────────── */

.empty-state {
  text-align: center;
  padding: var(--space-8) var(--space-6);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: var(--space-4);
  opacity: 0.4;
}

.empty-state-icon i[data-lucide] {
  width: 48px;
  height: 48px;
  stroke: var(--muted);
}

.empty-state-title {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--space-2);
}

.empty-state-desc {
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-family: var(--font-body);
  line-height: 1.5;
  margin-bottom: var(--space-5);
}


/* ──────────────────────────────────────────────────────────────
   16. UTILITY CLASSES
   ────────────────────────────────────────────────────────────── */

/* Text colors */
.text-white      { color: #fff; }
.text-navy       { color: var(--navy); }
.text-cyan       { color: var(--cyan); }
.text-muted      { color: var(--text-muted); }
.text-success    { color: var(--color-success); }
.text-error      { color: var(--color-error); }
.text-warning    { color: var(--color-warning); }

/* Text alignment */
.text-center { text-align: center; }
.text-right  { text-align: right; }

/* Truncation */
.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Spacing helpers */
.mt-0  { margin-top: 0; }
.mt-2  { margin-top: var(--space-2); }
.mt-4  { margin-top: var(--space-4); }
.mt-6  { margin-top: var(--space-6); }
.mb-0  { margin-bottom: 0; }
.mb-2  { margin-bottom: var(--space-2); }
.mb-4  { margin-bottom: var(--space-4); }
.mb-6  { margin-bottom: var(--space-6); }

/* Flex helpers */
.flex          { display: flex; }
.flex-col      { flex-direction: column; }
.flex-center   { align-items: center; justify-content: center; }
.flex-between  { justify-content: space-between; }
.flex-1        { flex: 1; }
.gap-2         { gap: var(--space-2); }
.gap-3         { gap: var(--space-3); }
.gap-4         { gap: var(--space-4); }

/* Content spacing */
.main-content {
  padding-bottom: calc(var(--nav-h) + var(--safe-bottom) + 16px);
}

.section {
  padding: var(--space-5) var(--space-4) 0;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-3);
}

.section-title {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text);
}

.section-link {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--cyan);
  text-decoration: none;
}

/* sr-only: untuk screen reader */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}


/* ──────────────────────────────────────────────────────────────
   17. COMPONENT-SPECIFIC: TRANSACTION LIST ITEM
   ────────────────────────────────────────────────────────────── */

.tx-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  transition: transform var(--duration-fast);
}

.tx-item:active {
  transform: scale(0.98);
}

.tx-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.tx-icon i[data-lucide] {
  width: 18px;
  height: 18px;
  stroke: var(--navy);
}

.tx-info {
  flex: 1;
  min-width: 0;
}

.tx-desc {
  font-size: var(--text-sm);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tx-meta {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 2px;
}

.tx-amount {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

.tx-amount.income  { color: var(--green); }
.tx-amount.expense { color: var(--red); }
.tx-amount.transfer { color: var(--amber); }


/* ──────────────────────────────────────────────────────────────
   18. COMPONENT-SPECIFIC: STAT MINI CARDS (Glass)
   ────────────────────────────────────────────────────────────── */

/* Digunakan di dalam hero balance card (income/expense summary) */
.stat-mini {
  flex: 1;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur-light));
  -webkit-backdrop-filter: blur(var(--glass-blur-light));
  border-radius: var(--radius-md);
  padding: 10px 12px;
  border: 1px solid var(--glass-border);
}

.stat-mini-label {
  color: rgba(255, 255, 255, 0.5);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-mini-value {
  color: #fff;
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 700;
  margin-top: 3px;
}

.stat-mini-value.income  { color: var(--color-income); }
.stat-mini-value.expense { color: var(--color-expense); }

@supports not (backdrop-filter: blur(1px)) {
  .stat-mini {
    background: rgba(255, 255, 255, 0.1);
  }
}


/* ──────────────────────────────────────────────────────────────
   19. COMPONENT-SPECIFIC: ACCOUNT CARD
   ────────────────────────────────────────────────────────────── */

.account-card {
  min-width: 140px;
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: var(--shadow-card);
  flex-shrink: 0;
  cursor: pointer;
  transition: transform var(--duration-normal) var(--ease-out),
              box-shadow var(--duration-normal);
}

.account-card:active {
  transform: scale(0.97);
}

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

.account-icon {
  font-size: 20px;
  margin-bottom: var(--space-2);
}

.account-name {
  font-size: var(--text-sm) - 1px;
  color: var(--text-muted);
  font-weight: 500;
}

.account-balance {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text);
  margin-top: 2px;
}

.account-type {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}


/* ──────────────────────────────────────────────────────────────
   20. COMPONENT-SPECIFIC: PROGRESS BAR (Budget)
   ────────────────────────────────────────────────────────────── */

.progress-bar-bg {
  height: 6px;
  background: #eef0f5;
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.6s var(--ease-out);
}

.progress-bar-fill--success { background: var(--green); }
.progress-bar-fill--warning { background: var(--amber); }
.progress-bar-fill--danger  { background: var(--red); }
.progress-bar-fill--cyan    { background: var(--cyan); }


/* ──────────────────────────────────────────────────────────────
   21. SCROLLBAR CUSTOMIZATION
   ────────────────────────────────────────────────────────────── */

/* Hide scrollbar for horizontal scroll areas */
.scroll-hide-bar {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.scroll-hide-bar::-webkit-scrollbar {
  display: none;
}


/* ──────────────────────────────────────────────────────────────
   22. DIVIDERS & SEPARATORS
   ────────────────────────────────────────────────────────────── */

.divider {
  height: 1px;
  background: rgba(8, 38, 84, 0.06);
  border: none;
  margin: var(--space-4) 0;
}

.divider--light {
  background: rgba(255, 255, 255, 0.08);
}


/* ──────────────────────────────────────────────────────────────
   23. RESPONSIVE — Desktop/Tablet Enhancements
   ────────────────────────────────────────────────────────────── */

@media (min-width: 768px) {
  .modal {
    max-width: 480px;
  }

  .bottom-sheet {
    max-width: var(--max-width);
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  }

  .bottom-sheet.active {
    transform: translateX(-50%) translateY(0);
  }
}
