:root {
  --brand-dark: #0f2857;
  --brand-blue: #0ea5e9;
  --brand-teal: #10b981;
  --bg-main: #f0f4f8;
  --card-bg: #ffffff;
  --stroke: #cbd5e1;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --good: #10b981;
  --bad: #ef4444;
  --shadow-soft: 0 4px 20px rgba(15, 40, 87, 0.06);
  --shadow-hover: 0 10px 25px rgba(15, 40, 87, 0.12);
  --radius: 20px;
}

* { box-sizing: border-box; }

/* FIX LEBAR (FIT WIDTH) DI MOBILE */
html, body {
  height: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
}

#bg-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  z-index: -1;
  pointer-events: none;
}

.app-shell { display: flex; min-height: 100vh; max-width: 100vw; overflow-x: hidden; }

/* SIDEBAR */
.sidebar {
  width: 260px; padding: 24px;
  background: var(--card-bg);
  border-right: 1px solid var(--stroke);
  display: none;
}
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 30px; }
.brand-name { font-weight: 800; letter-spacing: 0.5px; font-size: 20px; color: var(--brand-dark);}
.brand-sub { font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase;}

.nav { display: flex; flex-direction: column; gap: 8px; }
.nav-item {
  text-decoration: none; color: var(--text-muted);
  padding: 12px 14px; border-radius: 12px;
  font-weight: 600; transition: all 0.2s;
}
.nav-item:hover { color: var(--brand-dark); background: #e0f2fe; transform: translateX(4px); }
.nav-item.danger { color: var(--bad); }
.nav-item.danger:hover { background: #fee2e2; }

/* MAIN CONTENT */
.main { flex: 1; padding: 16px; padding-bottom: 100px; max-width: 100vw; width: 100%; box-sizing: border-box; }

.glass, .card, .auth-card {
  background-color: var(--card-bg) !important;
  border: 1px solid var(--stroke) !important;
  box-shadow: var(--shadow-soft) !important;
  border-radius: var(--radius);
  padding: 24px;
  transition: all 0.3s;
}
.card:hover, .glass:hover { box-shadow: var(--shadow-hover) !important; border-color: #94a3b8 !important; }

/* TOPBAR */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 24px; padding: 16px 24px;
}
.title, h2, h3 { font-weight: 800; color: var(--brand-dark); margin-top: 0;}
.title { font-size: 24px; margin-bottom: 0;}
.subtitle { font-size: 13px; color: var(--text-muted); margin-top: 4px; font-weight: 500; }

.pill {
  padding: 8px 16px; border-radius: 999px;
  background: #f1f5f9; border: 1px solid var(--stroke);
  font-size: 13px; font-weight: 700; color: var(--brand-dark);
}

.toast { margin-top: 12px; margin-bottom: 20px; padding: 14px 16px; border-radius: 16px; font-weight: 600; font-size: 14px; }
.toast.success { background: #d1fae5; color: #065f46; border: 1px solid #10b981; }
.toast.error { background: #fee2e2; color: #991b1b; border: 1px solid #ef4444; }

/* GRID & DASHBOARD */
.grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
.hero-label { font-size: 13px; color: var(--text-muted); font-weight: 600; text-transform: uppercase;}
.hero-balance { 
  background: linear-gradient(135deg, var(--brand-dark), var(--brand-blue));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; font-weight: 900; line-height: 1.1;
}
.hero-row { display: flex; gap: 12px; flex-wrap: wrap; }
.mini {
  flex: 1; padding: 16px; border-radius: 16px;
  background: var(--bg-main); border: 1px solid var(--stroke); min-width: 130px;
}
.mini-label { font-size: 13px; color: var(--text-muted); font-weight: 600; }
.mini-val { font-size: 20px; font-weight: 800; margin-top: 6px; }

.badge {
  display: inline-block; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--stroke); background: #ffffff;
  font-size: 12px; font-weight: 700; color: var(--brand-blue);
}
.entity-name { font-weight: 800; font-size: 18px; margin-top: 14px; color: var(--brand-dark); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px;}

/* FORMS & BUTTONS */
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 14px 0; }
label { display: block; font-size: 13px; color: var(--text-main); font-weight: 700; margin-bottom: 6px; }

input, select, button, textarea { font: inherit; box-sizing: border-box; }
input, select, textarea {
  width: 100%; padding: 14px 16px; border-radius: 12px;
  border: 2px solid var(--stroke); background: #f8fafc;
  color: var(--text-main); outline: none; font-weight: 500; transition: all 0.2s;
  margin-bottom: 12px;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--brand-blue); background: #ffffff;
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.15);
}
.field-error { color: var(--bad); font-size: 12px; margin-top: -6px; margin-bottom: 12px; font-weight: 600;}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; border-radius: 12px;
  border: 1px solid var(--stroke); background: #ffffff;
  color: var(--text-main); font-weight: 700; font-size: 14px;
  text-decoration: none; cursor: pointer; transition: all 0.2s;
}
.btn:hover { background: #f1f5f9; border-color: #94a3b8; }

.btn.primary {
  background: linear-gradient(135deg, var(--brand-dark), var(--brand-blue));
  border: none; color: #ffffff; box-shadow: 0 4px 15px rgba(15, 40, 87, 0.2);
}
.btn.primary:hover {
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-teal));
  box-shadow: 0 6px 20px rgba(15, 40, 87, 0.3); transform: translateY(-2px);
}
.btn.danger { background: #fef2f2; color: var(--bad); border-color: #fecaca; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--brand-blue); }

.divider { height: 1px; background: var(--stroke); margin: 24px 0; }
.hint { color: var(--text-muted); font-size: 13px; margin-top: 10px; line-height: 1.5; font-weight: 500;}

/* LISTS */
.list { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.list-item {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 16px; border-radius: 16px; border: 1px solid var(--stroke);
  background: #ffffff; transition: all 0.2s;
}
.li-title { font-weight: 800; font-size: 14px; color: var(--brand-dark); }
.li-sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; font-weight: 500;}
.li-amt { font-weight: 800; font-size: 15px; white-space: nowrap; }
.li-amt.pos { color: var(--good); }
.li-amt.neg { color: var(--text-main); } 

.li-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.chip {
  display: inline-flex; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--stroke); background: #f8fafc;
  color: var(--text-muted); text-decoration: none; font-size: 12px; font-weight: 700;
  cursor: pointer; transition: all 0.2s;
}

