/* CSS Variables for Premium Realbyte Dark Theme Design System */
:root {
  --bg-main: #181b22;
  --bg-card: #222731;
  --bg-input: #2b313d;
  --text-main: #e3e8f0;
  --text-secondary: #8a99ad;
  --text-muted: #64748b;
  
  /* Brand Accents */
  --accent: #e05e55; /* Realbyte Coral Red */
  --accent-light: rgba(224, 94, 85, 0.15);
  --blue-positive: #4f93e3; /* Positive Income / Assets */
  --blue-positive-light: rgba(79, 147, 227, 0.1);
  --red-negative: #e05e55; /* Negative Expenses / Liabilities */
  --red-negative-light: rgba(224, 94, 85, 0.1);
  --border: #2e3543;
  --border-light: #384152;
  
  --font-family: 'Outfit', 'Inter', system-ui, -apple-system, sans-serif;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.4);
}

/* Reset and Global Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  /* Hide scrollbar for IE, Edge and Firefox */
  -ms-overflow-style: none;
  scrollbar-width: none;
}

html, body {
  width: 100%;
  max-width: 100%;
  height: 100%;
  overflow: hidden;
  touch-action: manipulation;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 14px;
  line-height: 1.5;
  height: 100%;
  display: flex;
  flex-direction: column;
  -webkit-overflow-scrolling: touch;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
}

button {
  cursor: pointer;
}

/* Premium Tactile Tap Animations & Scale Feedback */
button, 
.nav-item, 
.transaction-item, 
.calc-key-btn, 
.fab,
.settings-card,
.settings-list-item,
.stats-tab-btn,
.stats-dropdown-item {
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease !important;
}

button:active, 
.nav-item:active, 
.transaction-item:active, 
.calc-key-btn:active, 
.fab:active,
.settings-card:active,
.settings-list-item:active,
.stats-tab-btn:active,
.stats-dropdown-item:active {
  transform: scale(0.94) !important;
  opacity: 0.85 !important;
  transition: transform 0.05s ease-out !important;
}

/* Material-style Ripple Effect */
.ripple-effect {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  transform: scale(0);
  opacity: 0.8;
  pointer-events: none;
  transition: transform 0.45s cubic-bezier(0.1, 0.8, 0.3, 1), opacity 0.45s ease-out;
}

.ripple-effect.active {
  transform: scale(2.2);
  opacity: 0;
}


/* Hide scrollbars globally for a premium native app appearance */
::-webkit-scrollbar {
  display: none;
}

/* Screen Wrapper Layouts */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  max-width: 480px; /* Force phone aspect ratio on desktop */
  margin: 0 auto;
  background-color: var(--bg-main);
  box-shadow: 0 0 30px rgba(0,0,0,0.5);
  position: relative;
  overflow-x: hidden;
}

/* Top App Bar Header */
.app-header {
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.app-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-actions {
  display: flex;
  gap: 16px;
}

.icon-btn {
  font-size: 18px;
  color: var(--text-secondary);
  transition: var(--transition);
  padding: 4px;
}

.icon-btn:hover {
  color: var(--accent);
}

/* App Main Content Area */
.app-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  width: 100%;
  min-width: 0;
  padding-bottom: 70px; /* Space for bottom nav */
}

/* Bottom Navigation Bar Styles */
.bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--bg-card);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  padding: 8px 0 10px 0;
  z-index: 100;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 11px;
  font-weight: 500;
  flex: 1;
  transition: var(--transition);
  gap: 4px;
}

.nav-item svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  transition: var(--transition);
}

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

.nav-item.active svg {
  fill: var(--accent);
}

/* Tab Screens Display Switcher */
.tab-screen {
  display: none;
  animation: fadeIn 0.25s ease-out;
  width: 100%;
}

.tab-screen.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* TRANSACTIONS SCREEN STYLES */
#trans-screen .stats-header-bar {
  position: sticky;
  top: 0;
  z-index: 90;
  background-color: var(--bg-card);
}

#trans-screen .summary-bar {
  position: sticky;
  top: 45px;
  z-index: 89;
  background-color: var(--bg-card);
}

.summary-bar {
  background-color: var(--bg-main);
  border-bottom: 1px solid var(--border);
  padding: 10px 8px;
  display: flex;
  gap: 6px;
}

.summary-item {
  background: linear-gradient(145deg, var(--bg-card), rgba(255,255,255,0.03));
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 11px 4px 10px;
  text-align: center;
  flex: 1;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.05);
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.summary-item:active {
  transform: scale(0.96) !important;
}

