/* ==============================
   STRENGTH FLOW — STYLESHEET
   ============================== */

:root {
  --bg: #0A0F1E;
  --bg2: #111827;
  --bg3: #1a2236;
  --card: #141C2E;
  --card2: #1E2A42;
  --teal: #00D4AA;
  --teal-dim: rgba(0, 212, 170, 0.12);
  --amber: #F5A623;
  --amber-dim: rgba(245, 166, 35, 0.12);
  --red: #EF4444;
  --red-dim: rgba(239, 68, 68, 0.12);
  --green: #22C55E;
  --green-dim: rgba(34, 197, 94, 0.12);
  --text: #F8FAFC;
  --text2: #94A3B8;
  --text3: #64748B;
  --border: rgba(255,255,255,0.07);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
}

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

html { height: 100%; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100%;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* ==================== SCREENS ==================== */
.screen {
  display: none;
  position: fixed;
  inset: 0;
  overflow: hidden;
}
.screen.active { display: flex; flex-direction: column; }

/* ==================== LOGIN ==================== */
.login-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
}
.login-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.3;
  animation: float 6s ease-in-out infinite;
}
.orb1 {
  width: 300px; height: 300px;
  background: var(--teal);
  top: -80px; left: -80px;
}
.orb2 {
  width: 250px; height: 250px;
  background: var(--amber);
  bottom: -60px; right: -60px;
  animation-delay: -3s;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}

.login-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  margin: auto;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow-y: auto;
  max-height: 100vh;
}

.login-brand {
  text-align: center;
  padding: 20px 0 8px;
}
.brand-icon {
  display: inline-flex;
  padding: 16px;
  background: var(--teal-dim);
  border: 1px solid rgba(0,212,170,0.2);
  border-radius: 20px;
  margin-bottom: 12px;
}
.brand-name {
  font-size: 28px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--teal), var(--amber));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}
.brand-tagline {
  color: var(--text3);
  font-size: 13px;
  margin-top: 4px;
  letter-spacing: 2px;
}

.login-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 28px 24px;
}
.login-card h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
}
.login-sub {
  color: var(--text2);
  font-size: 14px;
  margin-bottom: 20px;
}

/* ==================== FORMS ==================== */
.form-group {
  margin-bottom: 14px;
}
.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  -webkit-appearance: none;
}
.form-group input:focus,
.form-group select:focus {
  border-color: var(--teal);
}
.form-group select option { background: var(--bg2); }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.password-wrap {
  position: relative;
}
.password-wrap input { padding-right: 44px; }
.toggle-pw {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text2);
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
}

.remember-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text2);
  cursor: pointer;
}
.checkbox-label input { display: none; }
.checkmark {
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.checkbox-label input:checked ~ .checkmark {
  background: var(--teal);
  border-color: var(--teal);
}
.checkbox-label input:checked ~ .checkmark::after {
  content: '✓';
  color: #000;
  font-size: 12px;
  font-weight: 700;
}
.forgot-link {
  font-size: 13px;
  color: var(--teal);
  cursor: pointer;
}
.signup-hint {
  text-align: center;
  font-size: 13px;
  color: var(--text3);
  margin-top: 14px;
}
.signup-hint span {
  color: var(--teal);
  cursor: pointer;
  font-weight: 600;
}

/* ==================== BUTTONS ==================== */
.btn-primary {
  background: linear-gradient(135deg, var(--teal), #00a88a);
  color: #000;
  font-weight: 700;
  font-size: 15px;
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px 20px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.btn-primary:active { transform: scale(0.97); opacity: 0.9; }
.btn-primary.full { width: 100%; }

.btn-outline {
  background: transparent;
  color: var(--teal);
  font-weight: 600;
  font-size: 14px;
  border: 1px solid var(--teal);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.btn-outline:active { background: var(--teal-dim); }
.btn-outline.full { width: 100%; }

.btn-danger {
  background: var(--red-dim);
  color: var(--red);
  font-weight: 600;
  font-size: 14px;
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  cursor: pointer;
  font-family: inherit;
}
.btn-danger.full { width: 100%; }

.icon-btn {
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text2);
  font-size: 12px;
  padding: 6px 10px;
  cursor: pointer;
  font-family: inherit;
}

.error-msg {
  background: var(--red-dim);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--red);
  font-size: 13px;
  margin-bottom: 12px;
}
.hidden { display: none !important; }

/* ==================== APP HEADER ==================== */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  padding-top: max(12px, env(safe-area-inset-top));
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  z-index: 10;
}
.header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand-icon-sm { display: flex; }
.app-title {
  font-size: 17px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--teal), var(--amber));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.avatar-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal), var(--amber));
  color: #000;
  font-weight: 800;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  padding: 0;
}

