[data-theme="dark"] {
  --bg: #090811;
  --bg2: #13112a;
  --bg3: #1a1836;
  --bg4: #221f42;
  --border: rgba(139, 92, 246, 0.18);
  --border-light: rgba(139, 92, 246, 0.4);
  --border2: rgba(255, 255, 255, 0.12);
  --text: #f0eeff;
  --text2: #9492b0;
  --text3: #4a4860;
  --grad1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --grad2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --grad3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --grad4: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
  --grad-acc: linear-gradient(135deg, #8b5cf6 0%, #4f46e5 100%);
  --income: #34d399;
  --expense: #fb7185;
  --saving: #60a5fa;
  --accent: #a78bfa;
  --glow1: rgba(139, 92, 246, 0.25);
  --glow2: rgba(79, 70, 229, 0.25);
  --bg-mesh:
    radial-gradient(ellipse at 10% 60%, rgba(99, 60, 220, 0.28) 0%, transparent 45%),
    radial-gradient(ellipse at 90% 20%, rgba(79, 46, 200, 0.22) 0%, transparent 40%),
    radial-gradient(ellipse at 50% 100%, rgba(60, 20, 180, 0.15) 0%, transparent 50%),
    #090811;
}

[data-theme="light"] {
  --bg: #eef0ff;
  --bg2: #ffffff;
  --bg3: #f5f4ff;
  --bg4: #ece9ff;
  --border: rgba(99, 60, 220, 0.12);
  --border-light: rgba(99, 60, 220, 0.35);
  --border2: rgba(0, 0, 0, 0.1);
  --text: #0f0e1a;
  --text2: #5e5c80;
  --text3: #b8b6d0;
  --grad1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --grad2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --grad3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --grad4: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
  --grad-acc: linear-gradient(135deg, #8b5cf6 0%, #4f46e5 100%);
  --income: #059669;
  --expense: #e11d48;
  --saving: #2563eb;
  --accent: #6366f1;
  --glow1: rgba(99, 60, 220, 0.12);
  --glow2: rgba(79, 70, 229, 0.1);
  --bg-mesh:
    radial-gradient(ellipse at 10% 20%, rgba(167, 139, 250, 0.2) 0%, transparent 45%),
    radial-gradient(ellipse at 90% 80%, rgba(99, 102, 241, 0.15) 0%, transparent 40%),
    #eef0ff;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg-mesh, var(--bg));
  background-attachment: fixed;
  color: var(--text);
  font-family: 'Plus Jakarta Sans', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.3s, color 0.3s;
}

.app {
  display: none;
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  padding: 1.25rem 0.85rem;
  position: fixed;
  top: 12px;
  left: 12px;
  height: calc(100vh - 24px);
  z-index: 50;
  box-shadow: 0 8px 40px rgba(99, 60, 220, 0.2), 0 2px 12px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);

  will-change: transform, width, padding;
  transition: background 0.3s, transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), width 0.4s cubic-bezier(0.22, 1, 0.36, 1), padding 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
}

[data-theme="light"] .sidebar {
  box-shadow: 0 8px 40px rgba(99, 60, 220, 0.12), 0 2px 12px rgba(0, 0, 0, 0.08);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
  padding: 0 0.5rem;
  justify-content: flex-start;
}

.brand-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
  overflow: visible;
}

#logout-btn-sidebar {
  width: 100%;
  border: none;
  background: none;
  margin-bottom: 0.75rem;
  color: var(--expense);
}

.brand-icon svg,
.brand-logo-mask {
  width: 100%;
  height: 100%;
  display: block;
}


.brand-logo-mask {
  width: 100%;
  height: 100%;
  background: currentColor;
  -webkit-mask-image: url('logo.png');
  mask-image: url('logo.png');
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  transform: scale(1.6);
  filter: none !important;
  -webkit-mask-type: alpha !important;
  mask-type: alpha !important;
}

[data-theme="dark"] .brand-logo-mask {
  background: #ffffff !important;

}

[data-theme="light"] .brand-logo-mask {
  background: #000000 !important;

}

.brand-name {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.01em;
}

.sidebar-section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 600;
  color: var(--text2);
  letter-spacing: 0.12em;
  padding: 0 0.75rem;
  margin-bottom: 0.5rem;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  text-decoration: none;
  color: var(--text2);
  font-size: 13.5px;
  font-weight: 500;
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  cursor: pointer;
  position: relative;
}

.nav-item:hover {
  background: var(--bg3);
  color: var(--text);
  transform: translateX(3px);
}

.nav-item.active {
  background: var(--grad-acc);
  color: white;
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.45), 0 0 0 1px rgba(139, 92, 246, 0.3);
}

.nav-item.active::before {
  display: none;
}

.nav-icon {
  width: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-bottom {
  margin-top: auto;
}

.theme-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.4rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 50px;
  color: var(--text2);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.theme-icon-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--grad-acc);
  color: white;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
  flex-shrink: 0;
  font-size: 14px;
}

.sidebar.collapsed .theme-btn {
  padding: 0.5rem;
  border-radius: 14px;
  background: var(--bg2);
}

.sidebar.collapsed .theme-icon-container {
  width: 38px;
  height: 38px;
  font-size: 16px;
}

.main-wrap {
  margin-left: 264px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 1.5rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  margin: 12px 12px 0 0;
  position: sticky;
  top: 12px;
  z-index: 40;
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);

  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(139, 92, 246, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.topbar-greeting {
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.greeting-name {
  color: var(--accent);
  font-weight: 700;
}

[data-theme="light"] .topbar {
  box-shadow: 0 4px 20px rgba(99, 60, 220, 0.1), 0 0 0 1px rgba(99, 60, 220, 0.08);
}

.topbar-left {
  display: flex;
  align-items: baseline;
  gap: 1rem;
}

.topbar-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.topbar-month {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--text2);
  letter-spacing: 0.08em;
}

.topbar-right {
  display: flex;
  gap: 0.75rem;
}

.mobile-settings-btn {
  display: none;
}

.topbar-btn {
  padding: 0.5rem 1.1rem;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 8px;
  color: var(--text2);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.topbar-btn:hover {
  color: var(--text);
  border-color: var(--accent);
}

.topbar-btn.primary {
  background: var(--grad-acc);
  border: none;
  color: white;
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.45);
}

.topbar-btn.primary:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.55);
}

.main {
  padding: 1.25rem 1.5rem 1.75rem;
  flex: 1;
  overflow-y: auto;
}

.page {
  display: none;
  animation: none;
}

.page.active {
  display: block;
  animation: pageIn 0.35s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.budget-notif {
  display: none;
  padding: 0.85rem 1.25rem;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 1.5rem;
  border: 1px solid transparent;
}

.budget-notif.show {
  display: block;
  animation: pageIn 0.3s forwards;
}

.budget-notif.warning {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.3);
  color: #f59e0b;
}

.budget-notif.danger {
  background: rgba(245, 87, 108, 0.1);
  border-color: rgba(245, 87, 108, 0.3);
  color: var(--expense);
}

.summary-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.sum-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  overflow: hidden;
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);

  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.sum-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-light);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.sum-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  opacity: 0.8;
}

.card-total::before {
  background: var(--grad4);
}

.card-spent::before {
  background: var(--grad2);
}

.card-remaining::before {
  background: var(--grad3);
}

