/* ═══════════════════════════════════════════════════════════
   Ahorro Pro — 米茶色 Theme
   ════════════════════════════════════════════════════════════ */

/* ── Variables ──────────────────────────────────────────── */
:root {
  --bg:          #E8E0CE;
  --bg-card:     #F0EAD9;
  --bg-row:      rgba(255,255,255,0.25);
  --accent:      #D45D4E;
  --accent-dark: #C04A3B;
  --accent-text: #ffffff;
  --income:      #6B9E7A;
  --text:        #3A332B;
  --text-2:      #7A6E62;
  --text-light:  #B0A898;
  --divider:     #D4CCBA;
  --nav-bg:      #2E2923;
  --nav-active:  #E8E0CE;
  --icon-color:  #4A3F35;
  --nav-height:  60px;
  --topbar-height: 52px;
  --transition:  all 0.22s cubic-bezier(0.4,0,0.2,1);
}

/* ── Reset ───────────────────────────────────────────────── */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  max-width: 480px;
  margin: 0 auto;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  position: relative;
}
input, button, select { font-family: inherit; }
button { cursor: pointer; border: none; background: none; color: inherit; }
input, select { outline: none; }
a { text-decoration: none; color: inherit; }

/* ── App Shell ───────────────────────────────────────────── */
#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
}

/* ── Topbar ─────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 100;
  height: var(--topbar-height);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px;
  background: var(--nav-bg);
}
.topbar-left { display: flex; align-items: center; gap: 10px; }
.logo-circle {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 800; color: #fff;
  letter-spacing: -1px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(212,93,78,0.5);
}
.app-name {
  font-size: 16px; font-weight: 700;
  color: var(--nav-active);
  letter-spacing: -0.3px;
}
.topbar-right { display: flex; align-items: center; gap: 2px; }
.topbar-date {
  font-size: 15px; font-weight: 600;
  color: var(--nav-active);
  margin-right: 4px;
}

/* Icon Button (topbar) */
.icon-btn {
  width: 38px; height: 38px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--nav-active); opacity: 0.85;
  transition: var(--transition);
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover { opacity: 1; background: rgba(255,255,255,0.08); }
.icon-btn:active { transform: scale(0.92); }

/* ── Page Content ───────────────────────────────────────── */
.page-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}
.page { display: none; }
.page.active { display: flex; flex-direction: column; min-height: calc(100vh - var(--topbar-height) - var(--nav-height)); }

/* ── Daily View ─────────────────────────────────────────── */
.daily-hero {
  background: var(--bg);
  padding: 20px 20px 24px;
  user-select: none;
}
.daily-date-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.daily-date-nav {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-light); font-size: 22px; font-weight: 300;
  border-radius: 50%;
  transition: var(--transition);
}
.daily-date-nav:hover { color: var(--text); background: rgba(0,0,0,0.05); }
.daily-date-nav:active { transform: scale(0.9); }
.daily-date-label {
  font-size: 15px; font-weight: 600; color: var(--text); opacity: 0.9;
}
.daily-total-row {
  display: flex; align-items: baseline; justify-content: space-between;
}
.daily-currency {
  font-size: 20px; font-weight: 700; color: var(--text-2);
}
.daily-amount {
  font-size: 56px; font-weight: 800; color: var(--text);
  letter-spacing: -2px; line-height: 1;
}

/* Transaction list on daily view (inside red area) */
.daily-tx-list {
  background: var(--bg);
  flex: 1;
  padding: 0 0 8px;
}
.daily-tx-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px;
  background: rgba(255,255,255,0.12);
  margin: 0 12px 6px;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.daily-tx-item:hover { background: rgba(255,255,255,0.18); }
.daily-tx-item:active { transform: scale(0.98); }
.daily-tx-icon {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  color: var(--icon-color);
  flex-shrink: 0;
}
.daily-tx-icon svg { width: 28px; height: 28px; }
.daily-tx-cat {
  flex: 1;
  font-size: 15px; font-weight: 500; color: var(--text);
}
.daily-tx-note {
  font-size: 12px; color: rgba(0,0,0,0.5);
  margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.daily-tx-amt {
  font-size: 16px; font-weight: 700; color: var(--accent);
  text-align: right; flex-shrink: 0;
}
.daily-tx-amt.income { color: var(--income); }
.daily-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-light);
  font-size: 14px;
}