/* ==================== TAB NAV (BOTTOM) ==================== */
.tab-nav {
  display: flex;
  background: var(--bg);
  border-top: 1px solid var(--border);
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  flex-shrink: 0;
  justify-content: space-between;
  
  /* Fixed to bottom */
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
}
.tab-nav::-webkit-scrollbar { display: none; }
.tab {
  flex: 1;
  background: none;
  border: none;
  color: var(--text3);
  font-size: 16px; /* increased emoji size */
  font-weight: 600;
  padding: 12px 0;
  cursor: pointer;
  border-top: 2px solid transparent;
  white-space: nowrap;
  font-family: inherit;
  transition: all 0.2s;
  text-align: center;
}
.tab.active {
  color: var(--teal);
  border-top-color: var(--teal);
  background: rgba(0, 212, 170, 0.05); /* subtle highlight for active */
}

/* ==================== CONTENT ==================== */
.tab-content {
  display: none;
  flex: 1;
  overflow: hidden;
}
.tab-content.active { display: flex; flex-direction: column; }

.content-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  padding-bottom: calc(80px + env(safe-area-inset-bottom));
  -webkit-overflow-scrolling: touch;
}

.section-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}
.section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text2);
  margin-bottom: 12px;
  margin-top: 4px;
}
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 600;
}
.see-all {
  color: var(--teal);
  font-size: 12px;
  cursor: pointer;
}

/* ==================== DAILY BANNER ==================== */
.daily-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--amber-dim);
  border: 1px solid rgba(245,166,35,0.2);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13px;
  color: var(--amber);
  margin-bottom: 12px;
}

/* ==================== BALANCE RING ==================== */
.balance-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 16px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.balance-ring-wrap {
  position: relative;
  width: 140px;
  height: 140px;
}
.ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.ring-label {
  font-size: 10px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.ring-value {
  font-size: 16px;
  font-weight: 800;
  color: var(--teal);
  font-variant-numeric: tabular-nums;
}
.balance-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
}
.stat-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg3);
  border-radius: var(--radius-sm);
  padding: 12px;
}
.stat-arrow {
  font-size: 18px;
}
.stat-item.income .stat-arrow { color: var(--green); }
.stat-item.expense .stat-arrow { color: var(--red); }
.stat-label {
  font-size: 10px;
  color: var(--text3);
}
.stat-val {
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.stat-item.income .stat-val { color: var(--green); }
.stat-item.expense .stat-val { color: var(--red); }

/* ==================== BUDGET HEALTH ==================== */
.health-bar-track {
  background: var(--bg3);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
  margin-bottom: 8px;
}
.health-bar {
  height: 100%;
  border-radius: 999px;
  background: var(--green);
  transition: width 0.5s ease, background 0.3s;
}
.health-badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  font-weight: 700;
}
.health-badge.good { background: var(--green-dim); color: var(--green); }
.health-badge.warning { background: var(--amber-dim); color: var(--amber); }
.health-badge.danger { background: var(--red-dim); color: var(--red); }
.health-detail {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text3);
}

/* ==================== KATEGORI LIST ==================== */
.kategori-list { display: flex; flex-direction: column; gap: 8px; }
.kat-item {
  display: flex;
  align-items: center;
  gap: 10px;
}
.kat-icon {
  width: 36px; height: 36px;
  background: var(--bg3);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.kat-info { flex: 1; min-width: 0; }
.kat-name-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}
.kat-over {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--red-dim);
  color: var(--red);
  font-weight: 700;
}
.kat-ok {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--green-dim);
  color: var(--green);
  font-weight: 700;
}
.kat-warn {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--amber-dim);
  color: var(--amber);
  font-weight: 700;
}
.kat-bar-track {
  background: var(--bg3);
  border-radius: 999px;
  height: 5px;
  overflow: hidden;
}
.kat-bar {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s;
}
.kat-amount {
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--red);
  flex-shrink: 0;
  margin-left: 8px;
}