/* --- ATM Card Style for Tabungan --- */
.card-saving {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%) !important;
  color: #f1f5f9;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="light"] .card-saving {
  background: linear-gradient(135deg, #334155 0%, #0f172a 100%) !important;
  color: #ffffff;
  box-shadow: 0 12px 35px rgba(15, 23, 42, 0.2) !important;
}

.card-saving::before {
  display: none;
  /* Hide the top color bar for ATM card */
}

/* The ATM Chip */
.card-saving::after {
  content: '';
  position: absolute;
  top: 1.15rem;
  right: 1.15rem;
  width: 38px;
  height: 28px;
  background: linear-gradient(135deg, #fcd34d 0%, #d97706 100%);
  border-radius: 6px;
  opacity: 0.9;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.2) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.2) 1px, transparent 1px);
  background-size: 12px 10px;
  background-position: center;
  box-shadow: inset 0 1px 3px rgba(255, 255, 255, 0.5), 0 2px 5px rgba(0, 0, 0, 0.2);
  z-index: 10;
}

/* Hide the standard SVG icon on ATM card to make room for chip */
.card-saving .sum-card-icon {
  display: none;
}

.card-saving .sum-card-label {
  color: #94a3b8;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.card-saving .sum-card-val {
  font-family: 'DM Mono', monospace;
  font-size: 1.35rem;
  letter-spacing: 0.05em;
  color: #f8fafc;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.5);
  /* Embossed look */
  margin-top: 0.5rem;
}

/* Adjust colors for inner text inside ATM card */
.card-saving .sum-card-sub,
.card-saving .saving-color {
  color: #cbd5e1 !important;
}

/* REMOVED OLD HOVER */
.sum-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.sum-card-label {
  font-size: 12px;
  color: var(--text2);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.sum-card-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.income-icon {
  background: linear-gradient(135deg, rgba(67, 233, 123, 0.2), rgba(56, 249, 215, 0.2));
  color: #43e97b;
}

.spent-icon {
  background: linear-gradient(135deg, rgba(240, 147, 251, 0.2), rgba(245, 87, 108, 0.2));
  color: #f5576c;
}

.rem-icon {
  background: linear-gradient(135deg, rgba(79, 172, 254, 0.2), rgba(0, 242, 254, 0.2));
  color: #4facfe;
}

.save-icon {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.2), rgba(118, 75, 162, 0.2));
  color: #a78bfa;
}

.income-input-row {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.currency-sym {
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  color: var(--text2);
}

.income-big {
  background: none;
  border: none;
  outline: none;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  width: 100%;
  letter-spacing: -0.02em;
}

.income-big::placeholder {
  color: var(--text3);
}

.sum-card-val {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
}

.sum-card-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.sum-card-sub {
  font-size: 12px;
  color: var(--text2);
}

.income-color {
  color: var(--income) !important;
}

.expense-color {
  color: var(--expense) !important;
}

.saving-color {
  color: var(--saving) !important;
}

.accent-color {
  color: var(--accent) !important;
}

.period-sel {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.25rem 0.5rem;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--text2);
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
}

.period-sel:focus {
  border-color: var(--accent);
}

.extra-badge {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--text2);
}

.extra-badge span {
  color: var(--income);
}

.charts-row {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.chart-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);

  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.chart-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.chart-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.chart-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.see-all {
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.2s;
}

.see-all:hover {
  opacity: 0.7;
}

.bar-chart-wrap {
  display: flex;
  flex-direction: column;
  position: relative;
}

.line-chart-labels {
  display: flex;
  justify-content: space-between;
  padding: 0 2px;
  margin-top: 6px;
}

.week-label {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: var(--text2);
}

.line-chart-legend {
  display: flex;
  gap: 1rem;
  margin-top: 0.75rem;
}

.line-chart-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--text2);
}

.line-chart-legend-line {
  display: inline-block;
  width: 20px;
  height: 2px;
  border-radius: 2px;
}

.donut-wrap {
  position: relative;
  width: 160px;
  height: 160px;
  margin: 0 auto 1rem;
}

#donut-chart {
  width: 160px;
  height: 160px;
}

.donut-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}

.donut-pct {
  font-family: 'DM Mono', monospace;
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--text);
}

.donut-sub {
  font-size: 10px;
  color: var(--text2);
}

.donut-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 11px;
  color: var(--text2);
  font-family: 'DM Mono', monospace;
}

.legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.bottom-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.breakdown-card,
.recent-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);

  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.breakdown-card:hover,
.recent-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}


.breakdown-item {
  margin-bottom: 1rem;
}

.breakdown-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}

.breakdown-name {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 13px;
  color: var(--text);
}

.breakdown-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.breakdown-right {
  text-align: right;
}

.breakdown-amt {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--text);
}

.breakdown-pct-label {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: var(--text2);
}

.breakdown-track {
  height: 5px;
  background: var(--bg4);
  border-radius: 99px;
  overflow: hidden;
}

.breakdown-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.recent-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.recent-item:last-child {
  border-bottom: none;
}

.recent-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.recent-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.recent-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.recent-cat {
  font-size: 11px;
  color: var(--text2);
  margin-top: 1px;
}

.recent-amount {
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  font-weight: 500;
}

.trx-filter-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.filter-btn {
  padding: 0.45rem 1rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text2);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.filter-btn.active {
  background: var(--glow1);
  border-color: var(--accent);
  color: var(--accent);
}

.trx-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.trx-group-date {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--text2);
  letter-spacing: 0.1em;
  padding: 0.5rem 0 0.4rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.25rem;
  display: flex;
  justify-content: space-between;
}

.trx-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.25rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);

}

.trx-item:hover {
  border-color: var(--border-light);
  transform: translateX(4px) scale(1.01);
  background: var(--bg3);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.trx-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.trx-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

.trx-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.trx-meta {
  font-size: 11px;
  color: var(--text2);
  margin-top: 1px;
}

.trx-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.trx-amount {
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  font-weight: 500;
}

.trx-delete {
  background: none;
  border: none;
  color: var(--text3);
  cursor: pointer;
  font-size: 16px;
  padding: 2px 6px;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
  line-height: 1;
}

.trx-delete:hover {
  color: var(--expense);
  background: rgba(245, 87, 108, 0.1);
}

.page-actions {
  margin-bottom: 1.25rem;
}

.add-btn {
  padding: 0.5rem 1.1rem;
  background: var(--grad-acc);
  border: none;
  border-radius: 8px;
  color: white;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
  transition: opacity 0.2s, transform 0.15s;
}

.add-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.budget-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.budget-item {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  transition: border-color 0.2s;
  position: relative;
  overflow: hidden;
}

.budget-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
}

.budget-item:hover {
  border-color: var(--border2);
}

.budget-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.budget-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.budget-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.budget-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.budget-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.budget-amounts {
  text-align: right;
}

.budget-spent {
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  color: var(--text);
}

.budget-alloc {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--text2);
}

.budget-delete {
  background: none;
  border: none;
  color: var(--text3);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 6px;
  transition: color 0.2s;
}

.budget-delete:hover {
  color: var(--expense);
}

.budget-bar-track {
  height: 5px;
  background: var(--bg4);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 0.85rem;
}

.budget-bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.budget-input-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.budget-input-label {
  font-size: 11px;
  color: var(--text2);
  font-family: 'DM Mono', monospace;
}

.budget-input {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.4rem 0.75rem;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--text);
  width: 150px;
  outline: none;
  transition: border-color 0.2s;
}

