/* =========================================================
   SOLAR SPIRE - PERSONAL BUDGET PLANNER
   Design System & Mobile Styles
   Theme: Deep Blue & Radiant Cyan Neon Glassmorphism
   ========================================================= */

:root {
  --bg-primary: #0a0f1d;
  --bg-card: rgba(16, 26, 48, 0.72);
  --bg-card-hover: rgba(22, 36, 68, 0.85);
  --border-glass: rgba(0, 210, 255, 0.16);
  --border-light: rgba(255, 255, 255, 0.08);

  --cyan-primary: #00d2ff;
  --cyan-glow: rgba(0, 210, 255, 0.35);
  --blue-vibrant: #1e62ff;
  --blue-deep: #0e214d;
  
  --green-accent: #00e676;
  --green-glow: rgba(0, 230, 118, 0.28);
  --red-accent: #ff4757;
  --red-glow: rgba(255, 71, 87, 0.28);
  --amber-accent: #ffa502;

  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;

  --transition-fast: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  user-select: none;
}

/* App Container - Phone Viewport Shell */
.app-container {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  position: relative;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-primary);
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.6);
}

/* Background Artwork Layer (100% visible, not blacked out) */
.app-background {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: 100%;
  background-image: url('bg.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 0;
  pointer-events: none;
  opacity: 0.92;
}

/* Glass Panels */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

/* Safe Area Insets Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px 12px 16px;
  background: rgba(10, 15, 29, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-light);
}

.header-left {
  display: flex;
  align-items: center;
}

.app-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.badge-icon {
  color: var(--cyan-primary);
  filter: drop-shadow(0 0 8px var(--cyan-glow));
}

.app-brand-name {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #ffffff 30%, var(--cyan-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.btn-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
  background: rgba(0, 210, 255, 0.12);
  color: var(--cyan-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-icon:active {
  transform: scale(0.92);
  background: rgba(0, 210, 255, 0.25);
}

/* Main Content Area */
.app-main-content {
  flex: 1;
  position: relative;
  z-index: 10;
  padding: 16px 16px 100px 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Screen Transitions */
.screen-view {
  display: none;
  animation: fadeIn 0.24s ease forwards;
}

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

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

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

.screen-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #fff;
}

/* Balance Hero Card */
.balance-hero {
  padding: 22px 20px;
  margin-bottom: 16px;
  background: linear-gradient(145deg, rgba(16, 28, 56, 0.85) 0%, rgba(10, 20, 42, 0.88) 100%);
  border: 1px solid rgba(0, 210, 255, 0.25);
  position: relative;
  overflow: hidden;
}

.balance-hero::after {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, var(--cyan-glow) 0%, transparent 70%);
  pointer-events: none;
}

.balance-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.label-tiny {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.currency-tag {
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: rgba(0, 210, 255, 0.15);
  color: var(--cyan-primary);
  border: 1px solid rgba(0, 210, 255, 0.3);
}

.balance-amount-wrap {
  margin-bottom: 18px;
}

.hero-amount {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -1px;
  color: #ffffff;
  text-shadow: 0 4px 20px rgba(0, 210, 255, 0.25);
}

.balance-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--border-light);
}

.stat-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.stat-divider {
  width: 1px;
  height: 36px;
  background: var(--border-light);
  margin: 0 12px;
}