/* ── Budget Bar (bottom of daily view) ──────────────────── */
.budget-strip {
  background: var(--bg-card);
  border-top: 1px solid var(--divider);
  padding: 12px 20px;
  display: flex; align-items: center; gap: 12px;
}
.budget-pig-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  flex-shrink: 0;
}
.budget-pig-icon { font-size: 28px; line-height: 1; }
.budget-pct { font-size: 11px; font-weight: 600; color: var(--text-2); }
.budget-figures {
  flex: 1;
  display: flex; align-items: baseline; justify-content: center; gap: 0;
}
.budget-fig-block { text-align: center; padding: 0 8px; }
.budget-fig-block + .budget-fig-block {
  border-left: 1px solid var(--divider);
}
.budget-fig-num {
  font-size: 19px; font-weight: 800;
  color: var(--text); letter-spacing: -0.5px;
}
.budget-fig-label {
  font-size: 10px; color: var(--text-light); font-weight: 500; margin-top: 2px;
}

/* ── Bottom Nav ─────────────────────────────────────────── */
.bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  height: var(--nav-height);
  display: grid; grid-template-columns: 1fr 1fr 64px 1fr 1fr;
  align-items: center;
  background: var(--nav-bg);
  padding: 0 4px;
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 200;
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px; border-radius: 8px;
  color: rgba(255,255,255,0.4); font-size: 10px; font-weight: 600;
  transition: var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.nav-item svg { width: 22px; height: 22px; transition: var(--transition); }
