/* Mobile Pigmy agent app (phone first), on top of the shared theme core/sookth.css.
   Header, bottom tabs, account list, amount sheet, confirm popup, PIN boxes, receipts,
   offline status. Only shared tokens (--ink, --yellow, ...) are used for colour. */

.hidden { display: none !important; }
.center-text { text-align: center; }

/* ---------- App shell ---------- */
.agent-app { min-height: 100vh; display: flex; flex-direction: column; max-width: 640px; margin: 0 auto; }
.app-top {
    position: sticky; top: 0; z-index: 10;
    display: flex; align-items: center; gap: .7rem;
    padding: .7rem 1rem;
    background: var(--surface);
    border-bottom: 3px solid var(--ink);
}
.app-top .titles { flex: 1; min-width: 0; }
.app-top .titles strong { display: block; font-weight: 900; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-top .titles span { display: block; font-size: .78rem; font-weight: 700; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-body { flex: 1; padding: 1rem 1rem 6.5rem; display: flex; flex-direction: column; gap: 1rem; }

.tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
    background: var(--surface);
    border-top: 3px solid var(--ink);
    padding-bottom: env(safe-area-inset-bottom);
}
.tabbar-inner { max-width: 640px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); }
.tab {
    display: flex; flex-direction: column; align-items: center; gap: .15rem;
    padding: .45rem .25rem .55rem;
    font-size: .75rem; font-weight: 850; text-decoration: none; color: var(--text);
}
.tab:hover { background: none; }
.tab .pill { display: grid; place-items: center; width: 52px; height: 30px; border: var(--bw) solid transparent; border-radius: 10px; }
.tab .pill .icon { width: 20px; height: 20px; }
.tab.is-active .pill { background: var(--yellow); color: var(--on-color); border-color: var(--ink); box-shadow: var(--shadow-sm); }