.budget-input:focus {
  border-color: var(--accent);
}

.budget-item-saving {
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.04), var(--bg2));
}

.saving-badge {
  font-size: 10px;
  font-family: 'DM Mono', monospace;
  color: var(--accent);
  background: rgba(167, 139, 250, 0.12);
  border: 1px solid rgba(167, 139, 250, 0.2);
  border-radius: 6px;
  padding: 2px 7px;
  margin-left: 4px;
}

.saving-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  margin-left: auto;
}

.saving-toggle-label {
  font-size: 11px;
  color: var(--text2);
  font-family: 'DM Mono', monospace;
  -webkit-user-select: none;
  user-select: none;
}

.saving-toggle {
  accent-color: var(--accent);
  width: 13px;
  height: 13px;
  cursor: pointer;
}

.saving-interest-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(167, 139, 250, 0.06);
  border: 1px solid rgba(167, 139, 250, 0.12);
  border-radius: 8px;
  margin-top: 0.5rem;
}

.saving-interest-info {
  display: flex;
  align-items: center;
  gap: 6px;
}

.saving-interest-label {
  font-size: 11px;
  color: var(--text2);
  font-family: 'DM Mono', monospace;
}

.saving-interest-input {
  width: 80px !important;
  text-align: right;
}

.saving-interest-unit {
  font-size: 11px;
  color: var(--text2);
  font-family: 'DM Mono', monospace;
}

.saving-interest-earned {
  display: flex;
  align-items: center;
  gap: 6px;
}

.saving-interest-earned-label {
  font-size: 11px;
  color: var(--text2);
  font-family: 'DM Mono', monospace;
}

.saving-interest-earned-val {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  font-weight: 600;
}

.cat-saving-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px !important;
  color: var(--text) !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  font-weight: 500 !important;
  margin-top: 4px;
}

.cat-saving-label input[type="checkbox"] {
  accent-color: var(--accent);
  width: 15px;
  height: 15px;
  cursor: pointer;
  flex-shrink: 0;
}

.cal-header-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.cal-arrow {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text2);
  width: 34px;
  height: 34px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cal-arrow:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.cal-month-label {
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  color: var(--text);
  min-width: 140px;
}

.calendar-wrap {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.cal-grid-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 0.75rem;
}

.cal-grid-header span {
  text-align: center;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--text2);
  padding: 0.4rem 0;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  cursor: pointer;
  position: relative;
  padding: 4px;
  transition: transform 0.15s cubic-bezier(0.22, 1, 0.36, 1), background 0.15s, box-shadow 0.15s;
  transform-style: preserve-3d;
  will-change: transform;
}

.cal-day:not(.empty):hover {
  transform: perspective(300px) rotateX(-6deg) rotateY(4deg) translateY(-3px) scale(1.06);
  background: var(--bg3);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  z-index: 5;
}

.cal-day.empty {
  cursor: default;
  pointer-events: none;
}

.cal-day.today .cal-day-num {
  background: var(--grad-acc);
  color: white;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cal-day.selected {
  background: var(--glow1);
  border: 1px solid rgba(167, 139, 250, 0.2);
}

.cal-day-num {
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  color: var(--text);
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cal-day.other-month .cal-day-num {
  color: var(--text3);
}

.cal-dot-wrap {
  display: flex;
  gap: 2px;
  margin-top: 2px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 24px;
}

.cal-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
}

.cal-tooltip {
  position: fixed;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 10px;
  padding: 0.7rem 1rem;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--text);
  pointer-events: none;
  z-index: 999;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.15s, transform 0.15s;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  min-width: 150px;
}

.cal-tooltip.show {
  opacity: 1;
  transform: translateY(0);
}

.tooltip-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 3px;
}

.tooltip-in {
  color: var(--income);
}

.tooltip-out {
  color: var(--expense);
}

.cal-detail {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
  min-height: 100px;
}

.cal-detail-empty {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--text2);
  text-align: center;
  padding: 1.5rem 0;
}

.cal-detail-date {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 1rem;
}

.cal-detail-totals {
  display: flex;
  gap: 1.5rem;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.settings-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.setting-item {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.setting-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.setting-desc {
  font-size: 12px;
  color: var(--text2);
}

.danger-btn {
  padding: 0.5rem 1.1rem;
  background: rgba(245, 87, 108, 0.1);
  color: var(--expense);
  border: 1px solid var(--expense);
  border-radius: 8px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s;
}

.danger-btn:hover {
  background: rgba(245, 87, 108, 0.2);
}

.outline-btn {
  padding: 0.5rem 1.1rem;
  background: none;
  color: var(--text);
  border: 1px solid var(--border2);
  border-radius: 8px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.2s;
}

.outline-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 1.5rem;
  transition: background 0.25s;
  pointer-events: none;
}

.modal.visible {
  background: rgba(0, 0, 0, 0.65);
  pointer-events: all;
}

.modal.hidden {
  display: none;
}

.modal-box {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 16px;
  width: 100%;
  max-width: 400px;
  overflow: hidden;
  transform: translateY(20px);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s;
}

.modal.visible .modal-box {
  transform: translateY(0);
  opacity: 1;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text2);
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}

.modal-close:hover {
  color: var(--text);
}

