/* =====================================================
   CashFlow Tracker Pro - Design System
   Premium Financial App UI
   ===================================================== */

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

/* ===== CSS Variables ===== */
:root {
  /* Primary Colors */
  --navy-900: #0a0f1e;
  --navy-800: #0f172a;
  --navy-700: #1a2340;
  --navy-600: #1e293b;
  --navy-500: #283548;

  /* Accent Colors */
  --blue-500: #3b82f6;
  --blue-400: #60a5fa;
  --blue-600: #2563eb;
  --green-500: #10b981;
  --green-400: #34d399;
  --green-100: #d1fae5;
  --rose-500: #f43f5e;
  --rose-400: #fb7185;
  --rose-100: #ffe4e6;
  --amber-500: #f59e0b;
  --amber-400: #fbbf24;
  --purple-500: #8b5cf6;
  --purple-400: #a78bfa;

  /* Neutral */
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --white: #ffffff;
  --black: #000000;

  /* Gradients */
  --gradient-dark: linear-gradient(135deg, #0f172a 0%, #1a2340 50%, #1e293b 100%);
  --gradient-blue: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  --gradient-green: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --gradient-rose: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
  --gradient-card: linear-gradient(145deg, #1a2340 0%, #0f172a 100%);
  --gradient-glass: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%);

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.15);
  --shadow-xl: 0 15px 50px rgba(0, 0, 0, 0.2);
  --shadow-blue: 0 4px 20px rgba(59, 130, 246, 0.3);
  --shadow-card: 0 2px 16px rgba(0, 0, 0, 0.06);

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

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-xs: 11px;
  --font-sm: 13px;
  --font-base: 14px;
  --font-md: 16px;
  --font-lg: 18px;
  --font-xl: 22px;
  --font-2xl: 28px;
  --font-3xl: 36px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s ease;
  --transition-spring: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ===== Lucide Icon Sizing ===== */
.lucide {
  width: 1em;
  height: 1em;
  stroke-width: 2;
  vertical-align: middle;
}

.inline-icon {
  width: 16px;
  height: 16px;
  vertical-align: -2px;
  margin-right: 2px;
}

.inline-icon-sm {
  width: 14px;
  height: 14px;
  vertical-align: -2px;
  margin-right: 2px;
}

.section-icon {
  width: 18px;
  height: 18px;
  vertical-align: -3px;
  margin-right: 4px;
  color: var(--blue-500);
}

.badge-icon {
  width: 12px;
  height: 12px;
  vertical-align: -1px;
}

.online-dot {
  width: 10px;
  height: 10px;
  color: var(--green-500);
  fill: var(--green-500);
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background: linear-gradient(180deg, #e8edf5 0%, #dce3ed 50%, #e2e8f0 100%);
  color: var(--navy-800);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ===== App Container ===== */
.app-container {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  background: linear-gradient(180deg, #eef2f7 0%, #e4e9f0 100%);
  position: relative;
  overflow-x: hidden;
}

/* ===== Login Screen ===== */
.login-screen {
  min-height: 100vh;
  background: var(--gradient-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
}

.login-card {
  background: var(--white);
  border-radius: var(--radius-2xl);
  padding: 40px 32px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-xl);
  animation: fadeInUp 0.6s ease;
}

.login-logo {
  width: 72px;
  height: 72px;
  background: var(--navy-800);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 32px;
  color: var(--blue-400);
  animation: pulse-glow 2s infinite;
}

.login-logo .lucide {
  width: 32px;
  height: 32px;
}

.login-card h1 {
  font-size: var(--font-xl);
  font-weight: 700;
  color: var(--navy-800);
  margin-bottom: 4px;
}

.login-card .subtitle {
  font-size: var(--font-sm);
  color: var(--blue-500);
  margin-bottom: 32px;
  font-weight: 500;
}

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

.form-group label {
  font-size: var(--font-xs);
  font-weight: 600;
  color: var(--slate-500);
  text-transform: uppercase;
  letter-spacing: 1px;
  display: block;
  margin-bottom: 8px;
}

.form-group .input-wrapper {
  display: flex;
  align-items: center;
  background: var(--slate-50);
  border: 2px solid var(--slate-200);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  gap: 12px;
  transition: var(--transition-fast);
}

.form-group .input-wrapper:focus-within {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group .input-wrapper .icon {
  font-size: 18px;
  color: var(--slate-400);
}

.form-group .input-wrapper input {
  flex: 1;
  border: none;
  background: none;
  font-family: var(--font-family);
  font-size: var(--font-base);
  color: var(--navy-800);
  outline: none;
}

.form-group .input-wrapper input::placeholder {
  color: var(--slate-400);
}

.btn-login {
  width: 100%;
  padding: 14px;
  background: var(--gradient-blue);
  color: var(--white);
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-family);
  font-size: var(--font-md);
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition-fast);
  box-shadow: var(--shadow-blue);
}

.btn-login:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 25px rgba(59, 130, 246, 0.4);
}

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

.ssl-badge {
  margin-top: 16px;
  font-size: var(--font-xs);
  color: var(--slate-400);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ===== Page Header ===== */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 12px;
}

.page-header h1 {
  font-size: var(--font-2xl);
  font-weight: 800;
  color: var(--navy-800);
}

.page-header .greeting {
  font-size: var(--font-xs);
  color: var(--slate-500);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  margin-top: 2px;
}

.btn-logout {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: var(--font-xs);
  color: var(--slate-500);
  background: none;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-full);
  padding: 6px 12px;
  cursor: pointer;
  font-family: var(--font-family);
  font-weight: 500;
  transition: var(--transition-fast);
}

.btn-logout:hover {
  background: var(--slate-50);
  color: var(--rose-500);
  border-color: var(--rose-500);
}

/* ===== Dashboard Page ===== */
.net-worth-card {
  margin: 0 20px 20px;
  background: var(--gradient-card);
  border-radius: var(--radius-xl);
  padding: 24px;
  color: var(--white);
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.net-worth-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, transparent 70%);
  border-radius: 50%;
}