.nav-item:hover { color: rgba(255,255,255,0.7); }
.nav-item.active { color: var(--nav-active); }
.nav-fab {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  justify-self: center;
  box-shadow: 0 3px 14px rgba(212,93,78,0.55);
  transition: var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.nav-fab svg { width: 22px; height: 22px; color: #fff; }
.nav-fab:hover { transform: scale(1.08); }
.nav-fab:active { transform: scale(0.93); }

/* ── Records Page ─────────────────────────────────────────── */
.records-header {
  padding: 16px 16px 10px;
  display: flex; align-items: center; justify-content: space-between;
}
.records-month-nav {
  display: flex; align-items: center; gap: 10px;
}
.month-arrow {
  width: 30px; height: 30px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-card); color: var(--text-2);
  font-size: 16px; font-weight: 500;
  transition: var(--transition);
}
.month-arrow:hover { background: var(--divider); }
.month-arrow:active { transform: scale(0.93); }
.records-month-label {
  font-size: 16px; font-weight: 700; color: var(--text);
  min-width: 90px; text-align: center;
}
.records-summary {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px; padding: 0 16px 16px;
}
.rec-card {
  background: var(--bg-card);
  border-radius: 10px;
  padding: 12px 14px;
}
.rec-card-label { font-size: 11px; color: var(--text-2); font-weight: 500; margin-bottom: 4px; }
.rec-card-amt { font-size: 18px; font-weight: 800; letter-spacing: -0.5px; }
.rec-card-amt.expense { color: var(--accent); }
.rec-card-amt.income  { color: var(--income); }

.tx-group { margin-bottom: 4px; }
.tx-group-header {
  padding: 8px 16px 4px;
  font-size: 12px; font-weight: 600; color: var(--text-light);
  display: flex; justify-content: space-between;
}

/* ── Transaction Item (records & daily) ─────────────────── */
.tx-item {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--divider);
  cursor: pointer;
  transition: var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.tx-item:first-child { border-top: 1px solid var(--divider); }
.tx-item:hover { background: var(--bg); }
.tx-item:active { transform: scaleX(0.99); }
.tx-icon-wrap {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  color: var(--icon-color);
  flex-shrink: 0;
}
.tx-icon-wrap svg { width: 30px; height: 30px; }
.tx-info { flex: 1; min-width: 0; }
.tx-cat { font-size: 14px; font-weight: 500; color: var(--text); }
.tx-note-small { font-size: 12px; color: var(--text-light); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-right { text-align: right; flex-shrink: 0; }
.tx-amt { font-size: 15px; font-weight: 700; color: var(--accent); }
.tx-amt.income-tx { color: var(--income); }

/* ── Empty State ────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 48px 20px;
  color: var(--text-light);
}
.empty-icon { font-size: 36px; margin-bottom: 10px; }
.empty-state p { font-size: 14px; line-height: 1.6; }

/* ── Budget Settings Page ──────────────────────────────── */
.budget-hero {
  background: var(--accent);
  padding: 28px 24px;
  text-align: center;
}
.budget-hero-label {
  font-size: 14px; font-weight: 600; color: rgba(255,255,255,0.7);
  margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px;
}
.budget-hero-amount {
  font-size: 48px; font-weight: 900; color: #fff;
  letter-spacing: -2px; line-height: 1;
  cursor: pointer;
}
.budget-hero-currency {
  font-size: 20px; font-weight: 700; color: rgba(255,255,255,0.8);
}
.budget-settings-list { padding: 8px 0; }
.budget-row {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--divider);
}
.budget-row:first-child { border-top: 1px solid var(--divider); }
.budget-row-icon {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  color: var(--icon-color); flex-shrink: 0;
}
.budget-row-icon svg { width: 26px; height: 26px; }
.budget-row-label { flex: 1; font-size: 15px; font-weight: 500; color: var(--text); }
.budget-row-value { font-size: 14px; color: var(--text-2); font-weight: 500; }
.budget-row select {
  border: none; background: transparent;
  font-size: 14px; color: var(--text-2); font-weight: 500;
  text-align: right;
}

/* Toggle Switch */
.toggle-switch { position: relative; display: inline-block; width: 48px; height: 26px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0; cursor: pointer;
  background: var(--divider); border-radius: 26px;
  transition: 0.3s;
}
.toggle-slider:before {
  content: ''; position: absolute;
  width: 20px; height: 20px; left: 3px; bottom: 3px;
  background: #fff; border-radius: 50%;
  transition: 0.3s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
input:checked + .toggle-slider { background: var(--accent); }
input:checked + .toggle-slider:before { transform: translateX(22px); }

/* Budget amount editor */
.budget-amount-input {
  background: transparent; border: none;
  font-size: 48px; font-weight: 900; color: #fff;
  letter-spacing: -2px; width: 100%; text-align: center;
  max-width: 260px;
}
.budget-amount-input:focus { outline: 2px solid rgba(255,255,255,0.4); border-radius: 8px; }

/* ── Category Page ──────────────────────────────────────── */
.cat-tabs {
  display: flex; background: var(--bg);
  border-bottom: 1px solid var(--divider);
}
.cat-tab {
  flex: 1; padding: 12px 0;
  text-align: center; font-size: 14px; font-weight: 600;
  color: var(--text-light); border-bottom: 2px solid transparent;
  transition: var(--transition);
}
.cat-tab.active { color: var(--text); border-color: var(--accent); }

.cat-list { flex: 1; overflow-y: auto; }
.cat-list-item {
  display: flex; align-items: center;
  padding: 14px 20px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--divider);
  gap: 16px;
  cursor: pointer;
  transition: var(--transition);
}
.cat-list-item:hover { background: var(--bg); }
.cat-list-icon {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  color: var(--icon-color);
}
.cat-list-icon svg { width: 32px; height: 32px; }
.cat-list-name {
  flex: 1; font-size: 16px; font-weight: 500; color: var(--text);
  text-align: right;
}
.cat-add-btn {
  position: fixed; bottom: calc(var(--nav-height) + 16px); left: 50%; transform: translateX(-50%);
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--nav-bg);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 12px rgba(0,0,0,0.25);
  z-index: 150;
  transition: var(--transition);
}
.cat-add-btn svg { width: 22px; height: 22px; color: #fff; }
.cat-add-btn:hover { transform: translateX(-50%) scale(1.08); }

/* ── Add Category Modal ─────────────────────────────────── */
.cat-modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(0,0,0,0.5);
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s;
}
.cat-modal-overlay.open { opacity: 1; pointer-events: auto; }
.cat-modal {
  width: 100%; max-width: 480px;
  background: var(--bg-card);
  border-radius: 20px 20px 0 0;
  padding: 20px 20px 32px;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1);
  max-height: 85vh; overflow-y: auto;
}
.cat-modal-overlay.open .cat-modal { transform: translateY(0); }

