/* Expense Organizer — shared styles. Mobile-first, light/dark aware. */
:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --ink: #1a1d21;
  --muted: #6b7280;
  --line: #e5e7eb;
  --brand: #2563eb;
  --brand-ink: #ffffff;
  --ok: #16a34a;
  --warn: #b45309;
  --danger: #dc2626;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1216; --card: #181c22; --ink: #e8eaed; --muted: #9aa3af;
    --line: #2a2f37; --brand: #3b82f6; --shadow: 0 1px 3px rgba(0,0,0,.4);
  }
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--brand); }
header.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; background: var(--card); border-bottom: 1px solid var(--line);
}
header.top .brand { font-weight: 700; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
header.top .brand .dot { width: 10px; height: 10px; border-radius: 3px; background: var(--brand); }
main { max-width: 860px; margin: 0 auto; padding: 20px 16px 64px; }
h1 { font-size: 22px; margin: 0 0 6px; letter-spacing: -.02em; }
h2 { font-size: 16px; margin: 0 0 12px; }
p.sub { color: var(--muted); margin: 0 0 18px; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px;
}
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.grid { display: grid; gap: 12px; }
@media (min-width: 620px) { .grid.cols2 { grid-template-columns: 1fr 1fr; } }

label { display: block; font-size: 13px; color: var(--muted); margin: 0 0 4px; }
input, select, textarea, button {
  font: inherit; color: inherit;
}
input, select, textarea {
  width: 100%; padding: 10px 12px; background: var(--bg);
  border: 1px solid var(--line); border-radius: 9px;
}
input[type=file] { padding: 8px; }
textarea { min-height: 60px; resize: vertical; }

button {
  cursor: pointer; border: 1px solid transparent; border-radius: 9px;
  padding: 10px 16px; font-weight: 600; background: var(--brand); color: var(--brand-ink);
}
button.secondary { background: transparent; border-color: var(--line); color: var(--ink); }
button.ghost { background: transparent; border-color: transparent; color: var(--brand); padding: 6px 8px; }
button.danger { background: var(--danger); }
button.small { padding: 6px 10px; font-size: 13px; }
button:disabled { opacity: .5; cursor: not-allowed; }

.code-input { font-size: 24px; letter-spacing: .28em; text-align: center; text-transform: uppercase; font-weight: 700; }

.pill { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.pill.open { background: color-mix(in srgb, var(--warn) 15%, transparent); color: var(--warn); }
.pill.processed { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
td.amt, th.amt { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.total td { font-weight: 700; border-bottom: none; font-size: 16px; }

.item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.item .thumb { width: 54px; height: 54px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line); background: var(--bg); flex: 0 0 auto; display: grid; place-items: center; color: var(--muted); font-size: 11px; text-decoration: none; }
.item .body { flex: 1 1 auto; min-width: 0; }
.item .meta { color: var(--muted); font-size: 13px; }
.item .amt { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }

.share { display: grid; gap: 8px; }
.share .link { display: flex; gap: 8px; align-items: center; }
.share .link input { font-size: 13px; }
.qr { width: 150px; height: 150px; background: #fff; border-radius: 8px; padding: 6px; border: 1px solid var(--line); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.right { text-align: right; }
.spacer { flex: 1 1 auto; }
hr { border: none; border-top: 1px solid var(--line); margin: 16px 0; }

#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: .2s; z-index: 50;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.banner { padding: 10px 14px; border-radius: 9px; font-size: 14px; margin-bottom: 14px; }
.banner.info { background: color-mix(in srgb, var(--brand) 12%, transparent); }
.banner.warn { background: color-mix(in srgb, var(--warn) 15%, transparent); color: var(--warn); }

.hidden { display: none !important; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.flag { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 999px; margin: 3px 3px 0 0; }
.flag.warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.flag.info { background: color-mix(in srgb, var(--muted) 20%, transparent); color: var(--muted); }
.ded { color: var(--muted); font-variant-numeric: tabular-nums; }
.disclaimer { font-size: 12px; color: var(--muted); font-style: italic; margin-top: 10px; }