.net-worth-card .label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.net-worth-card .label span {
  font-size: var(--font-xs);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 600;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-live {
  background: rgba(16, 185, 129, 0.2);
  color: var(--green-400);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-live::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--green-400);
  border-radius: 50%;
  animation: blink 1.5s infinite;
}

.net-worth-card .amount {
  font-size: var(--font-3xl);
  font-weight: 800;
  margin-bottom: 16px;
}

.net-worth-sub {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.net-worth-sub-item {
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.net-worth-sub-item .sub-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 600;
  margin-bottom: 4px;
}

.net-worth-sub-item .sub-amount {
  font-size: var(--font-md);
  font-weight: 700;
}

.sub-amount.green {
  color: var(--green-400);
}

/* Wallet Section */
.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 20px;
  margin-bottom: 12px;
  font-size: var(--font-base);
  font-weight: 700;
  color: var(--navy-800);
}

.section-title .icon {
  font-size: 18px;
}

.wallet-scroll {
  display: flex;
  gap: 12px;
  padding: 0 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 20px;
  scrollbar-width: none;
}

.wallet-scroll::-webkit-scrollbar {
  display: none;
}

.wallet-card {
  min-width: 140px;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-card);
  scroll-snap-align: start;
  border: 1px solid rgba(0, 0, 0, 0.04);
  transition: var(--transition-fast);
  cursor: pointer;
}

.wallet-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.wallet-card .wallet-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 10px;
}

.wallet-icon.cash {
  background: #e8f5e9;
}

.wallet-icon.bank {
  background: #e3f2fd;
}

.wallet-icon.ewallet {
  background: #f3e5f5;
}

.wallet-card .wallet-name {
  font-size: var(--font-xs);
  color: var(--slate-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  margin-bottom: 4px;
}

.wallet-card .wallet-balance {
  font-size: var(--font-base);
  font-weight: 700;
  color: var(--navy-800);
}

/* Debt / Receivable */
.debt-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 20px;
  margin-bottom: 20px;
}

.debt-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.debt-card .debt-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  margin-bottom: 8px;
}

