:root {
  --bg: #f6f3ec;
  --paper: #fffdf8;
  --card: #ffffff;
  --ink: #17231d;
  --ink-2: #3c4a42;
  --muted: #6c776f;
  --line: #e6dfcf;
  --line-2: #efe9dc;
  --green: #0e4d39;
  --green-2: #15684d;
  --green-soft: #e3f0e8;
  --in: #137a52;
  --out: #b2412c;
  --out-soft: #fbe9e4;
  --gold: #d9a441;
  --gold-2: #b8862b;
  --gold-soft: #f8edd3;
  --shadow: 0 1px 2px rgba(23,35,29,.04), 0 4px 14px rgba(23,35,29,.04);
  --shadow-lg: 0 10px 40px rgba(14,77,57,.22);
  --r: 18px;
  --fs: 17px;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --font: "Manrope", "Noto Sans Malayalam", system-ui, sans-serif;
  --display: "Fraunces", Georgia, serif;
  color-scheme: light;
}
:root[data-size="large"] { --fs: 19px; }
:root[data-size="xlarge"] { --fs: 21.5px; }
:root[lang="ml"] { --font: "Noto Sans Malayalam", "Manrope", system-ui, sans-serif; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
html { font-size: var(--fs); }
body {
  background: var(--bg); color: var(--ink); font-family: var(--font);
  line-height: 1.4; -webkit-font-smoothing: antialiased; overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; text-decoration: none; }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

.boot { height: 100dvh; display: grid; place-items: center; }
.boot-mark { width: 72px; height: 72px; border-radius: 22px; background: var(--green); color: var(--gold); display: grid; place-items: center; font-size: 38px; font-weight: 800; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(.92); opacity: .7; } }

/* ---------- layout ---------- */
.screen { min-height: 100dvh; padding: calc(var(--sat) + 8px) 16px calc(var(--sab) + 108px); max-width: 560px; margin: 0 auto; }
#app.enter { animation: rise .2s ease-out; }
.screen.flush { padding-bottom: calc(var(--sab) + 24px); }
@keyframes rise { from { opacity: 0; } }

.topbar { display: flex; align-items: center; gap: 10px; min-height: 56px; margin: 0 -4px 6px; }
.topbar h1 { font-size: 1.25rem; font-weight: 800; margin: 0; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; flex: none; color: var(--ink); }
.icon-btn:active { background: var(--line-2); }
.icon-btn svg { width: 26px; height: 26px; }

.status-chip { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 700; padding: 6px 10px; border-radius: 99px; background: var(--green-soft); color: var(--green); }
.status-chip.warn { background: var(--gold-soft); color: #7a5414; }
.status-chip.off { background: var(--out-soft); color: var(--out); }
.status-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

/* ---------- home ---------- */
.greet { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0 14px; }
.greet small { display: block; color: var(--muted); font-weight: 600; font-size: .85rem; }
.greet b { font-size: 1.3rem; font-weight: 800; }

.hero {
  position: relative; overflow: hidden; border-radius: 26px; padding: 22px 20px 18px; color: #f7f1e3;
  background: radial-gradient(120% 90% at 100% 0%, #1c7a5a 0%, transparent 55%), linear-gradient(160deg, #11583f, #0b3a2b);
  box-shadow: var(--shadow-lg);
}
.hero::after { content: ""; position: absolute; right: -40px; top: -40px; width: 170px; height: 170px; border-radius: 50%; border: 22px solid rgba(217,164,65,.16); }
.hero .label { font-size: .9rem; font-weight: 700; opacity: .85; }
.hero .big { font-family: var(--display); font-size: 2.55rem; font-weight: 700; letter-spacing: -.5px; margin: 4px 0 16px; line-height: 1.05; }
.hero .big .r { color: var(--gold); margin-right: 4px; }
.hero-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; position: relative; z-index: 1; }
.hero-stats div { background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.12); border-radius: 16px; padding: 10px 12px; }
.hero-stats small { display: block; font-size: .76rem; font-weight: 700; opacity: .8; }
.hero-stats b { font-size: 1.15rem; font-weight: 800; }
.hero-stats span { display: block; font-size: .72rem; opacity: .75; font-weight: 600; }