.summary-item div:first-child {
  font-size: 10px;
  color: var(--text-secondary);
  margin-bottom: 5px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.summary-income,
.summary-expense,
.summary-total {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.5px;
  display: block;
  line-height: 1.1;
}

.summary-income { color: #4ade80; text-shadow: 0 0 10px rgba(74,222,128,0.3); }
.summary-expense { color: #f87171; text-shadow: 0 0 10px rgba(248,113,113,0.3); }
.summary-total { color: var(--text-main); }

/* Day Group Box */
.day-group {
  margin-bottom: 0;
}

.day-header {
  background-color: #1b1f28;
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-light);
  font-size: 12.5px;
  font-weight: 600;
}

.day-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.day-num {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1;
}

.day-name {
  color: white;
  background: #373e4f;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 700;
}

.day-name.saturday {
  background-color: #2b7de9;
}

.day-name.sunday {
  background-color: #e05e55;
}

.day-month {
  color: var(--text-secondary);
  font-size: 12.5px;
}

.day-header-right {
  display: flex;
  gap: 12px;
  font-size: 13.5px;
  font-weight: 700;
}

.day-group-income { color: var(--blue-positive); }
.day-group-expense { color: var(--red-negative); }

/* Transaction List Item */
.transaction-item {
  background-color: var(--bg-card);
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
  min-height: 48px;
}

.transaction-item:hover {
  background-color: var(--border);
}

.trans-left {
  display: flex;
  align-items: center;
  flex: 1;
  overflow: hidden;
  min-width: 0;
}

.trans-category-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 78px;
  min-width: 78px;
  margin-right: 12px;
  text-align: center;
  gap: 3px;
}

.trans-cat-icon {
  font-size: 21px;
  line-height: 1.1;
  font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', 'Twemoji Mozilla', sans-serif;
  font-variant-emoji: emoji;
  -webkit-text-size-adjust: none;
  display: block;
}

.trans-cat-name {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: 0.2px;
  line-height: 1.2;
}

.trans-sub-name {
  font-size: 10.5px;
  color: var(--text-muted);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.2;
}

/* Middle column: transaction title + account */
.trans-details {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
  overflow: hidden;
  min-width: 0;
  padding-right: 8px;
}

.trans-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
}

.trans-acc-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 400;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

/* Right column: amount */
.trans-amount {
  font-size: 15px;
  font-weight: 700;
  text-align: right;
  min-width: 72px;
  white-space: nowrap;
  flex-shrink: 0;
}

.trans-amount.expense  { color: var(--red-negative); }
.trans-amount.income   { color: var(--blue-positive); }
.trans-amount.transfer { color: var(--text-secondary); }

/* Float Action Button (FAB) */
.fab {
  position: absolute;
  bottom: 66px;
  right: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(224, 94, 85, 0.4);
  font-size: 24px;
  z-index: 99;
  transition: var(--transition);
}

.fab:hover {
  transform: translateY(-2px) scale(1.05);
}

/* STATS SCREEN STYLES */
.stats-header-bar {
  background-color: var(--bg-card);
  padding: 12px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.month-selector {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 16px;
  font-weight: 700;
}

.stats-tabs {
  display: flex;
  background-color: var(--bg-main);
  border-radius: 6px;
  padding: 3px;
}

.stats-tab-btn {
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 4px;
  color: var(--text-secondary);
  transition: var(--transition);
}

.stats-tab-btn.active {
  background-color: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-light);
}

/* STICKY for stats screen */
#stats-screen .stats-header-bar {
  position: sticky;
  top: 0;
  z-index: 90;
  background-color: var(--bg-card);
}

#stats-screen .stats-subheader-bar {
  position: sticky;
  top: 47px;
  z-index: 89;
  background-color: var(--bg-card);
}

.stats-tabs {
  display: flex;
  width: 100%;
  background-color: var(--bg-main);
  border-bottom: 2px solid var(--border);
}

.stats-tab-btn {
  flex: 1;
  padding: 10px 8px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 0;
  color: var(--text-secondary);
  transition: var(--transition);
  text-align: center;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.stats-tab-btn.active {
  background-color: transparent;
  color: var(--text-main);
  border-bottom: 2px solid var(--accent);
}

.stats-tab-label {
  font-size: 16.5px;
  font-weight: 700;
  line-height: 1.2;
}

.stats-tab-amt {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
}

.stats-tab-amt.expense-amt { color: var(--red-negative); }
.stats-tab-amt.income-amt  { color: #4ade80; text-shadow: 0 0 10px rgba(74,222,128,0.25); }

.stats-subheader-bar {
  background-color: var(--bg-card);
  display: flex;
  justify-content: stretch;
  border-bottom: 1px solid var(--border);
  padding: 0;
}

.stats-period-btn {
  background-color: var(--bg-main);
  color: var(--text-main);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition);
}

.stats-period-btn:hover {
  background-color: var(--border);
}

.stats-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  min-width: 110px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  z-index: 200;
  display: none;
  overflow: hidden;
}

.stats-dropdown-menu.active {
  display: block;
}

.stats-dropdown-item {
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  font-weight: 500;
  text-align: left;
}

.stats-dropdown-item:hover {
  background-color: var(--bg-main);
  color: var(--text-main);
}

.stats-dropdown-item.active {
  color: var(--accent);
  font-weight: 700;
  background-color: var(--bg-main);
}