.debt-icon.hutang {
  background: var(--rose-100);
}

.debt-icon.piutang {
  background: var(--green-100);
}

.debt-card .debt-label {
  font-size: var(--font-xs);
  color: var(--slate-500);
  font-weight: 600;
  margin-bottom: 4px;
}

.debt-card .debt-amount {
  font-size: var(--font-base);
  font-weight: 700;
}

.debt-amount.rose {
  color: var(--rose-500);
}

.debt-amount.green {
  color: var(--green-500);
}

/* Recent Activity */
.activity-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  margin-bottom: 12px;
}

.activity-header h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--font-base);
  font-weight: 700;
}

.btn-see-all {
  font-size: var(--font-xs);
  color: var(--blue-500);
  background: none;
  border: none;
  font-family: var(--font-family);
  font-weight: 600;
  cursor: pointer;
}

.activity-list {
  padding: 0 20px;
  margin-bottom: 20px;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--white);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0, 0, 0, 0.03);
  cursor: pointer;
  transition: var(--transition-fast);
}

.activity-item:hover {
  background: var(--slate-50);
}

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

.act-icon.income {
  background: var(--green-100);
}

.act-icon.expense {
  background: var(--rose-100);
}

.activity-item .act-info {
  flex: 1;
  min-width: 0;
}

.act-info .act-category {
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--navy-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.act-info .act-date {
  font-size: var(--font-xs);
  color: var(--slate-400);
  margin-top: 2px;
}

.activity-item .act-amount {
  font-size: var(--font-sm);
  font-weight: 700;
  flex-shrink: 0;
}

.act-amount.income {
  color: var(--green-500);
}

.act-amount.expense {
  color: var(--rose-500);
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--slate-400);
  font-size: var(--font-sm);
}

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

/* ===== Assets Page ===== */
.asset-card {
  margin: 0 20px 20px;
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 20px;
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(0, 0, 0, 0.04);
}

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

.asset-card-header h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--font-base);
  font-weight: 700;
}

.badge-realtime {
  background: var(--green-100);
  color: var(--green-500);
  font-size: 10px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-weight: 700;
}

.asset-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--slate-100);
}

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

.asset-item .asset-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.asset-icon.gold {
  background: #fef3c7;
}

.asset-icon.crypto {
  background: #fce7f3;
}

.asset-icon.stock {
  background: #d1fae5;
}

.asset-item .asset-info {
  flex: 1;
}

.asset-info .asset-name {
  font-size: var(--font-base);
  font-weight: 700;
  color: var(--navy-800);
}

.asset-info .asset-qty {
  font-size: var(--font-xs);
  color: var(--slate-400);
  margin-top: 2px;
}

.asset-item .asset-value {
  text-align: right;
}

.asset-value .asset-price {
  font-size: var(--font-base);
  font-weight: 700;
  color: var(--navy-800);
}

.asset-value .asset-change {
  font-size: var(--font-xs);
  margin-top: 2px;
}

.asset-change.up {
  color: var(--green-500);
}

.asset-change.down {
  color: var(--rose-500);
}

.asset-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 20px;
  margin-bottom: 20px;
}

.btn-asset {
  padding: 16px;
  border-radius: var(--radius-lg);
  border: none;
  font-family: var(--font-family);
  font-size: var(--font-base);
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition-fast);
}

.btn-buy {
  background: var(--gradient-card);
  color: var(--white);
  box-shadow: var(--shadow-md);
}

.btn-buy:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-sell {
  background: var(--white);
  color: var(--navy-800);
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.btn-sell:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ===== Report Page ===== */
.report-section {
  padding: 0 20px;
  margin-bottom: 20px;
}

.report-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 20px;
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(0, 0, 0, 0.04);
  margin-bottom: 16px;
}

.report-card h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--font-base);
  font-weight: 700;
  margin-bottom: 16px;
}

/* Budget Tracker */
.budget-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.budget-info .budget-label {
  font-size: var(--font-xs);
  color: var(--slate-500);
}

.budget-info .budget-amount {
  font-size: var(--font-sm);
  font-weight: 700;
}

