/* ===== PickleTeam-style theme: dark court green + lime volt ===== */
:root {
  --bg: #f8fafc; --card: #ffffff; --text: #1e293b; --title: #0f172a;
  --muted: #64748b; --muted-2: #94a3b8; --line: #e2e8f0; --soft: #f1f5f9;
  --dark: #14532d; --dark-2: #064e3b; --teal-9: #134e4a; --court: #0f766e;
  --lime-50: #f7fee7; --lime-100: #ecfccb; --lime-300: #bef264; --lime-400: #a3e635; --volt: #84cc16;
  --em-50: #ecfdf5; --em-100: #d1fae5; --em-200: #a7f3d0; --em-500: #10b981; --em-600: #059669; --em-700: #047857;
  --amber-50: #fffbeb; --amber-100: #fef3c7; --amber-300: #fcd34d; --amber-500: #f59e0b; --amber-600: #d97706; --amber-800: #92400e;
  --rose-50: #fff1f2; --rose-100: #ffe4e6; --rose-600: #e11d48; --rose-700: #be123c;
  --msg-1: #00b2ff; --msg-2: #006aff;
  --ok: var(--em-600); --warn: var(--amber-600); --neg: var(--rose-600);
  --radius: 24px; --tab-h: 66px; --top-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  --shadow-sm: 0 1px 2px rgb(15 23 42 / .05);
  --sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --sport: "Chakra Petch", Inter, system-ui, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 14.5px/1.45 var(--sans); -webkit-font-smoothing: antialiased; }
body.noscroll { overflow: hidden; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; transition: transform .1s, background .15s, opacity .15s; }
input, select {
  width: 100%; padding: 11px 14px; border: 1px solid #cbd5e1; border-radius: 14px;
  background: #fff; font-size: 16px; outline: none; color: var(--title);
}
input:focus, select:focus { border-color: var(--em-600); box-shadow: 0 0 0 3px rgb(16 185 129 / .15); }
input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--dark); padding: 0; }
input[type=range] { padding: 0; border: 0; accent-color: var(--em-600); box-shadow: none; }
code { background: var(--lime-100); color: var(--dark); padding: 1px 6px; border-radius: 6px; font-size: 13px; }
.sport, .summary b, .rating, .score, .datebox b, .balance > b, .stat-box b, .qty b, .money input, .stepper input, .otp, .rank { font-family: var(--sport); }