.chart-container {
  padding: 16px 20px 20px;
  background: linear-gradient(180deg, rgba(30,36,48,0.98) 0%, var(--bg-card) 100%);
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.chart-container::before {
  content: '';
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99,102,241,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.chart-wrapper {
  position: relative;
  width: 100%;
  max-width: 260px;
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-wrapper canvas {
  filter: drop-shadow(0px 0px 18px rgba(99,102,241,0.25)) drop-shadow(0px 4px 16px rgba(0,0,0,0.4));
}

.chart-center-val {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: centerPulse 3s ease-in-out infinite;
}

@keyframes centerPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.85; }
}

.chart-center-title {
  font-size: 10px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 700;
  margin-bottom: 3px;
}

.chart-center-amount {
  font-size: 22px;
  font-weight: 900;
  color: var(--text-main);
  letter-spacing: -1px;
  text-shadow: 0 0 20px rgba(255,255,255,0.15);
}

/* Income vs Expense Ratio Bar */
.chart-ratio-bar-wrapper {
  width: 100%;
  max-width: 260px;
  margin-top: 12px;
  padding: 0 4px;
}

.chart-ratio-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 700;
}

.ratio-income-label {
  color: #4ade80;
  display: flex;
  align-items: center;
  gap: 4px;
}

.ratio-expense-label {
  color: #f87171;
  display: flex;
  align-items: center;
  gap: 4px;
}

.chart-ratio-track {
  height: 6px;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  background: var(--border);
}

.chart-ratio-fill-income {
  height: 100%;
  background: linear-gradient(90deg, #22c55e, #4ade80);
  box-shadow: 0 0 8px rgba(74,222,128,0.5);
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 6px 0 0 6px;
}

.chart-ratio-fill-expense {
  height: 100%;
  background: linear-gradient(90deg, #f87171, #ef4444);
  box-shadow: 0 0 8px rgba(248,113,113,0.5);
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 0 6px 6px 0;
}

/* Stats breakdown list rows - sized to match prototype */
.stats-list {
  background-color: var(--bg-card);
}

.stats-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  min-height: 44px;
}

.stats-row-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

/* Colored square block (percentage badge) - MATCHES PROTOTYPE */
.stats-pct-badge {
  background-color: var(--accent);
  color: white;
  font-size: 12.5px;
  font-weight: 800;
  padding: 4px 6px;
  border-radius: 5px;
  min-width: 36px;
  text-align: center;
  line-height: 1.2;
}

.stats-pct-badge.income {
  background-color: var(--blue-positive);
}

.stats-cat-icon {
  font-size: 17px;
  line-height: 1;
  font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', 'Twemoji Mozilla', sans-serif;
  font-variant-emoji: emoji;
  -webkit-text-size-adjust: none;
  display: inline-block;
}


.stats-category-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
  flex: 1;
}

.stats-row-right {
  font-weight: 700;
  font-size: 15px;
  color: var(--text-main);
  white-space: nowrap;
}

/* ACCOUNTS SCREEN STYLES */
.accounts-overview-card {
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 16px;
  margin-bottom: 8px;
}

.overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  text-align: center;
  margin-bottom: 16px;
}

.overview-val {
  font-size: 15px;
  font-weight: 700;
  margin-top: 4px;
}

.overview-val.positive { color: var(--blue-positive); }
.overview-val.negative { color: var(--red-negative); }

.account-section-title {
  padding: 10px 16px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.account-row {
  background-color: var(--bg-card);
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}

.account-row:hover {
  background-color: var(--border);
}

.account-name-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.account-icon {
  font-size: 18px;
  width: 32px;
  height: 32px;
  background-color: var(--bg-main);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
}

.account-title {
  font-weight: 600;
}

.account-meta {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.account-value {
  font-weight: 700;
}

.account-value.positive { color: var(--blue-positive); }
.account-value.negative { color: var(--red-negative); }

/* MORE / SETTINGS SCREEN STYLES */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1px;
  background-color: var(--border);
  border-bottom: 1px solid var(--border);
}

.settings-card {
  background-color: var(--bg-card);
  padding: 24px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: var(--transition);
}

.settings-card:hover {
  background-color: var(--border);
}

.settings-card-icon {
  font-size: 24px;
  color: var(--text-secondary);
  height: 36px;
  display: flex;
  align-items: center;
}

.settings-card-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  text-align: center;
}

.settings-section-title {
  padding: 16px 16px 8px 16px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.settings-list-item {
  background-color: var(--bg-card);
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
}

.settings-list-item:hover {
  background-color: var(--border);
}

.settings-item-label {
  font-weight: 600;
}

.settings-item-value {
  color: var(--accent);
  font-weight: 600;
}

.settings-item-value.off {
  color: var(--text-secondary);
}

.settings-select {
  background: transparent;
  border: none;
  color: var(--accent);
  font-weight: 600;
  font-family: inherit;
  font-size: 14px;
  text-align: right;
  cursor: pointer;
  outline: none;
  padding: 0;
  margin: 0;
}
.settings-select option {
  background-color: #1a1e26;
  color: var(--text-main);
}

/* MODALS & OVERLAYS */
.modal-overlay {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  display: flex;
  align-items: flex-end; /* Bottom sheet on mobile */
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background-color: var(--bg-main);
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-top: 1px solid var(--border);
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

.modal-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
}

.modal-close {
  font-size: 20px;
  color: var(--text-secondary);
  cursor: pointer;
}

.modal-body {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
}

/* Form Styling inside Modals */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-bottom: 6px;
  letter-spacing: 0.3px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  background-color: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--text-main);
  transition: var(--transition);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent);
  outline: none;
}

.form-textarea {
  resize: none;
  height: 60px;
}

/* Add transaction type selector tabs */
.type-selector-tabs {
  display: flex;
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  padding: 2px;
}