/* ==================== TX LIST ==================== */
.tx-list { display: flex; flex-direction: column; gap: 8px; }
.tx-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg3);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
}
.tx-item:active { background: var(--card2); }
.tx-icon {
  width: 40px; height: 40px;
  background: var(--card2);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.tx-meta { flex: 1; min-width: 0; }
.tx-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tx-sub {
  font-size: 11px;
  color: var(--text3);
  margin-top: 2px;
}
.tx-amount {
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.tx-amount.out { color: var(--red); }
.tx-amount.in { color: var(--green); }
.tx-del {
  width: 28px; height: 28px;
  background: var(--red-dim);
  border: none;
  border-radius: 8px;
  color: var(--red);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

/* ==================== STREAK ==================== */
.streak-card { background: linear-gradient(135deg, rgba(0,212,170,0.05), rgba(245,166,35,0.05)); }
.streak-badge {
  background: linear-gradient(135deg, var(--teal), var(--amber));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 800;
  font-size: 16px;
}
.streak-dots {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.streak-dot {
  width: 28px; height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}
.streak-dot.done { background: var(--teal); color: #000; }
.streak-dot.today { background: var(--amber); color: #000; }
.streak-dot.miss { background: var(--bg3); color: var(--text3); }

/* ==================== TRANSAKSI TAB ==================== */
.tx-controls { margin-bottom: 12px; }
.tx-controls input {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  margin-bottom: 10px;
}
.tx-controls input:focus { border-color: var(--teal); }
.tx-filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.tx-list-full { display: flex; flex-direction: column; gap: 8px; }

/* ==================== DOMPET ==================== */
.dompet-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.dompet-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
}
.dompet-icon {
  width: 40px; height: 40px;
  background: var(--teal-dim);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.dompet-info { flex: 1; }
.dompet-name { font-size: 15px; font-weight: 700; }
.dompet-type { font-size: 11px; color: var(--text3); }
.dompet-saldo {
  font-size: 15px;
  font-weight: 700;
  color: var(--teal);
  font-variant-numeric: tabular-nums;
}
.dompet-del {
  width: 28px; height: 28px;
  background: var(--red-dim);
  border: none;
  border-radius: 8px;
  color: var(--red);
  cursor: pointer;
  font-size: 14px;
}

/* ==================== LAPORAN ==================== */
.stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.stat-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
}
.stat-box-label { font-size: 11px; color: var(--text3); margin-bottom: 4px; }
.stat-box-val {
  font-size: 16px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.stat-box.income .stat-box-val { color: var(--green); }
.stat-box.expense .stat-box-val { color: var(--red); }
.donut-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text2);
}
.legend-dot {
  width: 10px; height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

/* ==================== SARAN ==================== */
.saran-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.saran-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text2);
}
.saran-icon { font-size: 20px; flex-shrink: 0; }
.saran-item b { color: var(--amber); }
.saran-item strong { color: var(--text); }

.split-result {
  background: var(--teal-dim);
  border: 1px solid rgba(0,212,170,0.2);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-top: 12px;
  text-align: center;
  font-size: 20px;
  font-weight: 800;
  color: var(--teal);
}
.export-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.lap-kat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.lap-kat-item:last-child { border-bottom: none; }
.lap-kat-left { display: flex; align-items: center; gap: 10px; }
.lap-kat-pct { font-size: 11px; color: var(--text3); }
.lap-kat-val { font-weight: 700; color: var(--red); font-variant-numeric: tabular-nums; }

/* ==================== TARGET ==================== */
.target-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.target-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.target-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.target-name-row { display: flex; align-items: center; gap: 8px; }
.target-emoji { font-size: 22px; }
.target-name { font-size: 15px; font-weight: 700; }
.target-deadline { font-size: 11px; color: var(--text3); margin-top: 2px; }
.target-pct {
  font-size: 18px;
  font-weight: 800;
  color: var(--teal);
}
.target-bar-track {
  background: var(--bg3);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
  margin-bottom: 8px;
}
.target-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--teal), var(--amber));
  transition: width 0.5s ease;
}
.target-detail {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text3);
}
.target-add-btn {
  width: 28px; height: 28px;
  background: var(--teal-dim);
  border: none;
  border-radius: 8px;
  color: var(--teal);
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
}
.target-del {
  width: 28px; height: 28px;
  background: var(--red-dim);
  border: none;
  border-radius: 8px;
  color: var(--red);
  cursor: pointer;
  font-size: 14px;
}

/* ==================== BUDGET PER KAT ==================== */
.budget-kat-inputs { display: flex; flex-direction: column; gap: 8px; }
.budget-kat-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.budget-kat-row span { font-size: 14px; width: 80px; }
.budget-kat-row input {
  flex: 1;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
}

/* ==================== REMINDER TOGGLE ==================== */
.reminder-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
}
.switch { position: relative; width: 48px; height: 26px; }
.switch input { display: none; }
.slider {
  position: absolute;
  inset: 0;
  background: var(--bg3);
  border-radius: 999px;
  transition: background 0.3s;
  border: 1px solid var(--border);
  cursor: pointer;
}
.slider::before {
  content: '';
  position: absolute;
  width: 20px; height: 20px;
  left: 2px; top: 2px;
  background: var(--text2);
  border-radius: 50%;
  transition: transform 0.3s, background 0.3s;
}
.switch input:checked + .slider { background: var(--teal-dim); border-color: var(--teal); }
.switch input:checked + .slider::before {
  transform: translateX(22px);
  background: var(--teal);
}