.stat-indicator {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.green-bg {
  background: rgba(0, 230, 118, 0.16);
  color: var(--green-accent);
}

.red-bg {
  background: rgba(255, 71, 87, 0.16);
  color: var(--red-accent);
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-value {
  font-size: 15px;
  font-weight: 700;
}

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

.expense-stat .stat-value {
  color: #ff6b81;
}

/* Monthly Budget Limit Card */
.budget-limit-card {
  padding: 18px;
  margin-bottom: 16px;
}

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

.card-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-icon-badge {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(0, 210, 255, 0.12);
  color: var(--cyan-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

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

.progress-container {
  margin: 12px 0 8px 0;
}

.progress-bar-bg {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 20px;
  background: linear-gradient(90deg, #1e62ff 0%, var(--cyan-primary) 100%);
  transition: width 0.4s ease, background 0.3s ease;
}

.progress-bar-fill.warning {
  background: linear-gradient(90deg, #ffa502 0%, #ff7f50 100%);
}

.progress-bar-fill.danger {
  background: linear-gradient(90deg, #ff4757 0%, #ff6b81 100%);
}

.budget-meta-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.meta-label {
  font-size: 12px;
  color: var(--text-muted);
}

.meta-val {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  display: block;
}

.budget-status-banner {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: rgba(0, 210, 255, 0.1);
  color: var(--cyan-primary);
  font-size: 12px;
  font-weight: 600;
}

.budget-status-banner.warning {
  background: rgba(255, 165, 2, 0.12);
  color: var(--amber-accent);
}

.budget-status-banner.danger {
  background: rgba(255, 71, 87, 0.14);
  color: var(--red-accent);
}

/* Quick Action Buttons */
.quick-actions-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.action-btn {
  height: 60px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform var(--transition-fast), background var(--transition-fast);
}

.action-btn:active {
  transform: scale(0.95);
}

.cyan-btn {
  background: linear-gradient(135deg, rgba(0, 210, 255, 0.18) 0%, rgba(30, 98, 255, 0.22) 100%);
  color: var(--cyan-primary);
  border-color: rgba(0, 210, 255, 0.4);
}

.blue-btn {
  background: linear-gradient(135deg, rgba(30, 98, 255, 0.22) 0%, rgba(14, 33, 77, 0.4) 100%);
  color: #70a1ff;
  border-color: rgba(112, 161, 255, 0.3);
}

.glass-btn {
  background: var(--bg-card);
  color: var(--text-main);
  border-color: var(--border-light);
}

/* Section Header */
.section-container {
  margin-top: 8px;
}

.section-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.link-btn {
  background: none;
  border: none;
  color: var(--cyan-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
}

.link-btn:active {
  opacity: 0.7;
}

/* Transactions List */
.transactions-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tx-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.tx-card:active {
  transform: scale(0.98);
  border-color: var(--border-glass);
}

.tx-card-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.tx-icon-circle {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.tx-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.tx-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tx-sub {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.tx-category-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
}

.tx-card-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
  margin-left: 10px;
}

.tx-amount {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.2px;
}

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

.tx-amount.expense {
  color: #ff5252;
}

.tx-date-small {
  font-size: 11px;
  color: var(--text-dim);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-state svg {
  margin-bottom: 12px;
  color: var(--text-dim);
}

.empty-state h4 {
  font-size: 16px;
  color: #fff;
  margin-bottom: 4px;
}

.empty-state p {
  font-size: 13px;
}

/* Screen 2: Filter Toolbar */
.filter-toolbar {
  padding: 14px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  pointer-events: none;
}

.clean-input {
  width: 100%;
  height: 44px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: rgba(10, 15, 29, 0.6);
  padding: 0 36px 0 38px;
  color: #fff;
  font-size: 16px; /* prevent iOS zoom */
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition-fast);
}

.clean-input:focus {
  border-color: var(--cyan-primary);
}

.btn-clear {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
}

.segment-tabs {
  display: flex;
  background: rgba(10, 15, 29, 0.6);
  border-radius: var(--radius-md);
  padding: 4px;
  border: 1px solid var(--border-light);
}

.tab-btn {
  flex: 1;
  height: 38px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tab-btn.active {
  background: linear-gradient(135deg, rgba(0, 210, 255, 0.25) 0%, rgba(30, 98, 255, 0.3) 100%);
  color: #fff;
  border: 1px solid var(--border-glass);
}

.filter-selectors-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.select-wrap {
  position: relative;
}

.select-input {
  width: 100%;
  height: 42px;
  border-radius: var(--radius-md);
  background: rgba(10, 15, 29, 0.6);
  border: 1px solid var(--border-light);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 0 10px;
  outline: none;
  cursor: pointer;
  font-family: inherit;
}

.select-input option {
  background: #0f172a;
  color: #fff;
}

.filter-metrics-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
  padding: 0 4px;
}

.filtered-total {
  font-weight: 700;
  color: #fff;
}

/* Screen 3: Analytics */
.month-selector-badge {
  padding: 4px 12px;
  border-radius: var(--radius-md);
  background: rgba(0, 210, 255, 0.12);
  border: 1px solid var(--border-glass);
  color: var(--cyan-primary);
  font-size: 12px;
  font-weight: 700;
}

.analytics-trio-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.stat-card {
  padding: 12px 10px;
  text-align: center;
}

.card-metric-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
}

.card-metric-val {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cyan-text { color: var(--cyan-primary); }
.green-text { color: var(--green-accent); }

.chart-container-card {
  padding: 18px;
  margin-bottom: 16px;
}

.badge-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.canvas-chart-wrap {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 12px 0;
}

canvas {
  max-width: 100%;
  height: auto;
  display: block;
}

.category-legend-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
}

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

.legend-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-name {
  color: var(--text-main);
  font-weight: 600;
}

.legend-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.legend-amount {
  font-weight: 700;
  color: #fff;
}

.legend-percent {
  font-size: 12px;
  color: var(--text-muted);
  width: 36px;
  text-align: right;
}

.chart-legend-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

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

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

.income-dot { background: var(--green-accent); }
.expense-dot { background: var(--cyan-primary); }

/* Screen 4: Settings */
.profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  margin-bottom: 16px;
}

.profile-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(0, 210, 255, 0.25) 0%, rgba(30, 98, 255, 0.35) 100%);
  border: 2px solid var(--cyan-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}

.profile-details {
  flex: 1;
}

.profile-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-name {
  font-size: 17px;
  font-weight: 800;
  color: #fff;
}

.btn-ghost-icon {
  background: none;
  border: none;
  color: var(--cyan-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 4px;
}

.profile-desc {
  font-size: 12px;
  color: var(--text-muted);
}

.settings-group {
  padding: 8px 16px;
  margin-bottom: 14px;
}

.settings-group-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--cyan-primary);
  padding: 10px 0 6px 0;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-light);
  min-height: 48px;
}

.settings-row:last-child {
  border-bottom: none;
}

.settings-row.clickable {
  cursor: pointer;
  transition: opacity var(--transition-fast);
}

.settings-row.clickable:active {
  opacity: 0.7;
}

.row-info {
  display: flex;
  flex-direction: column;
}

.row-label {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.row-sub {
  font-size: 12px;
  color: var(--text-muted);
}

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

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 28px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: 0.3s;
  border-radius: 34px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background-color: var(--cyan-primary);
}

input:checked + .toggle-slider:before {
  transform: translateX(20px);
}

.settings-footer {
  text-align: center;
  padding: 20px 0 40px 0;
  font-size: 12px;
  color: var(--text-dim);
}

.sub-credit {
  font-size: 11px;
  margin-top: 2px;
}

/* Bottom Navigation Bar */
.bottom-nav-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: 68px;
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 8px);
  background: rgba(10, 15, 29, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 50;
}

.nav-tab-btn {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  min-width: 58px;
  min-height: 48px;
  transition: color var(--transition-fast), transform var(--transition-fast);
}

.nav-tab-btn:active {
  transform: scale(0.92);
}

.nav-tab-btn.active {
  color: var(--cyan-primary);
}

.nav-tab-btn.active svg {
  filter: drop-shadow(0 0 8px var(--cyan-glow));
}

.nav-fab-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan-primary) 0%, var(--blue-vibrant) 100%);
  border: none;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(0, 210, 255, 0.45);
  margin-top: -24px;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.nav-fab-btn:active {
  transform: scale(0.92);
  box-shadow: 0 2px 10px rgba(0, 210, 255, 0.3);
}

