:root {
  --bg: #ffffff;
  --surface: #fbfbfd;
  --fg: #111111;
  --muted: #6b7280;
  --line: #ececf1;
  --accent: #2563eb;
  --accent-soft: #eff4ff;
  --success: #10b981;
  --success-soft: #ecfdf5;
  --warning: #f59e0b;
  --warning-soft: #fffbeb;
  --danger: #ef4444;
  --danger-soft: #fef2f2;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(17,17,17,.04), 0 16px 40px -16px rgba(17,17,17,.14);
}
*, *::before, *::after { box-sizing: border-box; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: Inter, Poppins, ui-sans-serif, system-ui, Segoe UI, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent); color: #fff; }
.wrap { max-width: 72rem; margin: 0 auto; padding: 0 1.25rem; }
.muted { color: var(--muted); }
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  transition: transform .35s cubic-bezier(.22,1,.36,1), box-shadow .35s;
}
.card-hover:hover, a.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 50px -18px rgba(37,99,235,.35);
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  height: 2.75rem; padding: 0 1.25rem; border-radius: 14px; border: 0;
  font-weight: 600; font-size: .875rem; cursor: pointer; font-family: inherit;
  position: relative; overflow: hidden; transition: transform .2s, box-shadow .2s, filter .2s;
}
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 10px 24px -10px rgba(37,99,235,.7); }
.btn-primary:hover { box-shadow: 0 16px 32px -12px rgba(37,99,235,.85); }
.btn-dark { background: var(--fg); color: #fff; }
.btn-outline { background: #fff; border: 1px solid var(--line); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-full { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:active { transform: scale(.97); }
.input, .select, .textarea {
  width: 100%; height: 2.75rem; border: 1px solid var(--line); border-radius: 14px;
  padding: 0 .9rem; font: inherit; background: #fff;
}
.input:focus, .select:focus, .textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.textarea { height: auto; padding: .75rem .9rem; min-height: 6rem; }
label { display: block; font-size: .875rem; font-weight: 500; margin-bottom: .4rem; }
.field { margin-bottom: 1rem; }
.badge {
  display: inline-flex; align-items: center; gap: .35rem;
  border: 1px solid var(--line); border-radius: 999px; padding: .2rem .65rem;
  font-size: .75rem; font-weight: 600;
}
.badge-accent { background: var(--accent-soft); color: var(--accent); border-color: rgba(37,99,235,.2); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.alert { border-radius: 14px; border: 1px solid; padding: .85rem 1rem; font-size: .875rem; font-weight: 500; margin-bottom: 1rem; }
.alert-danger { background: var(--danger-soft); color: var(--danger); border-color: rgba(239,68,68,.2); }
.alert-success { background: var(--success-soft); color: var(--success); border-color: rgba(16,185,129,.2); }
.alert-warning { background: var(--warning-soft); color: var(--warning); border-color: rgba(245,158,11,.25); }
.site-header {
  position: sticky; top: 0; z-index: 40; background: rgba(255,255,255,.88);
  backdrop-filter: blur(16px); border-bottom: 1px solid var(--line);
}
.site-header .inner { display: flex; align-items: center; justify-content: space-between; height: 4rem; gap: .75rem; }
.logo { display: flex; align-items: center; gap: .5rem; font-weight: 700; min-width: 0; }
.mark { width: 2rem; height: 2rem; border-radius: 10px; background: #111; color: #fff; display: grid; place-items: center; font-size: .85rem; flex-shrink: 0; }
.nav { display: flex; gap: 1.25rem; font-size: .875rem; font-weight: 500; color: var(--muted); }
.nav a:hover { color: var(--fg); }
@media (max-width: 900px) { .hide-sm { display: none !important; } }
.announce {
  background: #111; color: #fff; text-align: center; font-size: .8rem; font-weight: 600;
  padding: .55rem 1rem; line-height: 1.35;
}
.wrap { max-width: 72rem; margin: 0 auto; padding: 0 1.25rem; }
@media (max-width: 480px) {
  .wrap { padding: 0 1rem; }
  .announce { font-size: .72rem; padding: .5rem .75rem; }
  .btn { height: 2.55rem; }
  .auth-grid { min-height: 100dvh; }
  .auth-grid > div:first-child { padding: 1.25rem !important; }
}
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; min-width: 32rem; }
html { overflow-x: clip; }
body { overflow-x: visible; }
.dash-stage { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dash-menu-btn {
  display: none; width: 2.35rem; height: 2.35rem; border-radius: 12px;
  border: 1px solid var(--line); background: #fff; cursor: pointer; place-items: center; flex-shrink: 0;
}
.dash-menu-btn .burger, .dash-menu-btn .burger::before, .dash-menu-btn .burger::after {
  display: block; width: 1rem; height: 2px; background: #111; border-radius: 2px; position: relative;
}
.dash-menu-btn .burger::before, .dash-menu-btn .burger::after { content: ""; position: absolute; left: 0; }
.dash-menu-btn .burger::before { top: -5px; }
.dash-menu-btn .burger::after { top: 5px; }
.sidebar-backdrop {
  position: fixed; inset: 0; background: rgba(15,23,42,.4); z-index: 55;
}
.sidebar-backdrop[hidden] { display: none !important; }
.topbar { display: flex; align-items: center; gap: .55rem; padding: .85rem 1.25rem; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar .topbar-title { flex: 1; min-width: 0; }
.topbar-right { margin-left: auto; }
.nav-label { font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding: .75rem .75rem .2rem; margin: 0; }
.sidebar-admin { width: 16.5rem; overflow: auto; }
.admin-wide { max-width: 70rem; }
.admin-topbar { z-index: 30; }
@media (max-width: 1023px) {
  .dash-menu-btn { display: grid; }
  body.admin-body .sidebar-admin {
    display: flex !important;
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 60;
    width: min(16.5rem, 86vw);
    transform: translateX(-105%);
    transition: transform .22s ease;
    box-shadow: 12px 0 40px -20px rgba(15,23,42,.35);
    background: #fff;
  }
  body.admin-open .sidebar-admin { transform: translateX(0); }
  body.admin-open { overflow: hidden; }
  body.admin-body .main { padding: 1rem; }
  body.admin-body .topbar { padding: .7rem .85rem; }
}
.band { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 3.5rem 0; }
.hero {
  padding: 5rem 0 3.5rem;
  background: radial-gradient(60% 60% at 50% 0%, rgba(37,99,235,.09), transparent 70%);
}
.hero h1 { font-family: Poppins, Inter, sans-serif; font-size: clamp(2rem, 5vw, 3.6rem); line-height: 1.08; margin: 1rem 0; letter-spacing: -.03em; }
.cta-dark { background: #111; color: #fff; border-radius: 22px; padding: 3rem 1.5rem; text-align: center; position: relative; overflow: hidden; }
.cta-dark p { color: rgba(255,255,255,.7); }
.grid-2, .grid-3, .grid-4 { display: grid; gap: 1rem; }
@media (min-width: 700px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr 1fr; }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}
.footer { border-top: 1px solid var(--line); padding: 2.5rem 0; color: var(--muted); font-size: .875rem; }
.dash { display: flex; min-height: 100dvh; background: var(--surface); }
.sidebar { width: 15rem; background: #fff; border-right: 1px solid var(--line); padding: 1.25rem .75rem; display: none; flex-direction: column; }
.sidebar a, .bottom a {
  display: flex; align-items: center; gap: .7rem; border-radius: 12px; padding: .65rem .75rem;
  font-size: .875rem; font-weight: 500; color: var(--muted);
}
.sidebar a.active, .bottom a.active { background: #111; color: #fff; }
body.dash-body .sidebar a.active,
body.dash-body .bottom a.active { background: #eff6ff; color: #2563eb; }
/* Member dashboard overrides live in dash.css (.dash-body) */
.main { flex: 1; padding: 1.25rem 1.25rem 6rem; animation: fadeUp .45s ease; }
.main-inner { max-width: 56rem; margin: 0 auto; }
.bottom {
  position: fixed; left: .75rem; right: .75rem; bottom: max(10px, env(safe-area-inset-bottom));
  z-index: 40; display: flex; background: rgba(255,255,255,.96); border: 1px solid var(--line);
  border-radius: 16px; padding: .25rem; box-shadow: 0 12px 40px -12px rgba(17,17,17,.28);
}
body.dash-body .bottom {
  left: 0; right: 0; bottom: 0; border-radius: 0; border-left: 0; border-right: 0;
  border-top: 1px solid #e2e8f0; background: #fff;
  padding: .35rem .25rem max(.35rem, env(safe-area-inset-bottom));
  box-shadow: 0 -8px 24px -16px rgba(15,23,42,.2);
}
.bottom a { flex: 1; flex-direction: column; gap: .15rem; font-size: 10px; }
@media (min-width: 1024px) {
  .sidebar { display: flex; }
  .bottom { display: none; }
  .main { padding: 1.5rem 2rem; }
}
.table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.table th, .table td { text-align: left; padding: .7rem .4rem; border-bottom: 1px solid var(--line); }
.auth-grid { min-height: 100vh; display: grid; }
@media (min-width: 1024px) { .auth-grid { grid-template-columns: 1fr 1fr; } }
.auth-side { display: none; background: var(--surface); border-left: 1px solid var(--line); padding: 3.5rem; }
@media (min-width: 1024px) { .auth-side { display: flex; flex-direction: column; justify-content: center; } }
.stat { font-size: 1.4rem; font-weight: 800; letter-spacing: -.03em; }
.progress { height: 8px; background: var(--surface); border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), #60a5fa); }
.chips { display: flex; gap: .5rem; overflow: auto; padding-bottom: .25rem; }
.chip { height: 2.4rem; border-radius: 999px; border: 1px solid var(--line); padding: 0 1rem; background: #fff; font-size: .875rem; font-weight: 500; cursor: pointer; }
.chip.on { background: #111; color: #fff; border-color: #111; }
body.dash-body .chip.on { background: #2563eb; color: #fff; border-color: #2563eb; }
.float-stage { position: relative; min-height: 280px; }
@media (max-width: 699px) {
  .float-stage { min-height: auto; display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
  .float-card { position: relative; width: auto; animation: none; inset: auto !important; }
}
.float-card {
  position: absolute; width: 11.5rem; padding: 1rem;
  animation: floatY 5s ease-in-out infinite;
}
.float-card:nth-child(1) { top: 8%; left: 4%; animation-delay: 0s; }
.float-card:nth-child(2) { top: 12%; right: 6%; animation-delay: .6s; }
.float-card:nth-child(3) { bottom: 18%; left: 18%; animation-delay: 1.1s; }
.float-card:nth-child(4) { bottom: 6%; right: 10%; animation-delay: 1.7s; }
.icon-blob {
  width: 2.5rem; height: 2.5rem; border-radius: 12px; display: grid; place-items: center;
  font-weight: 800; font-size: .8rem;
}
.pay-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.pay-opt { border: 1px solid var(--line); border-radius: 14px; padding: .75rem; cursor: pointer; font-weight: 600; font-size: .85rem; }
.pay-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.social { display: grid; gap: .6rem; margin: 1rem 0; }
.tree { padding-left: 1rem; border-left: 2px solid var(--line); margin-left: .4rem; }
.tree details { margin: .35rem 0; }
.bar { height: 8px; background: var(--accent-soft); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); }
.skel { background: linear-gradient(90deg, #f3f4f6, #fff, #f3f4f6); background-size: 200% 100%; animation: shine 1.2s infinite; border-radius: 12px; height: 1rem; }
.chat-fab {
  position: fixed; right: 1rem; bottom: calc(5.5rem + env(safe-area-inset-bottom));
  z-index: 45; width: 3.25rem; height: 3.25rem; border-radius: 999px; border: 0;
  background: var(--accent); color: #fff; font-weight: 800; box-shadow: 0 12px 30px -10px rgba(37,99,235,.7);
}
@media (min-width: 1024px) { .chat-fab { bottom: 1.5rem; } }
.wallet-flip { perspective: 800px; }
.wallet-flip .card { transition: transform .6s; }
@keyframes floatY { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes shine { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.risk-low { color: var(--success); }
.risk-med { color: var(--warning); }
.risk-high { color: var(--danger); }