/* MENU BAWAH & FAB */
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: #ffffff; border-top: 1px solid var(--stroke);
  display: flex; justify-content: space-around; align-items: flex-end;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 50; box-shadow: 0 -4px 20px rgba(0,0,0,0.04);
}
.bottomnav-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--text-muted); text-decoration: none; font-size: 11px; font-weight: 700;
  padding: 10px 8px; flex: 1; transition: 0.2s;
}
.bottomnav-item svg { width: 22px; height: 22px; margin-bottom: 4px; stroke: currentColor; stroke-width: 2; fill: none; transition: 0.2s; }
.bottomnav-item:hover, .bottomnav-item.active { color: var(--brand-blue); }
.bottomnav-item:hover svg { transform: translateY(-2px); }

.fab-container { position: relative; top: -20px; display: flex; justify-content: center; align-items: center; }
.fab-center {
  width: 60px; height: 60px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-teal));
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 20px rgba(14, 165, 233, 0.4);
  border: 4px solid #ffffff; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); z-index: 60;
}
.fab-center svg { width: 28px; height: 28px; stroke: #fff; stroke-width: 2; fill: none; }
.fab-center:hover { transform: translateY(-4px) scale(1.05); }

/* ========================================= */
/* HALAMAN AUTH & TOMBOL GOOGLE 3D           */
/* ========================================= */
.auth-wrap { display: flex; justify-content: center; align-items: center; min-height: 100vh; padding: 20px; }
.auth-card { width: 100%; max-width: 420px; padding: 40px 32px !important; margin: auto; }
.auth-links { display: flex; justify-content: center; gap: 12px; margin-top: 16px; font-size: 14px; font-weight: 700;}
.auth-links a { color: var(--brand-blue); text-decoration: none; transition: color 0.2s; }

/* Gaya Spesifik Tombol Google */
.btn-google {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  width: 100%; padding: 14px 20px; border-radius: 12px;
  background: #ffffff; color: #3c4043; font-weight: 700; font-size: 15px;
  text-decoration: none; border: 1px solid #dadce0;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.04); /* Efek melayang istirahat */
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}
.btn-google svg { width: 22px; height: 22px; }
.btn-google:hover {
  background: #f8f9fa; border-color: #d2e3fc;
  box-shadow: 0 8px 20px rgba(66, 133, 244, 0.15), 0 4px 8px rgba(0,0,0,0.06); /* Mengangkat ke atas */
  transform: translateY(-3px); color: #1a73e8;
}
.btn-google:active {
  background: #f1f3f4;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  transform: translateY(1px) scale(0.98); /* Ditekan ke bawah */
}

/* RESPONSIVE DESKTOP */
@media (min-width: 820px){
  .grid { grid-template-columns: 1.6fr 1fr; align-items: start;}
  .sidebar { display: block; }
  .main { padding: 30px; padding-bottom: 30px; }
  .bottomnav { display: none; }
}