/* ---------- Today hero ---------- */
.hero {
    padding: 1.1rem 1.15rem;
    color: var(--on-color); background: var(--yellow);
    border: 3px solid var(--ink); border-radius: 16px; box-shadow: var(--shadow-lg);
}
.hero .label { font-size: .78rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.hero .big { font-size: 2.1rem; font-weight: 900; letter-spacing: -.03em; line-height: 1.15; }
.hero-row { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-top: .8rem; }
.hero-stat { padding: .5rem .65rem; background: var(--surface); color: var(--text); border: var(--bw) solid var(--ink); border-radius: 10px; }
.hero-stat span { display: block; font-size: .72rem; font-weight: 800; color: var(--muted); }
.hero-stat strong { font-size: 1.05rem; font-weight: 900; }

.section-title { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.section-title h2 { font-size: 1.15rem; }
.section-title span { font-size: .85rem; font-weight: 800; color: var(--muted); }

/* ---------- Search + account list ---------- */
.search-sticky { position: sticky; top: 64px; z-index: 5; padding: .25rem 0; background: var(--bg); }
.input-icon { position: relative; }
.input-icon > .icon { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.input-icon .input { padding-left: 2.6rem; }
.input-lg { min-height: 52px; font-size: 1.05rem; }

.acc-list { display: flex; flex-direction: column; gap: .6rem; }
.acc {
    display: flex; align-items: center; gap: .75rem; width: 100%;
    padding: .7rem .8rem;
    font: inherit; text-align: left; color: var(--text);
    background: var(--surface);
    border: var(--bw) solid var(--ink); border-radius: 12px; box-shadow: var(--shadow-sm);
    cursor: pointer;
}
.acc:active { transform: translate(2px, 2px); box-shadow: none; }
.acc .info { flex: 1; min-width: 0; }
.acc .info strong { display: block; font-weight: 850; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc .info span { display: block; font-size: .8rem; color: var(--muted); font-weight: 700; }
.acc .bal { text-align: right; flex: none; }
.acc .bal strong { display: block; font-weight: 900; font-variant-numeric: tabular-nums; }
.acc .bal span { display: block; font-size: .75rem; font-weight: 800; color: var(--success); }
.acc .bal span.warning { color: var(--warning); }
.acc.is-done { background: var(--sunk); }
.acc.is-done .avatar { background: var(--green); }
.avatar-lg { width: 56px; height: 56px; font-size: 1.2rem; border-radius: 14px; }

/* ---------- Bottom sheet (step 1: amount) ---------- */
.sheet-backdrop, .modal-backdrop { position: fixed; inset: 0; z-index: 30; background: rgba(0, 0, 0, .45); opacity: 0; pointer-events: none; transition: opacity .15s ease; }
.sheet {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 31;
    max-width: 640px; margin: 0 auto;
    padding: .6rem 1rem calc(1.2rem + env(safe-area-inset-bottom));
    display: flex; flex-direction: column; gap: .9rem;
    background: var(--surface);
    border: 3px solid var(--ink); border-bottom: 0; border-radius: 18px 18px 0 0;
    transform: translateY(105%); transition: transform .18s ease;
}
.sheet-open .sheet-backdrop { opacity: 1; pointer-events: auto; }
.sheet-open .sheet { transform: none; }
.sheet-grip { width: 48px; height: 6px; margin: 0 auto; background: var(--ink); border-radius: 99px; opacity: .4; }
.sheet-acc { display: flex; align-items: center; gap: .7rem; }
.sheet-acc .info { flex: 1; min-width: 0; }
.sheet-acc .info strong { display: block; font-weight: 900; font-size: 1.05rem; }
.sheet-acc .info span { display: block; font-size: .82rem; color: var(--muted); }

.input-money { position: relative; }
.input-money::before { content: "₹"; position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); font-size: 1.5rem; font-weight: 900; }
.input-money .input { padding-left: 2.4rem; min-height: 60px; font-size: 1.8rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.chips { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .3rem; }
.chip { padding: .35rem .75rem; font: inherit; font-weight: 850; color: var(--text); background: var(--surface); border: 2px solid var(--ink); border-radius: 99px; cursor: pointer; }
.chip:active { background: var(--yellow); color: var(--on-color); }
.balance-preview { display: flex; justify-content: space-between; gap: .5rem; padding: .6rem .8rem; font-weight: 700; background: var(--sunk); border: 2px dashed var(--ink); border-radius: 10px; }

/* ---------- Centred confirm popup (step 2) ---------- */
.modal {
    position: fixed; left: 50%; top: 50%; z-index: 41;
    width: min(92vw, 420px);
    padding: 1.2rem;
    display: flex; flex-direction: column; gap: 1rem;
    background: var(--surface);
    border: 3px solid var(--ink); border-radius: 16px; box-shadow: var(--shadow-lg);
    transform: translate(-50%, -50%) scale(.95); opacity: 0; pointer-events: none; transition: all .15s ease;
}
.modal-backdrop { z-index: 40; }
.confirm-open .modal { transform: translate(-50%, -50%); opacity: 1; pointer-events: auto; }
.confirm-open .modal-backdrop { opacity: 1; pointer-events: auto; }
.confirm-title { display: flex; align-items: center; gap: .5rem; font-weight: 900; font-size: 1.05rem; }
.confirm-box { display: flex; flex-direction: column; gap: .5rem; }
.confirm-row { display: flex; justify-content: space-between; gap: .75rem; font-size: .95rem; }
.confirm-row span { color: var(--muted); font-weight: 700; }
.confirm-amount { display: flex; justify-content: space-between; align-items: center; padding: .6rem .8rem; background: var(--yellow); color: var(--on-color); border: var(--bw) solid var(--ink); border-radius: 10px; }
.confirm-amount span { font-weight: 800; }
.confirm-amount strong { font-size: 1.6rem; font-weight: 900; }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.btn-lg { min-height: 52px; font-size: 1.05rem; }

/* ---------- Receipt ---------- */
.receipt-ok { text-align: center; display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: .5rem 0; }
.receipt-ok .tick { display: grid; place-items: center; width: 64px; height: 64px; background: var(--green); color: var(--on-color); border: 3px solid var(--ink); border-radius: 50%; box-shadow: var(--shadow); }
.receipt-ok .tick .icon { width: 34px; height: 34px; stroke-width: 3; }
.receipt-ok .amount { font-size: 2rem; font-weight: 900; }
.receipt { padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .5rem; background: var(--surface); border: var(--bw) solid var(--ink); border-radius: 12px; box-shadow: var(--shadow); }
.receipt-row { display: flex; justify-content: space-between; gap: 1rem; }
.receipt-row span { color: var(--muted); font-weight: 700; }
.receipt-row strong { text-align: right; word-break: break-word; }
.receipt-sep { border-top: 2px dashed var(--ink); margin: .2rem 0; }
.send-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; }
.btn-sms, .btn-sms:hover { background: var(--blue); }
.btn-whatsapp, .btn-whatsapp:hover { background: var(--green); }

/* ---------- PIN boxes ---------- */
.pin-label { display: flex; align-items: center; gap: .4rem; }
.pin-boxes { display: grid; grid-template-columns: repeat(6, 1fr); gap: .45rem; }
.pin-box {
    width: 100%; min-width: 0; height: 54px; padding: 0;
    font: inherit; font-size: 1.5rem; font-weight: 900; text-align: center; color: var(--text);
    background: var(--surface);
    border: var(--bw) solid var(--ink); border-radius: 10px; box-shadow: var(--shadow-sm);
}
.pin-box:focus { outline: none; box-shadow: var(--ring), var(--shadow-sm); }
.pin-box.is-filled { background: var(--yellow); color: var(--on-color); }
.pin-boxes.is-invalid .pin-box { border-color: var(--danger); }

.password-wrap { position: relative; }
.password-wrap .input { padding-right: 3rem; }
.password-wrap .reveal { position: absolute; right: .4rem; top: 50%; transform: translateY(-50%); padding: .4rem; background: none; border: 0; color: var(--text); cursor: pointer; }
.remember { display: flex; align-items: center; gap: .6rem; font-weight: 700; }
.remember input { width: 20px; height: 20px; accent-color: var(--ink); }
.welcome-back { display: flex; align-items: center; gap: .9rem; }
.welcome-back h1 { font-size: 1.35rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }

/* ---------- Lists (history, day-wise, statement) ---------- */
.filter { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.filter .wide { grid-column: 1 / -1; }
.rows { display: flex; flex-direction: column; }
.rows > a, .rows > div { display: flex; align-items: center; gap: .7rem; padding: .7rem .9rem; text-decoration: none; color: var(--text); border-bottom: 2px solid var(--ink); }
.rows > a:last-child, .rows > div:last-child { border-bottom: 0; }
.rows > a:hover { background: var(--sunk); }
.rows .grow { flex: 1; min-width: 0; }
.rows .grow strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rows .grow span { display: block; font-size: .78rem; color: var(--muted); font-weight: 700; }
.rows .amt { text-align: right; font-weight: 900; font-variant-numeric: tabular-nums; }
.rows .amt span { display: block; font-size: .72rem; font-weight: 800; }
.is-cancelled .amt { text-decoration: line-through; color: var(--muted); }
.totals { display: flex; justify-content: space-between; padding: .75rem .9rem; font-weight: 900; background: var(--sunk); border-top: var(--bw) solid var(--ink); border-radius: 0 0 calc(var(--r) - 2px) calc(var(--r) - 2px); }

/* ---------- Offline Collect ---------- */
.off-status { display: flex; align-items: center; gap: .6rem; padding: .55rem .8rem; font-weight: 800; background: var(--surface); border: var(--bw) solid var(--ink); border-radius: 10px; }
.off-status-text { flex: 1; }
.off-dot { width: 12px; height: 12px; border: 2px solid var(--ink); border-radius: 50%; background: var(--surface); }
.off-status.is-online .off-dot { background: var(--green); }
.off-status.is-waiting .off-dot { background: var(--yellow); }
.off-status.is-busy .off-dot { background: var(--blue); }
.off-status.is-offline .off-dot { background: var(--pink); }
.off-panel { display: flex; flex-direction: column; gap: 1rem; }
.off-lock { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 1rem; background: var(--bg); }
.off-lock .auth-card { max-width: 420px; }
.off-toast {
    position: fixed; left: 50%; bottom: 6rem; z-index: 60; max-width: 90vw;
    padding: .7rem 1rem; font-weight: 800; color: var(--on-color); background: var(--yellow);
    border: var(--bw) solid var(--ink); border-radius: 10px; box-shadow: var(--shadow);
    transform: translate(-50%, 1rem); opacity: 0; pointer-events: none; transition: all .2s ease;
}
.off-toast.is-on { transform: translate(-50%, 0); opacity: 1; }

/* ---------- Public statement ---------- */
.statement { max-width: 640px; margin: 0 auto; padding: 1.25rem 1rem 3rem; display: flex; flex-direction: column; gap: 1rem; }
.statement-head { display: flex; align-items: center; gap: .8rem; }
.statement-head h1 { font-size: 1.3rem; }

/* ---------- Print: plain ---------- */
@media print {
    .app-top, .tabbar, .no-print, .sheet, .modal, .sheet-backdrop, .modal-backdrop { display: none !important; }
    .app-body { padding: 0; }
    .receipt, .hero, .card { box-shadow: none; }
}

/* The demo bank (user, 2026-10-30): a ribbon on every page, so it is never mistaken for a real bank. */
.demo-ribbon { display: flex; align-items: center; justify-content: center; gap: .4rem; padding: .35rem .75rem; font-size: .8rem; font-weight: 800;
    letter-spacing: .02em; color: #111; background: repeating-linear-gradient(45deg, #ffd93d 0 14px, #ffe680 14px 28px); border-bottom: 2px solid #111; }
.demo-ribbon .icon { width: 15px; height: 15px; }