.type-tab-btn {
  flex: 1;
  padding: 8px;
  font-weight: 700;
  text-align: center;
  color: var(--text-secondary);
  border-radius: 18px;
  font-size: 13px;
  transition: var(--transition);
}

.type-tab-btn.active[data-type="expense"] {
  background-color: var(--red-negative);
  color: white;
}

.type-tab-btn.active[data-type="income"] {
  background-color: var(--blue-positive);
  color: white;
}

.type-tab-btn.active[data-type="transfer"] {
  background-color: var(--text-secondary);
  color: var(--bg-main);
}

/* Premium Form Row Underlined Styling */
.form-row {
  display: flex;
  align-items: center;
  padding: 6px 0;
}

.form-row-label {
  width: 90px;
  min-width: 90px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-row-value-container {
  flex: 1;
  display: flex;
  align-items: center;
  border-bottom: 2px solid var(--border-light);
  padding-bottom: 6px;
  transition: border-color 0.25s ease;
}

/* Underline color based on modal active type */
#transaction-modal.expense .form-row-value-container {
  border-bottom-color: rgba(224, 94, 85, 0.25);
}
#transaction-modal.income .form-row-value-container {
  border-bottom-color: rgba(79, 147, 227, 0.25);
}
#transaction-modal.transfer .form-row-value-container {
  border-bottom-color: var(--border-light);
}

#transaction-modal.expense .form-row-value-container:focus-within,
#transaction-modal.expense .form-row-value-container.focused {
  border-bottom-color: var(--red-negative);
}
#transaction-modal.income .form-row-value-container:focus-within,
#transaction-modal.income .form-row-value-container.focused {
  border-bottom-color: var(--blue-positive);
}
#transaction-modal.transfer .form-row-value-container:focus-within,
#transaction-modal.transfer .form-row-value-container.focused {
  border-bottom-color: var(--text-secondary);
}

.form-row-input, .form-row-select {
  width: 100%;
  background: none;
  border: none;
  outline: none;
  color: var(--text-main);
  font-size: 15px;
  font-weight: 600;
  padding: 2px 0;
  text-align: left;
}

.form-row-select {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238a99ad' viewBox='0 0 24 24'><path d='M7 10l5 5 5-5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right center;
  padding-right: 16px;
}

.form-row-select option {
  background-color: var(--bg-card);
  color: var(--text-main);
}

.form-row-display-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
  display: block;
  width: 100%;
  cursor: pointer;
  padding: 2px 0;
}

/* Premium Action Buttons */
.modal-action-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.btn-primary-save, .btn-secondary-continue {
  width: 100%;
  padding: 12px;
  border-radius: 24px;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  transition: var(--transition);
}

#transaction-modal.expense .btn-primary-save {
  background-color: var(--red-negative);
  color: white;
}
#transaction-modal.income .btn-primary-save {
  background-color: var(--blue-positive);
  color: white;
}
#transaction-modal.transfer .btn-primary-save {
  background-color: var(--text-secondary);
  color: var(--bg-main);
}

.btn-secondary-continue {
  background-color: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
}
.btn-secondary-continue:hover {
  background-color: var(--bg-card);
  color: var(--text-main);
}

/* Custom Calculator Keypad */
.calc-keypad-container {
  background-color: #15181f;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

.calc-keypad-container.active {
  max-height: 380px;
}

.calc-keypad-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  background-color: #121419;
  border-bottom: 1px solid var(--border-light);
}

.calc-keypad-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.calc-keypad-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background-color: var(--border);
  gap: 1px;
  flex: 1;
}

.calc-key-btn {
  background-color: #181b22;
  color: var(--text-main);
  padding: 0;
  height: 72px;
  font-size: 26px;
  font-weight: 600;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  transition: background-color 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}

.calc-key-btn:active {
  background-color: #2e3543;
}

.calc-key-btn.backspace-key,
.calc-key-btn.minus-key,
.calc-key-btn.calc-op-key {
  background-color: #121419;
  color: var(--text-secondary);
  font-size: 22px;
}

.calc-key-btn.done-key {
  color: white;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.3px;
}
#transaction-modal.expense .calc-key-btn.done-key {
  background-color: var(--red-negative);
}
#transaction-modal.income .calc-key-btn.done-key {
  background-color: var(--blue-positive);
}
#transaction-modal.transfer .calc-key-btn.done-key {
  background-color: var(--text-secondary);
  color: var(--bg-main);
}

/* Supabase Modal Buttons Compatibility */
.btn-container {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.btn {
  flex: 1;
  padding: 12px;
  border-radius: 8px;
  font-weight: 700;
  text-align: center;
  transition: var(--transition);
}

.btn-secondary {
  background-color: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border);
}

.btn-primary {
  background-color: var(--accent);
  color: white;
}

.btn-primary:hover {
  background-color: #f16f66;
}

/* Stats category icon */
.stats-cat-icon {
  font-size: 16px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Excel Mapping UI Styles */
.mapping-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}