.cat-modal-name-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: var(--bg);
  border-radius: 10px;
  margin-bottom: 16px;
  border: 1px solid var(--divider);
}
.cat-modal-preview {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  color: var(--icon-color); flex-shrink: 0;
}
.cat-modal-preview svg { width: 30px; height: 30px; }
.cat-name-input {
  flex: 1; background: none; border: none;
  font-size: 16px; color: var(--text); font-weight: 500;
}
.cat-name-input::placeholder { color: var(--text-light); }

.icon-picker {
  background: var(--bg);
  border-radius: 10px;
  padding: 10px;
  border: 1px solid var(--divider);
}
.icon-picker-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px;
}
.icon-picker-cell {
  aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px; cursor: pointer;
  color: var(--icon-color);
  transition: var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.icon-picker-cell svg { width: 28px; height: 28px; }
.icon-picker-cell:hover { background: var(--divider); }
.icon-picker-cell.selected { background: var(--accent); color: #fff; }

/* ── Add Transaction Modal ───────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(0,0,0,0.55);
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s;
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal {
  width: 100%; max-width: 480px;
  background: var(--bg-card);
  border-radius: 20px 20px 0 0;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1);
  max-height: 90vh; overflow-y: auto;
  overflow-x: hidden;
}
.modal-overlay.open .modal { transform: translateY(0); }

.modal-amount-header {
  background: var(--accent);
  padding: 16px 20px 20px;
  display: flex; flex-direction: column; gap: 10px;
  text-align: right;
  transition: background 0.3s;
}
.modal-amount-display {
  font-size: 48px; font-weight: 900; color: #fff;
  letter-spacing: -2px; line-height: 1;
  cursor: text;
}
.modal-amount-currency {
  font-size: 20px; font-weight: 700; color: rgba(255,255,255,0.8);
}
.modal-type-row {
  display: flex; gap: 0;
  background: rgba(0,0,0,0.15);
  border-radius: 8px; padding: 3px;
  margin-top: 12px;
}
.modal-type-btn {
  flex: 1; padding: 6px;
  border-radius: 6px; font-size: 13px; font-weight: 600;
  color: rgba(255,255,255,0.6); transition: var(--transition);
}
.modal-type-btn.active { background: rgba(255,255,255,0.22); color: #fff; }

/* Category section in add modal */
.modal-section { padding: 4px 0; }
#modal-form-area, #modal-numpad {
  height: 410px;
  overflow-y: auto;
}
.modal-cat-grid {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 0;
}
.modal-cat-cell {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 12px 4px 10px;
  cursor: pointer; border-radius: 8px;
  color: var(--icon-color); transition: var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.modal-cat-cell svg { width: 28px; height: 28px; }
.modal-cat-cell span { font-size: 10px; font-weight: 500; color: var(--text-2); }
.modal-cat-cell.selected { background: rgba(212,93,78,0.12); color: var(--accent); }
.modal-cat-cell.selected span { color: var(--accent); }
.modal-cat-dots { display: flex; justify-content: center; gap: 5px; padding: 4px 0 8px; }
.modal-cat-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--divider); }
.modal-cat-dot.active { background: var(--text-2); }

/* Form rows */
.modal-form-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px;
  border-top: 1px solid var(--divider);
}
.modal-form-icon {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  color: var(--icon-color); flex-shrink: 0;
}
.modal-form-icon svg { width: 22px; height: 22px; }
.modal-form-input {
  flex: 1; background: none; border: none;
  font-size: 14px; color: var(--text); font-weight: 500;
  text-align: right;
}
.modal-form-input::placeholder { color: var(--text-light); }
.modal-form-label { font-size: 14px; color: var(--text-light); }

