/* ===== GOOGLE FONTS ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ===== CSS VARIABLES ===== */
:root {
  --bg-primary: #0f1117;
  --bg-secondary: #1a1d2e;
  --bg-card: #1e2235;
  --bg-card-hover: #252840;
  --accent-green: #00d4aa;
  --accent-green-dim: rgba(0, 212, 170, 0.15);
  --accent-red: #ff5c7a;
  --accent-red-dim: rgba(255, 92, 122, 0.15);
  --accent-blue: #4f8ef7;
  --accent-blue-dim: rgba(79, 142, 247, 0.15);
  --accent-purple: #a855f7;
  --accent-yellow: #fbbf24;
  --text-primary: #f0f2ff;
  --text-secondary: #8b8fa8;
  --text-muted: #5a5f7a;
  --border-color: rgba(255, 255, 255, 0.07);
  --nav-height: 70px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* ===== RESET & BASE ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100%;
  font-family: 'Inter', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
}

/* ===== APP CONTAINER ===== */
#app {
  max-width: 430px;
  width: 100%;
  height: 100dvh;
  margin: 0 auto;
  position: relative;
  background: var(--bg-primary);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ===== PAGE WRAPPER ===== */
.page-wrapper {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: calc(var(--nav-height) + 16px);
  scroll-behavior: smooth;
}

.page-wrapper::-webkit-scrollbar {
  width: 3px;
}

.page-wrapper::-webkit-scrollbar-track {
  background: transparent;
}

.page-wrapper::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 10px;
}

/* ===== PAGES ===== */
.page {
  display: none;
  animation: fadeSlideIn 0.3s ease;
  min-height: 100%;
}

.page.active {
  display: block;
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== TOP HEADER ===== */
.page-header {
  padding: 20px 20px 16px;
  background: linear-gradient(180deg, var(--bg-secondary) 0%, transparent 100%);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.page-header h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

#home-greeting {
  font-size: 18px;
  font-weight: 400;
}

.page-header p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
 
/* ===== PROFILE BUTTON ===== */
.profile-avatar-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
 
.profile-avatar-btn:hover {
  transform: scale(1.05);
  border-color: var(--accent-blue);
  box-shadow: 0 6px 16px rgba(79, 142, 247, 0.2);
}
 
.profile-avatar-btn .status-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-green);
  border: 2px solid var(--bg-primary);
}
 
.profile-avatar-btn.premium .status-dot {
  background: var(--accent-yellow);
  box-shadow: 0 0 8px var(--accent-yellow);
}
 
/* ===== ACCOUNT PAGE ===== */
.akun-profile-header {
  padding: 32px 24px;
  text-align: center;
  background: linear-gradient(180deg, var(--bg-secondary) 0%, transparent 100%);
}
 
.akun-avatar-large {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  margin: 0 auto 16px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}
 
.akun-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}
 
.akun-email {
  font-size: 14px;
  color: var(--text-secondary);
}
 
.akun-menu {
  padding: 0 16px;
}
 
.akun-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
}
 
.akun-item-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
 
.akun-item-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}
 
.akun-logout-btn {
  width: 100%;
  padding: 16px;
  background: rgba(255, 92, 122, 0.1);
  border: 1px solid rgba(255, 92, 122, 0.2);
  color: var(--accent-red);
  font-weight: 700;
  font-size: 15px;
  border-radius: var(--radius-md);
  margin-top: 24px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
 
.akun-logout-btn:hover {
  background: var(--accent-red);
  color: #000;
}

/* ===== BOTTOM NAV ===== */
#bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  height: var(--nav-height);
  background: rgba(26, 29, 46, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 100;
  padding: 0 8px;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  transition: all 0.25s ease;
  flex: 1;
  position: relative;
  border: none;
  background: transparent;
  color: var(--text-muted);
}

.nav-item:hover {
  color: var(--text-secondary);
}

.nav-item.active {
  color: var(--accent-green);
}

.nav-item .nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s ease, color 0.25s ease;
  line-height: 1;
  color: var(--text-muted);
}

.nav-item.active .nav-icon {
  transform: scale(1.15);
  color: var(--accent-green);
}

.nav-item .nav-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.btn-edit-tx {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: 8px;
}

.btn-edit-tx:hover {
  background: var(--accent-blue-dim);
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  transform: scale(1.05);
}

/* Catat button - normal style */
.nav-item.nav-catat {
  color: var(--text-muted);
}

.nav-item.nav-catat.active {
  color: var(--accent-green);
}