.cta {
  width: 100%; margin: 16px 0 6px; min-height: 68px; border-radius: 20px; display: flex; align-items: center; justify-content: center; gap: 12px;
  background: linear-gradient(180deg, #e3b252, var(--gold)); color: #2d1f05; font-size: 1.2rem; font-weight: 800;
  box-shadow: 0 6px 18px rgba(184,134,43,.35), inset 0 1px 0 rgba(255,255,255,.4);
}
.cta svg { width: 30px; height: 30px; }
.cta:active { transform: translateY(1px) scale(.995); }

.section-h { display: flex; align-items: baseline; justify-content: space-between; margin: 22px 2px 10px; }
.section-h h2 { font-size: 1.05rem; font-weight: 800; margin: 0; }
.section-h span { color: var(--muted); font-weight: 700; font-size: .85rem; white-space: nowrap; padding-left: 10px; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 40px; padding: 0 16px; border-radius: 99px; background: var(--card); border: 1.5px solid var(--line); font-weight: 700; font-size: .88rem; color: var(--ink-2); }
.chip.on { background: var(--green); border-color: var(--green); color: #fff; }

/* ---------- lists ---------- */
.list { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 72px; border-bottom: 1px solid var(--line-2); width: 100%; text-align: left; }
.row:last-child { border-bottom: 0; }
.row:active { background: #faf7f0; }
.avatar { width: 46px; height: 46px; border-radius: 14px; flex: none; display: grid; place-items: center; font-weight: 800; font-size: 1rem; color: var(--green); background: var(--green-soft); }
.avatar.c1 { background: #fbecd0; color: #8a5a10; } .avatar.c2 { background: #e5ecf8; color: #2c4f86; }
.avatar.c3 { background: #f6e3e8; color: #8b3550; } .avatar.c4 { background: #ece6f7; color: #5a3f8f; }
.row .main { flex: 1; min-width: 0; }
.row .main b { display: block; font-size: 1rem; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .main small { display: block; color: var(--muted); font-weight: 600; font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .end { text-align: right; flex: none; }
.row .end b { font-size: 1.02rem; font-weight: 800; display: block; }
.row .end small { font-size: .74rem; color: var(--muted); font-weight: 700; }
.in { color: var(--in); } .out { color: var(--out); } .gold-t { color: var(--gold-2); }
.mini-btn { flex: none; min-height: 44px; padding: 0 14px; border-radius: 12px; background: var(--green); color: #fff; font-weight: 800; font-size: .88rem; }
.pending-badge { display: inline-block; font-size: .68rem; font-weight: 800; color: #7a5414; background: var(--gold-soft); border-radius: 6px; padding: 1px 6px; margin-left: 6px; vertical-align: 2px; }
.empty { text-align: center; color: var(--muted); font-weight: 600; padding: 28px 18px; background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); }
.more-link { display: block; width: 100%; text-align: center; font-weight: 800; color: var(--green); padding: 14px; }

/* ---------- search ---------- */
.search { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: calc(var(--sat) + 6px) 0 10px; margin-top: calc(-1 * var(--sat) - 8px); }
.search-box { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1.5px solid var(--line); border-radius: 16px; padding: 0 14px; min-height: 56px; box-shadow: var(--shadow); }
.search-box:focus-within { border-color: var(--green-2); }
.search-box svg { width: 22px; height: 22px; color: var(--muted); flex: none; }
.search-box input { border: 0; outline: 0; background: none; flex: 1; min-width: 0; font-size: 1rem; font-weight: 600; height: 54px; }
.seg { display: flex; background: #ebe4d4; border-radius: 14px; padding: 4px; gap: 4px; margin-top: 10px; }
.seg button { flex: 1; min-height: 40px; border-radius: 10px; font-weight: 800; font-size: .86rem; color: var(--ink-2); }
.seg button.on { background: var(--card); color: var(--green); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

.fab {
  position: fixed; right: max(16px, calc(50% - 264px)); bottom: calc(var(--sab) + 96px); z-index: 20;
  min-height: 60px; padding: 0 22px 0 18px; border-radius: 20px; background: var(--green); color: #fff; font-weight: 800; font-size: 1rem;
  display: flex; align-items: center; gap: 8px; box-shadow: var(--shadow-lg);
}
.fab svg { width: 26px; height: 26px; }

/* ---------- bottom nav ---------- */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: rgba(255,253,248,.94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line); padding: 6px 8px calc(var(--sab) + 6px); display: flex; justify-content: center;
}
.nav-inner { display: grid; grid-template-columns: repeat(4, 1fr); width: 100%; max-width: 560px; }
.nav a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 2px; min-height: 64px; border-radius: 14px; color: var(--muted); font-weight: 700; font-size: .74rem; text-align: center; }
.nav a svg { width: 27px; height: 27px; }
.nav a.on { color: var(--green); }
.nav a.on svg { background: var(--green-soft); border-radius: 12px; padding: 3px 14px; width: 55px; box-sizing: content-box; height: 24px; margin: -1px 0 -2px; }

/* ---------- passbook ---------- */
.pb-head { background: var(--paper); border-radius: 24px; padding: 18px; box-shadow: var(--shadow); border: 1px solid var(--line-2); position: relative; overflow: hidden; }
.pb-head::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 8px; background: var(--gold); }
.pb-meta { display: flex; gap: 8px; flex-wrap: wrap; color: var(--muted); font-weight: 700; font-size: .82rem; }
.pb-meta span { background: var(--bg); border-radius: 8px; padding: 3px 8px; }
.pb-bal { margin-top: 12px; }
.pb-bal small { color: var(--muted); font-weight: 700; font-size: .85rem; }
.pb-bal b { display: block; font-family: var(--display); font-size: 2.3rem; color: var(--green); line-height: 1.1; }
.pb-contact { display: flex; gap: 8px; margin-top: 14px; }
.pb-contact a, .pb-contact button { flex: 1; min-height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 800; font-size: .9rem; background: var(--bg); color: var(--ink-2); }
.pb-contact svg { width: 22px; height: 22px; }
.pb-contact .wa { color: #128c4b; }

.actions3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0 4px; }
.act { min-height: 100px; border-radius: 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; font-weight: 800; font-size: .9rem; line-height: 1.15; text-align: center; padding: 10px 6px; box-shadow: var(--shadow); }
.act svg { width: 32px; height: 32px; }
.act.dep { background: var(--green); color: #fff; }
.act.cash { background: var(--card); color: var(--out); border: 1.5px solid #f1d4cc; }
.act.gold { background: var(--gold-soft); color: #7a5414; border: 1.5px solid #ecd9a8; }
.act:active { transform: scale(.98); }

.ledger { background: var(--paper); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; border: 1px solid var(--line-2); }
.lg-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 12px 16px; border-bottom: 1px dashed var(--line); width: 100%; text-align: left; }
.lg-row:last-child { border-bottom: 0; }
.lg-row:active { background: #faf6ec; }
.lg-row .d { font-weight: 800; font-size: .95rem; }
.lg-row .k { color: var(--muted); font-weight: 700; font-size: .8rem; }
.lg-row .a { font-weight: 800; font-size: 1.05rem; text-align: right; }
.lg-row .b { font-weight: 700; font-size: .78rem; color: var(--muted); text-align: right; }
.lg-row.void { opacity: .5; }
.lg-row.void .a { text-decoration: line-through; }
.lg-month { padding: 8px 16px; background: var(--bg); font-weight: 800; font-size: .78rem; color: var(--muted); letter-spacing: .3px; text-transform: uppercase; }

/* ---------- entry ---------- */
.entry { display: flex; flex-direction: column; min-height: 100dvh; padding: calc(var(--sat) + 8px) 16px calc(var(--sab) + 14px); max-width: 560px; margin: 0 auto; }
.entry-who { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 18px; padding: 12px 14px; box-shadow: var(--shadow); }
.entry-who .main b { font-size: 1.05rem; font-weight: 800; display: block; }
.entry-who .main small { color: var(--muted); font-weight: 700; font-size: .82rem; }
.kind-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 12px 0 4px; background: #ebe4d4; padding: 5px; border-radius: 16px; }
.kind-tabs button { min-height: 48px; border-radius: 12px; font-weight: 800; font-size: .84rem; color: var(--ink-2); line-height: 1.1; padding: 0 4px; }
.kind-tabs button.on.deposit { background: var(--green); color: #fff; }
.kind-tabs button.on.withdraw_cash { background: var(--out); color: #fff; }
.kind-tabs button.on.withdraw_gold { background: var(--gold); color: #2d1f05; }
.amount-disp { text-align: center; padding: 14px 0 6px; }
.amount-disp small { display: block; font-weight: 700; color: var(--muted); font-size: .9rem; }
.amount-disp .v { font-family: var(--display); font-size: 3.3rem; font-weight: 700; line-height: 1.1; color: var(--ink); min-height: 1.1em; }
.amount-disp .v.zero { color: #c4bba8; }
.amount-disp .v .r { color: var(--gold-2); font-size: .7em; margin-right: 4px; vertical-align: .12em; }
.amount-disp .err { color: var(--out); font-weight: 700; font-size: .88rem; min-height: 1.3em; }
.quick { display: flex; gap: 8px; overflow-x: auto; margin: 4px -16px 10px; padding: 2px 16px; scrollbar-width: none; }
.quick::-webkit-scrollbar { display: none; }
.quick button { flex: none; min-height: 46px; padding: 0 16px; border-radius: 14px; background: var(--card); border: 1.5px solid var(--line); font-weight: 800; font-size: .95rem; }
.quick button.usual { border-color: var(--green-2); color: var(--green); background: var(--green-soft); }
.entry-extra { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.pill { min-height: 44px; padding: 0 14px; border-radius: 12px; background: var(--card); border: 1.5px solid var(--line); font-weight: 700; font-size: .88rem; display: inline-flex; align-items: center; gap: 8px; position: relative; }
.pill svg { width: 20px; height: 20px; color: var(--muted); }
.pill input[type=date] { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.pill.back-dated { border-color: var(--gold); background: var(--gold-soft); color: #7a5414; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: auto; }
.keypad button { min-height: 56px; border-radius: 16px; background: var(--card); font-size: 1.55rem; font-weight: 700; box-shadow: 0 1px 0 var(--line); }
.keypad button:active { background: var(--line-2); transform: scale(.98); }
.keypad button svg { width: 30px; height: 30px; }
.save-btn { width: 100%; min-height: 64px; margin-top: 10px; border-radius: 18px; font-size: 1.15rem; font-weight: 800; color: #fff; background: var(--green); box-shadow: var(--shadow-lg); }
.save-btn.withdraw_cash { background: var(--out); box-shadow: 0 10px 30px rgba(178,65,44,.25); }
.save-btn.withdraw_gold { background: var(--gold); color: #2d1f05; box-shadow: 0 10px 30px rgba(184,134,43,.3); }
.save-btn:disabled { background: #cfc7b6; color: #fff; box-shadow: none; }

/* ---------- forms ---------- */
.form { display: flex; flex-direction: column; gap: 16px; }
.field label { display: block; font-weight: 800; font-size: .9rem; margin: 0 2px 6px; }
.field label em { font-style: normal; color: var(--muted); font-weight: 600; font-size: .8rem; }
.field input, .field textarea, .field select { width: 100%; min-height: 56px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--card); padding: 0 16px; font-size: 1.02rem; font-weight: 600; outline: none; }
.field textarea { padding: 14px 16px; min-height: 88px; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--green-2); box-shadow: 0 0 0 4px rgba(21,104,77,.12); }
.field .hint { color: var(--muted); font-size: .8rem; font-weight: 600; margin: 6px 2px 0; }
.field .ferr { color: var(--out); font-size: .84rem; font-weight: 700; margin: 6px 2px 0; }
.field.bad input { border-color: var(--out); }
.phone-row { display: flex; gap: 8px; }
.phone-row input { flex: 1; min-width: 0; }
.phone-row .pick { width: auto; min-height: 56px; padding: 0 14px; font-size: .95rem; white-space: nowrap; flex: none; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; gap: 12px; align-items: center; font-weight: 700; min-height: 52px; }
.check input { width: 26px; height: 26px; accent-color: var(--green); }
.btn { width: 100%; min-height: 58px; border-radius: 16px; font-weight: 800; font-size: 1.05rem; display: flex; align-items: center; justify-content: center; gap: 10px; }
.btn svg { width: 24px; height: 24px; }
.btn.primary { background: var(--green); color: #fff; }
.btn.ghost { background: var(--card); border: 1.5px solid var(--line); color: var(--ink); }
.btn.danger { background: var(--out-soft); color: var(--out); }
.btn.wa { background: #1fa855; color: #fff; }
.btn:disabled { opacity: .55; }
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; }

/* ---------- success ---------- */
.done { min-height: 100dvh; display: flex; flex-direction: column; padding: calc(var(--sat) + 40px) 20px calc(var(--sab) + 20px); max-width: 560px; margin: 0 auto; text-align: center; }
.done .tick { width: 108px; height: 108px; margin: 0 auto 18px; border-radius: 50%; background: var(--green); display: grid; place-items: center; animation: pop .45s cubic-bezier(.2,1.4,.4,1); box-shadow: 0 0 0 14px var(--green-soft); }
.done .tick.withdraw_cash { background: var(--out); box-shadow: 0 0 0 14px var(--out-soft); }
.done .tick.withdraw_gold { background: var(--gold); box-shadow: 0 0 0 14px var(--gold-soft); }
.done .tick svg { width: 58px; height: 58px; color: #fff; stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .4s .25s ease-out forwards; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
.done h1 { font-size: 1.15rem; margin: 6px 0 2px; color: var(--muted); font-weight: 800; }
.done .amt { font-family: var(--display); font-size: 2.9rem; font-weight: 700; margin: 4px 0; }
.done p { font-weight: 700; font-size: 1.05rem; margin: 0 0 18px; }
.done .bal-box { background: var(--card); border-radius: 18px; padding: 14px; box-shadow: var(--shadow); margin-bottom: 18px; }
.done .bal-box small { color: var(--muted); font-weight: 700; }
.done .bal-box b { display: block; font-size: 1.6rem; color: var(--green); font-weight: 800; }
.done .offline-note { background: var(--gold-soft); color: #7a5414; font-weight: 700; border-radius: 14px; padding: 10px 12px; margin-bottom: 14px; font-size: .9rem; }
.done .btns { display: flex; flex-direction: column; gap: 10px; margin-top: auto; }

/* ---------- day book ---------- */
.period { display: flex; align-items: center; gap: 8px; margin: 10px 0 12px; }
.period .icon-btn { background: var(--card); box-shadow: var(--shadow); }
.period .lbl { flex: 1; text-align: center; font-weight: 800; font-size: 1.02rem; background: var(--card); border-radius: 14px; min-height: 48px; display: grid; place-items: center; box-shadow: var(--shadow); position: relative; }
.period .lbl input { position: absolute; inset: 0; opacity: 0; }
.totals { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 4px; }
.tot { background: var(--card); border-radius: 18px; padding: 14px; box-shadow: var(--shadow); }
.tot small { display: block; font-weight: 700; color: var(--muted); font-size: .8rem; }
.tot b { font-size: 1.3rem; font-weight: 800; }
.tot span { display: block; font-size: .74rem; font-weight: 700; color: var(--muted); }
.tot.wide { grid-column: 1 / -1; background: var(--green); color: #fff; display: flex; align-items: center; justify-content: space-between; }
.tot.wide small, .tot.wide span { color: rgba(255,255,255,.8); }

/* ---------- sheet / toast ---------- */
.scrim { position: fixed; inset: 0; background: rgba(15,25,20,.45); z-index: 60; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 61; background: var(--paper); border-radius: 26px 26px 0 0; padding: 10px 18px calc(var(--sab) + 18px); max-width: 560px; margin: 0 auto; max-height: 88dvh; overflow-y: auto; animation: up .25s cubic-bezier(.2,.9,.3,1); }
@keyframes up { from { transform: translateY(100%); } }
.sheet .grab { width: 44px; height: 5px; border-radius: 9px; background: var(--line); margin: 0 auto 14px; }
.sheet h3 { margin: 0 0 12px; font-size: 1.15rem; font-weight: 800; }
.sheet p { font-weight: 600; color: var(--ink-2); margin: 0 0 16px; }
.sheet .btns { display: flex; flex-direction: column; gap: 10px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); font-weight: 700; }
.kv span { color: var(--muted); }
.kv:last-of-type { margin-bottom: 16px; }

#toast { position: fixed; left: 50%; bottom: calc(var(--sab) + 100px); transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none; z-index: 80; background: #17231d; color: #fff; padding: 14px 18px; border-radius: 16px; font-weight: 700; font-size: .95rem; max-width: calc(100% - 32px); width: max-content; box-shadow: var(--shadow-lg); transition: .25s; text-align: center; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- auth ---------- */
.auth { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: calc(var(--sat) + 24px) 20px calc(var(--sab) + 24px); max-width: 460px; margin: 0 auto; }
.brand { text-align: center; margin-bottom: 28px; }
.brand img { width: 88px; height: 88px; border-radius: 24px; box-shadow: var(--shadow-lg); }
.brand h1 { font-family: var(--display); font-size: 2.2rem; margin: 14px 0 2px; color: var(--green); }
.brand p { margin: 0; color: var(--muted); font-weight: 700; }
.auth .switch { text-align: center; margin-top: 18px; font-weight: 700; color: var(--muted); }
.auth .switch button { color: var(--green); font-weight: 800; text-decoration: underline; padding: 8px; }
.notice { border-radius: 14px; padding: 12px 14px; font-weight: 700; font-size: .9rem; }
.notice.err { background: var(--out-soft); color: var(--out); }
.notice.ok { background: var(--green-soft); color: var(--green); }
.demo-ribbon { background: var(--gold-soft); color: #7a5414; text-align: center; font-weight: 800; font-size: .78rem; padding: calc(var(--sat) + 4px) 8px 4px; }
.demo-ribbon + .screen, .demo-ribbon + .entry { padding-top: 8px; }

/* settings */
.set-group { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 4px 16px; margin-bottom: 14px; }
.set-row { padding: 14px 0; border-bottom: 1px solid var(--line-2); }
.set-row:last-child { border-bottom: 0; }
.set-row > b { display: block; font-weight: 800; margin-bottom: 8px; font-size: .95rem; }
.set-row .seg { margin-top: 0; }
.set-row p { margin: 6px 0 0; color: var(--muted); font-weight: 600; font-size: .82rem; }
.foot { text-align: center; color: var(--muted); font-size: .78rem; font-weight: 600; margin-top: 18px; }

/* ================= v2: leaner look ================= */
.greet b { font-weight: 700; letter-spacing: -.2px; }
.topbar h1 { font-weight: 700; letter-spacing: -.2px; }
.section-h h2 { font-weight: 700; }
.section-h a { color: var(--green); font-weight: 700; font-size: .88rem; padding: 6px 0 6px 10px; }
.list, .ledger, .tot, .card, .set-group, .empty, .entry-who, .pb-head { border: 1px solid var(--line-2); }
.row .main b, .lg-row .d { font-weight: 700; }

.hero { padding: 24px 22px 20px; border-radius: 28px;
  background: radial-gradient(90% 120% at 100% 0%, rgba(217,164,65,.22) 0%, transparent 50%), linear-gradient(155deg, #125a42 0%, #0c3d2d 100%); }
.hero::after { right: -60px; top: -70px; width: 200px; height: 200px; border-width: 1px; border-color: rgba(217,164,65,.35);
  box-shadow: 0 0 0 26px rgba(217,164,65,.06), 0 0 0 52px rgba(217,164,65,.04); }
.hero .label { font-weight: 600; opacity: .78; letter-spacing: .2px; }
.hero .big { font-size: 2.7rem; margin: 6px 0 18px; }
.hero-row { display: flex; border-top: 1px solid rgba(255,255,255,.14); padding-top: 14px; position: relative; z-index: 1; }
.hero-row > div { flex: 1; min-width: 0; }
.hero-row > div + div { border-left: 1px solid rgba(255,255,255,.14); padding-left: 18px; }
.hero-row small { display: block; font-size: .78rem; font-weight: 600; opacity: .75; }
.hero-row b { display: block; font-size: 1.25rem; font-weight: 700; margin-top: 2px; }
.hero-row span { display: block; font-size: .74rem; font-weight: 600; opacity: .6; }

.cta { font-weight: 700; margin-top: 14px; }

/* entry rows (recent / day book) */
.er { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 14px; min-height: 68px; border-bottom: 1px solid var(--line-2); }
.er:last-child { border-bottom: 0; }
.er:active { background: #faf7f0; }
.er-ic { width: 42px; height: 42px; border-radius: 13px; flex: none; display: grid; place-items: center; }
.er-ic svg { width: 21px; height: 21px; }
.k-deposit { background: var(--green-soft); color: var(--in); }
.k-opening { background: #eef0ec; color: var(--ink-2); }
.k-withdraw_cash { background: var(--out-soft); color: var(--out); }
.k-withdraw_gold { background: var(--gold-soft); color: var(--gold-2); }
.er-main { flex: 1; min-width: 0; }
.er-main b { display: block; font-weight: 700; font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.er-main small { display: block; color: var(--muted); font-weight: 600; font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.er-amt { flex: none; font-weight: 800; font-size: 1.02rem; }
.er.void { opacity: .5; } .er.void .er-amt { text-decoration: line-through; }

/* chips with place icon */
.chip { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.chip svg { width: 16px; height: 16px; }

/* entry: who card with place, phone, call */
.entry-who { align-items: flex-start; }
.entry-who .main { flex: 1; min-width: 0; }
.entry-who .main b { font-weight: 700; }
.who-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; color: var(--ink-2); font-weight: 600; font-size: .84rem; }
.who-meta span { display: inline-flex; align-items: center; gap: 4px; }
.who-meta svg { width: 15px; height: 15px; color: var(--muted); }
.call-btn { flex: none; align-self: center; width: 52px; height: 52px; border-radius: 16px; background: var(--green); color: #fff; display: grid; place-items: center; box-shadow: 0 4px 12px rgba(14,77,57,.25); }
.call-btn svg { width: 24px; height: 24px; }

/* day book */
.period.all .icon-btn { visibility: hidden; }
.period.all .lbl input { display: none; }
.tot b { font-weight: 700; }
.seg button { font-weight: 700; }
.er-end { flex: none; text-align: right; }
.er-end .er-amt { display: block; }
.er-end small { display: block; color: var(--muted); font-weight: 600; font-size: .72rem; }
