/* Wild Fox Referrals — portal shell + shared components (UX round 2026-10).
   Loads after referrals.css. DESIGN.md "Portal": left nav on desktop, top bar + bottom tabs on phones.
   Tokens come from referrals.css (:root --wf-*). Accent stays on the primary action, the brand word and
   the eyebrow dot only. Page-area styles live in portal-partner.css / portal-admin.css / portal-money.css. */

:root {
    --wf-side-w: 248px;
    --wf-tabbar-h: 64px;
    --wf-ease: cubic-bezier(.2,.7,.2,1);
}

/* ── Shell ─────────────────────────────────────────────────────── */
.wf-app { background: var(--wf-ground); }
.wf-skip { position: absolute; left: -9999px; top: 8px; z-index: 300; background: #fff; padding: 8px 12px; border-radius: 8px; }
.wf-skip:focus { left: 8px; }
.wf-app-shell { display: grid; grid-template-columns: var(--wf-side-w) minmax(0, 1fr); min-height: 100vh; }
.wf-app-main { min-width: 0; display: flex; flex-direction: column; }
.wf-app .wf-portal-main { width: 100%; max-width: 1040px; padding: 36px 40px 64px; margin: 0; gap: 20px; }

/* Sidebar (dark — the portal's one dark surface; the fox coin sits on it) */
.wf-side { background: var(--wf-dark); color: #fff; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; padding: 16px 14px 18px; }
.wf-side-top { display: flex; align-items: center; justify-content: space-between; padding: 0 6px 22px; }
.wf-side-brand .wf-nav-logo { width: 56px; height: 56px; margin: 0 4px 0 -6px; animation: none; }
.wf-side-brand .brand-mark { font-size: 1.3rem; }
.wf-side-close { display: none; background: none; border: 0; color: rgba(255,255,255,.7); padding: 6px; border-radius: 8px; }
.wf-side-nav { display: flex; flex-direction: column; gap: 2px; }
.wf-side-nav > a { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px; color: rgba(255,255,255,.72); font-size: 14.5px; font-weight: 500; text-decoration: none; transition: background .14s ease, color .14s ease; }
.wf-side-nav > a svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; opacity: .9; }
.wf-side-nav > a:hover { background: rgba(255,255,255,.06); color: #fff; }
.wf-side-nav > a.is-active { background: rgba(255,255,255,.1); color: #fff; font-weight: 600; }
.wf-side-nav > a.is-active svg { opacity: 1; }
.wf-side-cta { background: var(--wf-accent) !important; color: #fff !important; font-weight: 600 !important; margin: 0 0 12px; box-shadow: var(--wf-glow); justify-content: center; }
.wf-side-cta:hover { background: var(--wf-accent-600) !important; }
.wf-side-cta svg { stroke-width: 2.4 !important; }
.wf-side-label { font-size: 12px; font-weight: 600; color: rgba(255,255,255,.42); margin: 20px 12px 6px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.08); }
.wf-side-count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--wf-accent); color: #fff; font-size: 11.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }
.wf-side-count.is-quiet { background: rgba(255,255,255,.14); }
.wf-side-count.is-good { background: var(--wf-good); }
.wf-side-foot { margin-top: auto; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.08); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wf-side-me { display: flex; align-items: center; gap: 10px; min-width: 0; color: #fff; text-decoration: none; font-size: 13.5px; font-weight: 500; }
.wf-side-me-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wf-side-scrim { display: none; }

/* Page heading (non-dashboard pages) */
.wf-ph { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 4px; }
.wf-ph-main { min-width: 0; }
.wf-ph-title { font-size: 30px !important; letter-spacing: -.03em; line-height: 1.1; margin: 0 !important; display: block !important; }
.wf-ph-sub { margin: 6px 0 0; color: var(--wf-muted); font-size: 15px; max-width: 62ch; }
.wf-ph-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.wf-ph-back { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; color: var(--wf-muted); text-decoration: none; margin-bottom: 8px; }
.wf-ph-back:hover { color: var(--wf-ink); }

/* The dashboard keeps its dark greeting band as a rounded panel inside the content column */
.wf-hero-band { background: var(--wf-dark); color: #fff; border-radius: 18px; padding: 28px 30px 30px; }
.wf-hero-band h1, .wf-hero-band h2 { color: #fff; }
.wf-hero-band .wf-band-head { padding-top: 0; }

/* Mobile top bar (hidden on desktop) */
.wf-mbar { display: none; }

/* Bottom tab bar (phones) */
.wf-tabbar { display: none; }

@media (max-width: 991.98px) {
    .wf-app-shell { grid-template-columns: 1fr; }
    .wf-side { position: fixed; z-index: 120; left: 0; top: 0; bottom: 0; width: min(300px, 86vw); height: auto; transform: translateX(-102%); transition: transform .24s var(--wf-ease); box-shadow: 24px 0 60px rgba(0,0,0,.25); }
    .wf-app.side-open .wf-side { transform: none; }
    .wf-side-close { display: inline-flex; }
    .wf-side-scrim { display: block; position: fixed; inset: 0; z-index: 110; background: rgba(18,24,36,.45); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
    .wf-app.side-open .wf-side-scrim { opacity: 1; pointer-events: auto; }
    .wf-mbar { display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 60; height: 56px; padding: 0 12px 0 14px; background: var(--wf-dark); }
    .wf-mbar .wf-nav-logo { width: 44px; height: 44px; margin: 0 2px 0 -4px; }
    .wf-mbar .brand-mark { font-size: 1.15rem; }
    .wf-mbar-menu { position: relative; background: none; border: 0; color: #fff; padding: 8px; border-radius: 10px; }
    .wf-mbar-dot { position: absolute; top: 7px; right: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--wf-accent); box-shadow: 0 0 0 2px var(--wf-dark); }
    .wf-app .wf-portal-main { padding: 22px 16px calc(var(--wf-tabbar-h) + 32px + env(safe-area-inset-bottom)); }
    .wf-ph-title { font-size: 25px !important; }
    .wf-hero-band { border-radius: 16px; padding: 22px 18px 24px; }

    .wf-tabbar { display: flex; position: fixed; z-index: 90; left: 0; right: 0; bottom: 0; height: calc(var(--wf-tabbar-h) + env(safe-area-inset-bottom)); padding: 4px 4px env(safe-area-inset-bottom);
        background: rgba(255,255,255,.96); backdrop-filter: saturate(180%) blur(12px); -webkit-backdrop-filter: saturate(180%) blur(12px); border-top: 1px solid var(--wf-line); }
    .wf-tabbar > a, .wf-tabbar > button { flex: 1; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; background: none; border: 0; font: inherit; font-size: 11.5px; font-weight: 600; color: var(--wf-muted); text-decoration: none; min-height: 52px; }
    .wf-tabbar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
    .wf-tabbar > a.is-active { color: var(--wf-ink); }
    .wf-tab-plus span { width: 44px; height: 44px; margin-top: -14px; border-radius: 50%; background: var(--wf-accent); color: #fff; display: grid; place-items: center; box-shadow: var(--wf-glow); }
    .wf-tab-plus span svg { stroke-width: 2.6; width: 22px; height: 22px; }
    .wf-tab-dot { position: absolute; top: 4px; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--wf-accent); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; }
    .wf-tab-dot.is-good { background: var(--wf-good); }
}

/* ── Toasts ───────────────────────────────────────────────────── */
.wf-toasts { position: fixed; z-index: 200; left: 50%; bottom: 24px; transform: translateX(-50%); width: min(480px, calc(100vw - 32px)); display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.wf-toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 13px 14px 13px 16px; border-radius: 12px; background: var(--wf-ink); color: #fff; font-size: 14.5px; font-weight: 500; box-shadow: 0 18px 44px rgba(18,24,36,.28); animation: wf-toast-in .26s var(--wf-ease) both; }
.wf-toast-bad { background: #7A1D14; }
.wf-toast-x { margin-left: auto; background: none; border: 0; color: rgba(255,255,255,.7); font-size: 20px; line-height: 1; padding: 0 4px; }
.wf-toast.is-leaving { animation: wf-toast-out .2s ease both; }
@keyframes wf-toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes wf-toast-out { to { opacity: 0; transform: translateY(8px); } }
@media (max-width: 991.98px) { .wf-toasts { bottom: calc(var(--wf-tabbar-h) + 16px + env(safe-area-inset-bottom)); } }

/* ── Sheet: <dialog class="wf-sheet"> — centered on desktop, bottom sheet on phones ── */
dialog.wf-sheet { border: 0; padding: 0; border-radius: 18px; width: min(520px, calc(100vw - 32px)); max-height: 88vh; box-shadow: 0 30px 70px -20px rgba(18,24,36,.45); color: var(--wf-ink-2); }
dialog.wf-sheet::backdrop { background: rgba(18,24,36,.45); }
dialog.wf-sheet[open] { animation: wf-sheet-in .22s var(--wf-ease) both; }
.wf-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 22px 4px; }
.wf-sheet-head h3 { margin: 0; font-size: 18px; letter-spacing: -.015em; }
.wf-sheet-body { padding: 10px 22px 4px; overflow-y: auto; }
.wf-sheet-foot { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; padding: 14px 22px 20px; }
.wf-sheet-x { background: none; border: 0; color: var(--wf-muted); font-size: 22px; line-height: 1; padding: 2px 6px; border-radius: 8px; }
@keyframes wf-sheet-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (max-width: 575.98px) {
    dialog.wf-sheet { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 18px 18px 0 0; max-height: 92vh; }
    .wf-sheet-foot .btn { flex: 1; }
}

/* ── "⋯" action menu: <details class="wf-menu"><summary class="btn btn-ghost btn-sm">…</summary><div class="wf-menu-pop">…</div></details> ── */
.wf-menu { position: relative; display: inline-block; }
.wf-menu > summary { list-style: none; cursor: pointer; }
.wf-menu > summary::-webkit-details-marker { display: none; }
.wf-menu-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 70; min-width: 220px; background: #fff; border: 1px solid var(--wf-line); border-radius: 12px; box-shadow: 0 18px 44px rgba(18,24,36,.16); padding: 6px; }
.wf-menu-pop a, .wf-menu-pop button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; border: 0; background: none; font: inherit; font-size: 14.5px; color: var(--wf-ink); text-align: left; text-decoration: none; }
.wf-menu-pop a:hover, .wf-menu-pop button:hover { background: var(--wf-tile); }
.wf-menu-pop .is-danger { color: var(--wf-bad); }
.wf-menu-pop hr { border: 0; border-top: 1px solid var(--wf-line); margin: 6px 4px; opacity: 1; }

/* ── Action list (admin overview, "what needs you") ── */
.wf-inbox { display: flex; flex-direction: column; gap: 10px; }
.wf-inbox-item { display: flex; align-items: center; gap: 14px; padding: 16px 18px; background: var(--wf-surface); border: 1px solid var(--wf-line); border-radius: var(--wf-r-card); box-shadow: var(--wf-shadow-sm); text-decoration: none; color: var(--wf-ink-2); transition: box-shadow .14s ease, border-color .14s ease, transform .14s ease; }
.wf-inbox-item:hover { color: var(--wf-ink-2); border-color: #D3DAE4; box-shadow: var(--wf-shadow); transform: translateY(-1px); }
.wf-inbox-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--wf-tile); color: var(--wf-ink); }
.wf-inbox-ic svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.wf-inbox-ic.is-accent { background: var(--wf-accent-weak); color: var(--wf-accent-600); }
.wf-inbox-ic.is-good { background: var(--wf-good-weak); color: var(--wf-good); }
.wf-inbox-ic.is-warn { background: var(--wf-warn-weak); color: var(--wf-warn); }
.wf-inbox-title { font-weight: 600; color: var(--wf-ink); font-size: 15.5px; letter-spacing: -.01em; }
.wf-inbox-sub { font-size: 13.5px; color: var(--wf-muted); }
.wf-inbox-go { margin-left: auto; color: var(--wf-faint); flex: none; }

/* ── Empty state ── */
.wf-empty-state { text-align: center; padding: 36px 22px; background: var(--wf-surface); border: 1px solid var(--wf-line); border-radius: var(--wf-r-card); }
.wf-empty-state .wf-icon { width: 52px; height: 52px; border-radius: 15px; margin-bottom: 12px; }
.wf-empty-state h3 { margin: 0 0 6px; }
.wf-empty-state p { color: var(--wf-muted); margin: 0 auto 16px; max-width: 420px; font-size: 15px; }

/* ── Stepper (referral progress) ── */
.wf-stepper { display: flex; list-style: none; margin: 0; padding: 0; }
.wf-stepper li { flex: 1; position: relative; text-align: center; font-size: 12.5px; color: var(--wf-faint); padding-top: 30px; min-width: 0; font-weight: 500; }
.wf-stepper li::before { content: ""; position: absolute; top: 6px; left: 50%; transform: translateX(-50%); width: 18px; height: 18px; border-radius: 50%; background: var(--wf-surface); border: 2px solid var(--wf-line); z-index: 1; }
.wf-stepper li::after { content: ""; position: absolute; top: 14px; left: calc(-50% + 10px); right: calc(50% + 10px); height: 2px; background: var(--wf-line); }
.wf-stepper li:first-child::after { display: none; }
.wf-stepper li.is-done { color: var(--wf-ink-2); }
.wf-stepper li.is-done::before { background: var(--wf-good); border-color: var(--wf-good); }
.wf-stepper li.is-done::after, .wf-stepper li.is-current::after { background: var(--wf-good); }
.wf-stepper li.is-current { color: var(--wf-ink); font-weight: 600; }
.wf-stepper li.is-current::before { border-color: var(--wf-ink); box-shadow: 0 0 0 4px var(--wf-tile); }
.wf-stepper li.is-stopped::before { background: var(--wf-bad); border-color: var(--wf-bad); }
@media (max-width: 575.98px) { .wf-stepper li { font-size: 11px; } }

/* ── Stacked rows (anything people act on; replaces tables on phones) ── */
.wf-list { display: flex; flex-direction: column; background: var(--wf-surface); border: 1px solid var(--wf-line); border-radius: var(--wf-r-card); box-shadow: var(--wf-shadow-sm); overflow: hidden; }
.wf-li { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--wf-line-2); text-decoration: none; color: var(--wf-ink-2); }
.wf-li:last-child { border-bottom: 0; }
a.wf-li:hover { background: var(--wf-surface-2); color: var(--wf-ink-2); }
.wf-li-main { flex: 1; min-width: 0; }
.wf-li-title { font-weight: 600; color: var(--wf-ink); font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wf-li-sub { font-size: 13.5px; color: var(--wf-muted); margin-top: 2px; }
.wf-li-side { flex: none; display: flex; align-items: center; gap: 10px; text-align: right; }
.wf-li-amount { font-weight: 700; color: var(--wf-ink); font-variant-numeric: tabular-nums; }
.wf-initials { width: 38px; height: 38px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--wf-tile); color: var(--wf-ink-2); font-weight: 600; font-size: 13px; }
@media (max-width: 575.98px) { .wf-li { padding: 13px 14px; align-items: flex-start; } .wf-li-side { flex-direction: column; align-items: flex-end; gap: 6px; } }

/* ── Share card helpers (QR) ── */
.wf-qr { background: #fff; border: 1px solid var(--wf-line); border-radius: 12px; padding: 8px; width: 132px; height: 132px; flex: none; display: block; }
.wf-qr img { width: 100%; height: 100%; display: block; }
.wf-qr-lg { width: min(280px, 80vw); height: min(280px, 80vw); margin: 0 auto; }

/* ── Utilities ── */
.wf-stack > * + * { margin-top: 16px; }
.wf-hide-sm { } @media (max-width: 575.98px) { .wf-hide-sm { display: none !important; } }
.wf-only-sm { display: none !important; } @media (max-width: 575.98px) { .wf-only-sm { display: revert !important; } }

/* Sidebar foot (2026-11-07, "broken ui"): a long email squeezed "Log out" onto two lines. The button and
   avatar never shrink; only the name truncates. */
.wf-side-foot form { flex: none; margin: 0; }
.wf-side-foot .wf-link-btn { white-space: nowrap; padding: 6px 10px; border-radius: 8px; border: 1px solid rgba(255,255,255,.14); }
.wf-side-foot .wf-link-btn:hover { background: rgba(255,255,255,.08); }
.wf-side-me .wf-avatar { flex: none; }
.wf-side-me-name { min-width: 0; }
