/* ============================================================
   App shell — shared by the student app and vendor app
   Mobile-first, centered to a phone-width column on larger screens.
   ============================================================ */

.app-topbar {
    position: sticky; top: 0; z-index: 40;
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; background: var(--parchment);
    border-bottom: 1px solid var(--paper-hairline);
}
.app-topbar .who { display: flex; align-items: center; gap: 10px; }
.app-topbar .who img { width: 30px; height: 30px; border-radius: 50%; }
.app-topbar h1 { font-size: 1.05rem; margin: 0; }
.app-topbar .eyebrow { font-size: 0.74rem; color: var(--text-muted); margin: 0; }
.icon-btn {
    width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--paper-hairline); background: #fff; color: var(--text-primary);
}

.app-main { padding: 20px 20px 108px; }
.app-main.no-tab-pad { padding-bottom: 32px; }

.page-title { margin-bottom: 4px; }
.page-sub { margin-bottom: 24px; }

/* ── Bottom tab bar ───────────────────────────────────────────────────────── */
.tab-bar {
    position: fixed; left: 50%; bottom: 0; transform: translateX(-50%);
    width: 100%; max-width: var(--app-max);
    background: rgba(243,248,252,0.94); backdrop-filter: blur(12px);
    border-top: 1px solid var(--paper-hairline);
    display: flex; justify-content: space-around; align-items: center;
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
    z-index: 60;
}
.tab-item {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    color: var(--text-muted); font-size: 0.68rem; font-weight: 700;
    padding: 6px 10px; border-radius: 12px; min-width: 58px;
}
.tab-item svg { width: 22px; height: 22px; }
.tab-item.active { color: var(--blue-deep); }
.tab-item.active svg { stroke: var(--blue-deep); }

/* ── Wallet hero ──────────────────────────────────────────────────────────── */
.wallet-hero {
    background: linear-gradient(145deg, #16334F 0%, #0B1A2B 100%); color: var(--text-on-ink); border-radius: var(--radius-lg);
    padding: 26px 24px; position: relative; overflow: hidden; margin-bottom: 18px;
}
.wallet-hero::before {
    content: ""; position: absolute; inset: -40% -20% auto auto; width: 260px; height: 260px;
    background: radial-gradient(circle, rgba(81,160,213,0.40), transparent 70%);
}
.wallet-hero .label { font-size: 0.8rem; color: var(--text-on-ink-dim); margin-bottom: 6px; }
.wallet-hero .amount { font-family: var(--font-display); font-size: 2.5rem; margin-bottom: 2px; }
.wallet-hero .sub { font-size: 0.82rem; color: var(--text-on-ink-dim); margin-bottom: 20px; }
.wallet-hero .actions { display: flex; gap: 10px; position: relative; }

.stat-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.stat-tile { background: #fff; border: 1px solid var(--paper-hairline); border-radius: var(--radius-md); padding: 16px; }
.stat-tile .num { font-family: var(--font-display); font-size: 1.5rem; }
.stat-tile .label { font-size: 0.78rem; color: var(--text-muted); }

/* ── Home quick actions (student dashboard) ──────────────────────────────── */
.home-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 8px; }
.home-action {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    padding: 14px 4px; background: #fff; border: 1px solid var(--paper-hairline);
    border-radius: var(--radius-md); text-decoration: none; color: var(--text-primary); text-align: center;
}
.home-action:active { transform: scale(0.97); }
.home-action .ic {
    width: 42px; height: 42px; border-radius: 50%; background: var(--blue-tint);
    display: flex; align-items: center; justify-content: center; color: var(--blue-deep);
}
.home-action .ic svg { width: 20px; height: 20px; }
.home-action span { font-size: 0.7rem; font-weight: 700; line-height: 1.2; }

.section-label {
    display: flex; align-items: center; justify-content: space-between;
    margin: 26px 0 12px;
}
.section-label h2 { font-size: 1.02rem; margin: 0; }
.section-label a { font-size: 0.82rem; font-weight: 700; color: var(--blue-deep); }

/* ── List rows (transactions, vendors) ───────────────────────────────────── */
.list-row {
    display: flex; align-items: center; gap: 12px; padding: 13px 4px;
    border-bottom: 1px solid var(--paper-hairline);
}
.list-row:last-child { border-bottom: none; }
.list-icon {
    width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    background: var(--blue-tint); flex-shrink: 0; font-family: var(--font-display); font-size: 1rem;
}
.list-icon.debit { color: var(--crimson); }
.list-icon.credit { color: var(--green); }
.list-body { flex: 1; min-width: 0; }
.list-body .title { font-weight: 700; font-size: 0.92rem; }
.list-body .meta { font-size: 0.78rem; color: var(--text-muted); }
.list-amount { font-weight: 700; font-size: 0.94rem; white-space: nowrap; }
.list-amount.debit { color: var(--crimson); }
.list-amount.credit { color: var(--green); }

.empty-state { text-align: center; padding: 46px 18px; color: var(--text-muted); }
.empty-state .glyph { font-size: 2.2rem; margin-bottom: 10px; }

/* ── Vendor directory cards ───────────────────────────────────────────────── */
.vendor-card { display: flex; gap: 14px; align-items: center; }
.vendor-mark {
    width: 48px; height: 48px; border-radius: 14px; background: var(--ink); color: var(--blue-highlight);
    display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 1.2rem; flex-shrink: 0;
}
.vendor-info .name { font-weight: 700; }
.vendor-info .meta { font-size: 0.8rem; color: var(--text-muted); }

/* ── Multi-step wizard (Claim Your Card) ──────────────────────────────────── */
.wizard-progress { display: flex; gap: 6px; margin-bottom: 26px; }
.wizard-progress span { height: 4px; flex: 1; border-radius: 4px; background: var(--paper-hairline); }
.wizard-progress span.done, .wizard-progress span.active { background: var(--blue); }
.wizard-step-label { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 4px; font-weight: 700; }
.wizard-panel { display: none; }
.wizard-panel.active { display: block; animation: rise 0.35s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.wizard-nav { display: flex; gap: 10px; margin-top: 26px; }

.review-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--paper-hairline); font-size: 0.9rem; }
.review-row:last-child { border-bottom: none; }
.review-row .k { color: var(--text-muted); }
.review-row .v { font-weight: 700; text-align: right; }

