/* ==========================================================
   DAILY EXPENSE PWA - MOBILE FIRST STYLES
   ========================================================== */

:root {
  --bg-app: #0B0F19;
  --bg-surface: #151D2E;
  --bg-card: #1E293B;
  --bg-card-hover: #27354D;
  --bg-input: #0F172A;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-active: rgba(59, 130, 246, 0.4);

  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;

  --accent: #3B82F6;
  --accent-glow: rgba(59, 130, 246, 0.25);
  --income: #10B981;
  --income-bg: rgba(16, 185, 129, 0.12);
  --expense: #F43F5E;
  --expense-bg: rgba(244, 63, 94, 0.12);
  --transfer: #8B5CF6;
  --transfer-bg: rgba(139, 92, 246, 0.12);
  --warning: #F59E0B;
  --warning-bg: rgba(245, 158, 11, 0.12);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-glow: 0 8px 30px rgba(59, 130, 246, 0.3);
}

[data-theme="light"] {
  --bg-app: #F1F5F9;
  --bg-surface: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F8FAFC;
  --bg-input: #F1F5F9;
  --border-subtle: rgba(0, 0, 0, 0.08);
  --border-active: rgba(59, 130, 246, 0.4);

  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #94A3B8;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-glow: 0 8px 30px rgba(59, 130, 246, 0.2);
}

/* Reset & Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

input, textarea, select {
  user-select: auto;
  font-family: inherit;
}

body {
  background-color: #030712;
  color: var(--text-primary);
  font-family: var(--font);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  overflow-x: hidden;
}

/* App Container (Mobile Frame on Desktop, full screen on Mobile) */
.mobile-frame {
  width: 100%;
  max-width: 440px;
  height: 100vh;
  height: 100dvh;
  background-color: var(--bg-app);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.6);
}

@media (min-width: 480px) {
  .mobile-frame {
    height: 92vh;
    max-height: 890px;
    border-radius: 40px;
    border: 8px solid #1E293B;
  }
}

/* Offline Banner */
.offline-banner {
  background: var(--warning);
  color: #000;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  text-align: center;
  display: none;
  z-index: 100;
}
.offline-banner.active {
  display: block;
}

/* Top App Bar */
.top-bar {
  padding: calc(env(safe-area-inset-top, 12px) + 12px) 16px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-app);
  z-index: 10;
}

.user-greeting {
  display: flex;
  align-items: center;
  gap: 10px;
}
.avatar-pill {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent), #8B5CF6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  color: #FFF;
  box-shadow: var(--shadow-sm);
}
.greeting-text h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}
.greeting-text span {
  font-size: 11px;
  color: var(--text-secondary);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s;
}
.icon-btn:active {
  transform: scale(0.92);
}

/* Main Content Views Area */
.app-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 16px 90px;
  -webkit-overflow-scrolling: touch;
}

.view-section {
  display: none;
  animation: fadeIn 0.2s ease-out;
}
.view-section.active {
  display: block;
}

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

/* ==========================================================
   1. DASHBOARD VIEW
   ========================================================== */

/* Hero Balance Card */
.balance-card {
  background: linear-gradient(145deg, #1E293B 0%, #0F172A 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 20px;
  margin-top: 6px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.balance-card::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
}

.balance-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.eye-toggle {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 14px;
}

.balance-card-amount {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 16px;
}
.balance-currency {
  font-size: 16px;
  font-weight: 600;
  color: var(--accent);
}

.multi-currency-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: -6px;
  margin-bottom: 14px;
}
.cur-badge-chip {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}
.cur-badge-chip b {
  color: var(--text-primary);
}
.cur-badge-chip.none-cur {
  border-color: rgba(245, 158, 11, 0.3);
  color: var(--warning);
}