.nav-item.nav-catat .nav-label {
  display: block;
}

/* ===== LOGIN PAGE ===== */
#login-screen {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
}

.login-box {
  width: 100%;
  max-width: 380px;
  padding: 0 24px;
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo .logo-icon {
  font-size: 56px;
  display: block;
  margin-bottom: 12px;
  filter: drop-shadow(0 4px 16px rgba(0, 212, 170, 0.4));
}

.login-logo h1 {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.login-logo p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  box-shadow: var(--shadow);
}

.login-card .form-group {
  margin-bottom: 16px;
}

.login-input-wrapper {
  position: relative;
}

.login-input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  pointer-events: none;
}

.login-input {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 13px 14px 13px 42px;
  font-size: 15px;
  font-family: 'Inter', sans-serif;
  transition: all 0.2s ease;
}

.login-input:focus {
  outline: none;
  border-color: var(--accent-green);
  background: var(--bg-card-hover);
  box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.15);
}

.login-input::placeholder {
  color: var(--text-muted);
}

.login-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 20px;
  text-align: center;
  line-height: 1.6;
  padding: 10px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border-color);
}

.login-error {
  font-size: 13px;
  color: var(--accent-red);
  text-align: center;
  margin-top: 10px;
  min-height: 18px;
  font-weight: 500;
}


/* ===== CARDS ===== */
.card-glass {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  margin: 0 16px 14px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-glass:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

/* ===== SUMMARY CARDS ===== */
.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 16px;
  margin-bottom: 14px;
}

.summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  position: relative;
  overflow: hidden;
}

.summary-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.summary-card.income::before {
  background: var(--accent-green);
}

.summary-card.expense::before {
  background: var(--accent-red);
}

.summary-card.balance::before {
  background: var(--accent-blue);
}

.summary-card.used::before {
  background: var(--accent-purple);
}

.summary-card .s-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.summary-card .s-icon {
  font-size: 20px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
}

.summary-card .s-icon svg {
  width: 20px;
  height: 20px;
  stroke-width: 2.5px;
}

.summary-card .s-amount {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.summary-card.income .s-amount {
  color: var(--accent-green);
}

.summary-card.expense .s-amount {
  color: var(--accent-red);
}

.summary-card.balance .s-amount {
  color: var(--accent-blue);
}

/* ===== BALANCE HERO ===== */
.balance-hero {
  margin: 16px 16px 14px;
  background: linear-gradient(135deg, #1a2a4a 0%, #1e2235 50%, #1a1d2e 100%);
  border: 1px solid rgba(79, 142, 247, 0.2);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  position: relative;
  overflow: hidden;
}

.balance-hero::after {
  display: none;
}

.balance-hero .bh-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
}

.balance-hero .bh-amount {
  font-size: 32px;
  font-weight: 800;
  color: var(--accent-blue);
  letter-spacing: -1px;
  line-height: 1;
}

.balance-hero .bh-month {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

.hero-action-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  border-radius: 10px;
  padding: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: 'Inter', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.hero-action-btn svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.2px;
}

.hero-action-btn:hover {
  background: rgba(79, 142, 247, 0.15);
  border-color: rgba(79, 142, 247, 0.3);
  color: var(--accent-blue);
  transform: translateY(-1px);
}

/* ===== SECTION TITLE ===== */
.section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 0 16px;
  margin-bottom: 10px;
  margin-top: 4px;
}

/* ===== CHART AREA ===== */
.chart-container {
  position: relative;
  height: 200px;
  padding: 8px 0 0;
}

/* ===== DATE FILTER ===== */
.filter-row {
  display: flex;
  gap: 8px;
  padding: 0 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.filter-row .form-control,
.filter-row .form-select {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  font-size: 13px;
  padding: 8px 12px;
  flex: 1;
  min-width: 0;
}

.filter-row .form-control:focus,
.filter-row .form-select:focus {
  background: var(--bg-card-hover);
  border-color: var(--accent-green);
  color: var(--text-primary);
  box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.15);
  outline: none;
}

.filter-row .form-select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.btn-filter {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-filter:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-green);
  color: var(--accent-green);
  transform: translateY(-1px);
}

.btn-filter svg {
    width: 16px;
    height: 16px;
    stroke-width: 2.5px;
}

/* ===== MEMBER LIST ===== */
.member-section {
  margin: 0 16px 14px;
}

.member-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.member-tabs::-webkit-scrollbar {
  display: none;
}

.member-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 50px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.member-tab.active {
  background: var(--accent-green-dim);
  border-color: var(--accent-green);
  color: var(--accent-green);
}