.modal-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.modal-body label {
  font-size: 11px;
  color: var(--text2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
}

.modal-body input,
.modal-body select {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}

.modal-body input:focus,
.modal-body select:focus {
  border-color: var(--accent);
}

.modal-body select option {
  background: var(--bg2);
}

.color-options {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.color-opt {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.15s, border-color 0.15s;
}

.color-opt:hover {
  transform: scale(1.15);
}

.color-opt.selected {
  border-color: var(--text);
  transform: scale(1.15);
}

.modal-save {
  margin: 0 1.5rem 1.5rem;
  padding: 0.85rem;
  background: var(--grad-acc);
  color: white;
  border: none;
  border-radius: 10px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
  transition: opacity 0.2s, transform 0.15s;
}

.modal-save:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.confirm-box {
  max-width: 340px !important;
}

.confirm-btn-no {
  flex: 1;
  padding: 0.75rem;
  background: none;
  border: 1px solid var(--border2);
  border-radius: 8px;
  color: var(--text2);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.confirm-btn-no:hover {
  color: var(--text);
  border-color: var(--text2);
}

.confirm-btn-yes {
  flex: 1;
  padding: 0.75rem;
  background: rgba(245, 87, 108, 0.15);
  border: 1px solid var(--expense);
  border-radius: 8px;
  color: var(--expense);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.confirm-btn-yes:hover {
  background: rgba(245, 87, 108, 0.25);
}

.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text2);
  font-size: 13px;
  font-family: 'DM Mono', monospace;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes trxHighlight {
  0% {
    background: rgba(167, 139, 250, 0.18);
    box-shadow: 0 0 0 1.5px rgba(167, 139, 250, 0.5);
  }

  70% {
    background: rgba(167, 139, 250, 0.08);
    box-shadow: 0 0 0 1px rgba(167, 139, 250, 0.2);
  }

  100% {
    background: transparent;
    box-shadow: none;
  }
}

.trx-item.trx-new {
  animation: trxHighlight 1.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.insights-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
  min-height: 0;
}

.insight-card {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 1rem;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 500;
  flex: 1;
  min-width: 220px;
  animation: fadeInUp 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
  border: 1px solid transparent;
}

.insight-icon {
  font-size: 15px;
  flex-shrink: 0;
}

.insight-text {
  line-height: 1.4;
}

.insight-danger {
  background: rgba(245, 87, 108, 0.1);
  border-color: rgba(245, 87, 108, 0.25);
  color: #f5576c;
}

.insight-warning {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.25);
  color: #f59e0b;
}

.insight-info {
  background: rgba(79, 172, 254, 0.1);
  border-color: rgba(79, 172, 254, 0.25);
  color: #4facfe;
}

.insight-success {
  background: rgba(67, 233, 123, 0.1);
  border-color: rgba(67, 233, 123, 0.25);
  color: #43e97b;
}

.time-filter-tabs {
  display: flex;
  gap: 2px;
  background: var(--bg3);
  border-radius: 8px;
  padding: 3px;
}

.time-tab {
  background: none;
  border: none;
  border-radius: 6px;
  padding: 0.3rem 0.7rem;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: var(--text2);
  cursor: pointer;
  transition: all 0.2s;
}

.time-tab:hover {
  color: var(--text);
}

.time-tab.active {
  background: var(--bg2);
  color: var(--accent);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.trx-search-row {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  align-items: center;
}

.search-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.6rem 1rem;
  transition: border-color 0.2s;
}

.search-wrap:focus-within {
  border-color: var(--accent);
}

.search-wrap svg {
  color: var(--text2);
  flex-shrink: 0;
}

.search-wrap input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  color: var(--text);
}

.search-wrap input::placeholder {
  color: var(--text2);
}

.search-clear {
  background: none;
  border: none;
  color: var(--text2);
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  transition: color 0.2s;
}

.search-clear:hover {
  color: var(--text);
}

.search-clear.hidden {
  display: none;
}

.cat-filter-sel {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.6rem 0.85rem;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  color: var(--text);
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
}

.cat-filter-sel:focus {
  border-color: var(--accent);
}

.cat-filter-sel option {
  background: var(--bg2);
}

.empty-state-full {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3.5rem 2rem;
  text-align: center;
  gap: 0.5rem;
  animation: fadeInUp 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.empty-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  opacity: 0.7;
}

.empty-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.empty-sub {
  font-size: 12px;
  color: var(--text2);
  max-width: 220px;
  line-height: 1.5;
}

.empty-cta {
  margin-top: 1rem;
  padding: 0.6rem 1.4rem;
  background: var(--grad-acc);
  color: white;
  border: none;
  border-radius: 8px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
  transition: opacity 0.2s, transform 0.15s;
}

.empty-cta:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.mobile-nav {
  display: none;
  position: fixed;
  bottom: 12px;
  left: 12px;
  right: 12px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 24px;
  z-index: 200;
  padding: 0.5rem 0.6rem;
  gap: 4px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22), 0 2px 8px rgba(0, 0, 0, 0.12);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  align-items: center;
}

[data-theme="light"] .mobile-nav {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.10), 0 2px 8px rgba(0, 0, 0, 0.06);
}

.mobile-nav-item {
  flex: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0.6rem 0.5rem;
  border-radius: 16px;
  text-decoration: none;
  color: var(--text2);
  font-size: 12px;
  font-weight: 600;
  font-family: 'Plus Jakarta Sans', sans-serif;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
}

.mobile-nav-item span {
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-width 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.25s ease;
  display: inline-block;
  white-space: nowrap;
}

.mobile-nav-item.active {
  background: var(--grad-acc);
  color: white;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.4);
  flex: 2;
}

.mobile-nav-item.active span {
  max-width: 100px;
  opacity: 1;
}

.mobile-nav-item:not(.active):hover {
  color: var(--text);
  background: var(--bg3);
}

.mobile-nav-add {
  background: var(--grad-acc);
  color: white !important;
  border-radius: 16px;
  padding: 0.6rem 1rem;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.45);
  flex: 0 0 auto;
}