/* ── Card reveal / full virtual card view ─────────────────────────────────── */
.card-stage { display: flex; justify-content: center; padding: 30px 0 10px; }
.full-vcard {
    width: 100%; max-width: 360px; aspect-ratio: 1.586/1; border-radius: 22px; padding: 24px;
    background: linear-gradient(155deg, #1B3D5C 0%, #102943 55%, #08131F 100%);
    border: 1px solid rgba(81,160,213,0.45);
    box-shadow: var(--shadow-float);
    color: var(--text-on-ink);
    display: flex; flex-direction: column; justify-content: space-between;
}
.full-vcard .top-row { display: flex; align-items: center; justify-content: space-between; }
.full-vcard .mark { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-size: 1rem; }
.full-vcard .mark img { width: 26px; height: 26px; border-radius: 50%; }
.full-vcard .chip { width: 40px; height: 30px; border-radius: 6px; background: linear-gradient(135deg, #9FCFEE, #51A0D5 60%, #2E74A8); }
.full-vcard .number { font-family: var(--font-display); letter-spacing: 0.06em; font-size: 1.28rem; margin: 8px 0 2px; }
.full-vcard .bottom-row { display: flex; justify-content: space-between; align-items: flex-end; }
.full-vcard .name { font-size: 0.98rem; font-weight: 700; text-transform: capitalize; }
.full-vcard .valid { font-size: 0.68rem; color: var(--text-on-ink-dim); }
.full-vcard .campus { font-size: 0.68rem; color: var(--text-on-ink-dim); max-width: 55%; text-align: right; }

.card-actions { display: flex; gap: 10px; padding: 20px 0; }

.verify-pending { text-align: center; padding: 50px 22px; }
.verify-pending .ring {
    width: 84px; height: 84px; border-radius: 50%; margin: 0 auto 20px;
    border: 3px solid var(--paper-hairline); border-top-color: var(--blue);
    animation: spin 1.1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Bottom sheet (vendor: accept payment) ───────────────────────────────── */
.sheet-backdrop {
    position: fixed; inset: 0; background: rgba(8,20,34,0.55); z-index: 90;
    opacity: 0; pointer-events: none; transition: opacity 0.2s ease;
}
.sheet-backdrop.show { opacity: 1; pointer-events: auto; }
.sheet {
    position: fixed; left: 50%; bottom: 0; transform: translateX(-50%) translateY(100%);
    width: 100%; max-width: var(--app-max); background: var(--parchment);
    border-radius: 22px 22px 0 0; padding: 24px 22px calc(24px + env(safe-area-inset-bottom));
    z-index: 95; transition: transform 0.28s cubic-bezier(.2,.9,.3,1);
    box-shadow: 0 -20px 50px rgba(8,20,34,0.25);
}
.sheet.show { transform: translateX(-50%) translateY(0); }
.sheet-handle { width: 40px; height: 4px; background: var(--paper-hairline); border-radius: 4px; margin: 0 auto 18px; }

/* ── QR: vendor receive code + student scan-to-pay ───────────────────────── */
.qr-card {
    background: #fff; border: 1px solid var(--paper-hairline); border-radius: var(--radius-lg);
    padding: 26px; text-align: center;
}
.qr-stage { display: flex; justify-content: center; padding: 6px 0 18px; }
.qr-stage > div { padding: 14px; background: #fff; border-radius: var(--radius-md); border: 1px solid var(--paper-hairline); }
.qr-token { font-family: var(--font-display); letter-spacing: 0.04em; font-size: 1.05rem; margin-top: 4px; }
.qr-actions { display: flex; gap: 10px; justify-content: center; margin-top: 18px; }

.scan-shell { position: relative; border-radius: var(--radius-lg); overflow: hidden; background: var(--ink); aspect-ratio: 3/4; }
.scan-shell video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-frame-overlay {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none;
}
.scan-frame-overlay .box {
    width: 68%; aspect-ratio: 1; border: 2.5px solid var(--blue-highlight); border-radius: 18px;
    box-shadow: 0 0 0 999px rgba(8,20,34,0.45);
}
.scan-hint {
    position: absolute; left: 0; right: 0; bottom: 16px; text-align: center;
    color: var(--text-on-ink); font-size: 0.84rem; font-weight: 600;
}
.scan-manual { display: flex; gap: 10px; margin-top: 16px; }
.scan-manual input { flex: 1; }

.pay-vendor-card { display: flex; align-items: center; gap: 14px; padding: 18px; }
.amount-input-xl {
    display: flex; align-items: baseline; justify-content: center; gap: 6px; margin: 18px 0 6px;
}
.amount-input-xl .cur { font-family: var(--font-display); font-size: 2rem; color: var(--text-muted); }
.amount-input-xl input {
    border: none; background: transparent; font-family: var(--font-display); font-size: 3rem; width: 220px;
    text-align: center; padding: 0;
}
.amount-input-xl input:focus { outline: none; }

/* ── Auth screens ─────────────────────────────────────────────────────────── */
.auth-shell { min-height: 100vh; display: flex; flex-direction: column; background: linear-gradient(160deg, #143A5A 0%, #0B1A2B 60%); }
.auth-header { padding: 26px 24px 0; }
.auth-card { flex: 1; background: var(--parchment); border-radius: 26px 26px 0 0; margin-top: 30px; padding: 34px 24px 40px; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 22px 0; color: var(--text-muted); font-size: 0.82rem; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--paper-hairline); }
.helix-btn {
    display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
    padding: 13px 18px; border-radius: 999px; border: 1.5px solid var(--ink); background: #fff; font-weight: 700;
}
.helix-btn:hover { background: var(--parchment-dim); }

/* ── Print: card view reduces to just the card ────────────────────────────── */
@media print {
    .app-topbar, .tab-bar, .card-actions, .surface, .flash { display: none !important; }
    body, .app-shell { background: #fff; }
    .card-stage { padding: 0; }
}

/* ── Scanner controls (torch + photo upload) ──────────────────────────────── */
.scan-torch {
    position: absolute; top: 14px; right: 14px; z-index: 5;
    width: 42px; height: 42px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: rgba(11,26,43,0.55); color: #fff;
    border: 1px solid rgba(255,255,255,0.35); cursor: pointer;
    backdrop-filter: blur(6px);
}
.scan-torch.on { background: var(--blue); border-color: var(--blue-highlight); color: #fff; }
.scan-tools { display: flex; justify-content: center; margin-top: 14px; }
.scan-tools label { cursor: pointer; }

/* ── Vendor wallet ────────────────────────────────────────────────────────── */
.wallet-chart { display: flex; align-items: flex-end; gap: 8px; height: 118px; }
.wallet-chart .bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; justify-content: flex-end; }
.wallet-chart .bar {
    width: 100%; max-width: 26px; border-radius: 6px 6px 2px 2px;
    background: linear-gradient(180deg, var(--blue-highlight), var(--blue));
    transition: background 0.18s ease, transform 0.18s ease;
}
.wallet-chart .bar:hover { background: var(--blue-deep); transform: scaleX(1.12); }
.wallet-chart .bar-label { font-size: 0.68rem; color: var(--text-muted); font-weight: 700; }

/* A chip that's a link (wallet statement filters) rather than a button. */
.chip-row a.chip { text-decoration: none; display: inline-flex; align-items: center; }

/* ── Filter pills (transactions filter, quick top-up amounts) ────────────────
   Already defined in admin.css for the admin panel; repeated here so the
   student-facing pages that use the same markup (user/wallet.php,
   user/transactions.php) actually get styled. */
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; }
.pill-link {
    padding: 7px 14px; border-radius: 999px; font-size: 0.8rem; font-weight: 700;
    border: 1px solid var(--paper-hairline); background: #fff; color: var(--text-muted);
    cursor: pointer;
}
.pill-link.active { background: var(--blue); color: var(--ink); border-color: var(--blue); }

/* ── Add-to-home-screen banner (dashboards) ─────────────────────────────── */
.install-banner {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 12px 12px 14px;
    background: var(--blue-tint); border: 1px solid rgba(81,160,213,0.35);
    border-radius: var(--radius-sm); margin-bottom: 14px;
}
.install-banner-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.install-banner-text strong { font-size: 0.86rem; color: var(--blue-deeper); }
.install-banner-text span { font-size: 0.76rem; color: var(--text-muted); }
.install-banner .btn-sm { flex-shrink: 0; white-space: nowrap; }
.install-banner-close {
    flex-shrink: 0; background: none; border: none; cursor: pointer;
    font-size: 1.1rem; line-height: 1; color: var(--text-muted); padding: 4px 2px;
}
.install-banner-close:hover { color: var(--text-primary); }