/* Save button */
.modal-save-row {
  padding: 16px 20px;
  border-top: 1px solid var(--divider);
  display: flex; gap: 10px;
}
.btn-save {
  flex: 1; padding: 14px;
  background: var(--nav-bg); color: var(--nav-active);
  border-radius: 10px; font-size: 15px; font-weight: 700;
  transition: var(--transition);
}
.btn-save:hover { background: #3d3530; }
.btn-save:active { transform: scale(0.97); }
.btn-delete {
  padding: 14px 20px;
  background: rgba(212,93,78,0.1); color: var(--accent);
  border-radius: 10px; font-size: 15px; font-weight: 600;
  border: 1px solid rgba(212,93,78,0.3);
  transition: var(--transition);
}
.btn-delete:hover { background: rgba(212,93,78,0.2); }

/* ── Settings Page ──────────────────────────────────────── */
.settings-content { padding: 0 0 calc(var(--nav-height) + 20px); }
.settings-section { margin-bottom: 4px; }
.settings-section-title {
  padding: 16px 20px 6px;
  font-size: 12px; font-weight: 700; color: var(--text-light);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.settings-row {
  display: flex; align-items: center;
  padding: 15px 20px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--divider);
  gap: 12px;
}
.settings-row:first-of-type { border-top: 1px solid var(--divider); }
.settings-row-icon {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.settings-row-info { flex: 1; }
.settings-row-label { font-size: 14px; font-weight: 500; color: var(--text); }
.settings-row-sub { font-size: 12px; color: var(--text-light); margin-top: 1px; }
.settings-row-action { margin-left: auto; }
.settings-btn {
  padding: 7px 14px; border-radius: 8px;
  background: var(--bg); border: 1px solid var(--divider);
  font-size: 13px; font-weight: 500; color: var(--text-2);
  transition: var(--transition);
}
.settings-btn:hover { background: var(--divider); }
.settings-btn.danger { color: var(--accent); border-color: rgba(212,93,78,0.3); }
.settings-btn.danger:hover { background: rgba(212,93,78,0.08); }

/* Category tags in settings */
.cat-tags-wrap { padding: 12px 20px; display: flex; flex-wrap: wrap; gap: 8px; background: var(--bg-card); border-bottom: 1px solid var(--divider); }
.cat-tag {
  display: flex; align-items: center; gap: 5px;
  padding: 5px 10px; border-radius: 99px;
  background: var(--bg); border: 1px solid var(--divider);
  font-size: 12px; font-weight: 500; color: var(--text-2);
}
.cat-tag-remove { color: var(--text-light); font-size: 15px; line-height: 1; }

/* ── Invoice Page ───────────────────────────────────────── */
.invoice-page { padding: 20px 16px calc(var(--nav-height) + 20px); }
.invoice-hero-section {
  text-align: center; padding: 24px; margin-bottom: 12px;
  background: var(--bg-card); border-radius: 12px;
  border: 1px solid var(--divider);
}
.invoice-hero-section h2 { font-size: 17px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.invoice-hero-section p { font-size: 13px; color: var(--text-2); line-height: 1.5; }
.inv-form-section { background: var(--bg-card); border-radius: 12px; padding: 16px; margin-bottom: 12px; border: 1px solid var(--divider); }
.inv-form-label { font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 5px; display: block; }
.inv-form-input {
  width: 100%; padding: 10px 12px;
  background: var(--bg); border: 1px solid var(--divider);
  border-radius: 8px; color: var(--text); font-size: 14px; margin-bottom: 10px;
}
.inv-form-input:focus { border-color: var(--accent); }
.inv-btn-primary {
  width: 100%; padding: 13px;
  background: var(--accent); color: #fff; border-radius: 10px;
  font-size: 15px; font-weight: 700; transition: var(--transition);
}
.inv-btn-primary:hover { background: var(--accent-dark); }
.inv-btn-primary:active { transform: scale(0.98); }
.invoice-card {
  background: var(--bg-card); border-radius: 10px;
  padding: 12px 14px; margin-bottom: 8px;
  border: 1px solid var(--divider);
}
.invoice-card-top { display: flex; justify-content: space-between; margin-bottom: 6px; }
.inv-num { font-size: 12px; color: var(--text-2); font-weight: 600; }
.inv-amt { font-size: 15px; font-weight: 700; color: var(--accent); }
.inv-date { font-size: 12px; color: var(--text-light); }

/* ── Toast ──────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: calc(var(--nav-height) + 16px); left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--nav-bg); color: var(--nav-active);
  padding: 10px 22px; border-radius: 99px; font-size: 14px; font-weight: 500;
  white-space: nowrap; z-index: 999;
  opacity: 0; pointer-events: none;
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Loading ─────────────────────────────────────────────── */
.loading-overlay { text-align: center; padding: 40px; color: var(--text-2); }
.spinner {
  width: 36px; height: 36px; border: 3px solid var(--divider);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin 0.8s linear infinite; margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--divider); border-radius: 3px; }

/* ── Swipe animation ─────────────────────────────────────── */
@keyframes slideInRight { from { transform: translateX(60px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideInLeft  { from { transform: translateX(-60px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.slide-in-right .daily-hero, .slide-in-right .daily-tx-list { animation: slideInRight 0.28s ease; }
.slide-in-left  .daily-hero, .slide-in-left  .daily-tx-list { animation: slideInLeft  0.28s ease; }

/* ── Captcha Modal ──────────────────────────────────────── */
#captcha-modal {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.75); z-index: 9999;
  align-items: center; justify-content: center;
}
.captcha-box {
  background: var(--bg-card); padding: 24px; border-radius: 16px;
  width: 90%; max-width: 320px; text-align: center;
}
.captcha-box h3 { font-size: 16px; font-weight: 700; margin-bottom: 12px; color: var(--text); }
.captcha-box img { width: 100%; border-radius: 8px; margin-bottom: 14px; border: 1px solid var(--divider); }
.captcha-box input {
  width: 100%; padding: 11px; text-align: center;
  font-size: 22px; letter-spacing: 5px; font-weight: 700;
  border: 1px solid var(--divider); border-radius: 8px;
  background: var(--bg); color: var(--text); margin-bottom: 14px;
}
.captcha-btns { display: flex; gap: 8px; }
.captcha-btns button { flex: 1; padding: 12px; border-radius: 8px; font-size: 14px; font-weight: 600; }
.captcha-btns .btn-confirm { background: var(--accent); color: #fff; }
.captcha-btns .btn-cancel { background: var(--bg); color: var(--text-2); border: 1px solid var(--divider); }

/* Page bottom padding for nav */
.page.active { padding-bottom: calc(var(--nav-height) + 8px); }
#page-daily.active { padding-bottom: 0; }

/* ── Calculator Numpad ───────────────────────────────────── */
.numpad-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 16px;
}
.num-btn {
  background: var(--bg-body);
  border: none;
  border-radius: 12px;
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  padding: 16px 0;
  cursor: pointer;
  transition: background 0.15s;
}
.num-btn:active {
  background: var(--divider);
}
.num-btn.op {
  color: var(--accent);

/* ── Calculator Numpad ───────────────────────────────────── */
.numpad-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 16px;
}
.num-btn {
  background: var(--bg-body);
  border: none;
  border-radius: 12px;
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  padding: 16px 0;
  cursor: pointer;
  transition: background 0.15s;
}
.num-btn:active {
  background: var(--divider);
}
.num-btn.op {
  color: var(--accent);
  background: #fdf5f2;
}
.num-btn.action {
  color: var(--text-2);
}
.num-btn.ac {
  background: #e74c3c;
  color: #fff;
}
.num-btn.confirm {
  background: #2ecc71;
  color: #fff;
}

/* Category Settings Drag & Drop */
.cat-edit-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.cat-edit-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-card);
  margin-bottom: 8px;
  border-radius: 8px;
  cursor: grab;
  user-select: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.cat-edit-item:active {
  cursor: grabbing;
}
.cat-edit-item.dragging {
  opacity: 0.5;
}
.cat-edit-icon {
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  margin-right: 12px;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cat-edit-icon svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}
.cat-edit-name {
  flex: 1;
  font-size: 16px;
  color: var(--text);
}
.cat-edit-drag-handle {
  color: var(--text-2);
}