@media (max-width: 1024px) {
  .summary-row {
    grid-template-columns: 1fr 1fr;
  }

  .charts-row {
    grid-template-columns: 1fr;
  }

  .bottom-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-110%);
    width: 240px;
    padding: 1.25rem 0.85rem;
    box-shadow: none;
    z-index: 1000;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
  }

  .main-wrap {
    margin-left: 0;
  }

  .brand-name,
  .sidebar-section-label,
  .nav-item span:last-child,
  .theme-btn span:last-child {
    display: none;
  }

  .dashboard-widgets-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .topbar {
    padding: 1rem;
  }

  .main {
    padding: 1rem;
  }

  .summary-row {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .sidebar {
    display: none !important;
  }

  .main-wrap {
    margin-left: 0 !important;
  }

  .mobile-nav {
    display: flex;
  }

  .main {
    padding: 0.85rem 0.85rem 6.5rem;
  }

  .topbar {
    padding: 0.75rem 1rem;
    gap: 0.5rem;
  }

  .topbar-title {
    font-size: 0.95rem;
  }

  .topbar-month {
    display: none;
  }

  .mobile-settings-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 0.6rem;
  }

  .topbar-btn {
    padding: 0.45rem 0.75rem;
    font-size: 12px;
  }

  .summary-row {
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
  }

  .sum-card {
    padding: 1rem 1rem;
  }

  .sum-card-val {
    font-size: 1.15rem;
  }

  .income-big {
    font-size: 1.25rem;
  }

  .charts-row {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .bottom-row {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .chart-card {
    padding: 1rem;
  }

  .breakdown-card,
  .recent-card {
    padding: 1rem;
  }

  .trx-search-row {
    flex-direction: column;
    gap: 0.5rem;
  }

  .cat-filter-sel {
    width: 100%;
  }

  .trx-filter-row {
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  .filter-btn {
    font-size: 12px;
    padding: 0.4rem 0.75rem;
  }

  .trx-item {
    padding: 0.75rem 1rem;
  }

  .trx-name {
    font-size: 12px;
  }

  .insights-row {
    gap: 0.5rem;
  }

  .insight-card {
    min-width: 100%;
    font-size: 12px;
  }

  .setting-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .budget-input-row {
    flex-wrap: wrap;
  }

  .budget-input {
    width: 100% !important;
  }

  .cal-grid {
    font-size: 11px;
  }

  .cal-day {
    padding: 0.35rem 0.2rem;
    min-height: 36px;
  }

  .modal {
    padding: 0.75rem;
    align-items: flex-end;
  }

  .modal-box {
    border-radius: 16px 16px 0 0;
    max-width: 100%;
  }
}

.sidebar {
  transition: width 0.45s cubic-bezier(0.4, 0, 0.2, 1),
    padding 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.main-wrap {
  transition: margin-left 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-wrap.sidebar-collapsed {
  margin-left: 86px;
}

.sidebar-brand {
  transition: padding 0.45s cubic-bezier(0.4, 0, 0.2, 1),
    gap 0.45s cubic-bezier(0.4, 0, 0.2, 1),
    margin 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.brand-icon {
  flex-shrink: 0;
  transition: all 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar .brand-name,
.sidebar .sidebar-section-label span,
.sidebar .nav-item span:last-child,
.sidebar .theme-btn span:last-child {
  transition: opacity 0.25s ease,
    max-width 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 1;
  max-width: 200px;
  overflow: hidden;
  white-space: nowrap;
}

.sidebar.collapsed {
  width: 68px;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.sidebar.collapsed .brand-name,
.sidebar.collapsed .sidebar-section-label span,
.sidebar.collapsed .nav-item span:last-child,
.sidebar.collapsed .theme-btn span:last-child {
  opacity: 0;
  max-width: 0;
  pointer-events: none;
}

.sidebar.collapsed .sidebar-brand {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0;
  gap: 0;
  margin-bottom: 1.5rem;
}

.sidebar.collapsed .brand-icon {
  width: 38px;
  height: 38px;
}

.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 0.7rem 0;
  gap: 0;
}

.sidebar.collapsed .nav-icon {
  width: auto;
  justify-content: center;
}

.sidebar.collapsed .theme-btn {
  justify-content: center;
  padding: 0.7rem 0;
  gap: 0;
}

.sidebar.collapsed .nav-item::before {
  left: 0;
  top: 15%;
  bottom: 15%;
}

.sidebar-toggle {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
  cursor: pointer;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.25s, color 0.25s, border-color 0.25s;
}

.sidebar-toggle:hover {
  background: var(--glow1);
  border-color: var(--accent);
  color: var(--accent);
}

.sidebar-toggle svg {
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.sidebar-toggle.is-collapsed svg {
  transform: rotate(180deg);
}

.sidebar.collapsed .sidebar-section-label {
  justify-content: center;
  padding: 0;
}

.wallet-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}


.wallet-row-3 {
  grid-template-columns: 1fr 1fr 1fr;
}

.wallet-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: border-color 0.2s, transform 0.2s;
  position: relative;
  overflow: hidden;
}

.wallet-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
}

.wallet-cash::before {
  background: linear-gradient(90deg, #43e97b, #38f9d7);
}

.wallet-digital::before {
  background: linear-gradient(90deg, #a78bfa, #7c3aed);
}

.wallet-card:hover {
  border-color: var(--border2);
  transform: translateY(-2px);
}

.wallet-card-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.wallet-icon {
  font-size: 1.5rem;
}

.wallet-label {
  font-size: 11px;
  color: var(--text2);
  font-weight: 500;
  letter-spacing: 0.02em;
  margin-bottom: 2px;
}

.wallet-val {
  font-family: 'DM Mono', monospace;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.wallet-badge {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(67, 233, 123, 0.12);
  color: #43e97b;
  border: 1px solid rgba(67, 233, 123, 0.25);
}

.wallet-badge.digital {
  background: rgba(167, 139, 250, 0.12);
  color: var(--accent);
  border-color: rgba(167, 139, 250, 0.25);
}

.wallet-badge.saving {
  background: rgba(251, 191, 36, 0.12);
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.25);
}

.wallet-saving-card::before {
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
}

@media (max-width: 600px) {
  .wallet-row {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .wallet-row-3 {
    grid-template-columns: 1fr 1fr;
  }

  .wallet-row-3 .wallet-saving-card {
    grid-column: 1 / -1;
  }

  .wallet-val {
    font-size: 0.9rem;
  }

  .wallet-label {
    font-size: 10px;
  }

  .wallet-icon {
    font-size: 1.2rem;
  }
}

.netflow-card {
  margin-bottom: 1.25rem;
}

.netflow-subtitle {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: var(--text2);
  letter-spacing: 0.05em;
}

.netflow-warning {
  margin-top: 0.75rem;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: #f59e0b;
  font-size: 12px;
  font-weight: 500;
  text-align: center;
}

.netflow-warning.hidden {
  display: none;
}

.offline-footer {
  padding: 0.6rem 2rem;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--text2);
  border-top: 1px solid var(--border);
  background: var(--bg2);
  letter-spacing: 0.03em;
}

@media (max-width: 600px) {
  .offline-footer {
    padding: 0.6rem 1rem 7rem;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.btn-spinner {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 4px;
}

.modal-save:disabled {
  opacity: 0.75;
  cursor: not-allowed;
  transform: none !important;
}

.mobile-choice-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  transition: opacity 0.2s;
}

.mobile-choice-overlay.hidden {
  display: none;
}

.mobile-choice-overlay.visible {
  opacity: 1;
}

.mobile-choice-sheet {
  width: 100%;
  background: var(--bg2);
  border-radius: 20px 20px 0 0;
  padding: 1.5rem 1.5rem calc(1.5rem + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  animation: slideUp 0.25s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }

  to {
    transform: translateY(0);
  }
}

.mobile-choice-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  margin-bottom: 0.25rem;
  letter-spacing: -0.01em;
}

.mobile-choice-btn {
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid var(--border2);
  background: var(--bg3);
  color: var(--text);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.mobile-choice-btn.income-choice {
  background: rgba(67, 233, 123, 0.1);
  border-color: rgba(67, 233, 123, 0.3);
  color: #43e97b;
}

.mobile-choice-btn.expense-choice {
  background: rgba(245, 87, 108, 0.1);
  border-color: rgba(245, 87, 108, 0.3);
  color: var(--expense);
}

.mobile-choice-btn:hover {
  opacity: 0.85;
  transform: scale(0.98);
}

.mobile-choice-cancel {
  padding: 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: none;
  color: var(--text2);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 0.25rem;
}

.mobile-choice-cancel:hover {
  color: var(--text);
  border-color: var(--border2);
}

.trx-pm-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 10px;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: 20px;
  background: var(--bg4, rgba(255, 255, 255, 0.06));
  color: var(--text2);
  margin-left: 4px;
  vertical-align: middle;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  font-family: 'DM Mono', monospace;
  letter-spacing: 0;
  white-space: nowrap;
}

[data-theme="light"] .trx-pm-badge {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.1);
  color: #666;
}

.topbar-btn.transfer-btn {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(245, 87, 108, 0.1));
  border-color: rgba(251, 191, 36, 0.35);
  color: #fbbf24;
}

.topbar-btn.transfer-btn:hover {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.25), rgba(245, 87, 108, 0.18));
  border-color: #fbbf24;
  color: #fbbf24;
}

.mobile-choice-btn.transfer-choice {
  background: rgba(251, 191, 36, 0.1);
  border-color: rgba(251, 191, 36, 0.3);
  color: #fbbf24;
}

.transfer-save-btn {
  background: linear-gradient(135deg, #fbbf24, #f59e0b) !important;
}

.transfer-info-text {
  font-size: 11px;
  color: var(--text2);
  background: rgba(251, 191, 36, 0.07);
  border: 1px solid rgba(251, 191, 36, 0.2);
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  line-height: 1.5;
  margin-top: 0.25rem;
}

[data-theme="light"] .transfer-info-text {
  background: rgba(251, 191, 36, 0.08);
  border-color: rgba(245, 158, 11, 0.25);
}

.trx-item.trx-transfer {
  border-left: 2px solid rgba(251, 191, 36, 0.4);
}

@media (max-width: 600px) {
  .topbar-btn.transfer-btn {
    display: none;
  }
}


.splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.8s;
}

.splash-screen.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.splash-logo-container {
  width: 160px;
  height: 160px;
  opacity: 0;
  transform: scale(0.7);
  animation: logo-reveal 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.splash-logo-mask {
  width: 100%;
  height: 100%;
  background: currentColor;
  -webkit-mask-image: url('logo.png');
  mask-image: url('logo.png');
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  transform: scale(2);
  filter: none !important;
  -webkit-mask-type: alpha !important;
  mask-type: alpha !important;
}

[data-theme="dark"] .splash-logo-mask {
  background: #ffffff !important;
}

[data-theme="light"] .splash-logo-mask {
  background: #000000 !important;
}

.splash-text-area {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.splash-inly {
  font-size: 6rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.04em;
  line-height: 0.8;
  opacity: 0;
  transform: translateX(-30px);
  animation: brand-reveal 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.5s forwards;
  margin-left: -5px;
}

.splash-slogan {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.05em;
  margin-top: 0.75rem;
  opacity: 0;
  transform: translateY(10px);
  animation: brand-reveal 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.7s forwards;
}

@keyframes brand-reveal {
  to {
    opacity: 1;
    transform: translate(0, 0);
  }
}

@keyframes logo-reveal {
  to {
    opacity: 1;
    transform: scale(1.1);
  }
}

@keyframes brand-slide-right {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}


body.loading .app {
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 1024px) {
  .splash-brand {
    gap: 0.6rem;
  }

  .splash-logo-container {
    width: 130px;
    height: 130px;
  }

  .splash-inly {
    font-size: 5rem;
  }

  .splash-slogan {
    font-size: 1.05rem;
    margin-top: 0.75rem;
  }
}

@media (max-width: 768px) {
  .splash-logo-container {
    width: 100px;
    height: 100px;
  }

  .splash-inly {
    font-size: 4rem;
    margin-left: -3px;
  }

  .splash-slogan {
    font-size: 0.95rem;
    margin-top: 0.5rem;
  }
}

@media (max-width: 600px) {
  .splash-brand {
    gap: 0.4rem;
  }

  .splash-logo-container {
    width: 80px;
    height: 80px;
  }

  .splash-inly {
    font-size: 3.25rem;
  }

  .splash-slogan {
    font-size: 0.8rem;
  }
}


@media (max-width: 400px) {
  .splash-logo-container {
    width: 65px;
    height: 65px;
  }

  .splash-inly {
    font-size: 2.75rem;
  }

  .splash-slogan {
    font-size: 0.7rem;
    margin-top: 0.25rem;
  }


  .summary-row {
    grid-template-columns: 1fr;
  }

  .sum-card {
    padding: 1.15rem;
  }

  .sum-card-val {
    font-size: 1.45rem;
  }

  .wallet-row {
    grid-template-columns: 1fr;
  }
}

.theme-switch-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 0.5rem;
}

.theme-switch-icon {
  display: none;
}

.theme-toggle-switch {
  position: relative;
  width: 52px;
  height: 28px;
  background: #2a2a3a;
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 99px;
  cursor: pointer;
  padding: 0;
  transition: background 0.4s ease, border-color 0.3s;
  flex-shrink: 0;
}

.theme-toggle-switch:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.theme-toggle-pill {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  line-height: 1;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.theme-toggle-pill::after {
  content: '🌙';
  font-size: 11px;
}

.theme-toggle-switch.is-light {
  background: #e8e0f0;
  border-color: rgba(124, 58, 237, 0.25);
}

.theme-toggle-switch.is-light .theme-toggle-pill {
  transform: translateX(24px);
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.25);
}

.theme-toggle-switch.is-light .theme-toggle-pill::after {
  content: '☀️';
  font-size: 11px;
}

.sidebar.collapsed .theme-switch-wrap {
  padding: 0.5rem;
}

/* NEW STYLES: DASHBOARD WIDGETS */
.dashboard-widgets-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.dash-widget {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
}

.dash-widget:hover {
  transform: translateY(-3px);
  border-color: var(--border-light);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  background: var(--bg3);
}

.widget-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.dash-widget span {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  text-align: center;
}

.widget-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--expense);
  color: white;
  font-size: 10px;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 20px;
}

/* NEW STYLES: PROFILE & DATE PICKER */
.profile-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
  padding: 2rem;
  background: var(--bg2);
  border-radius: 16px;
  border: 1px solid var(--border);
}