.member-tab .tab-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

/* ===== TRANSACTION ITEMS ===== */
.tx-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tx-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  transition: all 0.2s ease;
}

.tx-item:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.12);
}

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

.tx-icon.income {
  background: var(--accent-green-dim);
}

.tx-icon.expense {
  background: var(--accent-red-dim);
}

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

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

.tx-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.tx-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 50px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.tx-badge.cat {
  background: var(--accent-blue-dim);
  color: var(--accent-blue);
}

.tx-badge.member {
  background: rgba(168, 85, 247, 0.15);
  color: var(--accent-purple);
}

.tx-amount {
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
}

.tx-amount.income {
  color: var(--accent-green);
}

.tx-amount.expense {
  color: var(--accent-red);
}

.tx-date-full {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ===== EMPTY STATE ===== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  color: var(--text-muted);
  text-align: center;
}

.empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.empty-state p {
  font-size: 14px;
  line-height: 1.5;
}

/* ===== FORM STYLES (CATAT) ===== */
.form-section {
  padding: 0 16px;
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.form-control-dark,
.form-select-dark {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  font-size: 15px;
  font-family: 'Inter', sans-serif;
  transition: all 0.2s ease;
  appearance: none;
  -webkit-appearance: none;
}

.form-control-dark:focus,
.form-select-dark:focus {
  outline: none;
  border-color: var(--accent-green);
  background: var(--bg-card-hover);
  box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.15);
}

.form-control-dark::placeholder {
  color: var(--text-muted);
}

.form-select-dark option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* Type toggle */
.type-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.type-btn {
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  font-family: 'Inter', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.type-btn svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.5px;
}

.type-btn.active-income {
  border-color: var(--accent-green);
  background: var(--accent-green-dim);
  color: var(--accent-green);
}

.type-btn.active-expense {
  border-color: var(--accent-red);
  background: var(--accent-red-dim);
  color: var(--accent-red);
}

/* Amount input */
.amount-wrapper {
  position: relative;
}

.amount-prefix {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
  pointer-events: none;
}

.amount-input {
  padding-left: 44px !important;
}

/* Submit button */
.btn-submit {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--accent-green), #00a88a);
  color: #000;
  border: none;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 20px rgba(0, 212, 170, 0.3);
  margin-top: 8px;
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0, 212, 170, 0.4);
}

.btn-submit:active {
  transform: translateY(0);
}

/* Category chips */
.category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cat-chip {
  padding: 7px 14px;
  border-radius: 50px;
  border: 2px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Inter', sans-serif;
}

/* ===== WALLET STYLES ===== */
.wallet-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 16px;
  margin-bottom: 20px;
}

.wallet-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  position: relative;
  overflow: hidden;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.wallet-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.wallet-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--accent-blue);
}

.wallet-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.wallet-title {
  flex: 1;
}

.wallet-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.wallet-cat-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-blue);
  background: var(--accent-blue-dim);
  padding: 2px 8px;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.wallet-actions {
  display: flex;
  gap: 6px;
}

.wallet-btn-icon {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0;
}

.wallet-btn-icon:hover {
  background: var(--accent-blue-dim);
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(79, 142, 247, 0.2);
}

.wallet-btn-icon.delete:hover {
  background: var(--accent-red-dim);
  color: var(--accent-red);
  border-color: var(--accent-red);
  box-shadow: 0 4px 12px rgba(255, 92, 122, 0.2);
}

.wallet-btn-icon svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.5px;
}

.wallet-body {
  margin-bottom: 14px;
}

.wallet-main-amount {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.wallet-usage-text {
  font-size: 12px;
  color: var(--text-secondary);
}

.wallet-usage-text span {
  font-weight: 600;
  color: var(--text-primary);
}

.wallet-progress-container {
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 8px;
}

.wallet-progress-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease, background 0.4s ease;
}

.wallet-progress-bar.safe { background: var(--accent-green); }
.wallet-progress-bar.warning { background: var(--accent-yellow); }
.wallet-progress-bar.danger { background: var(--accent-red); }

.btn-add-wallet {
  width: calc(100% - 32px);
  margin: 0 16px 16px;
  padding: 14px;
  background: var(--bg-card);
  border: 1.5px dashed var(--accent-blue);
  color: var(--accent-blue);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-add-wallet:hover {
  background: var(--accent-blue-dim);
  transform: translateY(-1px);
}

.cat-chip.selected {
  border-color: var(--accent-blue);
  background: var(--accent-blue-dim);
  color: var(--accent-blue);
}

/* ===== KELUARGA PAGE ===== */
.family-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  margin: 0 16px 10px;
  transition: all 0.2s ease;
}

