:root {
  --bg: #fafafa;
  --bg-card: #ffffff;
  --text: #1a1a1a;
  --text-muted: #6b6b6b;
  --border: #e5e5e5;
  --accent: #007aff;
  --accent-hover: #0066d6;
  --green: #34c759;
  --red: #ff3b30;
  --orange: #ff9500;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  --radius: 12px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1a1a;
    --bg-card: #2a2a2a;
    --text: #f5f5f5;
    --text-muted: #999;
    --border: #3a3a3a;
    --accent: #0a84ff;
    --accent-hover: #1f95ff;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}

.brand {
  display: flex;
  gap: 8px;
  align-items: center;
}

.logo {
  font-size: 24px;
}

.beta {
  background: var(--orange);
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.user-badge {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 14px;
  color: var(--text-muted);
}

.container {
  max-width: 700px;
  margin: 32px auto;
  padding: 0 24px;
}

h1 {
  font-size: 28px;
  margin: 0 0 12px;
}

h2 {
  font-size: 17px;
  margin: 0 0 8px;
}

.muted {
  color: var(--text-muted);
}

.small {
  font-size: 13px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 16px 0;
  box-shadow: var(--shadow);
}

.dev-card {
  border-style: dashed;
}

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

input[type="text"] {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

input[type="text"]:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}

.primary-btn,
.secondary-btn {
  padding: 10px 18px;
  border-radius: 8px;
  border: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

.primary-btn {
  background: black;
  color: white;
  width: 100%;
}

.primary-btn:disabled {
  background: #999;
  cursor: not-allowed;
}

.primary-btn:not(:disabled):hover {
  background: #222;
}

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

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

.ghost-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
}

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

.error {
  color: var(--red);
  background: rgba(255, 59, 48, 0.08);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
}

.hidden {
  display: none !important;
}

.list-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 16px;
}

.receipt-row {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin: 10px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
}

.receipt-row:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.receipt-meta {
  display: flex;
  flex-direction: column;
}

.receipt-store {
  font-weight: 600;
  font-size: 15px;
}

.receipt-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.receipt-amount {
  font-weight: 600;
  font-size: 16px;
}

.receipt-amount.income {
  color: var(--green);
}

.footer {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
}

.footer code {
  background: var(--bg-card);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  font-size: 12px;
}