.profile-avatar {
  font-size: 2.5rem;
  width: 70px;
  height: 70px;
  background: var(--bg3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.profile-name-edit {
  background: transparent;
  border: 1px dashed var(--border-light);
  border-radius: 8px;
  color: var(--text);
  font-size: 1.35rem;
  font-weight: 700;
  text-align: center;
  padding: 0.5rem;
  width: 100%;
  max-width: 250px;
  outline: none;
  font-family: inherit;
}

.profile-name-edit:focus {
  border-color: var(--accent);
}

.profile-subtitle {
  color: var(--text2);
  font-size: 13px;
}

.lang-select {
  background: var(--bg3);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  outline: none;
  font-family: inherit;
  font-weight: 500;
}

.custom-date-picker {
  background: var(--bg3);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.75rem 1rem;
  border-radius: 12px;
  width: 100%;
  outline: none;
  font-family: inherit;
  font-size: 14px;
  margin-bottom: 1rem;
  cursor: pointer;
  color-scheme: dark;
}

[data-theme="light"] .custom-date-picker {
  color-scheme: light;
}

/* DEBT LIST */
.debt-item {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.debt-info p {
  color: var(--text);
  font-weight: 600;
  font-size: 1rem;
}

.debt-meta {
  font-size: 12px;
  color: var(--text2);
  margin-top: 0.25rem;
}

.debt-amount {
  font-family: 'DM Mono', monospace;
  font-size: 1.15rem;
  font-weight: 600;
}

.debt-amount.expense-color {
  color: var(--expense);
}

.debt-amount.income-color {
  color: var(--income);
}

.debt-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.debt-actions button {
  padding: 0.35rem 0.75rem;
  font-size: 12px;
}

/* ERROR MSG & SHAKE ANIMATION */
.error-msg {
  color: var(--expense);
  font-size: 11px;
  margin-top: -10px;
  margin-bottom: 10px;
  display: block;
}

.error-msg.hidden {
  display: none;
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-5px);
  }

  50% {
    transform: translateX(5px);
  }

  75% {
    transform: translateX(-5px);
  }
}

.shake {
  animation: shake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

input.error {
  border-color: var(--expense) !important;
}

/* DASHBOARD WIDGET VALS */
.dash-widget-val {
  font-family: 'DM Mono', monospace;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin-top: 4px;
}

/* ONBOARDING OVERLAY */
.onboarding-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.onboarding-overlay.hidden {
  display: none;
}

.onboarding-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 20px;
  max-width: 400px;
  width: 100%;
  padding: 2rem;
  text-align: center;
  color: var(--text);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.onboarding-step h3 {
  font-size: 1.4rem;
  margin-bottom: 1rem;
  color: var(--accent);
}

.onboarding-step p {
  font-size: 14px;
  color: var(--text2);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.onboarding-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  justify-content: center;
}

/* INTERACTIVE TOUR STYLES */
.tour-mask {
  position: absolute;
  border-radius: 12px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.8);
  pointer-events: none;
  z-index: 10001;
  transition: all 0.4s ease-in-out;
}

.tour-popover {
  position: absolute;
  background: var(--bg2);
  border: 1px solid var(--accent);
  padding: 1.5rem;
  border-radius: 16px;
  z-index: 10002;
  color: var(--text);
  width: 300px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  transition: all 0.4s ease-in-out;
}

.tour-popover h3 {
  color: var(--accent);
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
}

.tour-popover p {
  color: var(--text2);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.tour-popover .actions {
  display: flex;
  justify-content: space-between;
}

/* EXTRACTED INLINE STYLES */
.inline-widget-icon-budget {
  background: rgba(67, 233, 123, 0.2);
  color: #43e97b
}

.inline-widget-icon-target {
  background: rgba(167, 139, 250, 0.2);
  color: #a78bfa
}

.inline-widget-icon-debt {
  background: rgba(245, 87, 108, 0.2);
  color: #f5576c
}

.inline-widget-icon-report {
  background: rgba(79, 172, 254, 0.2);
  color: #4facfe
}

.inline-trx-buttons-row {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap
}

.inline-lap-summary-row {
  display: flex;
  justify-content: space-between;
  margin-top: 1rem;
}

.inline-onbrd-plus-icon {
  display: inline-flex;
  padding: 2px 8px;
  background: var(--accent);
  border-radius: 10px;
}

.inline-lap-label {
  color: var(--text2);
  font-size: 13px;
}

.inline-lap-inc-val {
  color: var(--income);
  font-size: 1.2rem;
  font-weight: bold;
}

.inline-flex-between {
  display: flex;
  justify-content: space-between;
}

.inline-mt-1 {
  margin-top: 1rem;
}

.inline-mb-1 {
  margin-bottom: 1rem;
}

.inline-confirm-msg {
  font-size: 15px;
  color: var(--text);
  text-align: center;
  line-height: 1.6
}

.inline-flex-gap-center {
  display: flex;
  align-items: center;
  gap: 0.5rem
}

.inline-mt-1-5 {
  margin-top: 1.5rem
}

.inline-lap-exp-val {
  color: var(--expense);
  font-size: 1.2rem;
  font-weight: bold;
}

.inline-page-actions-header {
  justify-content: space-between;
  align-items: center;
  display: flex;
}

.inline-hidden-input {
  display: none
}

.inline-modal-footer-pad {
  display: flex;
  gap: 0.75rem;
  padding: 0 1.5rem 1.5rem
}

.inline-p-1 {
  padding: 1rem;
}

.inline-lap-divider {
  border-color: var(--border);
  margin: 1rem 0;
}

.inline-lap-net-label {
  color: var(--text);
  font-size: 14px;
  font-weight: bold;
}

.inline-text-color {
  color: var(--text);
}

.inline-confirm-body-pad {
  padding: 1.75rem 1.5rem 1.25rem
}

.inline-lap-net-val {
  font-size: 1.4rem;
  font-weight: bold;
}


img,
svg,
canvas {
  max-width: 100%;
}

button,
input,
select {
  touch-action: manipulation;
}

input,
select,
textarea {
  font-size: 16px;
}

.topbar-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-card-header,
.page-header,
.trx-actions-row {
  flex-wrap: wrap;
  gap: 0.75rem;
}

.time-filter-tabs {
  overflow-x: auto;
  max-width: 100%;
  scrollbar-width: none;
}

.time-filter-tabs::-webkit-scrollbar {
  display: none;
}

.trx-name,
.recent-name,
.budget-name,
.debt-info p {
  overflow-wrap: anywhere;
}

.modal {
  overflow-y: auto;
  overscroll-behavior: contain;
}

.modal-box {
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
}

.debt-item {
  gap: 1rem;
}

@media (max-width: 900px) {
  .topbar {
    margin: 10px;
    top: 10px;
  }

  .main {
    padding-inline: 1rem;
  }

  .summary-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-widgets-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  body {
    background-attachment: scroll;
  }

  .topbar {
    border-radius: 14px;
    align-items: center;
  }

  .topbar-left {
    min-width: 0;
  }

  .topbar-title {
    font-size: 0.9rem;
  }

  .summary-row,
  .wallet-row,
  .dashboard-widgets-row {
    grid-template-columns: 1fr 1fr;
  }

  .sum-card,
  .wallet-card,
  .dash-widget,
  .chart-card,
  .breakdown-card,
  .recent-card {
    border-radius: 14px;
  }

  .sum-card {
    padding: 0.9rem;
  }

  .sum-card-label,
  .sum-card-sub,
  .wallet-label {
    font-size: 10px;
  }

  .wallet-card {
    padding: 0.85rem;
    align-items: flex-start;
    flex-direction: column;
    gap: 0.65rem;
  }

  .wallet-card-left {
    align-items: flex-start;
  }

  .chart-card-header {
    align-items: flex-start;
  }

  .time-filter-tabs {
    width: 100%;
  }

  .time-tab {
    flex: 1;
    min-width: max-content;
  }

  .trx-item,
  .recent-item,
  .debt-item {
    align-items: flex-start;
  }

  .trx-right {
    align-items: flex-end;
  }

  .budget-top,
  .debt-item {
    flex-direction: column;
    align-items: stretch;
  }

  .budget-right {
    width: 100%;
    justify-content: space-between;
  }

  .cal-weekdays span {
    font-size: 10px;
  }

  .cal-day {
    min-height: 44px;
  }

  .mobile-nav {
    bottom: max(10px, env(safe-area-inset-bottom));
    left: 10px;
    right: 10px;
  }

  .mobile-nav-item {
    padding-inline: 0.35rem;
  }

  .mobile-nav-add {
    padding-inline: 0.8rem;
  }
}

@media (max-width: 420px) {

  .summary-row,
  .wallet-row {
    grid-template-columns: 1fr;
  }

  .dashboard-widgets-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .main {
    padding-inline: 0.7rem;
  }

  .topbar {
    margin: 8px;
  }

  .sum-card-val,
  .wallet-val {
    font-size: 1.05rem;
  }

  .dash-widget {
    padding: 0.85rem 0.7rem;
  }

  .modal {
    padding: 0;
  }

  .modal-box {
    width: 100%;
    max-height: 92dvh;
    border-radius: 18px 18px 0 0;
  }

  .mobile-nav-item span {
    display: none;
  }

  .mobile-nav-item.active {
    flex: 1;
  }
}


/* Splash Screen handling */
body.loading {
  overflow: hidden !important;
}

/* ================================================
   RESPONSIVE FIXES & MOBILE IMPROVEMENTS
   ================================================ */

/* d-none utility */
.d-none {
  display: none !important;
}

/* Mobile Scaling Logic (Consolidated) */
@media (max-width: 768px) {
  .main {
    padding: 0.6rem 0.6rem 80px;
  }

  .dashboard-widgets-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.4rem;
  }

  .dash-widget {
    padding: 0.4rem 0.5rem;
    border-radius: 10px;
  }

  .widget-icon {
    width: 22px;
    height: 22px;
    line-height: 22px;
    font-size: 0.9rem;
  }

  .dash-widget span {
    font-size: 9px;
    white-space: nowrap;
  }

  .dash-widget-val {
    font-size: 0.75rem;
  }

  .summary-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.4rem;
  }

  .sum-card {
    padding: 0.6rem 0.5rem;
  }

  .sum-card-val {
    font-size: 0.9rem;
  }

  .income-big {
    font-size: 1.15rem;
  }

  .sum-card-label {
    font-size: 10px;
  }

  .sum-card-sub {
    font-size: 9px;
  }

  /* Charts */
  .donut-wrap {
    transform: scale(0.8);
    margin: -1rem 0;
  }

  .donut-pct {
    font-size: 1rem;
  }

  /* Pages: Transactions */
  .trx-search-row {
    flex-direction: column;
    gap: 0.5rem;
  }

  .search-wrap,
  .cat-filter-sel {
    width: 100%;
    font-size: 12px;
  }

  .inline-trx-buttons-row {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
  }

  .inline-trx-buttons-row .topbar-btn {
    padding: 0.4rem 0.2rem;
    font-size: 10px;
    white-space: nowrap;
  }

  .trx-item {
    padding: 0.5rem 0.75rem;
  }

  .trx-icon {
    width: 30px;
    height: 30px;
    font-size: 13px;
  }

  .trx-name {
    font-size: 11.5px;
  }

  .trx-right {
    gap: 0.4rem;
  }

  .trx-amount {
    font-size: 11.5px;
  }

  /* Pages: Budget */
  .budget-item {
    padding: 0.6rem 0.8rem;
  }

  .budget-name {
    font-size: 12px;
  }

  .budget-spent {
    font-size: 11px;
  }

  .budget-alloc {
    font-size: 9px;
  }

  .budget-bar-track {
    height: 3px;
  }

  /* Pages: Calendar */
  .calendar-wrap {
    padding: 0.25rem;
  }

  .cal-day {
    height: 38px;
    font-size: 11px;
  }

  .cal-grid-header {
    font-size: 10px;
  }

  /* Pages: Profile */
  .profile-header {
    padding: 0.75rem 1rem;
  }

  .profile-avatar {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
  }

  .profile-name-edit {
    font-size: 1rem;
  }

  .setting-item {
    padding: 0.5rem 0;
    gap: 0.5rem;
    flex-direction: column;
    align-items: flex-start;
  }

  .setting-label {
    font-size: 12px;
  }

  .setting-desc {
    font-size: 10px;
  }

  .lang-select {
    width: 100%;
  }

  /* Topbar */
  .topbar {
    padding: 0.5rem 0.75rem;
    border-radius: 12px;
  }

  .topbar-title {
    font-size: 0.9rem;
  }

  .topbar-month {
    font-size: 9px;
  }

  /* Navigation */
  .mobile-nav {
    height: 60px;
  }

  .mobile-nav-item span {
    font-size: 9px;
  }
}