.family-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
  position: relative;
}

.family-avatar.ayah {
  background: linear-gradient(135deg, #1a3a6a, #2a4a8a);
}

.family-avatar.ibu {
  background: linear-gradient(135deg, #6a1a4a, #8a2a6a);
}

.family-avatar.anak {
  background: linear-gradient(135deg, #1a5a3a, #2a7a4a);
}

.family-avatar.custom {
  background: linear-gradient(135deg, #4a3a1a, #6a5a2a);
}

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

.family-role {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.family-name-input {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  width: 100%;
  padding: 4px 0;
  transition: border-color 0.2s ease;
}

.family-name-input:focus {
  outline: none;
  border-bottom-color: var(--accent-green);
}

.family-name-input::placeholder {
  color: var(--text-muted);
}

.family-stats {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.btn-delete {
  background: var(--accent-red-dim);
  border: 1px solid rgba(255, 92, 122, 0.3);
  color: var(--accent-red);
  border-radius: var(--radius-sm);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-delete:hover {
  background: var(--accent-red-dim);
  border-color: var(--accent-red);
  color: var(--accent-red);
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(255, 92, 122, 0.2);
}

.btn-delete svg {
    width: 16px;
    height: 16px;
    stroke-width: 2.5px;
}

.btn-add-member {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 16px;
  padding: 14px;
  background: var(--bg-card);
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Inter', sans-serif;
  width: calc(100% - 32px);
}

.btn-add-member:hover {
  border-color: var(--accent-green);
  color: var(--accent-green);
  background: var(--accent-green-dim);
}

/* ===== TOAST ===== */
.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  width: calc(100% - 32px);
  max-width: 398px;
}

.toast-msg {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.2s forwards;
}

.toast-msg.success {
  border-left: 4px solid var(--accent-green);
}

.toast-msg.error {
  border-left: 4px solid var(--accent-red);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }

  to {
    opacity: 0;
    transform: translateY(-16px);
  }
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: overlayIn 0.25s ease;
}

@keyframes overlayIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal-sheet {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 24px 20px 32px;
  width: 100%;
  max-width: 430px;
  animation: sheetUp 0.3s ease;
}

@keyframes sheetUp {
  from {
    transform: translateY(100%);
  }

  to {
    transform: translateY(0);
  }
}

.modal-handle {
  width: 40px;
  height: 4px;
  background: var(--border-color);
  border-radius: 2px;
  margin: 0 auto 20px;
}

.modal-title {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 20px;
  font-family: 'Outfit', sans-serif;
  color: var(--text-primary);
}



/* ===== HISTORY FILTERS ===== */
.history-filters {
  padding: 0 16px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.filter-chips::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  padding: 7px 16px;
  border-radius: 50px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  font-family: 'Inter', sans-serif;
}

.filter-chip.active {
  background: var(--accent-green-dim);
  border-color: var(--accent-green);
  color: var(--accent-green);
}

.filter-chip.expense-active {
  background: var(--accent-red-dim);
  border-color: var(--accent-red);
  color: var(--accent-red);
}

/* ===== SCROLLBAR FOR DESKTOP ===== */
@media (min-width: 430px) {
  #app {
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.8);
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
  }
}

/* ===== FAMILY SUMMARY CARDS ===== */
#family-summary-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 16px;
}

.family-summary-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.family-summary-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.fsc-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.fsc-info {
  flex: 1;
}

.fsc-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.fsc-role {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.fsc-stats {
  text-align: right;
}

.fsc-stat {
  font-size: 12px;
  font-weight: 600;
}

.fsc-stat.income {
  color: var(--accent-green);
}

.fsc-stat.expense {
  color: var(--accent-red);
}

/* ===== PAGINATION ===== */
.pagination-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px 0;
}

.pg-info {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 8px;
  font-weight: 500;
}

.pg-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pg-btn:hover:not(:disabled) {
  border-color: var(--accent-green);
  color: var(--accent-green);
  background: var(--accent-green-dim);
}

.pg-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.pg-btn.pg-active {
  background: var(--accent-green);
  border-color: var(--accent-green);
  color: #000;
}

.pg-dots {
  color: var(--text-muted);
  font-weight: 700;
}

/* ===== UTILITY ===== */
.text-green {
  color: var(--accent-green);
}

.text-red {
  color: var(--accent-red);
}

.text-blue {
  color: var(--accent-blue);
}

.text-muted {
  color: var(--text-muted);
}

.fw-700 {
  font-weight: 700;
}

.mt-2 {
  margin-top: 8px;
}

.mb-0 {
  margin-bottom: 0;
}

.divider {
  height: 1px;
  background: var(--border-color);
  margin: 16px 16px;
}

.select-wrapper {
  position: relative;
}

.select-wrapper::after {
  content: '▾';
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  font-size: 14px;
}
/* ===== CONTACT FOOTER ===== */
.contact-footer {
  margin: 20px 16px 14px;
  padding: 24px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.cf-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cf-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

.cf-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cf-item {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  transition: transform 0.2s ease;
}

.cf-item:hover {
  transform: translateX(4px);
}

.cf-icon {
  width: 40px;
  height: 40px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: inset 0 0 10px rgba(255,255,255,0.02);
}

.cf-info {
  flex: 1;
}

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

.cf-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-top: 1px;
}

.cf-copyright {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  opacity: 0.8;
}

/* ===== PARAGRAPH AI ENHANCEMENTS ===== */
.ai-report-container {
    padding: 4px 0;
}

.ai-score-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 0;
    position: relative;
}

.ai-gauge-wrapper {
    position: relative;
    width: 160px;
    height: 160px;
}

.ai-gauge-svg {
    transform: rotate(-90deg);
}

.ai-gauge-bg {
    fill: none;
    stroke: rgba(255,255,255,0.05);
    stroke-width: 8;
}

.ai-gauge-fill {
    fill: none;
    stroke: var(--accent-blue);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s ease-out;
}

.ai-score-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.ai-score-num {
    font-size: 38px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.ai-score-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
}

.ai-status-badge {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    margin-top: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ai-status-sehat { background: var(--accent-green-dim); color: var(--accent-green); border: 1px solid var(--accent-green); }
.ai-status-waspada { background: rgba(251, 191, 36, 0.1); color: var(--accent-yellow); border: 1px solid var(--accent-yellow); }
.ai-status-kritis { background: var(--accent-red-dim); color: var(--accent-red); border: 1px solid var(--accent-red); }

.ai-summary-box {
    background: rgba(255,255,255,0.03);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

.ai-divider {
    height: 1px;
    background: var(--border-color);
    margin: 20px 0;
}

.ai-section-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Comparison Badges */
.ai-comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.ai-comp-card {
    background: var(--bg-secondary);
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.ai-comp-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.ai-comp-val {
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}

.trend-up { color: var(--accent-red); }
.trend-down { color: var(--accent-green); }
.trend-neutral { color: var(--text-secondary); }

/* Indicator Bars */
.ai-indicator-item {
    margin-bottom: 12px;
}

.ai-ind-header {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    margin-bottom: 5px;
}

.ai-ind-label { color: var(--text-secondary); }
.ai-ind-score { font-weight: 600; }

.ai-ind-bar-bg {
    height: 4px;
    background: rgba(255,255,255,0.05);
    border-radius: 2px;
    overflow: hidden;
}

.ai-ind-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 1s ease-out;
}

/* Prediction & Anomaly Cards */
.ai-card-premium {
    background: linear-gradient(135deg, rgba(79, 142, 247, 0.1), rgba(168, 85, 247, 0.1));
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 12px;
}

.ai-card-recco {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 12px;
}

.ai-recco-nominal {
    color: var(--accent-green);
    font-weight: 700;
    font-size: 14px;
}

/* Locked / Trial UI */
.ai-locked-container {
    position: relative;
    padding: 30px 10px;
    text-align: center;
}

.ai-locked-blur {
    filter: blur(8px);
    opacity: 0.3;
    pointer-events: none;
    user-select: none;
}

.ai-locked-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ai-locked-icon {
    font-size: 48px;
    margin-bottom: 16px;
    filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.5));
}

.ai-locked-title {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.ai-locked-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.5;
    max-width: 260px;
}

.btn-premium-ai {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #000;
    border: none;
    padding: 14px 28px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(245, 158, 11, 0.3);
    transition: all 0.3s ease;
}

.btn-premium-ai:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 25px rgba(245, 158, 11, 0.4);
}
 
/* Statistics Refinement */
.cat-list-scroll {
    margin-top: 15px;
    max-height: 220px;
    overflow-y: auto;
    padding-right: 4px;
}

.cat-list-scroll::-webkit-scrollbar {
    width: 4px;
}

.cat-list-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.cat-list-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.cat-list-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}