.budget-bar {
  height: 10px;
  background: var(--slate-100);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 8px;
}

.budget-bar .budget-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
  background: var(--gradient-green);
}

.budget-fill.warning {
  background: var(--gradient-rose);
}

.budget-fill.caution {
  background: linear-gradient(135deg, var(--amber-500) 0%, var(--amber-400) 100%);
}

.budget-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--font-xs);
  font-weight: 600;
}

.budget-status.safe {
  color: var(--green-500);
}

.budget-status.caution {
  color: var(--amber-500);
}

.budget-status.danger {
  color: var(--rose-500);
}

/* Cash Flow Summary */
.cashflow-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.cashflow-item {
  text-align: center;
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--slate-50);
}

.cashflow-item .cf-label {
  font-size: var(--font-xs);
  color: var(--slate-500);
  font-weight: 600;
  margin-bottom: 4px;
}

.cashflow-item .cf-amount {
  font-size: var(--font-md);
  font-weight: 800;
}

.cf-amount.income {
  color: var(--green-500);
}

.cf-amount.expense {
  color: var(--rose-500);
}

/* Chart Container */
.chart-container {
  position: relative;
  height: 220px;
  margin-top: 12px;
}

.chart-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 12px;
  font-size: var(--font-xs);
  color: var(--slate-500);
}

.chart-legend .legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.legend-dot.green {
  background: var(--green-500);
}

.legend-dot.rose {
  background: var(--rose-500);
}

.month-selector {
  display: flex;
  align-items: center;
  gap: 8px;
}

.month-selector select {
  padding: 6px 12px;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  font-family: var(--font-family);
  font-size: var(--font-xs);
  color: var(--navy-800);
  background: var(--white);
  cursor: pointer;
  outline: none;
}

/* ===== History Page ===== */
.filter-tabs {
  display: flex;
  padding: 0 20px;
  gap: 0;
  margin-bottom: 8px;
  background: var(--white);
  margin: 0 20px 8px;
  border-radius: var(--radius-full);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.filter-tab {
  flex: 1;
  padding: 10px;
  font-family: var(--font-family);
  font-size: var(--font-sm);
  font-weight: 600;
  border: none;
  background: none;
  color: var(--slate-500);
  cursor: pointer;
  transition: var(--transition-fast);
  text-align: center;
}

.filter-tab.active {
  background: var(--navy-800);
  color: var(--white);
  border-radius: var(--radius-full);
}

.filter-info {
  text-align: center;
  font-size: var(--font-xs);
  color: var(--slate-400);
  padding: 4px 20px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.history-list {
  padding: 0 20px;
  padding-bottom: 100px;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--white);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0, 0, 0, 0.03);
  cursor: pointer;
  transition: var(--transition-fast);
}

.history-item:hover {
  background: var(--slate-50);
}

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

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

.history-item .h-info {
  flex: 1;
  min-width: 0;
}