@media (max-width: 380px) {
  .dashboard-widgets-row span {
    display: none;
  }

  .dashboard-widgets-row {
    grid-template-columns: repeat(4, 1fr);
  }

  .dash-widget {
    aspect-ratio: 1/1;
    justify-content: center;
  }

  .dash-widget-val {
    display: none;
  }
}

/* Button Refinement */
.topbar-btn,
.primary-btn,
.outline-btn,
.modal-save,
.add-btn {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  cursor: pointer;
}

.topbar-btn:hover,
.primary-btn:hover,
.add-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.topbar-btn:active,
.primary-btn:active,
.add-btn:active {
  transform: translateY(0);
}

.modal-save {
  padding: 12px !important;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  border: none;
  font-size: 1rem;
}

.modal-save:hover {
  background: var(--accent2);
  transform: translateY(-1px);
}

/* ================================================
   NAV ICON COLOR FIXES
   ================================================ */
.mobile-nav-item.active .mobile-nav-icon,
.mobile-nav-item.active svg {
  color: var(--accent);
  stroke: var(--accent);
}

/* Page laporan net value color override */
#laporan-net {
  transition: color 0.3s ease;
}

/* Sidebar laporan icon color */
.nav-item[data-page="laporan"] .nav-icon svg {
  opacity: 0.85;
}