.mapping-table th, .mapping-table td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.mapping-table th {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.mapping-select {
  width: 100%;
  background-color: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 6px;
  font-size: 12px;
  color: var(--text-main);
}

/* Offline Banner */
.offline-banner {
  background-color: var(--accent);
  color: white;
  padding: 6px;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  display: none;
}

.offline-banner.active {
  display: block;
}

/* Sync status indicator badge */
.sync-badge {
  font-size: 10px;
  background-color: var(--bg-input);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.sync-badge.online {
  color: var(--blue-positive);
  border-color: rgba(79, 147, 227, 0.3);
}

.sync-badge.offline {
  color: var(--accent);
  border-color: rgba(224, 94, 85, 0.3);
}

/* Large Screens styling to make it look like a mobile frame on desktop */
@media (min-width: 480px) {
  body {
    background-color: #0f1115;
    align-items: center;
    justify-content: center;
  }
}

/* ============================================== */
/* NEW FEATURES STYLING */
/* ============================================== */

/* Net Savings Bar */
.stats-net-bar {
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 10px 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-size: 16.5px;
  font-weight: 700;
}

#stats-screen .stats-net-bar {
  position: sticky;
  top: 110px;
  z-index: 88;
  background-color: var(--bg-card);
}

.stats-net-val {
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.25);
}

.stats-net-val.positive {
  color: #ffffff;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.25);
}

.stats-net-val.negative {
  color: #ffffff;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.25);
}

/* =============================================
   SEARCH OVERLAY - PREMIUM HIGH-TECH REDESIGN
   ============================================= */
.search-overlay-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(160deg, #181b22 0%, #1e2230 100%);
  z-index: 500;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.38s cubic-bezier(0.32, 0.72, 0, 1);
  max-width: 480px;
  margin: 0 auto;
}

.search-overlay-container.active {
  transform: translateY(0);
}

/* Glassmorphism header bar */
.search-overlay-header {
  background: rgba(30, 34, 48, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.search-header-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-header-title::before {
  content: '⚡';
  font-size: 15px;
}

.text-link-btn {
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  background: rgba(224, 94, 85, 0.1);
  border: 1px solid rgba(224, 94, 85, 0.25);
  border-radius: 20px;
  padding: 5px 14px;
  transition: all 0.2s ease;
  letter-spacing: 0.3px;
}

.text-link-btn:hover, .text-link-btn:active {
  background: rgba(224, 94, 85, 0.2);
  box-shadow: 0 0 12px rgba(224, 94, 85, 0.3);
}

/* Scrollable body */
.search-overlay-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* === BIG SEARCH INPUT === */
.search-input-wrapper {
  position: relative;
  width: 100%;
}

.search-input-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  font-size: 17px;
  pointer-events: none;
  z-index: 2;
  transition: color 0.2s ease;
}

.search-input-wrapper:focus-within .search-input-icon {
  color: var(--accent);
}

#search-input {
  width: 100%;
  background: linear-gradient(135deg, rgba(43, 49, 61, 0.9), rgba(34, 39, 49, 0.9));
  border: 1.5px solid var(--border-light);
  border-radius: 14px;
  padding: 16px 48px 16px 50px;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.2);
  letter-spacing: 0.1px;
}

#search-input::placeholder {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 400;
}

#search-input:focus {
  border-color: var(--accent);
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.3), 0 0 0 3px rgba(224, 94, 85, 0.15), 0 4px 20px rgba(224, 94, 85, 0.1);
}

/* Clear (X) button inside search input */
.search-clear-btn {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--border-light);
  border: none;
  color: var(--text-secondary);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, background 0.2s ease;
  z-index: 2;
}

.search-clear-btn.visible {
  opacity: 1;
  pointer-events: all;
}

.search-clear-btn:hover {
  background: var(--accent);
  color: white;
}

/* === FILTERS PANEL === */
.search-filters-section-title {
  font-size: 10px;
  font-weight: 800;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: -4px;
}

.search-filters-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  background: linear-gradient(135deg, rgba(34, 39, 49, 0.95), rgba(30, 34, 44, 0.9));
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.search-filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.search-filter-label {
  font-size: 10px;
  color: var(--text-secondary);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding-left: 2px;
}

.search-filter-select, .search-filter-input {
  width: 100%;
  background: rgba(43, 49, 61, 0.8);
  border: 1.5px solid rgba(56, 65, 82, 0.8);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.search-filter-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238a99ad' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}

.search-filter-select:focus, .search-filter-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(224, 94, 85, 0.12), 0 2px 10px rgba(224, 94, 85, 0.08);
}

.search-filter-input::placeholder {
  color: var(--text-muted);
  font-size: 12px;
}

/* === RESULTS HEADER === */
.search-results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: linear-gradient(135deg, rgba(34, 39, 49, 0.9), rgba(30, 34, 44, 0.8));
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.search-results-header > span {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

#search-results-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  padding: 3px 10px;
  background: rgba(224, 94, 85, 0.15);
  border: 1px solid rgba(224, 94, 85, 0.35);
  border-radius: 20px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 0 10px rgba(224, 94, 85, 0.15);
  letter-spacing: 0.3px;
}

.transactions-list-scroll {
  flex: 1;
  overflow-y: auto;
}

/* Month Grid Picker */
.month-picker-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  text-align: center;
}