.h-info .h-category {
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--navy-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.h-info .h-desc {
  font-size: var(--font-xs);
  color: var(--slate-400);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.h-info .h-date {
  font-size: 10px;
  color: var(--slate-300);
  margin-top: 2px;
}

.history-item .h-amount {
  font-size: var(--font-sm);
  font-weight: 700;
  flex-shrink: 0;
  text-align: right;
}

.h-amount .h-wallet {
  font-size: 10px;
  color: var(--slate-400);
  font-weight: 500;
  margin-top: 2px;
}

/* ===== Bottom Navigation ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
  box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.08);
  z-index: 100;
  border-top: 1px solid rgba(0, 0, 0, 0.04);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: none;
  border: none;
  font-family: var(--font-family);
  color: var(--slate-400);
  cursor: pointer;
  padding: 4px 12px;
  transition: var(--transition-fast);
  font-size: var(--font-xs);
  font-weight: 500;
}

.nav-item .nav-icon {
  font-size: 22px;
  transition: var(--transition-fast);
}

.nav-item.active {
  color: var(--blue-500);
}

.nav-item.active .nav-icon {
  transform: scale(1.1);
}

.nav-add {
  position: relative;
  top: -20px;
  width: 52px;
  height: 52px;
  background: var(--gradient-blue);
  border-radius: 50%;
  border: none;
  color: var(--white);
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-blue);
  transition: var(--transition-spring);
}

.nav-add:hover {
  transform: scale(1.1) translateY(-2px);
  box-shadow: 0 8px 30px rgba(59, 130, 246, 0.5);
}

.nav-add:active {
  transform: scale(0.95);
}

/* ===== Modals / Bottom Sheet ===== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 200;
  display: none;
  align-items: flex-end;
  justify-content: center;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-overlay.active {
  display: flex;
  animation: fadeIn 0.2s ease;
}

.modal-sheet {
  width: 100%;
  max-width: 480px;
  background: var(--white);
  border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
  padding: 12px 24px 32px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-sheet .handle {
  width: 40px;
  height: 4px;
  background: var(--slate-300);
  border-radius: var(--radius-full);
  margin: 0 auto 16px;
}

.modal-sheet h2 {
  font-size: var(--font-lg);
  font-weight: 700;
  color: var(--navy-800);
  margin-bottom: 4px;
}

.modal-sheet .modal-subtitle {
  font-size: var(--font-sm);
  color: var(--slate-500);
  margin-bottom: 20px;
}

/* Transaction Form */
.tx-type-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.tx-type-btn {
  flex: 1;
  padding: 10px;
  border: 2px solid var(--slate-200);
  border-radius: var(--radius-md);
  background: var(--white);
  font-family: var(--font-family);
  font-size: var(--font-sm);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.tx-type-btn.active.income {
  border-color: var(--green-500);
  background: var(--green-100);
  color: var(--green-500);
}

.tx-type-btn.active.expense {
  border-color: var(--rose-500);
  background: var(--rose-100);
  color: var(--rose-500);
}

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

.modal-form-group label {
  display: block;
  font-size: var(--font-xs);
  font-weight: 600;
  color: var(--slate-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.modal-form-group input,
.modal-form-group select,
.modal-form-group textarea {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--slate-200);
  border-radius: var(--radius-md);
  font-family: var(--font-family);
  font-size: var(--font-base);
  color: var(--navy-800);
  outline: none;
  transition: var(--transition-fast);
  background: var(--white);
}

.modal-form-group input:focus,
.modal-form-group select:focus,
.modal-form-group textarea:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.modal-form-group .amount-input {
  font-size: var(--font-2xl);
  font-weight: 800;
  text-align: center;
  padding: 16px;
}

.modal-form-group textarea {
  resize: none;
  height: 80px;
}

.btn-submit {
  width: 100%;
  padding: 14px;
  background: var(--gradient-blue);
  color: var(--white);
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-family);
  font-size: var(--font-md);
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-fast);
  box-shadow: var(--shadow-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}

.btn-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 25px rgba(59, 130, 246, 0.4);
}

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

.btn-submit.green {
  background: var(--gradient-green);
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.3);
}

.btn-submit.red {
  background: var(--gradient-rose);
  box-shadow: 0 4px 20px rgba(244, 63, 94, 0.3);
}

.btn-danger {
  width: 100%;
  padding: 12px;
  background: none;
  color: var(--rose-500);
  border: 2px solid var(--rose-500);
  border-radius: var(--radius-md);
  font-family: var(--font-family);
  font-size: var(--font-sm);
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
  transition: var(--transition-fast);
}

.btn-danger:hover {
  background: var(--rose-100);
}

/* Category grid */
.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.category-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 4px;
  border: 2px solid var(--slate-100);
  border-radius: var(--radius-md);
  background: var(--white);
  font-family: var(--font-family);
  font-size: 10px;
  font-weight: 600;
  color: var(--slate-500);
  cursor: pointer;
  transition: var(--transition-fast);
}

