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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f0f2f5;
  color: #1a1a2e;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ===== Navigation ===== */
nav {
  background: #1a1a2e;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 0;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.nav-brand {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin-right: 32px;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}
.nav-brand:hover { color: #fff; opacity: 0.85; }

.nav-brand span { color: #f0a500; }

nav a {
  color: #aab4c4;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0 16px;
  height: 56px;
  display: flex;
  align-items: center;
  transition: color 0.15s, background 0.15s;
  letter-spacing: 0.01em;
}

nav a:hover { color: #fff; background: rgba(255,255,255,0.06); }
nav a.active { color: #fff; border-bottom: 3px solid #f0a500; }

/* ===== Page Container ===== */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

/* ===== Page Header ===== */
.page-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: #1a1a2e;
}

.page-header .subtitle {
  font-size: 0.9rem;
  color: #666;
}

/* ===== Month Navigation ===== */
.month-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
}

.month-nav-center {
  display: flex;
  gap: 8px;
}

.month-nav-center select {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 1rem;
  font-weight: 600;
  color: #1a1a2e;
  background: #fff;
  cursor: pointer;
}

.month-nav-center select:focus {
  outline: none;
  border-color: #f0a500;
  box-shadow: 0 0 0 3px rgba(240,165,0,0.15);
}

.btn-nav {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  width: 40px;
  height: 40px;
  font-size: 1.5rem;
  line-height: 1;
  color: #1a1a2e;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}

.btn-nav:hover:not(:disabled) { background: #f5f5f5; border-color: #bbb; }
.btn-nav:disabled { color: #ccc; cursor: default; }

/* ===== YTD Strip ===== */
.ytd-strip {
  display: flex;
  align-items: center;
  background: #1a1a2e;
  border-radius: 12px;
  padding: 16px 24px;
  margin-bottom: 24px;
  gap: 0;
}

.ytd-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: center;
}

.ytd-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #7a8599;
}

.ytd-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}

.ytd-value.positive { color: #66bb6a; }
.ytd-value.negative { color: #ef5350; }

.ytd-divider {
  width: 1px;
  height: 36px;
  background: rgba(255,255,255,0.1);
  margin: 0 8px;
}

/* ===== Summary Cards ===== */
.summary-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.summary-cards-4 {
  grid-template-columns: repeat(4, 1fr);
}

.card {
  background: #fff;
  border-radius: 12px;
  padding: 20px 24px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.card-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #888;
  margin-bottom: 8px;
}

.card-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: #1a1a2e;
  line-height: 1;
}

.card-value.positive { color: #2e7d32; }
.card-value.negative { color: #c62828; }

/* ===== Section Headers ===== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title {
  font-size: 1rem;
  font-weight: 700;
  color: #1a1a2e;
  letter-spacing: 0.01em;
}

/* ===== No-budget Banner ===== */
.banner {
  background: #fff3cd;
  border: 1px solid #f0a500;
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.banner p { font-size: 0.9rem; color: #7a5a00; }
.banner a { color: #7a5a00; font-weight: 600; text-decoration: underline; }

/* ===== Category Progress Rows ===== */
.categories-list {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  overflow: hidden;
  margin-bottom: 32px;
}

.category-row {
  padding: 16px 20px;
  border-bottom: 1px solid #f0f0f0;
}

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

.category-row-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}

.category-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #1a1a2e;
}

.category-amounts {
  font-size: 0.825rem;
  color: #555;
}

.category-amounts .spent { font-weight: 700; }
.category-amounts .over { color: #c62828; font-weight: 700; }

.progress-track {
  height: 10px;
  background: #eee;
  border-radius: 6px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.4s ease;
  min-width: 2px;
}

.progress-fill.on-track  { background: #4caf50; }
.progress-fill.warning   { background: #ff9800; }
.progress-fill.over      { background: #f44336; }

.category-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
}

.pct-label {
  font-size: 0.75rem;
  color: #888;
}

.over-label {
  font-size: 0.75rem;
  color: #c62828;
  font-weight: 600;
}

.no-budget-label {
  font-size: 0.8rem;
  color: #aaa;
  font-style: italic;
  margin-top: 4px;
}

/* ===== Expenses Table ===== */
.table-wrapper {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  overflow: hidden;
  margin-bottom: 32px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead th {
  background: #f7f8fa;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #888;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #eee;
}

tbody tr { transition: background 0.1s; }
tbody tr:hover { background: #fafafa; }
tr.totals-row-active { background: #fff8e1 !important; }

tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }

.td-amount { font-weight: 700; text-align: right; }
.td-note { color: #666; font-size: 0.8rem; max-width: 200px; }
.td-person { color: #888; font-size: 0.8rem; }

.empty-row td {
  text-align: center;
  color: #bbb;
  padding: 32px;
  font-style: italic;
}

.btn-delete {
  background: none;
  border: none;
  color: #ccc;
  font-size: 1rem;
  padding: 4px 8px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}

.btn-delete:hover { color: #f44336; background: #fff0f0; }

.btn-edit {
  background: none;
  border: none;
  color: #ccc;
  font-size: 1rem;
  padding: 4px 8px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}
.btn-edit:hover { color: #1a6bb5; background: #e8f0fb; }

.td-actions { white-space: nowrap; }

.edit-modal { max-width: 560px; width: 100%; }

/* ===== Forms ===== */
.form-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  padding: 24px;
  margin-bottom: 32px;
}

.form-card h2 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: #1a1a2e;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

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

.form-group label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #888;
}

.form-group input,
.form-group select,
.form-group textarea {
  border: 1px solid #ddd;
  border-radius: 7px;
  padding: 9px 12px;
  font-size: 0.9rem;
  color: #1a1a2e;
  background: #fafafa;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #f0a500;
  box-shadow: 0 0 0 3px rgba(240,165,0,0.15);
  background: #fff;
}

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

.form-note { width: 100%; }

.btn-primary {
  background: #f0a500;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 24px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.15s, transform 0.1s;
  letter-spacing: 0.01em;
}

.btn-primary:hover { background: #d4920a; }
.btn-primary:active { transform: scale(0.98); }

.btn-secondary {
  background: #fff;
  color: #1a1a2e;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 9px 18px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.15s;
}

.btn-secondary:hover { background: #f5f5f5; }

.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ===== Split Expense ===== */
.split-section {
  margin-bottom: 14px;
}
.split-divider {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #f0a500;
  margin-bottom: 10px;
  padding-bottom: 7px;
  border-bottom: 1px solid #f5e9c8;
}
.split-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 10px;
}
.split-row .form-group:first-child { flex: 1; min-width: 0; }
.split-amount-col { width: 130px; flex-shrink: 0; }
#split-amount-2 {
  background: #f0f0f0 !important;
  color: #888;
  cursor: default;
}

/* ===== Income Row ===== */
.income-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid #f0f0f0;
}

/* ===== Budgets Page ===== */
.budget-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.budget-item label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #555;
  margin-bottom: 5px;
}

.budget-item input {
  width: 100%;
  border: 1px solid #ddd;
  border-radius: 7px;
  padding: 9px 12px;
  font-size: 0.9rem;
  background: #fafafa;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.budget-item input:focus {
  outline: none;
  border-color: #f0a500;
  box-shadow: 0 0 0 3px rgba(240,165,0,0.15);
  background: #fff;
}

.budget-total-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f7f8fa;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: 0.875rem;
  color: #555;
}

.budget-total-bar strong { color: #1a1a2e; font-size: 1rem; }

.form-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

/* ===== Month Selector ===== */
.month-selector {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.month-selector label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #888;
}

.month-selector select {
  border: 1px solid #ddd;
  border-radius: 7px;
  padding: 8px 12px;
  font-size: 0.875rem;
  background: #fff;
  color: #1a1a2e;
}

.month-selector select:focus {
  outline: none;
  border-color: #f0a500;
}

/* ===== Filter Row ===== */
.filter-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.filter-row label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #888;
}

.filter-row select {
  border: 1px solid #ddd;
  border-radius: 7px;
  padding: 7px 10px;
  font-size: 0.875rem;
  background: #fff;
  color: #1a1a2e;
}

/* ===== Toast Notification ===== */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1a1a2e;
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  transform: translateY(0);
  opacity: 1;
  transition: opacity 0.4s, transform 0.4s;
  z-index: 200;
}

.toast.success { background: #2e7d32; }
.toast.error   { background: #c62828; }
.toast.hide    { opacity: 0; transform: translateY(12px); }

/* ===== Voice input button ===== */
.btn-voice.voice-active {
  background: #ffebee;
  border-color: #ef5350;
  color: #c62828;
  animation: voice-pulse 1.2s ease-in-out infinite;
}

@keyframes voice-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 83, 80, 0.45); }
  50%       { box-shadow: 0 0 0 7px rgba(239, 83, 80, 0); }
}

/* ===== History read-only badge ===== */
.read-only-badge {
  display: inline-block;
  background: #e8eaf6;
  color: #3949ab;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 10px;
  border-radius: 20px;
}

/* ===== Settings — People ===== */
.people-list {
  list-style: none;
  margin-bottom: 24px;
}

.people-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
}

.people-item:last-child { border-bottom: none; }

.person-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f0a500;
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.person-name {
  flex: 1;
  font-size: 0.95rem;
  font-weight: 500;
}

.person-edit-input {
  flex: 1;
  border: 1px solid #f0a500;
  border-radius: 7px;
  padding: 6px 10px;
  font-size: 0.9rem;
  box-shadow: 0 0 0 3px rgba(240,165,0,0.15);
  outline: none;
}

.person-actions {
  display: flex;
  gap: 4px;
}

.btn-person-edit,
.btn-person-save,
.btn-person-delete {
  background: none;
  border: 1px solid #eee;
  border-radius: 6px;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: #888;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.btn-person-edit:hover  { color: #1a1a2e; background: #f5f5f5; border-color: #ddd; }
.btn-person-save:hover  { color: #2e7d32; background: #f0fff0; border-color: #2e7d32; }
.btn-person-delete:hover { color: #f44336; background: #fff0f0; border-color: #f44336; }

.people-empty {
  color: #bbb;
  font-style: italic;
  padding: 16px 0;
  font-size: 0.875rem;
}

.add-person-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

/* ===== Merchant Autocomplete ===== */
.autocomplete-wrap { position: relative; }
.autocomplete-wrap input { width: 100%; }

.autocomplete-list {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  z-index: 200;
  list-style: none;
  margin: 0;
  padding: 4px 0;
  max-height: 180px;
  overflow-y: auto;
}

.autocomplete-list li {
  padding: 9px 14px;
  cursor: pointer;
  font-size: 0.9rem;
  color: #1a1a2e;
}

.autocomplete-list li:hover,
.autocomplete-list li.ac-active {
  background: #f0a500;
  color: #fff;
}

/* ===== Modal ===== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal {
  background: #fff;
  border-radius: 14px;
  padding: 28px;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.18);
}

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

.modal-header h2 { font-size: 1.2rem; font-weight: 700; }

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #888;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}
.modal-close:hover { color: #333; }

.btn-add-expense-trigger {
  background: #f0a500;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-add-expense-trigger:hover { background: #d4910a; }

/* ===== Import Modal ===== */
.import-modal {
  width: 96vw;
  max-width: 960px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.import-step { flex: 1; overflow: hidden; display: flex; flex-direction: column; }

/* Drop zone */
.import-drop-zone {
  border: 2px dashed #d0d0d0;
  border-radius: 12px;
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  margin-bottom: 16px;
}
.import-drop-zone:hover,
.import-drop-zone.drag-over { border-color: #f0a500; background: #fffbf0; }
.import-drop-icon { font-size: 2.5rem; margin-bottom: 12px; }
.import-drop-title { font-size: 1rem; font-weight: 600; margin-bottom: 6px; }
.import-drop-hint  { font-size: 0.83rem; color: #888; margin-bottom: 20px; }
.import-type-btns  { display: flex; gap: 12px; justify-content: center; }
.btn-import-type {
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-import-type:hover { background: #f0a500; color: #fff; border-color: #f0a500; }

.import-key-note {
  font-size: 0.83rem;
  color: #c62828;
  padding: 10px 14px;
  background: #fff3f3;
  border-radius: 8px;
  line-height: 1.5;
}

/* Loading */
.import-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 20px;
  padding: 60px 0;
  color: #666;
  font-size: 0.95rem;
}
.import-spinner {
  width: 44px;
  height: 44px;
  border: 4px solid #f0e8d5;
  border-top-color: #f0a500;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Column mapper */
.import-col-map { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.import-col-row { display: flex; flex-direction: column; gap: 6px; }
.import-col-row label { font-size: 0.8rem; font-weight: 600; color: #555; text-transform: uppercase; letter-spacing: 0.04em; }
.import-col-row select { width: 100%; }

/* Hint text */
.import-hint { font-size: 0.85rem; color: #666; margin-bottom: 12px; }

/* Review table */
.import-table-wrap {
  flex: 1;
  overflow-y: auto;
  border: 1px solid #eee;
  border-radius: 8px;
  margin-bottom: 0;
}
.import-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.import-table thead th {
  position: sticky;
  top: 0;
  background: #f7f7f7;
  padding: 8px 10px;
  text-align: left;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #888;
  border-bottom: 1px solid #e0e0e0;
}
.import-table tbody tr { border-bottom: 1px solid #f0f0f0; }
.import-table tbody tr:last-child { border-bottom: none; }
.import-table tbody tr:hover { background: #fafafa; }
.import-table td { padding: 6px 8px; vertical-align: middle; }
.import-table tr.import-row-credit { opacity: 0.6; }
.import-field {
  border: 1px solid #e0e0e0;
  border-radius: 5px;
  padding: 4px 7px;
  font-size: 0.82rem;
  font-family: inherit;
  background: #fff;
}
.import-field:focus { outline: none; border-color: #f0a500; }

/* Hide number spinner arrows so amount doesn't get clipped */
.import-amount::-webkit-inner-spin-button,
.import-amount::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.import-amount { -moz-appearance: textfield; }

.import-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-debit  { background: #fce8e8; color: #c62828; }
.badge-credit { background: #e8f5e9; color: #2e7d32; }

/* Footer */
.import-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid #eee;
  margin-top: 12px;
}

/* ===== Duplicate Warning Modal ===== */
.dupe-modal {
  max-width: 500px;
  width: 90%;
}
.dupe-modal-desc {
  color: #666;
  font-size: 0.88rem;
  margin: 0 0 16px;
  line-height: 1.5;
}
.dupe-list {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid #eee;
  border-radius: 8px;
}
.dupe-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.85rem;
}
.dupe-item:last-child { border-bottom: none; }
.dupe-date     { color: #888; min-width: 90px; }
.dupe-merchant { flex: 1; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dupe-amount   { font-weight: 700; color: #333; min-width: 70px; text-align: right; }
.dupe-note     { font-size: 0.75rem; color: #f0a500; background: #fff8e1; border-radius: 10px; padding: 2px 8px; white-space: nowrap; }
.dupe-modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 16px;
  border-top: 1px solid #eee;
}

/* ===== Auth Pages ===== */
.auth-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: #f5f6fa;
}
.auth-container {
  width: 100%;
  max-width: 420px;
  padding: 24px 16px;
}
.auth-brand {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1a1a2e;
  text-align: center;
  margin-bottom: 24px;
  letter-spacing: -0.01em;
}
.auth-brand span { color: #f0a500; }
.auth-error {
  background: #fff3f3;
  color: #c62828;
  border: 1px solid #f5c6c6;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 0.875rem;
  margin-bottom: 16px;
}

/* ===== Nav logout button ===== */
.btn-nav-logout {
  margin-left: auto;
  background: none;
  border: 1px solid rgba(255,255,255,0.2);
  color: #aab4c4;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0 14px;
  height: 30px;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.btn-nav-logout:hover {
  color: #fff;
  border-color: rgba(255,255,255,0.5);
}

/* ===== Income Section ===== */
.income-add-form {
  margin-bottom: 0;
  border-top: none;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.income-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  background: #fff;
  border: 1px solid #e8eaf0;
  border-top: none;
  font-size: 0.85rem;
  color: #555;
}

.income-summary .income-actual {
  font-weight: 700;
  color: #1a1a2e;
}

.income-summary .income-divider {
  color: #ccc;
}

.income-diff.over  { font-weight: 600; color: #2e7d32; }
.income-diff.under { font-weight: 600; color: #c62828; }

.income-table-wrap {
  margin-bottom: 0;
  border-top: none;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

/* ===== Utility ===== */
.text-muted { color: #999; font-style: italic; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.flex-center { display: flex; align-items: center; gap: 10px; }

/* ===== Import Row Split ===== */
.btn-row-split {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 6px;
  font-size: 0.72rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #f8f8f8;
  color: #666;
  cursor: pointer;
  vertical-align: middle;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn-row-split:hover { background: #f0a500; color: #fff; border-color: #f0a500; }
.btn-row-split.active { background: #e8533a; color: #fff; border-color: #e8533a; }
.import-split-cats { display: flex; flex-direction: column; gap: 4px; }
.import-split-cats select { width: 160px; }
.import-split-amts { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.import-split-amt2 { background: #f0f0f0 !important; color: #888; cursor: default; }

/* ===== Import Modal — Expanded ===== */
.import-modal.expanded {
  max-height: 98vh;
  max-width: 99vw;
  width: 99vw;
}

.import-year-warning {
  background: #3a2e00;
  border: 1px solid #f0a500;
  color: #f0c040;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.83rem;
  margin-bottom: 10px;
}

/* ===== User Role Badges ===== */
.user-role-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-left: 8px;
}
.badge-admin {
  background: #1a3a1a;
  color: #4caf50;
  border: 1px solid #2e6b2e;
}
.badge-member {
  background: #1a2a3a;
  color: #64b0f0;
  border: 1px solid #2a4a6a;
}

/* ===== Category Row — Expand Transactions ===== */
.cat-expandable { cursor: pointer; }
.cat-expandable:hover { background: #fafbff; }

.cat-chevron {
  display: inline-block;
  margin-right: 5px;
  font-size: 0.68rem;
  color: #ccc;
  transition: color 0.15s;
  user-select: none;
}
.cat-expandable.expanded .cat-chevron { color: #f0a500; }

.cat-txn-panel {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed #eeeeee;
}
.cat-txn-table {
  width: 100%;
  font-size: 0.8rem;
  border-collapse: collapse;
}
.cat-txn-table td {
  padding: 5px 6px;
  vertical-align: middle;
  border-bottom: 1px solid #f8f8f8;
  color: #444;
}
.cat-txn-table tr:last-child td { border-bottom: none; }
.cat-txn-date     { color: #999; white-space: nowrap; width: 58px; }
.cat-txn-merchant { font-weight: 500; }
.cat-txn-note     { color: #aaa; font-size: 0.76rem; }
.cat-txn-person   { color: #bbb; font-size: 0.76rem; white-space: nowrap; }
.cat-txn-amount   { text-align: right; font-weight: 600; white-space: nowrap; color: #1a1a2e; width: 70px; }
.cat-txn-empty    { font-size: 0.82rem; color: #bbb; text-align: center; padding: 10px 0; margin: 0; font-style: italic; }