.balance-stats-row {
  display: flex;
  gap: 12px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 14px;
}
.stat-pill {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}
.stat-icon-wrapper {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.stat-icon-wrapper.income {
  background: var(--income-bg);
  color: var(--income);
}
.stat-icon-wrapper.expense {
  background: var(--expense-bg);
  color: var(--expense);
}
.stat-info .stat-label {
  font-size: 11px;
  color: var(--text-muted);
  display: block;
}
.stat-info .stat-val {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

/* Wallets / Accounts Slider */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 16px 0 10px;
}
.section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}
.section-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  cursor: pointer;
}

.wallets-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin: 0 -16px 16px;
  padding-left: 16px;
  padding-right: 16px;
  scrollbar-width: none;
}
.wallets-scroll::-webkit-scrollbar {
  display: none;
}

.wallet-chip {
  flex: 0 0 auto;
  min-width: 140px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.wallet-chip.active {
  border-color: var(--accent);
  background: var(--bg-card);
  box-shadow: 0 0 12px var(--accent-glow);
}
.wallet-chip:active {
  transform: scale(0.97);
}
.wallet-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.wallet-icon {
  font-size: 18px;
}
.wallet-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wallet-balance {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

/* Filter Chips */
.filter-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  overflow-x: auto;
  scrollbar-width: none;
}
.filter-tabs::-webkit-scrollbar {
  display: none;
}
.filter-pill {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
}
.filter-pill.active {
  background: var(--accent);
  color: #FFF;
  border-color: var(--accent);
}

/* Transactions List */
.transactions-group {
  margin-bottom: 16px;
}
.tx-group-header {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  padding-left: 4px;
}
.tx-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.2s;
  cursor: pointer;
}
.tx-card:active {
  background: var(--bg-card-hover);
}
.tx-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.tx-icon-badge {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.tx-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}
.tx-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tx-account-tag {
  background: var(--border-subtle);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
}
.tx-right {
  text-align: right;
}
.tx-amount {
  font-size: 14px;
  font-weight: 700;
}
.tx-amount.expense { color: var(--expense); }
.tx-amount.income { color: var(--income); }
.tx-amount.transfer { color: var(--transfer); }
.tx-date {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}
.empty-icon {
  font-size: 40px;
  margin-bottom: 8px;
}
.empty-text {
  font-size: 13px;
}

/* ==========================================================
   2. ANALYTICS VIEW
   ========================================================== */
.month-picker-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 6px 12px;
  margin: 10px 0 16px;
}
.month-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}
.chart-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 18px;
  margin-bottom: 16px;
}

/* Donut Chart styles */
.donut-wrapper {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 0 auto 16px;
}
.donut-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.donut-segment {
  cursor: pointer;
  transition: stroke-width 0.2s, opacity 0.2s;
}
.donut-segment:hover {
  stroke-width: 38px;
}
.donut-center-info {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
  max-width: 130px;
}
.donut-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.donut-value {
  display: block;
  font-size: 17px;
  font-weight: 800;
  color: var(--text-primary);
}
.donut-currency {
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
}

.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.legend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  padding: 4px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.legend-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.legend-badge {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}
.legend-name {
  color: var(--text-primary);
  font-weight: 500;
}
.legend-right {
  text-align: right;
}
.legend-amount {
  font-weight: 700;
  color: var(--text-primary);
  display: block;
}
.legend-percent {
  font-size: 11px;
  color: var(--text-muted);
}

/* Bar Chart styles */
.bar-chart-scroll {
  overflow-x: auto;
  padding-bottom: 10px;
  scrollbar-width: none;
}
.bar-chart-scroll::-webkit-scrollbar {
  display: none;
}
.bar-chart-grid {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  height: 140px;
  padding-top: 15px;
  min-width: 480px;
}
.bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.bars-pair {
  display: flex;
  gap: 3px;
  align-items: flex-end;
  height: 110px;
}
.bar {
  width: 8px;
  border-radius: 4px 4px 0 0;
  transition: height 0.3s;
  position: relative;
}
.income-bar { background: var(--income); }
.expense-bar { background: var(--expense); }
.zero-bar { background: var(--border-subtle); width: 8px; }
.bar-label {
  font-size: 10px;
  color: var(--text-muted);
}
.bar-legend {
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 10px;
}
.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}
.income-dot { background: var(--income); }
.expense-dot { background: var(--expense); }