/* ==================== FAB ==================== */
.fab {
  position: fixed;
  bottom: calc(20px + env(safe-area-inset-bottom));
  right: 20px;
  width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--teal), #00a88a);
  color: #000;
  font-size: 28px;
  font-weight: 400;
  border: none;
  border-radius: 50%;
  box-shadow: 0 4px 20px rgba(0, 212, 170, 0.4);
  cursor: pointer;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.fab:active { transform: scale(0.92); }

/* ==================== MODAL ==================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  padding: 0;
  backdrop-filter: blur(4px);
}
.modal-overlay:not(.hidden) { display: flex; }
.modal {
  background: var(--bg2);
  border-radius: 24px 24px 0 0;
  padding: 20px 20px;
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  border-top: 1px solid var(--border);
  animation: slideUp 0.25s ease;
}
@keyframes slideUp {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.modal-header h3 { font-size: 18px; font-weight: 700; }
.modal-header button {
  background: var(--bg3);
  border: none;
  color: var(--text2);
  font-size: 16px;
  width: 30px; height: 30px;
  border-radius: 50%;
  cursor: pointer;
}
.modal-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: var(--bg3);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 16px;
}
.modal-tab {
  background: none;
  border: none;
  padding: 8px;
  border-radius: 8px;
  color: var(--text3);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}
.modal-tab.active {
  background: var(--card2);
  color: var(--red);
}
.modal-tab.active.income-mode { color: var(--green); }

/* ==================== KAT GRID ==================== */
.kat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.kat-btn {
  background: var(--bg3);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 10px 4px;
  cursor: pointer;
  text-align: center;
  font-size: 11px;
  color: var(--text2);
  font-family: inherit;
  transition: all 0.2s;
}
.kat-btn .kat-em { font-size: 22px; display: block; margin-bottom: 4px; }
.kat-btn.selected {
  border-color: var(--teal);
  background: var(--teal-dim);
  color: var(--teal);
}

/* ==================== PROFILE ==================== */
.profile-avatar {
  width: 72px; height: 72px;
  background: linear-gradient(135deg, var(--teal), var(--amber));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 800;
  color: #000;
  margin: 0 auto 12px;
}
.profile-name {
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}
.profile-username {
  text-align: center;
  font-size: 13px;
  color: var(--text3);
  margin-bottom: 4px;
}

/* ==================== MONTH PICKER ==================== */
.month-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.month-btn {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
}
.month-btn.current {
  border-color: var(--teal);
  background: var(--teal-dim);
  color: var(--teal);
  font-weight: 700;
}