.nav-item[data-page="laporan"].active .nav-icon svg {
  color: var(--accent);
  stroke: var(--accent);
}

/* Make debt page look better */
.debt-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  gap: 1rem;
}

.debt-info {
  flex: 1;
  min-width: 0;
}

.debt-info p {
  font-weight: 600;
  color: var(--text);
  margin: 0 0 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.debt-meta {
  font-size: 12px;
  color: var(--text2);
}

.debt-amount {
  font-family: 'DM Mono', monospace;
  font-size: 1rem;
  font-weight: 700;
  white-space: nowrap;
  text-align: right;
}

.debt-actions {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.4rem;
  justify-content: flex-end;
}

.debt-actions button {
  padding: 0.25rem 0.6rem;
  font-size: 11px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
}

.debt-actions button:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.debt-actions .danger-btn {
  border-color: var(--expense);
  color: var(--expense);
}

.debt-actions .danger-btn:hover {
  background: var(--expense);
  color: #fff;
}

/* Laporan page improvements */
#page-laporan .chart-card {
  margin-top: 1rem;
}

#page-laporan .lap-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

@media (max-width: 480px) {
  #page-laporan .lap-grid {
    grid-template-columns: 1fr;
  }
}

#page-laporan .lap-stat {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.25rem;
}

#page-laporan .lap-stat label {
  font-size: 12px;
  color: var(--text2);
  display: block;
  margin-bottom: 4px;
}

#page-laporan .lap-stat .val {
  font-family: 'DM Mono', monospace;
  font-size: 1.2rem;
  font-weight: 700;
}

/* Responsive page utang summary */
.utang-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 480px) {
  .utang-summary-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }
}

.utang-summary-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.25rem;
}

.utang-summary-card .label {
  font-size: 12px;
  color: var(--text2);
  margin-bottom: 4px;
}

.utang-summary-card .val {
  font-family: 'DM Mono', monospace;
  font-size: 1.1rem;
  font-weight: 700;
}

/* ================================================
   PAGE TITLE & PAGE-ACTIONS STYLES
   ================================================ */
.page-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.page-actions-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

/* Lap grid 2-col layout */
.lap-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

@media (max-width: 480px) {
  .lap-grid {
    grid-template-columns: 1fr;
  }
}

.lap-stat {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.25rem;
}

.lap-stat label {
  font-size: 12px;
  color: var(--text2);
  display: block;
  margin-bottom: 4px;
}

.lap-stat .val {
  font-family: "DM Mono", monospace;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

/* Helper classes for Laporan page */
.lap-mt-1 {
  margin-top: 1rem;
}

.lap-col-span-all {
  grid-column: 1 / -1;
}

.lap-text-xl {
  font-size: 1.5rem;
}

/* ================================================
   AUTH PAGE STYLES
   ================================================ */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  width: 100vw;
  background: var(--bg-mesh, var(--bg));
  padding: 1rem;
  z-index: 10000;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 2.5rem 2.5rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
  justify-content: flex-start;
}

.auth-brand .brand-icon {
  width: 44px;
  height: 44px;
}

.auth-brand .brand-name {
  font-size: 1.5rem;
}

.auth-title {
  font-size: 1.7rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text);
  letter-spacing: -0.02em;
}

.auth-subtitle {
  font-size: 0.95rem;
  color: var(--text2);
  margin-bottom: 2rem;
}

.input-group {
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  position: relative;
}

.input-group.hidden {
  display: none;
}

.input-group label {
  font-size: 0.85rem;
  color: var(--text2);
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.input-group input {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.95rem 1.1rem;
  border-radius: 12px;
  outline: none;
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.2s;
}

.input-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.auth-btn {
  width: 100%;
  padding: 1rem;
  border-radius: 12px;
  font-size: 1.05rem;
  font-weight: 600;
  margin-top: 0.5rem;
  margin-bottom: 1.5rem;
  border: none;
}

.auth-switch {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text2);
}

.auth-switch a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  margin-left: 0.35rem;
}

.auth-switch a:hover {
  text-decoration: underline;
}

@media (max-width: 480px) {
  .auth-card {
    padding: 2rem 1.5rem;
  }
}