/* ---------- Header ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px;
  padding: calc(var(--safe-t) + 10px) 14px 10px; min-height: var(--top-h); color: #fff;
  background: linear-gradient(90deg, var(--dark), var(--dark-2) 55%, var(--teal-9));
  box-shadow: 0 6px 18px rgb(20 83 45 / .25);
}
.brand { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo { border-radius: 14px; overflow: hidden; display: grid; place-items: center; flex: none; box-shadow: 0 0 0 2px rgb(190 242 100 / .55), 0 4px 10px rgb(0 0 0 / .25); }
.logo svg { display: block; }
.logo-ball { animation: ballBounce 2.2s infinite ease-in-out; transform-origin: 360px 150px; }
@keyframes ballBounce { 50% { transform: translateY(-14px); } }
.brand-title .amp { color: var(--lime-300); }
@keyframes subtleBounce { 50% { transform: translateY(-3px); } }
.brand-text { min-width: 0; }
.brand-title { display: flex; align-items: center; gap: 6px; }
.brand-title b { font-weight: 800; font-size: 15.5px; letter-spacing: -.2px; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-sub { font-size: 11px; color: #a7f3d0; display: flex; align-items: center; gap: 4px; white-space: nowrap; overflow: hidden; }
.brand-sub .ico { color: var(--lime-400); }
.pill-lime { font-size: 9.5px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; background: var(--lime-400); color: var(--dark); padding: 2px 7px; border-radius: 999px; flex: none; }
.topbar .icon-btn { background: rgb(255 255 255 / .1); color: #fff; width: 40px; height: 40px; }
.topbar .icon-btn .ico { color: var(--lime-300); }
.topbar .icon-btn:active { background: rgb(255 255 255 / .22); }
.topbar .badge { background: rgb(255 255 255 / .14); color: #fff; }

/* ---------- Layout ---------- */
main { max-width: 680px; margin: 0 auto; padding: 18px 16px calc(var(--tab-h) + var(--safe-b) + 100px); }
.page { display: flex; flex-direction: column; gap: 14px; }
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; display: flex; justify-content: space-around; gap: 4px;
  padding: 6px 6px calc(6px + var(--safe-b)); background: rgb(255 255 255 / .95); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line); box-shadow: 0 -4px 15px rgb(0 0 0 / .06);
}
.tabbar a {
  flex: 1; max-width: 120px; padding: 7px 4px; border-radius: 14px; display: flex; flex-direction: column; align-items: center;
  gap: 2px; font-size: 10.5px; color: var(--muted); text-decoration: none; font-weight: 500;
}
.tabbar a.on { background: var(--lime-100); color: var(--dark); font-weight: 800; }
.fab {
  position: fixed; right: max(16px, calc(50% - 324px)); bottom: calc(var(--tab-h) + var(--safe-b) + 16px); z-index: 15;
  width: 58px; height: 58px; border-radius: 20px; background: var(--dark); color: var(--lime-300);
  display: grid; place-items: center; box-shadow: 0 10px 24px rgb(20 83 45 / .4);
}
.fab:active { transform: scale(.94); }