/* ==================== TOAST ==================== */
.toast {
  position: fixed;
  bottom: calc(80px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 20px;
  font-size: 14px;
  z-index: 200;
  white-space: nowrap;
  animation: fadeInUp 0.3s ease;
}
@keyframes fadeInUp {
  from { transform: translateX(-50%) translateY(10px); opacity: 0; }
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

/* ==================== INSTALL BANNER ==================== */
.install-banner {
  position: fixed;
  bottom: 0;
  left: 0; right: 0;
  background: var(--card2);
  border-top: 1px solid var(--border);
  padding: 14px 16px;
  padding-bottom: calc(14px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 150;
}
.install-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
}
.install-text strong { color: var(--text); font-size: 14px; }
.install-text span { color: var(--text3); font-size: 12px; }
.install-btn {
  background: var(--teal);
  color: #000;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}
.install-close {
  background: none;
  border: none;
  color: var(--text3);
  font-size: 18px;
  cursor: pointer;
}

/* ==================== EMPTY STATE ==================== */
.empty-state {
  text-align: center;
  color: var(--text3);
  font-size: 13px;
  padding: 20px;
}

/* ==================== MISC ==================== */
.lap-kat-icon { font-size: 20px; }

/* Recurring items */
.recurring-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 8px;
}
.recurring-info { flex: 1; }
.recurring-name { font-size: 14px; font-weight: 600; }
.recurring-sub { font-size: 11px; color: var(--text3); margin-top: 2px; }
.recurring-amount {
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.recurring-amount.out { color: var(--red); }
.recurring-amount.in { color: var(--green); }

/* ==================== SYNC STATUS ==================== */
.sync-status {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 20px;
  background: rgba(0,212,170,0.1);
  color: var(--teal);
  border: 1px solid rgba(0,212,170,0.2);
  white-space: nowrap;
  transition: opacity 0.3s;
}
.sync-status.hidden { display: none; }

/* ==================== COMPACT TAB NAV (7 tabs) ==================== */
/* (Merged with main tab-nav above) */

/* ==================== FINANCIAL SCORE ==================== */
.score-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0 16px;
  gap: 8px;
}
.score-label {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.score-tips {
  font-size: 11px;
  color: var(--text3);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ==================== ACHIEVEMENT BADGES ==================== */
.badge-count {
  font-size: 12px;
  color: var(--text3);
  background: var(--bg3);
  padding: 2px 8px;
  border-radius: 20px;
}
.badges-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 12px;
}
.badge-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 4px;
  border-radius: 12px;
  position: relative;
  cursor: default;
  transition: transform 0.2s;
}
.badge-item.earned {
  background: linear-gradient(135deg, rgba(0,212,170,0.12), rgba(0,212,170,0.04));
  border: 1px solid rgba(0,212,170,0.2);
}
.badge-item.locked {
  background: var(--bg3);
  opacity: 0.5;
}
.badge-item.earned:hover { transform: scale(1.05); }
.badge-icon { font-size: 22px; }
.badge-name { font-size: 9px; color: var(--text2); text-align: center; line-height: 1.2; }
.badge-check {
  position: absolute;
  top: 4px; right: 4px;
  font-size: 8px;
  color: var(--teal);
  font-weight: 700;
}

/* ==================== PREDIKSI AKHIR BULAN ==================== */
.prediksi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}
.prediksi-item {
  background: var(--bg3);
  border-radius: 10px;
  padding: 10px;
}
.prediksi-item.full { grid-column: 1 / -1; }
.prediksi-label { font-size: 11px; color: var(--text3); margin-bottom: 4px; }
.prediksi-val { font-size: 15px; font-weight: 700; color: var(--text); }
.prediksi-val.big { font-size: 20px; color: var(--teal); }
.prediksi-status {
  grid-column: 1 / -1;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  padding: 8px;
}

/* ==================== COMPARISON CHART ==================== */
.comp-legend {
  font-size: 12px;
  color: var(--text2);
  margin: 8px 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}
.comp-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* ==================== ANALISA KEBIASAAN ==================== */
.analisa-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}
.analisa-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--bg3);
  border-radius: 10px;
  padding: 10px;
}
.analisa-icon { font-size: 20px; flex-shrink: 0; }
.analisa-label { font-size: 10px; color: var(--text3); }
.analisa-val { font-size: 14px; font-weight: 700; color: var(--text); margin: 2px 0; }
.analisa-sub { font-size: 10px; color: var(--text2); }

/* ==================== HUTANG TRACKER ==================== */
.hutang-summary {
  display: flex;
  gap: 12px;
  padding: 16px 0 8px;
}
.hutang-sum-item {
  flex: 1;
  background: var(--card);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
}
.hutang-sum-label { font-size: 11px; color: var(--text3); margin-bottom: 4px; }
.hutang-sum-val { font-size: 16px; font-weight: 700; }
.hutang-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 8px;
  transition: opacity 0.3s;
}
.hutang-item.lunas { opacity: 0.5; }
.hutang-icon { font-size: 22px; flex-shrink: 0; }
.hutang-info { flex: 1; min-width: 0; }
.hutang-nama { font-size: 14px; font-weight: 600; }
.hutang-sub { font-size: 11px; color: var(--text3); margin-top: 2px; }
.hutang-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.hutang-nominal { font-size: 14px; font-weight: 700; }
.btn-lunas {
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 8px;
  border: 1px solid var(--teal);
  background: transparent;
  color: var(--teal);
  cursor: pointer;
  font-family: inherit;
}
.badge-lunas {
  font-size: 10px;
  color: var(--green);
  font-weight: 600;
}

/* ==================== WISHLIST ==================== */
.wishlist-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--card);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 10px;
  transition: transform 0.2s;
}
.wishlist-item:hover { transform: translateY(-1px); }
.wishlist-icon { font-size: 28px; flex-shrink: 0; }
.wishlist-info { flex: 1; min-width: 0; }
.wishlist-nama { font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.wishlist-sub { font-size: 12px; color: var(--teal); margin-bottom: 6px; }
.wishlist-bar-track {
  height: 4px;
  background: var(--bg3);
  border-radius: 4px;
  overflow: hidden;
  margin: 6px 0;
}
.wishlist-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--amber));
  border-radius: 4px;
  transition: width 1s ease;
}
.wishlist-detail {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text3);
}
