:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #171d1a;
  background: #f4f2ea;
  --green: #123f2d;
  --green-2: #1f5b43;
  --cream: #f4f2ea;
  --card: #ffffff;
  --muted: #66736d;
  --line: #e4e6e1;
  --orange: #ef9c22;
  --red: #e5484d;
  --shadow: 0 16px 40px rgba(20, 49, 38, .09);
  --radius: 18px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--cream); }
body { min-height: 100vh; }
button, input, select { font: inherit; }
button { cursor: pointer; }
#app { min-height: 100vh; }

.shell { min-height: 100vh; max-width: 520px; margin: 0 auto; background: #f8f7f2; position: relative; padding-bottom: 86px; }
.page { padding: 18px 18px 26px; }

.login-shell { min-height: 100vh; max-width: 520px; margin: 0 auto; display: grid; grid-template-rows: auto 1fr; background: #f8f7f2; }
.brand-hero { background: linear-gradient(145deg, #0c2b20, #123f2d 58%, #1c5a42); color: white; padding: 52px 28px 34px; text-align: center; border-radius: 0 0 32px 32px; }
.brand-mark { width: 76px; height: 76px; border: 2px solid #e9c75e; border-radius: 50%; margin: 0 auto 16px; display: grid; place-items: center; color: #f3d978; font-weight: 800; font-size: 24px; letter-spacing: -1px; box-shadow: inset 0 0 0 5px rgba(255,255,255,.04); }
.brand-title { margin: 0; font-size: 28px; font-weight: 800; letter-spacing: .4px; }
.brand-sub { margin: 6px 0 0; color: #d9eee5; font-size: 14px; }
.login-card { align-self: start; margin: -6px 18px 24px; padding: 26px 20px; background: rgba(255,255,255,.98); border-radius: 24px; box-shadow: var(--shadow); }
.login-card h2 { margin: 0 0 6px; text-align: center; font-size: 25px; }
.login-card > p { text-align: center; margin: 0 0 24px; color: var(--muted); }
.field { display: grid; gap: 7px; margin-bottom: 16px; }
.field label { font-size: 13px; font-weight: 700; color: #26352e; }
.input { width: 100%; height: 48px; border: 1px solid #d7ddd8; border-radius: 12px; padding: 0 14px; background: #fff; outline: none; }
.input:focus { border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(31,91,67,.10); }
.btn { border: 0; border-radius: 12px; min-height: 48px; padding: 0 16px; font-weight: 800; }
.btn-primary { width: 100%; color: white; background: var(--green); box-shadow: 0 8px 18px rgba(18,63,45,.18); }
.btn-soft { background: #e9f0ec; color: var(--green); }
.link-btn { border: 0; background: transparent; color: var(--green-2); font-weight: 700; padding: 8px; }
.login-actions { text-align: center; margin-top: 10px; }
.demo-note { margin-top: 18px; background: #f1f4f2; border-radius: 12px; padding: 11px 12px; font-size: 12px; color: #5b6862; }

.topbar { display: flex; align-items: center; justify-content: space-between; padding: 15px 18px 8px; }
.logo-mini { display: flex; align-items: center; gap: 10px; font-weight: 900; color: var(--green); }
.logo-dot { width: 34px; height: 34px; border-radius: 50%; background: var(--green); color: #f2d76b; display: grid; place-items: center; font-size: 11px; }
.icon-btn { width: 38px; height: 38px; border: 1px solid var(--line); background: white; border-radius: 12px; display: grid; place-items: center; }
.greeting { margin: 8px 0 18px; }
.greeting small { color: var(--muted); }
.greeting h1 { margin: 3px 0 0; font-size: 27px; }
.month-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.month-pill { border: 1px solid var(--line); background: white; border-radius: 999px; padding: 9px 12px; color: #33433b; font-size: 13px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(20,49,38,.045); }
.hero-card { padding: 20px; margin-bottom: 12px; }
.eyebrow { font-size: 12px; font-weight: 800; letter-spacing: .05em; color: var(--muted); text-transform: uppercase; }
.big-money { font-size: 31px; font-weight: 900; margin-top: 5px; color: #10271e; }
.profit { margin-top: 8px; font-size: 14px; color: var(--green-2); font-weight: 700; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat-card { padding: 16px; min-height: 94px; }
.stat-card strong { display: block; margin-top: 8px; font-size: 20px; }
.quick-title { margin: 23px 0 10px; font-size: 17px; }
.quick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.quick { min-height: 92px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 7px; padding: 15px; border: 1px solid var(--line); background: white; border-radius: 16px; font-weight: 800; color: #24362e; }
.quick span:first-child { font-size: 22px; }
.section-row { margin-top: 24px; display: flex; align-items: center; justify-content: space-between; }
.section-row h3 { margin: 0; font-size: 17px; }
.receivable { margin-top: 10px; overflow: hidden; }
.receive-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 14px 15px; border-top: 1px solid var(--line); }
.receive-row:first-child { border-top: 0; }
.receive-row small { display: block; color: var(--muted); margin-top: 3px; }
.receive-row strong { color: var(--green); }

.bottom-nav { position: fixed; z-index: 20; left: 50%; transform: translateX(-50%); bottom: 0; width: min(520px, 100%); height: 72px; display: grid; grid-template-columns: repeat(5, 1fr); background: rgba(255,255,255,.98); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.nav-item { border: 0; background: transparent; color: #76827c; display: grid; place-items: center; align-content: center; gap: 3px; font-size: 11px; }
.nav-item .nav-icon { font-size: 19px; }
.nav-item.active { color: var(--green); font-weight: 800; }

.page-title { display:flex; align-items:center; justify-content:space-between; margin: 8px 0 16px; }
.page-title h1 { font-size: 25px; margin: 0; }
.list { display: grid; gap: 10px; }
.list-item { padding: 15px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.list-item h4 { margin: 0 0 4px; }
.list-item small { color: var(--muted); }
.qty { min-width: 42px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: #edf3ef; color: var(--green); font-weight: 900; }
.placeholder { padding: 28px 20px; text-align: center; color: var(--muted); }
.placeholder b { color: #26352e; display: block; margin-bottom: 6px; }

.toast { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); background: #173e2e; color: white; padding: 11px 16px; border-radius: 12px; z-index: 50; box-shadow: var(--shadow); font-size: 13px; }

@media (min-width: 760px) {
  body { padding: 24px 0; background: #e8e9e3; }
  .shell, .login-shell { min-height: calc(100vh - 48px); border-radius: 30px; overflow: hidden; box-shadow: 0 22px 60px rgba(15,37,28,.12); }
  .bottom-nav { bottom: 24px; border-radius: 0 0 30px 30px; }
}

/* V2 - Supabase */
.notice { background:#eef7f1; color:#1d513b; border:1px solid #cfe4d7; border-radius:12px; padding:11px 12px; margin:0 0 16px; font-size:13px; line-height:1.35; }
.brand-hero.compact { padding-top:32px; padding-bottom:28px; }
.loading-card { text-align:center; min-height:150px; display:grid; place-items:center; align-content:center; gap:12px; }
.spinner { width:34px; height:34px; border:4px solid #dfe9e3; border-top-color:var(--green); border-radius:50%; animation:spin .8s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }
.toast-error { background:#8d2f32; }
.btn:disabled { opacity:.6; cursor:wait; }
.list-button, .receive-button { width:100%; text-align:left; font:inherit; color:inherit; }
.receive-button { border:0; background:transparent; }
.empty-state { padding:18px; text-align:center; color:var(--muted); font-size:13px; }
