/* ============================================================
   style.css — Money Tracker Dark Theme
   Colors: #990033 (burgundy) + black
   ============================================================ */

/* ---- CSS Variables ---- */
:root {
  --bg-primary: #0D0D0D;
  --bg-secondary: #1A1A1A;
  --bg-tertiary: #252525;
  --bg-hover: #2A2A2A;
  --accent: #990033;
  --accent-light: #CC0044;
  --accent-dark: #6B0024;
  --accent-glow: rgba(153, 0, 51, 0.3);
  --text-primary: #FFFFFF;
  --text-secondary: #AAAAAA;
  --text-muted: #666666;
  --positive: #00CC66;
  --positive-bg: rgba(0, 204, 102, 0.1);
  --negative: #990033;
  --negative-bg: rgba(153, 0, 51, 0.1);
  --investment: #FFB800;
  --investment-bg: rgba(255, 184, 0, 0.1);
  --remaining: #FFFFFF;
  --border: #333333;
  --shadow: rgba(0, 0, 0, 0.5);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --nav-height: 70px;
  --header-height: 56px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ---- Reset ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.hidden {
  display: none !important;
}

/* ---- App Container ---- */
.app-container {
  max-width: 480px;
  margin: 0 auto;
  padding-bottom: calc(var(--nav-height) + 16px);
  min-height: 100dvh;
}

/* ---- Header ---- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(135deg, var(--bg-primary) 0%, #1a0a10 100%);
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.app-title {
  font-size: 1.4rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-light) 0%, #ff3366 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---- Period Selector ---- */
.period-selector {
  display: flex;
  gap: 6px;
  padding: 12px 16px 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.period-selector::-webkit-scrollbar {
  display: none;
}

.period-btn {
  flex-shrink: 0;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.period-btn:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

.period-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--text-primary);
  box-shadow: 0 2px 12px var(--accent-glow);
}

/* Custom date range */
.custom-date-range {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px 12px;
  flex-wrap: wrap;
}

.date-input-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.date-input-group label {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ---- Summary Panel ---- */
.summary-panel {
  margin: 12px 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 4px 0;
  border: 1px solid var(--border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  transition: background 0.15s ease;
}

.summary-row.clickable {
  cursor: pointer;
}

.summary-row.clickable:hover {
  background: var(--bg-hover);
}

.summary-row.clickable:active {
  background: var(--bg-tertiary);
}

.summary-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  font-weight: 500;
}

.summary-icon {
  font-size: 1.2rem;
}

.summary-amount {
  font-size: 1.1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.summary-amount.positive {
  color: var(--positive);
}

.summary-amount.negative {
  color: var(--negative);
}

.summary-amount.investment {
  color: var(--investment);
}

.summary-amount.remaining {
  color: var(--text-primary);
}

.summary-amount.remaining.negative-balance {
  color: #ff4466;
}

.summary-divider {
  height: 1px;
  background: var(--border);
  margin: 0 20px;
}

/* ---- Section Title ---- */
.section-title {
  padding: 20px 16px 12px;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ---- Category Grid ---- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 0 16px 20px;
}

.category-tile {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 120px;
  position: relative;
  overflow: hidden;
}

.category-tile::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform 0.2s ease;
}

.category-tile:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.category-tile:hover::before {
  transform: scaleX(1);
}

.category-tile:active {
  transform: translateY(0);
}

.tile-emoji {
  font-size: 2rem;
}

.tile-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.3;
}

.tile-amount {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.add-tile {
  border-style: dashed;
  border-color: var(--text-muted);
  opacity: 0.7;
}

.add-tile:hover {
  opacity: 1;
  border-color: var(--accent);
}

.category-tile .tile-delete {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 0, 0, 0.15);
  color: #ff4466;
  font-size: 0.8rem;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.category-tile:hover .tile-delete {
  display: flex;
}

.category-tile .tile-delete:hover {
  background: rgba(255, 0, 0, 0.3);
}

/* ---- Charts ---- */
.chart-card {
  margin: 0 16px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.chart-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.chart-wrapper {
  position: relative;
  width: 100%;
  height: 250px;
}

.chart-wrapper-pie {
  height: 300px;
}

.chart-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ---- Settings ---- */
.settings-group {
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-card {
  padding: 16px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.settings-btn {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 16px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
  font-family: var(--font);
  color: var(--text-primary);
}

.settings-btn:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
}

.settings-btn.danger:hover {
  border-color: #ff4466;
}

.settings-btn-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.settings-btn-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.settings-btn-title {
  font-size: 0.95rem;
  font-weight: 600;
}

.settings-btn-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.app-info {
  padding: 30px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.app-info .text-muted {
  margin-top: 4px;
  font-size: 0.75rem;
}

/* ---- Bottom Navigation ---- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: var(--nav-height);
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0;
  z-index: 200;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.nav-btn {
  flex: 1;
  max-width: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 0;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font);
  position: relative;
}

.nav-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 40px;
  height: 3px;
  background: var(--accent);
  border-radius: 0 0 3px 3px;
  transition: transform 0.2s ease;
}

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

.nav-btn.active::after {
  transform: translateX(-50%) scaleX(1);
}

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

.nav-btn-center-wrapper {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.nav-btn-center {
  width: 48px;
  height: 48px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 12px var(--accent-glow);
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
  color: white;
  border: none;
}

.nav-btn-center .nav-icon {
  font-size: 1.5rem;
  margin: 0;
}

.nav-btn-center:active {
  transform: scale(0.95);
  background: var(--accent-dark);
}

.nav-icon {
  font-size: 1.3rem;
}

.nav-label {
  font-size: 0.7rem;
  font-weight: 500;
}

/* ---- Modal ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.modal-content {
  background: var(--bg-secondary);
  border-radius: var(--radius) var(--radius) 0 0;
  width: 100%;
  max-width: 480px;
  max-height: 85dvh;
  overflow-y: auto;
  animation: slideUp 0.25s ease;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 20px 0;
  position: sticky;
  top: 0;
  background: var(--bg-secondary);
  z-index: 1;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
}

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.modal-close:hover {
  background: var(--accent);
  color: white;
}

.modal-body {
  padding: 20px;
}

/* ---- Confirm Dialog ---- */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.15s ease;
}

.confirm-dialog {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  width: 90%;
  max-width: 360px;
  text-align: center;
}

.confirm-message {
  font-size: 1rem;
  margin-bottom: 20px;
  line-height: 1.5;
}

.confirm-actions {
  display: flex;
  gap: 10px;
}

.confirm-actions .btn {
  flex: 1;
}

/* ---- Toast ---- */
.toast {
  position: fixed;
  bottom: calc(var(--nav-height) + 16px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  padding: 12px 24px;
  border-radius: 30px;
  font-size: 0.88rem;
  font-weight: 500;
  z-index: 3000;
  box-shadow: 0 4px 20px var(--shadow);
  border: 1px solid var(--border);
  animation: toastIn 0.3s ease;
  white-space: nowrap;
}

/* ---- Forms ---- */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  max-width: 100%;
  padding: 12px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.95rem;
  transition: border-color 0.2s;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.form-select {
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23FFFFFF%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right 16px top 50%;
  background-size: 12px auto;
  padding-right: 40px;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
}

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

.form-select {
  appearance: none;
  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 1L6 6L11 1' stroke='%23AAAAAA' stroke-width='2' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

/* Color scheme for date/time inputs */
input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-xs);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.btn-primary:hover {
  background: var(--accent-light);
  box-shadow: 0 2px 12px var(--accent-glow);
}

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

.btn-secondary:hover {
  background: var(--bg-hover);
}

.btn-danger {
  background: #cc2244;
  color: white;
}

.btn-danger:hover {
  background: #dd3355;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.82rem;
}

.btn-full {
  width: 100%;
}

/* ---- Transaction List ---- */
.transaction-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 16px;
}

.transaction-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-xs);
  transition: background 0.15s;
}

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

.transaction-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.transaction-desc {
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.transaction-date {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.transaction-amount {
  font-size: 1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-left: 12px;
  flex-shrink: 0;
}

.transaction-delete {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  flex-shrink: 0;
  transition: all 0.15s;
}

.transaction-delete:hover {
  background: rgba(255, 0, 0, 0.15);
  color: #ff4466;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 250px;
  text-align: center;
  padding: 30px 20px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.empty-state-text {
  font-size: 0.9rem;
}

/* ---- Emoji Picker ---- */
.emoji-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  margin-top: 8px;
}

.emoji-option {
  width: 100%;
  aspect-ratio: 1;
  border: 2px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--bg-tertiary);
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.emoji-option:hover {
  border-color: var(--accent);
  background: var(--bg-hover);
}

.emoji-option.selected {
  border-color: var(--accent);
  background: var(--accent-dark);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

/* ---- Modal Tabs (Income list / add form) ---- */
.modal-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.modal-tab {
  flex: 1;
  padding: 12px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.modal-tab.active {
  color: var(--accent-light);
  border-bottom-color: var(--accent);
}

.modal-tab:hover {
  color: var(--text-primary);
}

.modal-tab-content {
  display: none;
}

.modal-tab-content.active {
  display: block;
}

/* ---- Category Badge in expense list ---- */
.transaction-category {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  color: var(--accent-light);
  background: var(--accent-glow);
  padding: 2px 8px;
  border-radius: 10px;
  margin-top: 2px;
  width: fit-content;
}

/* ---- Receipt Scanner ---- */
.receipt-scanner {
  margin: 0 16px 16px;
}

.scan-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 40px 20px;
  background: var(--bg-secondary);
  border: 2px dashed var(--accent);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s ease;
}

.scan-btn:hover {
  background: var(--accent-dark);
  border-color: var(--accent-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px var(--accent-glow);
}

.scan-btn:active {
  transform: translateY(0);
}

.scan-icon {
  font-size: 3rem;
}

.scan-text {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.scan-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Receipt progress */
.receipt-progress {
  margin: 0 16px 16px;
  padding: 30px;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  text-align: center;
}

.progress-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.progress-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.progress-bar-container {
  width: 100%;
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  border-radius: 3px;
  width: 0%;
  transition: width 0.3s ease;
}

/* Receipt result */
.receipt-result {
  margin: 0 16px 16px;
  padding: 20px;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.receipt-preview-container {
  margin-bottom: 16px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  max-height: 250px;
  display: flex;
  justify-content: center;
  background: var(--bg-tertiary);
}

.receipt-preview {
  max-width: 100%;
  max-height: 250px;
  object-fit: contain;
}

.receipt-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.receipt-actions .btn {
  flex: 1;
}

/* Receipt list */
.receipt-list-container {
  padding: 0 16px 20px;
}

.receipt-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  transition: background 0.15s;
}

.receipt-item:hover {
  background: var(--bg-hover);
}

.receipt-thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-xs);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-tertiary);
}

.receipt-item-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.receipt-item-desc {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.receipt-item-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 2px;
}

.receipt-item-date {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.receipt-item-amount {
  font-size: 1rem;
  font-weight: 700;
  color: var(--negative);
  flex-shrink: 0;
}

.receipt-item-delete {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
}

.receipt-item-delete:hover {
  background: rgba(255, 0, 0, 0.15);
  color: #ff4466;
}

/* ---- Animations ---- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

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

/* ---- Scrollbar styling ---- */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ---- Tab content ---- */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

/* ---- Responsive ---- */
@media (min-width: 480px) {
  .modal-content {
    border-radius: var(--radius);
    margin: auto;
    max-height: 80vh;
  }

  .modal-overlay {
    align-items: center;
    padding: 20px;
  }
}

/* ---- Print (for export) ---- */
@media print {
  .bottom-nav,
  .period-selector,
  .modal-overlay,
  .confirm-overlay,
  .toast {
    display: none !important;
  }

  .app-container {
    padding-bottom: 0;
  }
}

/* ---- Auth Screen ---- */
.auth-screen { position: fixed; inset: 0; background: var(--bg-primary); display: flex; align-items: center; justify-content: center; z-index: 9999; padding: 20px; }
.auth-screen.hidden { display: none !important; }
.auth-card { background: var(--bg-secondary); padding: 30px; border-radius: var(--radius); border: 1px solid var(--border); width: 100%; max-width: 400px; box-shadow: 0 10px 30px var(--shadow); text-align: center; }
.auth-card h2 { font-size: 1.8rem; margin-bottom: 10px; color: var(--accent); }