/* Modals & Bottom Sheets */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(3, 7, 18, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 100;
  display: none;
  opacity: 0;
  transition: opacity 0.24s ease;
}

.modal-backdrop.show {
  display: flex;
  opacity: 1;
}

.bottom-sheet {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translate(-50%, 100%);
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  padding: 16px 20px calc(env(safe-area-inset-bottom, 0px) + 20px) 20px;
  display: flex;
  flex-direction: column;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
}

.modal-backdrop.show .bottom-sheet {
  transform: translate(-50%, 0);
}

.sheet-drag-handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.2);
  margin: 0 auto 14px auto;
}

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

.sheet-title {
  font-size: 19px;
  font-weight: 800;
  color: #fff;
}

.sheet-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.btn-sheet-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}

/* Modal Dialog (Center) */
.modal-dialog {
  position: relative;
  margin: auto;
  width: 90%;
  max-width: 400px;
  padding: 24px 20px;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  transform: scale(0.95);
  transition: transform 0.22s ease;
}

.modal-backdrop.show .modal-dialog {
  transform: scale(1);
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.dialog-title {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
}

.dialog-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.dialog-body {
  margin-bottom: 18px;
}

.scrollable-text {
  max-height: 320px;
  overflow-y: auto;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  padding-right: 6px;
}

.scrollable-text h4 {
  color: #fff;
  font-size: 14px;
  margin: 12px 0 4px 0;
}

.scrollable-text p {
  margin-bottom: 8px;
}

.dialog-footer {
  margin-top: auto;
}

/* Form Styles */
.form-group {
  margin-bottom: 14px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-input, .form-select {
  width: 100%;
  height: 46px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: rgba(10, 15, 29, 0.7);
  padding: 0 14px;
  color: #fff;
  font-size: 16px; /* prevent iOS zoom */
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition-fast);
}

textarea.form-input {
  height: auto;
  padding: 10px 14px;
}

.form-input:focus, .form-select:focus {
  border-color: var(--cyan-primary);
}

.type-toggle-group {
  display: flex;
  gap: 8px;
  background: rgba(10, 15, 29, 0.6);
  padding: 4px;
  border-radius: var(--radius-md);
  margin-bottom: 14px;
}

.type-toggle-btn {
  flex: 1;
  height: 42px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.type-toggle-btn.active#btnTypeExpense {
  background: rgba(255, 71, 87, 0.2);
  color: #ff5252;
  border: 1px solid rgba(255, 71, 87, 0.4);
}

.type-toggle-btn.active#btnTypeIncome {
  background: rgba(0, 230, 118, 0.2);
  color: var(--green-accent);
  border: 1px solid rgba(0, 230, 118, 0.4);
}