.month-picker-item {
  background-color: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 10px 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.month-picker-item:hover {
  background-color: var(--border);
  color: var(--text-main);
}

.month-picker-item.active {
  background-color: var(--accent);
  border-color: var(--accent);
  color: white;
  font-weight: 700;
}

/* Pull to Refresh styles */
.pull-to-refresh-container {
  width: 100%;
  height: 0;
  overflow: hidden;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: transparent;
  transition: height 0.25s cubic-bezier(0.19, 1, 0.22, 1);
  z-index: 50;
  pointer-events: none; /* Avoid blocking clicks when collapsed */
}

.pull-to-refresh-content {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  width: 40px;
  border-radius: 50%;
  background-color: var(--bg-card);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border);
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.pull-to-refresh-icon {
  font-size: 16px;
  color: var(--accent);
  transition: transform 0.2s cubic-bezier(0.19, 1, 0.22, 1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pull-to-refresh-spinner {
  display: none;
  font-size: 16px;
  color: var(--blue-positive);
  align-items: center;
  justify-content: center;
}

/* Pulling state (while user drags) */
.pull-to-refresh-container.pulling {
  transition: none; /* Instant feedback */
  pointer-events: auto;
}

.pull-to-refresh-container.pulling .pull-to-refresh-content {
  transition: none; /* Instant feedback */
}

/* Refreshing state (during network/db fetch) */
.pull-to-refresh-container.refreshing {
  height: 55px;
  transition: height 0.25s ease;
  pointer-events: auto;
}

.pull-to-refresh-container.refreshing .pull-to-refresh-content {
  opacity: 1;
  transform: scale(1);
  box-shadow: 0 0 15px rgba(79, 147, 227, 0.3);
  border-color: var(--blue-positive-light);
}

.pull-to-refresh-container.refreshing .pull-to-refresh-icon {
  display: none;
}

.pull-to-refresh-container.refreshing .pull-to-refresh-spinner {
  display: flex;
}

/* Selection Mode Styles */
.selection-bar-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 52px;
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
  z-index: 150;
  transform: translateY(-100%);
  transition: transform 0.3s cubic-bezier(0.19, 1, 0.22, 1);
}

.selection-bar-container.active {
  transform: translateY(0);
}

.selection-bar-left, .selection-bar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

#selection-count {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
}

/* Trans Checkbox alignment and animations */
.trans-checkbox {
  margin-right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
  animation: slideInCheckbox 0.25s cubic-bezier(0.19, 1, 0.22, 1);
}

.trans-checkbox.checked {
  color: var(--blue-positive);
}

@keyframes slideInCheckbox {
  from {
    opacity: 0;
    transform: scale(0.6) translateX(-15px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateX(0);
  }
}

/* Hide FAB during selection mode */
.fab.hidden {
  transform: translateY(100px) scale(0);
  opacity: 0;
  pointer-events: none;
}

/* Swipe Transitions */
.tab-screen.swipe-animating {
  transition: transform 0.15s ease-out, opacity 0.15s ease-out !important;
  opacity: 1;
  transform: translateX(0);
}
.swipe-out-left {
  opacity: 0 !important;
  transform: translateX(-25px) !important;
}
.swipe-out-right {
  opacity: 0 !important;
  transform: translateX(25px) !important;
}
.swipe-in-left-prepare {
  opacity: 0 !important;
  transform: translateX(-25px) !important;
}
.swipe-in-right-prepare {
  opacity: 0 !important;
  transform: translateX(25px) !important;
}

/* OLED Black Theme */
body.theme-oled {
  --bg-main: #000000;
  --bg-card: #0d0d0d;
  --bg-input: #151515;
  --border: #1f1f1f;
  --border-light: #262626;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.8);
}

/* Blossom Pink Theme */
body.theme-pink {
  --bg-main: #1f1218;
  --bg-card: #2d1b24;
  --bg-input: #3d2531;
  --accent: #ff758f; /* Pastel Pink */
  --accent-light: rgba(255, 117, 143, 0.15);
  --border: #422533;
  --border-light: #522d3f;
}

/* Classic Light Theme */
body.theme-light {
  --bg-main: #f4f6f9;
  --bg-card: #ffffff;
  --bg-input: #e9ecef;
  --text-main: #1e293b;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.08);
}

/* Emerald Forest Theme */
body.theme-emerald {
  --bg-main: #0f1916;
  --bg-card: #182823;
  --bg-input: #20352e;
  --accent: #2ec4b6; /* Emerald Green */
  --accent-light: rgba(46, 196, 182, 0.15);
  --border: #233d35;
  --border-light: #2c4c42;
}

/* Ocean Breeze Theme */
body.theme-ocean {
  --bg-main: #0b132b;
  --bg-card: #1c2541;
  --bg-input: #293250;
  --accent: #00b4d8; /* Ocean Blue */
  --accent-light: rgba(0, 180, 216, 0.15);
  --border: #2b3964;
  --border-light: #36487a;
}

/* Lock Screen Overlay */
.lock-screen-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-main);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  max-width: 480px;
  margin: 0 auto;
}

.lock-screen-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.lock-header {
  text-align: center;
  margin-bottom: 40px;
}

.lock-logo {
  font-size: 48px;
  color: var(--accent);
  margin-bottom: 16px;
}

.lock-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}

.lock-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
}