.category-btn .cat-icon {
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.category-btn .cat-icon .lucide {
  width: 20px;
  height: 20px;
}

.category-btn.active {
  border-color: var(--blue-500);
  background: rgba(59, 130, 246, 0.05);
  color: var(--blue-500);
}

/* Wallet Selector */
.wallet-select {
  display: flex;
  gap: 8px;
}

.wallet-opt {
  flex: 1;
  padding: 10px;
  border: 2px solid var(--slate-200);
  border-radius: var(--radius-md);
  background: var(--white);
  font-family: var(--font-family);
  font-size: var(--font-xs);
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: var(--transition-fast);
}

.wallet-opt.active {
  border-color: var(--blue-500);
  background: rgba(59, 130, 246, 0.05);
  color: var(--blue-500);
}

/* ===== AI Assistant ===== */
.ai-fab {
  position: fixed;
  bottom: 90px;
  right: calc(50% - 220px);
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
  border-radius: 50%;
  border: none;
  color: var(--white);
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
  z-index: 99;
  transition: var(--transition-spring);
  animation: float 3s ease-in-out infinite;
}

.ai-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 30px rgba(139, 92, 246, 0.5);
}

.ai-chat-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 300;
  display: none;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.ai-chat-modal.active {
  display: flex;
  animation: fadeIn 0.2s ease;
}

.ai-chat-container {
  width: 100%;
  max-width: 480px;
  height: 85vh;
  background: var(--white);
  border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ai-chat-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--slate-100);
  display: flex;
  align-items: center;
  gap: 12px;
}

.ai-chat-header .ai-avatar {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--white);
}

.ai-chat-header .ai-header-info h3 {
  font-size: var(--font-base);
  font-weight: 700;
  color: var(--navy-800);
}

.ai-chat-header .ai-header-info p {
  font-size: var(--font-xs);
  color: var(--green-500);
}

.ai-chat-header .btn-close-chat {
  margin-left: auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--slate-100);
  color: var(--slate-500);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-message {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  font-size: var(--font-sm);
  line-height: 1.5;
  animation: fadeInUp 0.3s ease;
}

.chat-message.ai {
  background: var(--slate-50);
  color: var(--navy-800);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.chat-message.user {
  background: var(--gradient-blue);
  color: var(--white);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.chat-message.typing {
  display: flex;
  gap: 4px;
  padding: 16px 20px;
}

.typing-dot {
  width: 8px;
  height: 8px;
  background: var(--slate-400);
  border-radius: 50%;
  animation: typingBounce 1.4s infinite;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

.ai-chat-input {
  padding: 12px 20px;
  border-top: 1px solid var(--slate-100);
  display: flex;
  gap: 8px;
  align-items: center;
}

.ai-chat-input input {
  flex: 1;
  padding: 10px 16px;
  border: 2px solid var(--slate-200);
  border-radius: var(--radius-full);
  font-family: var(--font-family);
  font-size: var(--font-sm);
  outline: none;
  transition: var(--transition-fast);
}

.ai-chat-input input:focus {
  border-color: var(--purple-500);
}

.ai-chat-input .btn-send {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  border: none;
  border-radius: 50%;
  color: var(--white);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
  flex-shrink: 0;
}

.ai-chat-input .btn-send:hover {
  transform: scale(1.05);
}

.ai-chat-input .btn-receipt {
  width: 40px;
  height: 40px;
  background: var(--slate-100);
  border: none;
  border-radius: 50%;
  color: var(--slate-500);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
  flex-shrink: 0;
}

.ai-chat-input .btn-receipt:hover {
  background: var(--slate-200);
}

/* AI Quick Actions */
.ai-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.ai-quick-btn {
  padding: 6px 12px;
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-full);
  font-family: var(--font-family);
  font-size: var(--font-xs);
  color: var(--purple-500);
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.ai-quick-btn:hover {
  background: rgba(139, 92, 246, 0.05);
  border-color: var(--purple-500);
}

/* AI Settings */
.ai-settings {
  padding: 12px 20px;
  background: var(--slate-50);
  border-top: 1px solid var(--slate-100);
}

.ai-settings .api-key-input {
  display: flex;
  gap: 8px;
}

.ai-settings input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  font-family: var(--font-family);
  font-size: var(--font-xs);
  outline: none;
}

.ai-settings .btn-save-key {
  padding: 8px 16px;
  background: var(--purple-500);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-family);
  font-size: var(--font-xs);
  font-weight: 600;
  cursor: pointer;
}

/* ===== Page Sections ===== */
.page-section {
  display: none;
  padding-bottom: 80px;
  animation: fadeIn 0.3s ease;
}

.page-section.active {
  display: block;
}

/* ===== Animations ===== */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

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

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

  to {
    transform: translateY(0);
  }
}

