/* =====================================================================
   Hollow Finch — member portal + admin panel (dark theme)
   ===================================================================== */

:root {
  --pink: #BB5098;
  --pink-light: #d46fb3;
  --purple: #7A5197;
  --orange: #E28144;
  --gold-1: #f6d365;
  --gold-2: #e0a526;

  --bg: #0e0a12;
  --surface: #161019;
  --card: #1c1522;
  --card-2: #241b2c;
  --border: rgba(187, 80, 152, .45);
  --border-soft: rgba(255, 255, 255, .08);
  --text: #eee8f2;
  --muted: #a69cb0;
  --success: #34c38f;
  --danger: #f46a6a;
  --warning: #f1b44c;
  --info: #50a5f1;

  --font-head: 'Playfair Display', Georgia, serif;
  --font-body: 'Poppins', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  --radius: 14px;
  --radius-sm: 8px;
  --sidebar-w: 260px;
  --topbar-h: 66px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.portal {
  margin: 0; font-family: var(--font-body); font-size: 14.5px; line-height: 1.6;
  color: var(--text); background: var(--bg);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--pink-light); text-decoration: none; }
a:hover { color: #fff; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.3; font-weight: 600; color: #fff; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.icon { flex-shrink: 0; }

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed; top: 0; bottom: 0; left: 0; width: var(--sidebar-w); z-index: 60;
  background: var(--surface); border-right: 1px solid var(--border-soft);
  display: flex; flex-direction: column; transform: translateX(-100%); transition: transform .35s cubic-bezier(.2,.8,.2,1); will-change: transform;
}
.sidebar-open .sidebar { transform: none; }
.sidebar-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 55; opacity: 0; visibility: hidden; transition: opacity .25s, visibility 0s .25s; }
.sidebar-open .sidebar-backdrop { opacity: 1; visibility: visible; transition-delay: 0s; }
.sidebar-brand { height: var(--topbar-h); display: flex; align-items: center; gap: 10px; padding: 0 20px; border-bottom: 1px solid var(--border-soft); flex-shrink: 0; }
.sidebar-brand img { height: 44px; width: auto; }
.area-tag { font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; background: var(--pink); color: #fff; padding: 2px 8px; border-radius: 999px; }
.side-nav { overflow-y: auto; padding: 14px 12px 30px; flex: 1; }
.side-nav ul { list-style: none; margin: 0; padding: 0; }
.side-nav form { margin: 0; }
.side-link {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 10px 14px; margin-bottom: 2px; border-radius: 10px;
  color: #cfc5d8; font-family: inherit; font-size: .93rem; background: none; border: 0; cursor: pointer; text-align: left;
  transition: background .2s, color .2s;
}
.side-link:hover { background: rgba(187, 80, 152, .1); color: #fff; }
.side-link.active { background: linear-gradient(90deg, rgba(187,80,152,.85), rgba(122,81,151,.85)); color: #fff; box-shadow: 0 6px 18px rgba(187,80,152,.25); }
.side-link .caret { margin-left: auto; transition: transform .2s; display: flex; }
.has-sub.open .caret { transform: rotate(90deg); }
.sub-menu { display: none; padding: 4px 0 8px 44px !important; }
.has-sub.open .sub-menu { display: block; }
.sub-menu a { display: block; padding: 7px 10px; color: var(--muted); font-size: .88rem; border-radius: 6px; position: relative; }
.sub-menu a::before { content: ''; position: absolute; left: -14px; top: 50%; width: 6px; height: 6px; border-radius: 50%; background: #4a3e55; transform: translateY(-50%); }
.sub-menu a:hover, .sub-menu a.active { color: #fff; }
.sub-menu a.active::before { background: var(--pink); }

/* ---------- Main + topbar ---------- */
.portal-main { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 50; height: var(--topbar-h);
  display: flex; align-items: center; gap: 12px; padding: 0 16px;
  background: rgba(22, 16, 25, .95); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border-soft);
}
.topbar-logo img { height: 34px; width: auto; }
.topbar-welcome { margin: 0; color: var(--muted); font-size: .88rem; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: none; }
.topbar-welcome strong { color: var(--pink-light); font-weight: 500; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 10px; border: 0; background: transparent; color: #d9d0e0; cursor: pointer;
}
.icon-btn:hover { background: rgba(255,255,255,.06); color: #fff; }
.dot-badge {
  position: absolute; top: 3px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--orange); color: #fff; font-size: .68rem; font-weight: 600; line-height: 18px; text-align: center;
}
.avatar-btn { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--pink); padding: 0; overflow: hidden; background: var(--card-2); cursor: pointer; }
.avatar-btn img { width: 100%; height: 100%; object-fit: cover; }
.avatar-initials { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; color: #fff; font-weight: 600; background: linear-gradient(135deg, var(--pink), var(--purple)); }
.hide-sm { display: none; }

.dropdown-wrap { position: relative; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 8px); width: 300px; max-width: calc(100vw - 24px);
  background: var(--card); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 18px 40px rgba(0,0,0,.5);
  overflow: hidden; z-index: 70;
  opacity: 0; visibility: hidden; transform: translateY(-8px) scale(.97); transform-origin: top right;
  transition: opacity .2s, transform .25s cubic-bezier(.2,.8,.2,1), visibility 0s .25s;
}
.dropdown-menu.show { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.user-menu { width: 220px; }
.dropdown-head { padding: 12px 16px; font-weight: 600; border-bottom: 1px solid var(--border-soft); color: #fff; }
.dropdown-menu a, .dropdown-menu form button {
  display: block; width: 100%; padding: 10px 16px; color: var(--text); font: inherit; text-align: left; background: none; border: 0; cursor: pointer;
}
.dropdown-menu a:hover, .dropdown-menu form button:hover { background: rgba(187,80,152,.12); color: #fff; }
.dropdown-menu form { margin: 0; }
.dropdown-empty { padding: 16px; margin: 0; color: var(--muted); }
.bell-item { border-bottom: 1px solid var(--border-soft); }
.bell-item strong { display: block; font-size: .88rem; font-weight: 500; }
.bell-item span { display: block; color: var(--muted); font-size: .82rem; }
.bell-item time { display: block; color: #776d80; font-size: .74rem; margin-top: 2px; }
.bell-item.unread { background: rgba(187,80,152,.07); }
.bell-item.unread strong::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--orange); margin-right: 7px; vertical-align: middle; }
.dropdown-foot { text-align: center !important; color: var(--pink-light) !important; font-size: .85rem; }

.portal-content { padding: 20px 16px 40px; flex: 1; width: 100%; max-width: 1500px; }
.portal-footer { padding: 16px; text-align: center; color: #6f6578; font-size: .8rem; border-top: 1px solid var(--border-soft); }

@media (min-width: 768px) {
  .topbar-welcome { display: block; }
  .hide-sm { display: inline-flex; }
  .portal-content { padding: 24px 24px 48px; }
}
@media (min-width: 1100px) {
  .sidebar { transform: none; }
  .portal-main { margin-left: var(--sidebar-w); }
  .topbar-logo { display: none; }
  .sidebar-backdrop { display: none; }
  body.sidebar-collapsed .sidebar { transform: translateX(-100%); }
  body.sidebar-collapsed .portal-main { margin-left: 0; }
  body.sidebar-collapsed .topbar-logo { display: block; }
}

/* ---------- Page head ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.page-head h1 { margin: 0; }
.page-head .crumbs { color: var(--muted); font-size: .85rem; }

/* ---------- Cards ---------- */
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; margin-bottom: 20px; position: relative;
}
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: -4px 0 16px; font-size: 1rem; font-weight: 600; color: #fff; }
.card-title .icon { color: var(--pink); }
.card-flush { padding: 0; overflow: hidden; }
.card-flush .card-title { padding: 18px 20px 0; }

.grid { display: grid; gap: 20px; }
.grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid-2, .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid-4 { grid-template-columns: repeat(4, 1fr); } }
.grid > .card { margin-bottom: 0; }
.layout-main-side { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 1200px) { .layout-main-side { grid-template-columns: minmax(0, 1fr) 340px; } }

/* stat card */
.stat-card { position: relative; display: flex; flex-direction: column; gap: 4px; min-height: 120px; overflow: hidden; padding-right: 72px; }
.stat-card .stat-label { font-size: .78rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.stat-card .stat-value { font-size: 1.55rem; font-weight: 600; color: #fff; line-height: 1.3; }
.stat-card .stat-note { font-size: .8rem; color: #8a7f94; }
.stat-card .stat-icon {
  position: absolute; right: 16px; top: 16px; width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; color: #fff; background: linear-gradient(135deg, var(--pink), var(--purple));
}
.stat-card .stat-link { margin-top: auto; display: inline-flex; align-items: center; gap: 4px; font-size: .82rem; }
.stat-card.accent-orange .stat-icon { background: linear-gradient(135deg, var(--orange), #c75f22); }
.stat-card.accent-green .stat-icon { background: linear-gradient(135deg, #34c38f, #1f8f66); }
.stat-card.accent-red .stat-icon { background: linear-gradient(135deg, #f46a6a, #c23b3b); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border-radius: 999px; border: 1px solid transparent;
  font-family: inherit; font-size: .9rem; font-weight: 500; line-height: 1.2; cursor: pointer; position: relative; overflow: hidden; transition: transform .2s, background-color .2s, border-color .2s, color .2s, box-shadow .2s;
  text-align: center; white-space: nowrap;
}
.btn-primary { background: linear-gradient(135deg, var(--pink), var(--purple)); color: #fff; }
.btn-primary:hover { color: #fff; box-shadow: 0 8px 22px rgba(187,80,152,.35); }
.btn-outline { border-color: var(--border); color: var(--text); background: transparent; }
.btn-outline:hover { border-color: var(--pink); background: rgba(187,80,152,.12); color: #fff; }
.btn-dark { background: #111; color: #fff; }
.btn-dark:hover { background: #000; color: var(--gold-1); }
.btn-success { background: var(--success); color: #062a1c; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-warning { background: var(--orange); color: #fff; }
.btn-sm { padding: 6px 14px; font-size: .8rem; }
.btn-block { display: flex; width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- Status pills ---------- */
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .74rem; font-weight: 600; text-transform: capitalize; letter-spacing: .02em; }
.pill-pending, .pill-open, .pill-free { background: rgba(241,180,76,.15); color: var(--warning); }
.pill-approved, .pill-completed, .pill-active, .pill-published, .pill-answered { background: rgba(52,195,143,.15); color: var(--success); }
.pill-rejected, .pill-suspended, .pill-cancelled, .pill-disabled, .pill-hidden, .pill-reversed { background: rgba(244,106,106,.15); color: var(--danger); }
.pill-closed, .pill-none { background: rgba(255,255,255,.08); color: var(--muted); }
.pill-info { background: rgba(80,165,241,.15); color: var(--info); }
.pill-pink { background: rgba(187,80,152,.18); color: var(--pink-light); }

/* ---------- Alerts ---------- */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; border: 1px solid; font-size: .9rem; }
.alert-success { background: rgba(52,195,143,.1); border-color: rgba(52,195,143,.35); color: #7ee2bd; }
.alert-error { background: rgba(244,106,106,.1); border-color: rgba(244,106,106,.35); color: #ffaaaa; }
.alert-info { background: rgba(122,81,151,.18); border-color: rgba(122,81,151,.5); color: #dcc8ee; }
.alert-warning { background: rgba(226,129,68,.12); border-color: rgba(226,129,68,.4); color: #ffc79f; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table th, .table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
.table th { color: var(--muted); font-weight: 500; font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; background: rgba(255,255,255,.02); }
.table td { white-space: nowrap; }
.table td.wrap { white-space: normal; min-width: 200px; }
.table tbody tr:hover { background: rgba(187,80,152,.05); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.amount-plus { color: var(--success); }
.amount-minus { color: var(--danger); }
.empty-state { text-align: center; padding: 36px 16px; color: var(--muted); }

/* ---------- Forms ---------- */
.form-grid { display: grid; gap: 0 20px; grid-template-columns: 1fr; }
@media (min-width: 768px) { .form-grid { grid-template-columns: repeat(2, 1fr); } .form-grid .span-2 { grid-column: span 2; } }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: .85rem; font-weight: 500; color: #d7cfdd; margin-bottom: 6px; }
.form-control {
  width: 100%; padding: 10px 14px; border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,.12); background: #120d16; color: var(--text);
  font-family: inherit; font-size: .92rem; transition: border-color .2s, box-shadow .2s;
}
.form-control:focus { outline: none; border-color: var(--pink); box-shadow: 0 0 0 3px rgba(187,80,152,.2); }
.form-control[readonly], .form-control:disabled { background: #1a141e; color: var(--muted); }
textarea.form-control { min-height: 110px; resize: vertical; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23a69cb0' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 20px; padding-right: 36px; }
input[type=file].form-control { padding: 8px; }
.form-hint { font-size: .78rem; color: #8a7f94; margin-top: 4px; }
.form-error { font-size: .8rem; color: var(--danger); margin-top: 4px; }
.check { display: flex; align-items: center; gap: 8px; font-size: .9rem; cursor: pointer; }
.check input { accent-color: var(--pink); width: 16px; height: 16px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 16px; }
.filters .form-group { margin: 0; min-width: 150px; flex: 1; }
@media (min-width: 768px) { .filters .form-group { flex: none; } }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border-soft); margin-bottom: 20px; overflow-x: auto; }
.tabs a { padding: 10px 16px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.active, .tabs a:hover { color: #fff; border-bottom-color: var(--pink); }

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 16px; }
.pagination a { padding: 6px 12px; border-radius: 8px; border: 1px solid var(--border-soft); color: var(--text); }
.pagination a.active, .pagination a:hover { background: var(--pink); border-color: var(--pink); color: #fff; }

/* ---------- Misc ---------- */
.muted { color: var(--muted); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; } .mt-2 { margin-top: 16px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; font-size: .9rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
.progress { height: 10px; background: rgba(255,255,255,.08); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--pink), var(--orange)); border-radius: 999px; transform-origin: left center; }
.copy-field { display: flex; gap: 8px; }
.copy-field .form-control { flex: 1; min-width: 0; }
.thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border-soft); background: #fff; }

/* =====================================================================
   Member portal pages
   ===================================================================== */
.welcome-banner {
  display: grid; gap: 18px; align-items: center;
  background: linear-gradient(120deg, var(--gold-1) 0%, var(--gold-2) 100%);
  color: #1d1406; border-radius: var(--radius); padding: 22px; margin-bottom: 20px;
  box-shadow: 0 12px 30px rgba(224, 165, 38, .18);
}
@media (min-width: 900px) { .welcome-banner { grid-template-columns: auto 1fr auto auto; } }
.welcome-avatar { width: 72px; height: 72px; border-radius: 50%; overflow: hidden; border: 3px solid #fff; background: #fff; flex-shrink: 0; }
.welcome-avatar img { width: 100%; height: 100%; object-fit: cover; }
.welcome-avatar .avatar-initials { font-size: 1.6rem; }
.welcome-banner h2 { color: #1d1406; margin: 0 0 4px; font-size: 1.3rem; }
.welcome-meta { font-size: .85rem; opacity: .85; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.welcome-figures { display: flex; gap: 24px; }
.welcome-figures div { display: flex; flex-direction: column; }
.welcome-figures small { font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; opacity: .75; }
.welcome-figures strong { font-size: 1.35rem; }
.welcome-head { display: flex; gap: 16px; align-items: center; }

.announcement {
  display: flex; gap: 12px; align-items: center; padding: 14px 18px; margin-bottom: 20px;
  border-radius: var(--radius); border: 1px dashed var(--orange); background: rgba(226,129,68,.08); color: #ffd2b3; font-size: .92rem;
}
.announcement .icon { color: var(--orange); }

.rank-card { display: grid; gap: 16px; align-items: center; }
@media (min-width: 768px) { .rank-card { grid-template-columns: auto 1fr auto; } }
.rank-badge { width: 70px; height: 70px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; background: radial-gradient(circle at 30% 30%, var(--orange), var(--pink) 60%, var(--purple)); box-shadow: 0 0 0 4px rgba(187,80,152,.2); }
.rank-name { font-size: 1.25rem; font-weight: 600; color: #fff; }
.rank-progress-meta { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); margin-top: 6px; gap: 10px; }
.bp-figure { text-align: right; }
.bp-figure strong { display: block; font-size: 1.5rem; color: var(--pink-light); }

.chart-box { position: relative; height: 260px; }
.ring-row { display: flex; justify-content: space-around; gap: 16px; margin-top: 16px; flex-wrap: wrap; }
.ring { text-align: center; }
.ring-svg { width: 92px; height: 92px; }
.ring-svg circle { fill: none; stroke-width: 9; }
.ring-svg .ring-bg { stroke: rgba(255,255,255,.08); }
.ring-svg .ring-fg { stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; stroke-dasharray: var(--full); stroke-dashoffset: var(--off); }
.ring-label { font-size: .8rem; color: var(--muted); }
.ring-value { font-weight: 600; color: #fff; }

.analytics-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border-soft); }
.analytics-item:last-child { border-bottom: 0; }
.analytics-item small { display: block; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
.analytics-item strong { font-size: 1.15rem; color: #fff; }
.spark { width: 110px; height: 40px; }

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ''; position: absolute; left: 15px; top: 4px; bottom: 4px; width: 2px; background: rgba(187,80,152,.3); }
.timeline li { position: relative; padding: 0 0 18px 44px; font-size: .88rem; }
.timeline li::before { content: ''; position: absolute; left: 8px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--pink); box-shadow: 0 0 0 4px rgba(187,80,152,.2); }
.timeline time { display: block; color: #7d7287; font-size: .76rem; margin-top: 2px; }
.timeline strong { color: var(--pink-light); font-weight: 500; }

.side-box { text-align: center; }
.side-box .icon-lg { width: 56px; height: 56px; border-radius: 16px; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 10px; color: #fff; }
.side-box p { color: var(--muted); font-size: .88rem; }
.bg-whatsapp { background: #25d366; }
.bg-app { background: linear-gradient(135deg, var(--purple), var(--pink)); }
.bg-kyc { background: linear-gradient(135deg, var(--orange), #c75f22); }
.bg-ok { background: var(--success); }
.btn-whatsapp { background: #25d366; color: #063d1d; }
.btn-whatsapp:hover { filter: brightness(1.1); color: #063d1d; }

/* payment method cards */
.gradient-head { background: linear-gradient(120deg, var(--pink), var(--purple)); border-radius: var(--radius); padding: 18px 22px; margin-bottom: 20px; color: #fff; }
.gradient-head h1, .gradient-head h2 { color: #fff; margin: 0; }
.gradient-head p { margin: 4px 0 0; opacity: .9; font-size: .9rem; }
.method-card { position: relative; }
.method-card .method-title { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.method-logo { width: 46px; height: 46px; border-radius: 12px; background: #fff; display: flex; align-items: center; justify-content: center; overflow: hidden; color: var(--purple); font-weight: 700; flex-shrink: 0; }
.method-logo img { width: 100%; height: 100%; object-fit: contain; }
.method-card h3 { margin: 0; }
.method-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: .88rem; padding: 6px 0; border-bottom: 1px dashed var(--border-soft); }
.method-row span:first-child { color: var(--muted); }
.method-row strong { font-weight: 500; word-break: break-all; text-align: right; }
.mini-copy { background: none; border: 1px solid var(--border); color: var(--pink-light); border-radius: 6px; font-size: .72rem; padding: 2px 8px; cursor: pointer; margin-left: 6px; }

/* portal bundles */
.p-bundle { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.p-bundle img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.p-bundle-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.p-bundle h3 { margin: 0; }
.p-bundle .price { font-size: 1.35rem; font-weight: 600; color: var(--pink-light); }
.p-bundle ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: .84rem; }
.p-bundle .btn-row { margin-top: auto; padding-top: 8px; }

/* downline tree */
.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul { margin-left: 22px; padding-left: 16px; border-left: 1px dashed rgba(187,80,152,.4); }
.tree li { padding: 6px 0; }
.tree-node { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 12px; border-radius: 10px; background: var(--card-2); border: 1px solid var(--border-soft); font-size: .86rem; }
.tree-node strong { color: #fff; font-weight: 500; }
.tree-node .lvl { font-size: .7rem; color: var(--muted); }
.tree-root { border-color: var(--pink); }

/* support thread */
.thread { display: grid; gap: 12px; }
.msg { padding: 14px 16px; border-radius: 12px; background: var(--card-2); border: 1px solid var(--border-soft); max-width: 92%; }
.msg.from-admin { border-color: var(--border); background: rgba(187,80,152,.08); justify-self: end; }
.msg-head { display: flex; justify-content: space-between; gap: 10px; font-size: .78rem; color: var(--muted); margin-bottom: 6px; }
.msg-body { white-space: pre-wrap; word-break: break-word; }

.notice-list { list-style: none; margin: 0; padding: 0; }
.notice-list li { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border-soft); }
.notice-list li.unread .n-title::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--orange); margin-right: 8px; }
.n-title { font-weight: 500; color: #fff; }
.n-msg { color: var(--muted); font-size: .88rem; }
.n-time { font-size: .76rem; color: #776d80; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.grid-chart { grid-template-columns: 1fr; }
@media (min-width: 1300px) { .grid-chart { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); } }

/* grid children must be allowed to shrink so wide tables scroll inside .table-wrap */
.grid > *, .layout-main-side > *, .grid-chart > * { min-width: 0; }

/* =====================================================================
   Motion & polish (member portal + admin panel)
   Only transform / opacity are animated. Reveal + page transitions use the
   individual `translate` property so they never fight hover `transform`.
   Everything is switched off under prefers-reduced-motion (bottom).
   ===================================================================== */

/* ---------- Page enter / leave ---------- */
.portal-content { animation: hf-page-in .5s cubic-bezier(.2,.8,.2,1) both; }
body.is-leaving .portal-content { opacity: 0; translate: 0 10px; transition: opacity .18s ease, translate .18s ease; }
.portal-main.sb-anim .portal-content { animation: hf-page-in .4s cubic-bezier(.2,.8,.2,1) both; }

/* ---------- Staggered reveal (JS adds .reveal, then .in) ---------- */
html.js .reveal { opacity: 0; translate: 0 18px; }
html.js .reveal.in {
  opacity: 1; translate: 0 0;
  transition: opacity .6s ease, translate .7s cubic-bezier(.2,.8,.2,1);
  transition-delay: var(--stagger, 0ms);
}

/* ---------- Card hover: lift + pink glow ---------- */
.card::after {
  content: ''; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none;
  box-shadow: 0 0 0 1px rgba(187,80,152,.75), 0 14px 40px rgba(187,80,152,.22);
  opacity: 0; transition: opacity .3s ease;
}
.card:hover::after { opacity: 1; }
.stat-card, .side-box, .p-bundle, .method-card { transition: transform .3s cubic-bezier(.2,.8,.2,1); }
.stat-card:hover, .side-box:hover, .p-bundle:hover, .method-card:hover { transform: translateY(-4px); }
.stat-card .stat-icon { transition: transform .35s cubic-bezier(.3,1.5,.5,1); }
.stat-card:hover .stat-icon { transform: rotate(-8deg) scale(1.1); }
.stat-card .stat-link .icon { transition: transform .25s; }
.stat-card .stat-link:hover .icon { transform: translateX(4px); }
.p-bundle img { transition: transform .6s cubic-bezier(.2,.8,.2,1); }
.p-bundle:hover img { transform: scale(1.04); }

/* ---------- Buttons: lift + shine sweep ---------- */
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn-primary::after, .btn-warning::after, .btn-success::after {
  content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 40%; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.3), transparent);
  transform: translateX(-140%);
}
.btn-primary:hover::after, .btn-warning:hover::after, .btn-success:hover::after { transform: translateX(300%); transition: transform .7s ease; }
.btn[disabled] { transform: none; }

/* ---------- Sidebar: hover nudge + animated active indicator ---------- */
.side-link { position: relative; }
.side-link .icon { transition: transform .25s cubic-bezier(.3,1.5,.5,1); }
.side-link:hover .icon { transform: translateX(3px) scale(1.08); }
.side-link.active::before {
  content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0;
  background: linear-gradient(var(--orange), var(--pink)); transform-origin: center;
  animation: hf-indicator .5s cubic-bezier(.3,1.5,.5,1) both;
}
.has-sub.open .sub-menu li { animation: hf-sub-in .3s cubic-bezier(.2,.8,.2,1) both; }
.has-sub.open .sub-menu li:nth-child(2) { animation-delay: .04s; }
.has-sub.open .sub-menu li:nth-child(3) { animation-delay: .08s; }
.has-sub.open .sub-menu li:nth-child(4) { animation-delay: .12s; }
.has-sub.open .sub-menu li:nth-child(n+5) { animation-delay: .16s; }
.sub-menu a { transition: color .2s, transform .2s; }
.sub-menu a:hover { transform: translateX(3px); }
.icon-btn { transition: transform .2s, background-color .2s, color .2s; }
.icon-btn:hover { transform: translateY(-1px); }
.avatar-btn { transition: transform .25s cubic-bezier(.3,1.5,.5,1); }
.avatar-btn:hover { transform: scale(1.06); }

/* ---------- Notification bell ---------- */
.icon-btn.has-unread > .icon { transform-origin: 50% 2px; animation: hf-bell 4s ease-in-out 1s infinite; }
.dot-badge { animation: hf-pop .45s .3s cubic-bezier(.3,1.6,.5,1) both; }
.dot-badge::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; background: var(--orange);
  animation: hf-ping 2s ease-out 1s infinite; z-index: -1;
}
.bell-item { transition: background-color .2s; }

/* ---------- Progress bars + rings ---------- */
html.js .progress.anim > span { transform: scaleX(0); }
html.js .progress.anim.in > span { transform: scaleX(1); transition: transform 1.3s cubic-bezier(.2,.8,.2,1) .2s; }
html.js .ring.anim .ring-fg { stroke-dashoffset: var(--full); }
html.js .ring.anim.in .ring-fg { stroke-dashoffset: var(--off); transition: stroke-dashoffset 1.5s cubic-bezier(.2,.8,.2,1) .25s; }

/* ---------- Skeleton loaders (tables + charts) ---------- */
.skeleton-host { position: relative; }
.skeleton-host > * { transition: opacity .4s ease; }
.skeleton-host.is-skeleton > * { opacity: 0; }
.skeleton-host.is-skeleton::before {
  content: ''; position: absolute; inset: 14px 18px; border-radius: 8px; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(255,255,255,.07) 0 14px, transparent 14px 36px);
}
.chart-box.is-skeleton::before {
  background:
    linear-gradient(to top, rgba(255,255,255,.08) 0 2px, transparent 2px) bottom / 100% 100% no-repeat,
    repeating-linear-gradient(to right, rgba(255,255,255,.06) 0 8%, transparent 8% 12.5%) bottom / 100% 70% no-repeat;
}
.skeleton-host.is-skeleton::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; overflow: hidden;
  background: linear-gradient(100deg, transparent 20%, rgba(255,255,255,.07) 50%, transparent 80%);
  animation: hf-shimmer-x 1.3s linear infinite;
}
.table-wrap.skeleton-host, .chart-box.skeleton-host { overflow: hidden; }

/* ---------- Toasts ---------- */
.toast-stack {
  position: fixed; z-index: 200; top: 76px; right: 16px; left: 16px;
  display: flex; flex-direction: column; align-items: flex-end; gap: 10px; pointer-events: none;
}
@media (min-width: 640px) { .toast-stack { left: auto; width: 380px; } }
.toast {
  pointer-events: auto; position: relative; overflow: hidden; width: 100%;
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 40px 16px 16px; border-radius: 14px;
  background: rgba(28,21,34,.96); border: 1px solid var(--border); color: var(--text); font-size: .9rem;
  box-shadow: 0 18px 40px rgba(0,0,0,.5);
  opacity: 0; transform: translateX(110%); transition: opacity .3s ease, transform .45s cubic-bezier(.2,.8,.2,1);
}
.toast.show { opacity: 1; transform: none; }
.toast.hide { opacity: 0; transform: translateX(110%); }
.toast-icon { flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; background: var(--pink); }
.toast-success .toast-icon { background: var(--success); color: #062a1c; }
.toast-error .toast-icon { background: var(--danger); }
.toast-warning .toast-icon { background: var(--orange); }
.toast-info .toast-icon { background: var(--purple); }
.toast-success { border-color: rgba(52,195,143,.5); }
.toast-error { border-color: rgba(244,106,106,.5); }
.toast-close { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; font-size: 1.2rem; line-height: 1; }
.toast-close:hover { color: #fff; background: rgba(255,255,255,.06); }
.toast-bar {
  position: absolute; left: 0; right: 0; bottom: 0; height: 3px; transform-origin: left;
  background: linear-gradient(90deg, var(--pink), var(--orange)); animation: hf-toast-bar var(--dur, 5s) linear forwards;
}
.toast:hover .toast-bar { animation-play-state: paused; }

/* ---------- Modal (confirm dialogs) ---------- */
.hf-modal {
  position: fixed; inset: 0; z-index: 250; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(8,5,11,.7); opacity: 0; transition: opacity .25s ease;
}
.hf-modal.show { opacity: 1; }
.hf-modal-box {
  width: 100%; max-width: 420px; padding: 26px 24px 22px; border-radius: 18px; text-align: center;
  background: var(--card); border: 1px solid var(--border); box-shadow: 0 30px 80px rgba(0,0,0,.6);
  transform: translateY(16px) scale(.95); transition: transform .35s cubic-bezier(.2,.8,.2,1);
}
.hf-modal.show .hf-modal-box { transform: none; }
.hf-modal-icon { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; background: linear-gradient(135deg, var(--orange), var(--pink)); animation: hf-pop .45s .1s cubic-bezier(.3,1.6,.5,1) both; }
.hf-modal-box p { color: var(--text); margin: 0 0 20px; font-size: .98rem; }
.hf-modal-box .btn-row { justify-content: center; }

/* ---------- Rank celebration ---------- */
.rank-badge { transition: transform .4s cubic-bezier(.3,1.5,.5,1); }
.rank-card:hover .rank-badge { transform: rotate(-6deg) scale(1.06); }
.rank-badge.celebrate { animation: hf-badge 1.2s cubic-bezier(.3,1.5,.5,1) 2; }
.confetti { position: fixed; top: 0; left: 0; width: 10px; height: 14px; border-radius: 2px; pointer-events: none; z-index: 300; will-change: transform, opacity; }

/* ---------- Keyframes ---------- */
@keyframes hf-page-in { from { opacity: 0; translate: 0 14px; } to { opacity: 1; translate: 0 0; } }
@keyframes hf-indicator { from { transform: scaleY(0); opacity: 0; } to { transform: scaleY(1); opacity: 1; } }
@keyframes hf-sub-in { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
@keyframes hf-bell {
  0%, 82%, 100% { transform: rotate(0); }
  85% { transform: rotate(14deg); } 88% { transform: rotate(-12deg); } 91% { transform: rotate(8deg); }
  94% { transform: rotate(-5deg); } 97% { transform: rotate(2deg); }
}
@keyframes hf-pop { from { transform: scale(0); } to { transform: scale(1); } }
@keyframes hf-ping { 0% { transform: scale(1); opacity: .6; } 80%, 100% { transform: scale(2.2); opacity: 0; } }
@keyframes hf-shimmer-x { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
@keyframes hf-toast-bar { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@keyframes hf-badge {
  0% { transform: scale(1); } 30% { transform: scale(1.25) rotate(-8deg); } 55% { transform: scale(.95) rotate(4deg); } 100% { transform: scale(1); }
}

/* ---------- Reduced motion: no animation, everything visible ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important;
    transition-duration: .001ms !important; transition-delay: 0s !important;
  }
  html.js .reveal { opacity: 1; translate: none; }
  .skeleton-host.is-skeleton::before, .skeleton-host.is-skeleton::after { display: none; }
  .skeleton-host.is-skeleton > * { opacity: 1; }
  .icon-btn.has-unread > .icon, .dot-badge::after { animation: none !important; }
}