.lock-dots {
  display: flex;
  gap: 16px;
  margin-bottom: 40px;
}

.lock-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--text-secondary);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.lock-dot.active {
  background-color: var(--accent);
  border-color: var(--accent);
}

.lock-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 280px;
  width: 100%;
}

.keypad-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-main);
  font-size: 24px;
  font-weight: 600;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  transition: var(--transition);
  margin: 0 auto;
}

.keypad-btn:active {
  background: var(--bg-input);
  transform: scale(0.9);
}

.keypad-btn.empty {
  background: transparent;
  border-color: transparent;
  cursor: default;
  pointer-events: none;
}

.keypad-btn.action {
  font-size: 18px;
  border-color: transparent;
  background: transparent;
}
.keypad-btn.action:active {
  background: var(--bg-card);
}

/* Custom Select Triggers (replacing native selects) */
.custom-select-trigger {
  width: 100%;
  background-color: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 10px 12px;
  font-size: 14px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: var(--transition);
}

.custom-select-trigger:active {
  background-color: var(--border);
}

.custom-select-trigger-content {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

/* Category Modal Grid */
.category-picker-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 8px 0;
  max-height: 50vh;
  overflow-y: auto;
}

.category-picker-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 8px;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  gap: 8px;
}

.category-picker-item:active {
  transform: scale(0.92);
  background-color: var(--border-light);
  border-color: var(--accent);
}

.category-picker-item.selected {
  border-color: var(--accent);
  background-color: var(--accent-light);
}

.category-picker-icon {
  font-size: 24px;
  line-height: 1;
}

.category-picker-name {
  font-size: 9px;
  font-weight: 600;
  color: var(--text-secondary);
  line-height: 1.2;
}

/* Subcategory List */
.subcategory-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 50vh;
  overflow-y: auto;
}

.subcategory-item {
  padding: 12px 16px;
  background-color: var(--bg-main);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.subcategory-item:active {
  background-color: var(--border);
}

.subcategory-item.selected {
  border-color: var(--accent);
  background-color: var(--accent-light);
  color: var(--accent);
}

.subcategory-item.new-subcat {
  color: var(--accent);
  border-color: var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

/* =============================================
   BACK SWIPE INDICATOR
   ============================================= */
#back-swipe-indicator {
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  background: rgba(224, 94, 85, 0.18);
  border: 1.5px solid rgba(224, 94, 85, 0.5);
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 18px;
  box-shadow: 0 0 18px rgba(224, 94, 85, 0.4), inset 0 0 12px rgba(224, 94, 85, 0.1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}

#back-swipe-indicator::after {
  content: '\f060'; /* fa-arrow-left */
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
}

/* Smooth overflow hidden on content lists for slide animation */
#transactions-list,
#stats-breakdown-list {
  overflow: hidden;
}

/* Wallet Switcher Styles Removed (Unified Wallet Mode) */

/* =============================================
   USER PROFILE BADGE
   ============================================= */
.user-profile-badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #ff8a80);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), 0 0 0 2px rgba(255, 255, 255, 0.08);
  transition: var(--transition);
  text-transform: uppercase;
}

.user-profile-badge:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px var(--accent-light), 0 0 0 2px var(--accent);
}

/* =============================================
   SHARED WALLET GLOBAL TRANSFORMATION
   ============================================= */
body.shared-wallet-active {
  --accent: #bd3bf4; /* Glowing electric purple */
  --accent-light: rgba(189, 59, 244, 0.18);
  --blue-positive: #00f2fe; /* Glowing cyan */
  --blue-positive-light: rgba(0, 242, 254, 0.1);
  --red-negative: #ff007f; /* Hot pink */
  --red-negative-light: rgba(255, 0, 127, 0.1);
  --border: #3b2853; /* Dark purple/magenta border */
  --border-light: #4f3471;
  --bg-main: #0c0816; /* Deep dark purple space bg */
  --bg-card: #150f26; /* Deep purple card */
}

/* Visual indications in Shared Wallet Mode */
body.shared-wallet-active .app-header {
  border-bottom-color: var(--accent);
  box-shadow: 0 4px 20px rgba(189, 59, 244, 0.22);
}

/* Wallet switcher indicators removed */

body.shared-wallet-active .bottom-nav {
  border-top-color: var(--border);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
}

body.shared-wallet-active .summary-item {
  border-color: var(--border-light);
  background: linear-gradient(145deg, var(--bg-card), rgba(189, 59, 244, 0.03));
}

body.shared-wallet-active .summary-income {
  text-shadow: 0 0 12px rgba(0, 242, 254, 0.4);
}

body.shared-wallet-active .summary-expense {
  text-shadow: 0 0 12px rgba(255, 0, 127, 0.4);
}

body.shared-wallet-active .fab {
  box-shadow: 0 4px 18px rgba(189, 59, 244, 0.5);
  background: linear-gradient(135deg, var(--accent), #e040fb);
}

body.shared-wallet-active .day-header {
  background-color: #120b22;
  border-bottom-color: var(--border-light);
}

/* Neon shared icon badge on lists */
.shared-badge-icon {
  color: var(--accent);
  font-size: 11px;
  margin-left: 6px;
  text-shadow: 0 0 6px var(--accent);
}

/* Neon partner icon badge on lists */
.partner-badge-icon {
  color: var(--accent);
  font-size: 11px;
  margin-left: 6px;
  text-shadow: 0 0 6px var(--accent);
}

/* =============================================
   PARTNER LINKING CARD & UI
   ============================================= */
.partner-linking-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin: 12px 0;
  box-shadow: var(--shadow);
}

