/* ClearLedger — Transaction Categorizer Styles */
/* Matches the landing page design language: warm off-white, forest green accent, gold highlights */

:root {
  --bg: #FAFAF7;
  --bg-warm: #F5F3EE;
  --fg: #1A1A1A;
  --fg-muted: #6B6B6B;
  --accent: #1E3A2F;
  --accent-light: #2D5A47;
  --gold: #B5860B;
  --gold-light: #D4A817;
  --border: #E2DDD5;
  --card-bg: #FFFFFF;
  --nav-h: 64px;
  --success: #1A7F4B;
  --error: #C0392B;
  --radius: 12px;
}

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

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--fg);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* NAV */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250, 250, 247, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: var(--nav-h);
}
.nav-inner {
  max-width: 1160px; margin: 0 auto; padding: 0 32px;
  height: 100%; display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
  font-family: 'Lora', Georgia, serif; font-weight: 700;
  font-size: 1.25rem; color: var(--accent); letter-spacing: -0.02em;
}
.nav-tagline { font-size: 0.8rem; color: var(--fg-muted); font-weight: 400; letter-spacing: 0.04em; text-transform: uppercase; }
.nav-right { display: flex; align-items: center; gap: 16px; }
.nav-badge { font-size: 0.75rem; background: var(--accent); color: #fff; padding: 4px 12px; border-radius: 20px; font-weight: 600; }

/* LAYOUT */
.container { max-width: 1160px; margin: 0 auto; padding: 0 32px; }
.page-header { padding: 48px 0 32px; }
.page-header h1 { font-family: 'Lora', Georgia, serif; font-size: 2rem; font-weight: 700; color: var(--accent); letter-spacing: -0.02em; }
.page-header p { color: var(--fg-muted); margin-top: 8px; }

/* STATS BAR */
.stats-bar {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
  margin-bottom: 32px;
}
.stat-card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 24px;
}
.stat-card .label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--fg-muted); font-weight: 600; }
.stat-card .value { font-size: 1.75rem; font-weight: 700; color: var(--accent); margin-top: 4px; font-family: 'Lora', Georgia, serif; }
.stat-card .sub { font-size: 0.8rem; color: var(--fg-muted); margin-top: 2px; }

/* ACTION BAR */
.action-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.action-bar h2 { font-family: 'Lora', Georgia, serif; font-size: 1.4rem; color: var(--accent); }

/* TRANSACTION LIST */
.tx-list { display: flex; flex-direction: column; gap: 12px; }

.tx-card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 24px;
  display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 24px;
  transition: box-shadow 0.15s ease;
}
.tx-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.06); }

.tx-merchant { font-weight: 600; font-size: 1rem; color: var(--fg); }
.tx-meta { font-size: 0.82rem; color: var(--fg-muted); margin-top: 4px; }
.tx-amount { font-size: 1.1rem; font-weight: 700; text-align: right; white-space: nowrap; }
.tx-amount.debit { color: var(--fg); }
.tx-amount.credit { color: var(--success); }

.tx-category { display: flex; align-items: center; gap: 12px; }
.cat-pill {
  padding: 6px 14px; border-radius: 20px; font-size: 0.82rem; font-weight: 600;
  border: 1.5px solid transparent; cursor: pointer; transition: all 0.15s;
}
.cat-pill.suggested { background: #EEF4FF; color: #1A56DB; border-color: #A5C2F5; }
.cat-pill.approved { background: #E8F7EE; color: var(--success); border-color: #7BD79E; }
.cat-pill.rejected { background: #FEF0F0; color: var(--error); border-color: #F5B7B1; }
.cat-pill.uncategorized { background: var(--bg-warm); color: var(--fg-muted); border-color: var(--border); }

.confidence {
  font-size: 0.78rem; color: var(--fg-muted); margin-top: 4px;
}
.confidence span { font-weight: 700; }
.confidence.high span { color: var(--success); }
.confidence.med span { color: var(--gold); }
.confidence.low span { color: var(--error); }

/* ACTION BUTTONS */
.action-group { display: flex; gap: 8px; align-items: center; }

.btn {
  padding: 8px 18px; border-radius: 8px; font-size: 0.85rem; font-weight: 600;
  border: none; cursor: pointer; transition: all 0.15s; font-family: inherit;
}
.btn:hover { transform: translateY(-1px); }
.btn-approve { background: var(--accent); color: #fff; }
.btn-approve:hover { background: var(--accent-light); }
.btn-reject { background: var(--bg-warm); color: var(--fg); border: 1.5px solid var(--border); }
.btn-reject:hover { border-color: var(--fg-muted); }
.btn-categorize { background: var(--gold); color: #fff; }
.btn-categorize:hover { background: var(--gold-light); }
.btn-icon {
  background: none; border: none; cursor: pointer; color: var(--fg-muted);
  padding: 4px 6px; border-radius: 6px; font-size: 1rem;
}
.btn-icon:hover { background: var(--bg-warm); color: var(--fg); }

/* CATEGORY SELECTOR DROPDOWN */
.cat-select {
  padding: 6px 10px; border: 1.5px solid var(--border); border-radius: 8px;
  font-size: 0.82rem; font-family: inherit; background: var(--card-bg); color: var(--fg);
  cursor: pointer; max-width: 180px;
}
.cat-select:focus { outline: none; border-color: var(--accent); }

/* LOADING SPINNER */
.spinner {
  display: inline-block; width: 16px; height: 16px;
  border: 2px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* EMPTY STATE */
.empty-state { text-align: center; padding: 64px 0; color: var(--fg-muted); }
.empty-state h3 { font-family: 'Lora', Georgia, serif; font-size: 1.25rem; color: var(--accent); margin-bottom: 8px; }

/* RESPONSIVE */
@media (max-width: 768px) {
  .stats-bar { grid-template-columns: 1fr 1fr; }
  .tx-card { grid-template-columns: 1fr; gap: 12px; }
  .tx-amount { text-align: left; }
  .action-group { flex-wrap: wrap; }
}

/* AUTO-CATEGORIZE ALL BAR */
.auto-actions { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 24px; margin-bottom: 24px; display: flex; align-items: center; justify-content: space-between; }
.auto-actions p { font-size: 0.9rem; color: var(--fg-muted); }
.btn-auto { background: var(--accent); color: #fff; padding: 10px 24px; border-radius: 8px; font-weight: 600; font-size: 0.9rem; border: none; cursor: pointer; font-family: inherit; }
.btn-auto:hover { background: var(--accent-light); }
.btn-auto:disabled { opacity: 0.5; cursor: not-allowed; }