/* ==========================================================
   3. BUDGETS & DEBTS VIEW
   ========================================================== */
.segmented-control {
  display: flex;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 4px;
  margin: 12px 0 16px;
}
.segment-btn {
  flex: 1;
  padding: 8px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  border: none;
  background: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s;
}
.segment-btn.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.budget-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin-bottom: 10px;
}
.budget-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.budget-category {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
}
.budget-vals {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}
.budget-bar-track {
  height: 8px;
  background: var(--bg-input);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 6px;
}
.budget-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.4s ease-out;
}
.budget-status-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
}

/* Debts */
.debt-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin-bottom: 10px;
}
.debt-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.debt-name {
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}
.debt-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-weight: 700;
}
.debt-badge.lend { background: var(--income-bg); color: var(--income); }
.debt-badge.borrow { background: var(--expense-bg); color: var(--expense); }
.debt-details {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}
.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
}
.btn-primary-sm { background: var(--accent); color: #FFF; }
.btn-outline-sm { background: transparent; border: 1px solid var(--border-subtle); color: var(--text-primary); }

/* ==========================================================
   4. SETTINGS & PROFILE VIEW
   ========================================================== */
.profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 16px;
  margin: 12px 0 20px;
}
.profile-avatar-lg {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent), #8B5CF6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  color: #FFF;
}
.profile-info h3 {
  font-size: 16px;
  font-weight: 700;
}
.profile-info p {
  font-size: 12px;
  color: var(--text-muted);
}

.settings-group {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  overflow: hidden;
}
.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
}
.settings-item:last-child {
  border-bottom: none;
}
.settings-left {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 500;
}
.settings-icon {
  font-size: 18px;
}
.settings-right {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 13px;
}

/* Switch Toggle */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--border-subtle);
  transition: .3s;
  border-radius: 24px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}
input:checked + .slider { background-color: var(--accent); }
input:checked + .slider:before { transform: translateX(20px); }

/* ==========================================================
   BOTTOM NAVIGATION BAR
   ========================================================== */
.bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(env(safe-area-inset-bottom, 16px) + 64px);
  padding-bottom: env(safe-area-inset-bottom, 16px);
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 50;
}

[data-theme="light"] .bottom-nav {
  background: rgba(255, 255, 255, 0.9);
}

.nav-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  flex: 1;
}
.nav-tab.active {
  color: var(--accent);
}
.nav-icon {
  font-size: 20px;
}

/* Radiant Add Button in Center */
.nav-add-btn {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent), #2563EB);
  color: #FFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-glow);
  transform: translateY(-12px);
  transition: transform 0.2s;
}
.nav-add-btn:active {
  transform: translateY(-12px) scale(0.92);
}

/* ==========================================================
   QUICK ADD BOTTOM SHEET & NUMPAD
   ========================================================== */
.modal-backdrop {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  opacity: 0;
  transition: opacity 0.25s;
}
.modal-backdrop.active {
  display: block;
  opacity: 1;
}

.bottom-sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-surface);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  border-top: 1px solid var(--border-subtle);
  max-height: 94vh;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 210;
  padding-bottom: env(safe-area-inset-bottom, 16px);
}
.bottom-sheet.active {
  transform: translateY(0);
}

.sheet-handle {
  width: 36px;
  height: 5px;
  background: var(--border-subtle);
  border-radius: var(--radius-full);
  margin: 10px auto 4px;
}

.sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px 10px;
}