.partner-desc {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 14px;
}

.form-group-row {
  display: flex;
  gap: 10px;
}

.form-group-row .form-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text-main);
  font-size: 13.5px;
}

.form-group-row .form-input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 8px var(--accent-light);
}

.form-group-row .btn {
  padding: 0 16px;
  font-size: 13px;
  font-weight: 700;
}

.partner-linked-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.partner-email {
  display: flex;
  align-items: center;
  font-size: 14px;
  color: var(--text-main);
}

.unlink-btn {
  align-self: flex-start;
  padding: 6px 12px !important;
  font-size: 11.5px !important;
  border: 1px solid var(--border-light) !important;
}

.unlink-btn:hover {
  background: var(--red-negative-light) !important;
  border-color: var(--red-negative) !important;
  color: var(--red-negative) !important;
}

/* Warning Banner when partner is not linked in shared wallet */
.shared-warning-banner {
  background: linear-gradient(135deg, rgba(189, 59, 244, 0.12), rgba(0, 0, 0, 0.4));
  border: 1.5px dashed var(--accent);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 12px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  box-shadow: 0 4px 15px rgba(189, 59, 244, 0.1);
  animation: bannerGlow 3s infinite alternate;
}

@keyframes bannerGlow {
  0% { box-shadow: 0 4px 12px rgba(189, 59, 244, 0.08); border-color: rgba(189, 59, 244, 0.5); }
  100% { box-shadow: 0 4px 20px rgba(189, 59, 244, 0.22); border-color: rgba(189, 59, 244, 0.9); }
}

.shared-warning-text {
  font-size: 12.5px;
  color: var(--text-main);
  line-height: 1.4;
  flex: 1;
}

.shared-warning-text strong {
  color: var(--accent);
  text-shadow: 0 0 6px var(--accent-light);
}

.shared-warning-link-btn {
  margin-top: 8px;
  display: inline-block;
  background: var(--accent);
  color: white;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  transition: var(--transition);
  box-shadow: 0 2px 8px rgba(189, 59, 244, 0.3);
}

.shared-warning-link-btn:active {
  transform: scale(0.95);
}

/* =============================================
   GLASSMORPHIC AUTH OVERLAY SCREEN
   ============================================= */
.auth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at top, rgba(30, 24, 52, 0.98), #09080e 100%);
  z-index: 20000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.auth-card {
  position: relative;
  background: rgba(30, 36, 48, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  width: 100%;
  max-width: 360px;
  padding: 24px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), 0 0 30px rgba(224, 94, 85, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: authCardEntrance 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.auth-lang-selector {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  gap: 6px;
  z-index: 10;
}

.lang-pill {
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.lang-pill:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.lang-pill.active {
  border-color: var(--accent) !important;
  color: var(--text-primary) !important;
  background: rgba(0, 229, 255, 0.1) !important;
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.2);
}

@keyframes authCardEntrance {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-header {
  text-align: center;
  margin-bottom: 8px;
}

.auth-logo {
  width: 52px;
  height: 52px;
  background: var(--accent);
  color: white;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin: 0 auto 12px;
  box-shadow: 0 4px 15px rgba(224, 94, 85, 0.4);
  animation: logoSpin 1.5s ease-out;
}

@keyframes logoSpin {
  0% { transform: scale(0.3) rotate(-180deg); opacity: 0; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

.auth-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-main);
  margin-bottom: 4px;
}

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

.auth-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.auth-tab-btn {
  flex: 1;
  padding: 8px 4px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 8px;
  color: var(--text-secondary);
  transition: var(--transition);
  text-align: center;
}

.auth-tab-btn.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.auth-form-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-mode-switch {
  display: flex;
  gap: 12px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 6px;
}

.auth-mode-btn {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-secondary);
  padding-bottom: 6px;
  border-bottom: 2px solid transparent;
  margin-bottom: -7px;
  transition: var(--transition);
}

.auth-mode-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.auth-desc {
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.4;
  text-align: center;
  margin-bottom: 4px;
}

.auth-submit-btn {
  margin-top: 8px;
  font-weight: 700;
  letter-spacing: 0.3px;
  padding: 12px !important;
  font-size: 14px !important;
}

.btn-block {
  width: 100%;
}

.btn-google {
  background: white !important;
  color: #1f2937 !important;
  border: 1px solid #e5e7eb !important;
  font-weight: 700 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px !important;
  font-size: 13.5px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  margin-top: 10px;
}

.btn-google:hover {
  background: #f9fafb !important;
}

.google-icon {
  font-size: 16px;
  color: #4285f4;
}

.auth-status-box {
  background: rgba(224, 94, 85, 0.12);
  border: 1px solid rgba(224, 94, 85, 0.3);
  color: #fca5a5;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
}

.auth-status-box.success {
  background: rgba(74, 222, 128, 0.12);
  border-color: rgba(74, 222, 128, 0.3);
  color: #a7f3d0;
}