@keyframes pulse-glow {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.3);
  }

  50% {
    box-shadow: 0 0 0 12px rgba(59, 130, 246, 0);
  }
}

@keyframes blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.3;
  }
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-6px);
  }
}

@keyframes typingBounce {

  0%,
  60%,
  100% {
    transform: translateY(0);
  }

  30% {
    transform: translateY(-6px);
  }
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
  .app-container {
    max-width: 100%;
  }

  .ai-fab {
    right: 16px;
  }
}

@media (min-width: 481px) {
  body {
    background: var(--gradient-dark);
  }

  .app-container {
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.3);
    border-radius: 0;
  }
}

/* ===== Toast Notification ===== */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  border-radius: var(--radius-full);
  font-family: var(--font-family);
  font-size: var(--font-sm);
  font-weight: 600;
  z-index: 500;
  animation: fadeInUp 0.3s ease;
  box-shadow: var(--shadow-lg);
  max-width: 400px;
}

.toast.success {
  background: var(--green-500);
  color: var(--white);
}

.toast.error {
  background: var(--rose-500);
  color: var(--white);
}

.toast.info {
  background: var(--blue-500);
  color: var(--white);
}

/* ===== Utility Classes ===== */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

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

.mt-4 {
  margin-top: 16px;
}

.mb-2 {
  margin-bottom: 8px;
}

.mb-4 {
  margin-bottom: 16px;
}

/* ===== Scrollbar Styling ===== */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--slate-300);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--slate-400);
}

/* ===== Edit Modal ===== */
.edit-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 16px;
}

.edit-actions .btn-edit {
  padding: 10px;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-family);
  font-weight: 600;
  font-size: var(--font-sm);
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-edit.edit {
  background: var(--gradient-blue);
  color: var(--white);
}

.btn-edit.delete {
  background: var(--rose-100);
  color: var(--rose-500);
}

/* Budget Setting */
.budget-set-card {
  margin: 0 20px 20px;
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 20px;
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.btn-set-budget {
  width: 100%;
  padding: 12px;
  background: var(--slate-50);
  border: 2px dashed var(--slate-300);
  border-radius: var(--radius-md);
  font-family: var(--font-family);
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--slate-500);
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-set-budget:hover {
  border-color: var(--blue-500);
  color: var(--blue-500);
  background: rgba(59, 130, 246, 0.03);
}

/* ===== Lucide Icon Overrides ===== */
.nav-icon .lucide {
  width: 22px;
  height: 22px;
}

.wallet-icon .lucide {
  width: 22px;
  height: 22px;
}

.debt-icon .lucide {
  width: 18px;
  height: 18px;
}

.asset-icon .lucide {
  width: 22px;
  height: 22px;
}

.empty-icon .lucide {
  width: 48px;
  height: 48px;
  color: var(--slate-300);
}

.ai-fab .lucide {
  width: 24px;
  height: 24px;
}

.ai-avatar .lucide {
  width: 22px;
  height: 22px;
}

.btn-close-chat .lucide {
  width: 16px;
  height: 16px;
}

.btn-receipt .lucide,
.btn-send .lucide {
  width: 18px;
  height: 18px;
}

/* ===== Google Sheets Sync ===== */
.sheets-settings {
  padding: 12px 20px;
  background: var(--slate-50);
  border-top: 1px solid var(--slate-100);
}

.btn-sync-all {
  width: 100%;
  padding: 8px;
  margin-top: 8px;
  background: var(--gradient-green);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-family);
  font-size: var(--font-xs);
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: var(--transition-fast);
}

.btn-sync-all:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-sync-all .lucide {
  width: 14px;
  height: 14px;
}