/* Amount Input Field */
.amount-field-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.currency-prefix {
  position: absolute;
  left: 14px;
  font-size: 24px;
  font-weight: 800;
  color: var(--cyan-primary);
}

.amount-input {
  width: 100%;
  height: 58px;
  border-radius: var(--radius-md);
  background: rgba(10, 15, 29, 0.8);
  border: 1px solid var(--border-glass);
  padding: 0 16px 0 40px;
  color: #fff;
  font-size: 26px;
  font-weight: 800;
  font-family: inherit;
  outline: none;
}

.amount-input:focus {
  border-color: var(--cyan-primary);
  box-shadow: 0 0 12px var(--cyan-glow);
}

/* Buttons */
.btn {
  height: 48px;
  border-radius: var(--radius-md);
  border: none;
  font-size: 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 20px;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, var(--cyan-primary) 0%, var(--blue-vibrant) 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(0, 210, 255, 0.35);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid var(--border-light);
}

.btn-danger {
  background: linear-gradient(135deg, #ff4757 0%, #c0392b 100%);
  color: #fff;
}

.btn-block {
  width: 100%;
}

.btn-sm {
  height: 38px;
  padding: 0 14px;
  font-size: 13px;
  border-radius: 10px;
}

.btn-ghost-sm {
  background: rgba(0, 210, 255, 0.1);
  border: 1px solid var(--border-glass);
  color: var(--cyan-primary);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-ghost-sm:active {
  transform: scale(0.95);
  background: rgba(0, 210, 255, 0.22);
}

.sheet-actions {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 10px;
  margin-top: 18px;
}

.dialog-actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.dialog-actions-vertical {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

/* Star Rating */
.rate-star-icon {
  margin: 0 auto 12px auto;
}

.star-rating-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 16px 0;
}

.star-btn {
  background: none;
  border: none;
  font-size: 32px;
  color: rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: color var(--transition-fast), transform var(--transition-fast);
}

.star-btn.active {
  color: var(--cyan-primary);
}

.star-btn:active {
  transform: scale(1.2);
}

/* Onboarding Welcome Screen */
.onboarding-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(3, 7, 18, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.onboarding-overlay.show {
  display: flex;
}

.onboarding-card {
  width: 100%;
  max-width: 400px;
  padding: 30px 24px;
  text-align: center;
}

.onboarding-logo-wrap {
  margin-bottom: 16px;
}

.logo-circle {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  margin: 0 auto;
  background: linear-gradient(135deg, rgba(0, 210, 255, 0.25) 0%, rgba(30, 98, 255, 0.4) 100%);
  border: 2px solid var(--cyan-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cyan-primary);
  box-shadow: 0 0 24px var(--cyan-glow);
}

.onboarding-title {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 4px;
  background: linear-gradient(135deg, #ffffff 40%, var(--cyan-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.onboarding-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.onboarding-features {
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
  margin-bottom: 26px;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 14px;
}

.feature-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cyan-glow {
  background: rgba(0, 210, 255, 0.15);
  color: var(--cyan-primary);
}

.blue-glow {
  background: rgba(30, 98, 255, 0.2);
  color: #70a1ff;
}

.green-glow {
  background: rgba(0, 230, 118, 0.16);
  color: var(--green-accent);
}

.feature-text h4 {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px;
}

.feature-text p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.35;
}

/* Toast Notification */
.toast-container {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 400px;
  z-index: 150;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast-msg {
  background: rgba(16, 26, 48, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--cyan-primary);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  color: #fff;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.26s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.toast-msg.toast-out {
  animation: toastOut 0.22s ease forwards;
}

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-10px); }
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .app-container {
    box-shadow: none;
  }
}