/* Operation Type Selector in Modal */
.type-segmented {
  display: flex;
  background: var(--bg-card);
  border-radius: var(--radius-full);
  padding: 3px;
  gap: 2px;
}
.type-chip {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: none;
  background: none;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
}
.type-chip.active.expense { background: var(--expense); color: #FFF; }
.type-chip.active.income { background: var(--income); color: #FFF; }
.type-chip.active.transfer { background: var(--transfer); color: #FFF; }

/* Big Tactile Amount Display */
.amount-display-box {
  text-align: center;
  padding: 12px 16px;
  background: var(--bg-card);
  margin: 0 16px 10px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
}
.amount-currency-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}
.amount-val-huge {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  word-break: break-all;
}

/* Account selector chips row */
.sheet-accounts-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 16px 10px;
  scrollbar-width: none;
}
.sheet-accounts-row::-webkit-scrollbar {
  display: none;
}
.acc-select-pill {
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  cursor: pointer;
}
.acc-select-pill.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #FFF;
}

/* Category Grid Scroll in Modal */
.category-picker-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 0 16px 12px;
  scrollbar-width: none;
}
.category-picker-scroll::-webkit-scrollbar {
  display: none;
}
.cat-pick-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 0 0 62px;
  cursor: pointer;
}
.cat-pick-circle {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  border: 2px solid transparent;
  transition: transform 0.15s;
}
.cat-pick-item.active .cat-pick-circle {
  border-color: #FFF;
  transform: scale(1.08);
  box-shadow: 0 0 10px var(--accent-glow);
}
.cat-pick-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

/* Optional Note & Date input row */
.extra-meta-row {
  display: flex;
  gap: 8px;
  padding: 0 16px 10px;
}
.input-field-sm {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text-primary);
  outline: none;
}
.input-field-sm:focus {
  border-color: var(--accent);
}

/* Numpad Keypad Layout */
.numpad-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 0 16px 10px;
}
.num-key {
  height: 52px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.1s, transform 0.1s;
}
.num-key:active {
  background: var(--bg-card-hover);
  transform: scale(0.95);
}
.num-key.op-key {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent);
  font-weight: 700;
}
.num-key.action-key {
  background: var(--accent);
  color: #FFF;
  font-weight: 800;
  font-size: 15px;
  grid-column: span 2;
  box-shadow: var(--shadow-glow);
}

/* ==========================================================
   AUTH SCREEN (Login / Register)
   ========================================================== */
.auth-container {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg-app);
  z-index: 300;
  padding: 40px 24px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.auth-logo {
  text-align: center;
  margin-bottom: 24px;
}
.auth-logo-icon {
  font-size: 48px;
  margin-bottom: 8px;
}
.auth-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
}
.auth-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}
.form-input {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  color: var(--text-primary);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}
.form-input:focus {
  border-color: var(--accent);
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #1D4ED8);
  color: #FFF;
  font-size: 15px;
  font-weight: 700;
  padding: 14px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-glow);
  margin-top: 6px;
  transition: transform 0.15s;
}
.btn-primary:active {
  transform: scale(0.98);
}
.auth-switch {
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 16px;
}
.auth-switch a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

/* ==========================================================
   PIN LOCK SCREEN
   ========================================================== */
.pin-lock-screen {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg-app);
  z-index: 400;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.pin-lock-screen.active {
  display: flex;
}
.pin-dots {
  display: flex;
  gap: 16px;
  margin: 24px 0 36px;
}
.pin-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--text-muted);
  transition: all 0.2s;
}
.pin-dot.filled {
  background: var(--accent);
  border-color: var(--accent);
  transform: scale(1.15);
}
.pin-numpad {
  display: grid;
  grid-template-columns: repeat(3, 72px);
  gap: 16px;
}
.pin-key {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 24px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
}
.pin-key:active {
  background: var(--accent);
  color: #FFF;
}

/* Toast Notification */
.toast-msg {
  position: absolute;
  top: 60px;
  left: 20px;
  right: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  box-shadow: var(--shadow-md);
  text-align: center;
  z-index: 500;
  transform: translateY(-80px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}
.toast-msg.show {
  transform: translateY(0);
  opacity: 1;
}
.toast-msg.success { border-color: var(--income); }
.toast-msg.error { border-color: var(--expense); }