/* ---------- Primitives ---------- */
.card { background: var(--card); border-radius: var(--radius); padding: 16px; border: 1px solid rgb(226 232 240 / .8); box-shadow: var(--shadow-sm); }
.section { margin: 8px 2px 0; font-size: 15px; font-weight: 800; color: var(--title); display: flex; align-items: center; gap: 8px; }
.section .muted { font-weight: 500; }
.eyebrow { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .3px; color: var(--muted-2); }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .center { text-align: center; }
.ok { color: var(--ok); } .warn { color: var(--warn); } .neg { color: var(--neg); }
.grow { flex: 1; min-width: 0; } .left { text-align: left; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.row-inline { display: flex; align-items: center; gap: 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hint { margin: 0 2px; font-size: 12.5px; color: var(--muted); }
.note { padding: 10px 14px; border-radius: 16px; background: var(--em-50); border: 1px solid var(--em-200); font-size: 13px; color: var(--em-700); font-weight: 600; }
.note.warn { background: var(--amber-50); border-color: #fde68a; color: var(--amber-800); }
.ico-tile { width: 40px; height: 40px; border-radius: 16px; display: grid; place-items: center; flex: none; background: var(--em-100); color: var(--dark); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 46px; padding: 0 16px; border-radius: 14px; font-weight: 700; font-size: 13.5px;
  background: var(--soft); color: #334155;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--dark); color: var(--lime-300); font-weight: 800; box-shadow: 0 4px 10px rgb(20 83 45 / .2); }
.btn.volt { background: linear-gradient(90deg, var(--lime-400), var(--em-500)); color: var(--dark); font-weight: 800; }
.btn.messenger { background: linear-gradient(90deg, var(--msg-1), var(--msg-2)); color: #fff; font-weight: 800; }
.btn.soft { background: var(--em-50); color: var(--em-700); border: 1px solid var(--em-200); }
.btn.amber { background: var(--amber-100); color: var(--amber-800); border: 1px solid var(--amber-300); }
.btn.danger-soft { background: var(--rose-50); color: var(--rose-600); }
.btn.block { width: 100%; }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 12.5px; border-radius: 11px; }
.btn[disabled] { opacity: .5; }
.btn-row { display: flex; gap: 10px; } .btn-row > .btn { flex: 1; } .btn-row.wrap { flex-wrap: wrap; }
.btn-row > .btn.danger-soft:first-child:not(:only-child) { flex: 0 0 54px; }
.icon-btn { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; color: var(--muted-2); flex: none; }
.icon-btn:active { background: var(--soft); }
.icon-btn.danger { color: var(--rose-600); }
.icon-btn.spin .ico { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.link-btn { color: var(--em-700); font-weight: 700; padding: 10px 4px; font-size: 13.5px; }

.badge { display: inline-block; font-size: 10.5px; font-weight: 800; padding: 3px 9px; border-radius: 999px; background: var(--lime-100); color: var(--dark); white-space: nowrap; }
.badge.live { background: var(--lime-400); color: var(--dark); }
.badge.demo { background: var(--amber-100); color: var(--amber-800); }
.badge.ok { background: var(--em-50); color: var(--em-700); } .badge.warn { background: var(--amber-100); color: var(--amber-800); }
.badge.neg { background: var(--rose-100); color: var(--rose-700); }
.badge.gray { background: var(--soft); color: var(--muted); }

.seg { display: flex; background: var(--soft); border: 1px solid var(--line); border-radius: 16px; padding: 4px; gap: 4px; }
.seg button { flex: 1; min-height: 38px; border-radius: 12px; font-weight: 700; font-size: 13px; color: var(--muted); white-space: nowrap; padding: 0 8px; }
.seg button.on { background: #fff; color: var(--dark); font-weight: 800; box-shadow: 0 1px 3px rgb(0 0 0 / .1); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chips.center { justify-content: center; }
.chip { min-height: 36px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font-size: 13px; font-weight: 700; color: #334155; }
.chips.small .chip { min-height: 32px; padding: 0 11px; font-size: 12px; }
.chip.on { background: var(--dark); border-color: var(--dark); color: var(--lime-300); }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field-label { font-size: 12px; font-weight: 700; color: #475569; }
.field small { color: var(--muted); font-size: 11.5px; }
.money { position: relative; }
.money input { font-size: 22px; font-weight: 700; padding-right: 36px; }
.money span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted-2); font-weight: 700; }
.stepper { display: flex; align-items: center; border: 1px solid #cbd5e1; border-radius: 14px; background: #fff; overflow: hidden; }
.stepper button { width: 48px; height: 46px; display: grid; place-items: center; color: var(--em-700); }
.stepper button:active { background: var(--em-50); }
.stepper input { border: 0; text-align: center; font-weight: 700; font-size: 22px; padding: 0; height: 46px; box-shadow: none !important; }
.toggles { display: flex; flex-direction: column; gap: 4px; }
.toggle { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 600; }

.search { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid rgb(226 232 240 / .9); border-radius: 16px; padding: 0 6px 0 14px; color: var(--muted-2); box-shadow: var(--shadow-sm); }
.search input { border: 0; padding: 12px 4px; box-shadow: none !important; background: transparent; }
.search .chip { flex: none; margin: 0; background: var(--amber-100); border-color: var(--amber-300); color: var(--amber-800); }

.avatar { flex: none; display: inline-grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 700; letter-spacing: .3px; box-shadow: inset 0 -2px 4px rgb(0 0 0 / .12); }
.avatar.sq { border-radius: 16px; }
.empty { text-align: center; color: var(--muted-2); padding: 26px 16px; font-style: italic; font-size: 13px; }
.empty p { margin: 8px 0 0; }

/* ---------- Lists ---------- */
.list { display: flex; flex-direction: column; gap: 8px; }
.row {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 58px;
  padding: 10px 12px; background: #fff; border: 1px solid rgb(226 232 240 / .9); border-radius: 18px;
}
.row.tap:active, .row-main:active { background: var(--soft); }
.row.on { border-color: var(--em-200); background: rgb(236 253 245 / .7); }
.row.dim { opacity: .55; }
.row b { color: var(--title); }
.row-main { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; padding: 0; border-radius: 12px; }
.idx { font-family: var(--sport); font-size: 12px; font-weight: 700; color: var(--em-700); width: 18px; flex: none; text-align: right; }
.check { flex: none; width: 30px; height: 30px; border-radius: 50%; border: 2px solid #cbd5e1; display: grid; place-items: center; transition: .15s; background: #fff; }
.check.on { background: var(--em-600); border-color: var(--em-600); color: #fff; }
.rank { width: 26px; text-align: center; color: var(--muted-2); font-weight: 700; font-size: 13px; flex: none; }
.rating { flex: none; text-align: center; background: rgb(236 252 203 / .9); border: 1px solid var(--lime-300); color: var(--dark); padding: 3px 10px; border-radius: 12px; font-weight: 700; font-size: 16px; line-height: 1.1; }
.rating::before { content: 'DUPR'; display: block; font-family: var(--sans); font-size: 8.5px; font-weight: 800; letter-spacing: .3px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.dot.lv-hi { background: #7c3aed; } .dot.lv-mid { background: var(--em-500); } .dot.lv-lo { background: var(--amber-500); }
.group-title { font-size: 11px; color: var(--muted-2); font-weight: 800; margin: 12px 4px 6px; text-transform: uppercase; letter-spacing: .3px; }
.tag { white-space: nowrap; flex: none; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 7px; background: var(--em-50); color: var(--em-700); }
.tag.guest { background: var(--amber-50); color: var(--amber-600); }
.guest-txt { color: var(--amber-600); font-weight: 700; }

/* ---------- Schedule ---------- */
.hero-btn {
  display: flex; align-items: center; gap: 14px; text-align: left; padding: 16px; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--dark), var(--court)); color: #fff; box-shadow: 0 10px 24px rgb(20 83 45 / .25);
  position: relative; overflow: hidden;
}
.hero-btn::after { content: ''; position: absolute; right: -30px; top: -30px; width: 120px; height: 120px; border-radius: 50%; background: rgb(190 242 100 / .12); }
.hero-btn .ico-tile { background: var(--lime-400); color: var(--dark); }
.hero-btn b { font-size: 16px; font-weight: 800; display: block; } .hero-btn small { color: #a7f3d0; font-size: 12px; }
.hero-btn:active { transform: scale(.99); }
.session-card { display: flex; gap: 14px; align-items: center; text-align: left; width: 100%; }
.session-card b { color: var(--title); }
.session-card.today { border-color: var(--lime-400); box-shadow: 0 0 0 3px var(--lime-100); }
.datebox { flex: none; width: 56px; text-align: center; background: var(--em-100); color: var(--dark); border-radius: 18px; padding: 7px 0; display: flex; flex-direction: column; line-height: 1.1; }
.datebox b { font-size: 22px; color: var(--dark) !important; } .datebox small { font-size: 10.5px; font-weight: 800; }
.today .datebox { background: var(--lime-400); }
.meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; margin-top: 5px; color: var(--muted); }
.meta span { display: inline-flex; align-items: center; gap: 4px; }
.meta .ico { color: var(--em-600); }

/* session hero card */
.detail-head { display: flex; align-items: center; gap: 4px; margin: -4px -6px 0; }
.detail-head b { font-size: 16px; font-weight: 800; color: var(--title); }
.hero-card { padding: 0; overflow: hidden; }
.status-banner { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 16px; background: linear-gradient(90deg, var(--lime-400), #34d399); color: var(--dark); font-weight: 800; font-size: 12px; }
.status-banner.past { background: linear-gradient(90deg, #e2e8f0, #cbd5e1); color: #334155; }
.status-banner.future { background: linear-gradient(90deg, #bae6fd, #a7f3d0); }
.status-banner > span { white-space: nowrap; }
.status-banner .when { background: rgb(255 255 255 / .85); padding: 3px 10px; border-radius: 999px; font-size: 11.5px; text-transform: capitalize; }
.ping { position: relative; width: 10px; height: 10px; display: inline-block; margin-right: 6px; flex: none; }
.ping::before, .ping::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: var(--dark); }
.ping::before { animation: ping 1.2s cubic-bezier(0, 0, .2, 1) infinite; opacity: .7; }
@keyframes ping { 75%, 100% { transform: scale(2.2); opacity: 0; } }
.hero-body { padding: 14px 16px 16px; }
.hero-body h2 { margin: 0; font-size: 19px; font-weight: 800; color: var(--title); letter-spacing: -.2px; }
.hero-actions { display: flex; gap: 2px; margin: -6px -8px 0 0; }
.stat-box { display: flex; align-items: center; gap: 14px; background: var(--bg); border: 1px solid var(--line); border-radius: 18px; padding: 10px 14px; margin-top: 12px; }
.stat-box > div { flex: 1; }
.stat-box small { display: block; font-size: 11px; color: var(--muted); font-weight: 500; }
.stat-box b { font-size: 24px; font-weight: 700; color: var(--dark); line-height: 1.15; }
.stat-box b span { color: var(--muted-2); font-size: 17px; }
.stat-box b.em { color: var(--em-600); font-size: 19px; }
.stat-box .vr { flex: none; width: 1px; height: 34px; background: var(--line); }

.sticky-tabs { position: sticky; top: calc(var(--top-h) + var(--safe-t)); z-index: 10; background: var(--bg); padding: 8px 0; margin: -4px 0 -6px; }
.toolbar { margin-bottom: 10px; }
.detail .list, .detail .btn-row, .detail .search, .detail .card, .detail .btn.block, .detail .note { margin-bottom: 10px; }
.panel { border-radius: 22px; padding: 12px; border: 1px solid; margin-bottom: 12px; }
.panel.em { background: rgb(236 253 245 / .45); border-color: rgb(167 243 208 / .8); }
.panel.gray { background: var(--bg); border-color: var(--line); }
.panel-title { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 800; color: var(--dark); margin: 2px 2px 10px; text-transform: uppercase; }
.panel.gray .panel-title { color: #334155; }
.panel-title .d { width: 10px; height: 10px; border-radius: 50%; background: var(--em-500); }
.panel.gray .panel-title .d { background: var(--muted-2); }

.summary { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; padding: 14px 6px; }
.summary div { display: flex; flex-direction: column; } .summary small { color: var(--muted); font-size: 11px; font-weight: 600; }
.summary b { font-size: 18px; color: var(--title); } .summary .hl b { color: var(--dark); font-size: 22px; } .summary .hl.neg b { color: var(--rose-600); }
.summary .hl { background: var(--lime-100); border-radius: 14px; margin: -6px 2px; padding: 6px 0; }
.progress { height: 8px; background: var(--soft); border-radius: 99px; overflow: hidden; margin-bottom: 4px; }
.progress div { height: 100%; background: linear-gradient(90deg, var(--lime-400), var(--em-500)); transition: width .3s; }
.add-box .chips { margin: 0 0 10px; } .add-box .btn { margin-top: 10px; }

.court { padding: 0; overflow: hidden; }
.court-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; background: linear-gradient(135deg, var(--court), #115e59); color: #fff; }
.court-head b { color: #fff !important; font-weight: 800; }
.court-head .btn { background: var(--lime-400); color: var(--dark); }
.court .vs { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; padding: 12px; }
.team { background: var(--bg); border: 1px solid var(--line); border-radius: 16px; padding: 10px; font-weight: 700; font-size: 13.5px; color: var(--title); display: flex; flex-direction: column; gap: 4px; }
.team.a { border-color: var(--em-200); } .team.b { border-color: #fde68a; }
.team small { font-weight: 600; }
.vs-x { font-family: var(--sport); font-weight: 700; color: var(--muted-2); font-size: 14px; }
.win { font-weight: 800; color: var(--em-700); }
.score { font-size: 19px; white-space: nowrap; color: var(--dark) !important; }
.score-input { display: flex; flex-direction: column; gap: 14px; background: var(--bg); border: 1px solid var(--line); border-radius: 18px; padding: 14px; }
.score-input > div { display: flex; flex-direction: column; gap: 6px; }
.score-input .lbl-a { font-size: 10.5px; font-weight: 800; color: var(--em-700); text-transform: uppercase; }
.score-input .lbl-b { font-size: 10.5px; font-weight: 800; color: var(--amber-600); text-transform: uppercase; }
.qr { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.qr-frame { padding: 12px; background: var(--bg); border: 2px dashed #6ee7b7; border-radius: 20px; }
.qr img { width: min(240px, 70vw); border-radius: 12px; background: #fff; display: block; }
.qr .amount { font-family: var(--sport); font-size: 26px; font-weight: 700; color: var(--dark); }
.qr .memo { background: var(--soft); padding: 6px 12px; border-radius: 12px; font-size: 12px; color: var(--muted); }
.small-qr img { width: 140px; }

/* ---------- Members podium ---------- */
.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; align-items: end; }
.podium .p { background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 12px 6px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; box-shadow: var(--shadow-sm); }
.podium .p1 { border-color: #fbbf24; box-shadow: 0 0 0 3px #fde68a; padding-top: 16px; padding-bottom: 16px; }
.podium .p2 { border-color: #cbd5e1; } .podium .p3 { border-color: #fdba74; }
.podium .top { font-size: 10px; font-weight: 800; padding: 2px 9px; border-radius: 999px; }
.p1 .top { background: #fbbf24; color: #451a03; } .p2 .top { background: #e2e8f0; color: #334155; } .p3 .top { background: #fed7aa; color: #9a3412; }
.podium b { font-size: 12.5px; color: var(--title); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium .pr { font-family: var(--sport); font-size: 18px; font-weight: 700; color: var(--em-700); line-height: 1; }
.podium small { font-size: 10px; color: var(--muted-2); }

/* ---------- Finance ---------- */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.balance { background: linear-gradient(135deg, var(--dark), #065f46); color: #fff; border: 0; padding: 18px; box-shadow: 0 8px 20px rgb(20 83 45 / .25); }
.balance .bal-top { display: flex; align-items: center; justify-content: space-between; color: #a7f3d0; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; }
.balance .bal-top .ico { color: var(--lime-400); }
.balance > b { display: block; font-size: 32px; font-weight: 700; color: var(--lime-300); margin-top: 6px; letter-spacing: -.3px; }
.balance > b.neg { color: #fecaca; }
.small-bal > b { font-size: 26px; }
.bal-row { font-size: 12px; color: #d1fae5; margin-top: 10px; padding-top: 10px; border-top: 1px solid rgb(255 255 255 / .15); display: flex; justify-content: space-between; gap: 8px; }
.mini-stat { padding: 14px; }
.mini-stat .eyebrow { display: flex; justify-content: space-between; align-items: center; }
.mini-stat b { display: block; font-family: var(--sport); font-size: 21px; font-weight: 700; margin-top: 4px; }
.mini-stat .chipico { padding: 5px; border-radius: 9px; display: grid; }
.month-bar { display: flex; align-items: center; gap: 12px; font-weight: 700; font-family: var(--sport); }
.month-bar input { flex: 1; font-family: var(--sans); font-weight: 700; }
.tx-ico { flex: none; width: 38px; height: 38px; border-radius: 13px; display: grid; place-items: center; font-weight: 800; font-size: 18px; }
.tx-ico.income { background: var(--em-50); color: var(--em-600); } .tx-ico.expense { background: var(--rose-50); color: var(--rose-600); }
.debt .chips { margin-top: 10px; }
.debt b.neg { font-family: var(--sport); font-size: 17px; }

/* ---------- Assets ---------- */
.qty { display: flex; align-items: center; gap: 2px; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; }
.qty b { min-width: 28px; text-align: center; font-size: 18px; color: var(--title); }
.qty .icon-btn { width: 38px; height: 38px; color: var(--em-700); }

/* ---------- Sheet & toast ---------- */
.backdrop { position: fixed; inset: 0; z-index: 50; background: rgb(15 23 42 / .6); backdrop-filter: blur(2px); display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.sheet { width: 100%; max-width: 480px; max-height: 92vh; display: flex; flex-direction: column; background: #fff; border-radius: 28px 28px 0 0; animation: up .22s ease-out; box-shadow: 0 25px 50px rgb(0 0 0 / .25); }
.sheet-head { display: flex; align-items: center; padding: 16px 10px 6px 20px; }
.sheet-head h3 { flex: 1; margin: 0; font-size: 17px; font-weight: 800; color: var(--title); }
.sheet-head .icon-btn { width: 36px; height: 36px; border-radius: 50%; }
.sheet-body { padding: 8px 20px 12px; overflow-y: auto; overscroll-behavior: contain; }
.sheet-foot { padding: 10px 20px calc(14px + var(--safe-b)); }
@media (min-width: 700px) { .backdrop { align-items: center; padding: 16px; } .sheet { border-radius: 28px; } }
@keyframes up { from { transform: translateY(40px); opacity: .5; } }
@keyframes fade { from { opacity: 0; } }
.toast {
  position: fixed; top: calc(var(--top-h) + var(--safe-t) + 12px); right: 16px; z-index: 60; display: flex; align-items: center; gap: 10px;
  background: #0f172a; color: #fff; padding: 12px 16px; border-radius: 18px; font-weight: 600; font-size: 13px;
  box-shadow: 0 12px 28px rgb(0 0 0 / .3); max-width: calc(100vw - 32px); animation: slideIn .25s ease-out;
}
.toast::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--lime-400); flex: none; }
.toast.err::before { background: #fb7185; }
@keyframes slideIn { from { transform: translateX(120%); } }

/* ---------- Boot & login ---------- */
.boot { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: var(--muted); padding: 24px; text-align: center; }
.boot.err b { color: var(--title); }
.ball { width: 44px; height: 44px; border-radius: 50%; background: var(--lime-300); border: 3px solid var(--dark); animation: bounce .6s ease-in-out infinite alternate; }
@keyframes bounce { to { transform: translateY(-18px); } }
.login { min-height: 100vh; padding: 48px 24px; display: flex; flex-direction: column; align-items: center; background: linear-gradient(180deg, var(--dark), var(--teal-9) 45%, var(--bg) 45%); }
.badge-logo { display: inline-block; max-width: 70vw; height: auto; filter: drop-shadow(0 10px 22px rgb(0 0 0 / .3)); }
.login h1 { margin: 14px 0 26px; font-size: 22px; font-weight: 800; color: #fff; text-transform: uppercase; }
.login form { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 12px; background: #fff; padding: 22px; border-radius: 28px; box-shadow: 0 10px 30px rgb(0 0 0 / .12); }
.otp { text-align: center; font-size: 28px; letter-spacing: 10px; font-weight: 700; }

/* ---------- Chế độ xem (chưa đăng nhập) ---------- */
.login-btn { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px; border-radius: 12px; background: var(--lime-400); color: var(--dark); font-weight: 800; font-size: 12.5px; flex: none; }
.login-btn:active { transform: scale(.96); }
.viewer-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 16px; background: var(--amber-50); border-bottom: 1px solid #fde68a; color: var(--amber-800); font-size: 12.5px; }
.viewer-bar button { font-weight: 800; color: var(--dark); white-space: nowrap; font-size: 12.5px; }
body.readonly .fab,
body.readonly .hero-actions,
body.readonly .add-box,
body.readonly .qty .icon-btn,
body.readonly .icon-btn.danger,
body.readonly .bal-row .btn,
body.readonly .search .chip { display: none !important; }
body.readonly .check { opacity: .55; }
