/* ════════════════════════════════════════════════════════════
   BudgetDealz v2.0 — Light Theme + Subspace UI Cards
   ════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  --primary:       #4f46e5;
  --primary-dark:  #4338ca;
  --primary-mid:   #6366f1;
  --primary-light: #eef2ff;
  --primary-glow:  rgba(79,70,229,.15);
  --success:       #10b981;
  --success-light: #d1fae5;
  --warning:       #f59e0b;
  --warning-light: #fef3c7;
  --danger:        #ef4444;
  --danger-light:  #fee2e2;
  --text:          #111827;
  --text-2:        #374151;
  --muted:         #6b7280;
  --muted-2:       #9ca3af;
  --border:        #e5e7eb;
  --border-light:  #f3f4f6;
  --bg:            #f5f7ff;
  --bg-2:          #eef2ff;
  --card:          #ffffff;
  --nav-h:         64px;
  --bottom-h:      64px;
  --sidebar-w:     340px;
  --radius:        14px;
  --radius-sm:     10px;
  --shadow:        0 2px 16px rgba(79,70,229,.08);
  --shadow-md:     0 4px 32px rgba(79,70,229,.12);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Outfit', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding-top: var(--nav-h);
  padding-bottom: var(--bottom-h);
}
body.admin-body { padding-top: 0; padding-bottom: 0; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; }
::selection { background: var(--primary-light); color: var(--primary); }

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }

/* ── Typography ─────────────────────────────────────────────── */
h1,h2,h3,h4,h5 { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 700; line-height: 1.3; }

/* ── Navbar ─────────────────────────────────────────────────── */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  height: var(--nav-h);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 20px;
  gap: 16px;
}
.nav-brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.2rem; font-weight: 800; color: var(--text);
  white-space: nowrap; text-decoration: none;
}
.nav-brand-icon {
  width: 36px; height: 36px; background: var(--primary); border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1rem; font-weight: 800;
  box-shadow: 0 4px 12px var(--primary-glow);
}
.nav-spacer { flex: 1; }
.nav-actions { display: flex; align-items: center; gap: 8px; }
.nav-icon-btn {
  position: relative; width: 40px; height: 40px; border-radius: 50%;
  background: var(--primary-light); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  border: none; cursor: pointer; font-size: 1.1rem; text-decoration: none;
  transition: .2s;
}
.nav-icon-btn:hover { background: var(--primary); color: #fff; }
.nav-badge {
  position: absolute; top: -2px; right: -2px;
  background: var(--danger); color: #fff;
  font-size: .6rem; font-weight: 700;
  min-width: 16px; height: 16px; border-radius: 99px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px; border: 2px solid #fff;
}
.nav-wallet-chip {
  display: flex; align-items: center; gap: 6px;
  background: var(--success-light); color: #065f46;
  padding: 6px 14px; border-radius: 99px;
  font-size: .85rem; font-weight: 600; white-space: nowrap;
  text-decoration: none;
}

/* ── Bottom Nav (mobile) ────────────────────────────────────── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000;
  height: var(--bottom-h);
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  display: flex;
}
.bn-item {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 3px; color: var(--muted);
  text-decoration: none; font-size: .68rem; font-weight: 600;
  position: relative; transition: .2s;
}
.bn-item .bn-icon { font-size: 1.3rem; transition: .2s; }
.bn-item.active, .bn-item:hover { color: var(--primary); }
.bn-item.active .bn-icon { transform: translateY(-2px); }
.bn-badge {
  position: absolute; top: 6px;
  background: var(--danger); color: #fff;
  font-size: .58rem; font-weight: 700; min-width: 16px; height: 16px;
  border-radius: 99px; display: flex; align-items: center; justify-content: center;
  padding: 0 3px; border: 2px solid #fff;
}

/* ── Container ──────────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.section-gap { padding: 24px 0; }

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); border: 1px solid var(--border);
  overflow: hidden;
}
.card-body { padding: 20px; }
.card-header-bar {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  font-weight: 700; display: flex; align-items: center; gap: 10px;
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; border: none; border-radius: var(--radius-sm);
  cursor: pointer; font-family: inherit; font-weight: 600;
  transition: .2s; font-size: .9rem; padding: 10px 20px;
  text-decoration: none; white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; transform: translateY(-1px); box-shadow: 0 6px 20px var(--primary-glow); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { filter: brightness(1.1); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.1); }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text-2); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-ghost { background: var(--primary-light); color: var(--primary); }
.btn-ghost:hover { background: var(--primary); color: #fff; }
.btn-sm { padding: 6px 14px; font-size: .8rem; }
.btn-lg { padding: 14px 32px; font-size: 1rem; }
.btn-full { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 99px; font-size: .72rem; font-weight: 700;
}
.badge-primary  { background: var(--primary-light); color: var(--primary); }
.badge-success  { background: var(--success-light); color: #065f46; }
.badge-warning  { background: var(--warning-light); color: #92400e; }
.badge-danger   { background: var(--danger-light);  color: #991b1b; }
.badge-muted    { background: var(--border-light);  color: var(--muted); }

/* ── Forms ──────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-label { font-size: .85rem; font-weight: 600; color: var(--text-2); }
.form-control {
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  padding: 11px 14px; font-family: inherit; font-size: .95rem;
  color: var(--text); background: var(--card); transition: .2s; width: 100%;
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
.form-hint { font-size: .78rem; color: var(--muted); }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='6,9 12,15 18,9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }

/* ── Alerts ─────────────────────────────────────────────────── */
.alert { padding: 14px 18px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: .9rem; line-height: 1.6; }
.alert-success { background: var(--success-light); color: #065f46; border-left: 4px solid var(--success); }
.alert-danger  { background: var(--danger-light);  color: #991b1b; border-left: 4px solid var(--danger); }
.alert-warning { background: var(--warning-light); color: #92400e; border-left: 4px solid var(--warning); }
.alert-info    { background: var(--primary-light); color: var(--primary); border-left: 4px solid var(--primary); }

/* ── Flash ──────────────────────────────────────────────────── */
.flash-container { position: fixed; top: 74px; left: 50%; transform: translateX(-50%); z-index: 9999; width: 90%; max-width: 440px; }

/* ── Sub Icon ───────────────────────────────────────────────── */
.sub-icon {
  width: 46px; height: 46px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; font-weight: 800; color: #fff; flex-shrink: 0;
}
.sub-icon-sm { width: 34px; height: 34px; border-radius: 9px; font-size: .85rem; }
.sub-icon-lg { width: 56px; height: 56px; border-radius: 16px; font-size: 1.4rem; }

/* ── Avatar ─────────────────────────────────────────────────── */
.avatar {
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .9rem; color: #fff; flex-shrink: 0; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-40 { width: 40px; height: 40px; font-size: .85rem; }
.avatar-48 { width: 48px; height: 48px; font-size: .95rem; }
.avatar-56 { width: 56px; height: 56px; font-size: 1.1rem; }

/* ══════════════════════════════════════════════════════════════
   SUBSPACE DARK THEME CARDS (INDEX PAGE)
═══════════════════════════════════════════════════════════════ */
.group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }

.subspace-card {
  background: #13151a; 
  border-radius: 16px;
  border: 1px solid #2d313d;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.subspace-card:hover {
  transform: translateY(-4px);
  border-color: #3b82f6;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

/* Card Header: Owner Info */
.sc-header { display: flex; justify-content: space-between; align-items: flex-start; }
.sc-owner { display: flex; gap: 12px; align-items: center; }
.sc-owner .avatar {
  width: 44px; height: 44px;
  border: 2px solid #2d313d;
  font-size: 1.1rem;
}
.sc-name {
  font-weight: 600; font-size: 1rem; color: #ffffff;
  display: flex; align-items: center; gap: 6px;
}
.sc-badge { color: #f59e0b; font-size: 1.1rem; } /* Verified tick */
.sc-active {
  font-size: 0.75rem; color: #8b94a5;
  display: flex; align-items: center; gap: 4px; margin-top: 3px;
}
.sc-rating {
  display: flex; align-items: center; gap: 4px;
  font-size: 0.9rem; font-weight: 700; color: #facc15;
  background: rgba(250, 204, 21, 0.1);
  padding: 4px 8px; border-radius: 6px;
}

/* Card Body: Pricing & Slots */
.sc-body {
  display: flex; justify-content: space-between; align-items: center;
  background: #1c1f26; padding: 14px 18px; border-radius: 12px;
}
.sc-price-block { display: flex; flex-direction: column; gap: 4px; }
.sc-price span { font-size: 1.6rem; font-weight: 800; color: #ffffff; }
.sc-price { font-size: 0.85rem; color: #8b94a5; font-weight: 500; }
.sc-total { font-size: 0.75rem; color: #6b7280; margin-top: 2px; }

.sc-slots { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.sc-slots-lbl { font-size: 0.75rem; color: #8b94a5; text-transform: uppercase; letter-spacing: 0.5px;}
.sc-slots-val { font-size: 1.5rem; font-weight: 800; color: #10b981; }
.sc-slots-val.full { color: #ef4444; }

/* Sub Info Tag */
.sc-sub-tag {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.85rem; color: #e2e8f0; font-weight: 500;
  padding: 8px 12px; background: rgba(255,255,255,0.05);
  border-radius: 8px; border: 1px solid rgba(255,255,255,0.08);
}
.sc-sub-icon {
  width: 20px; height: 20px; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.6rem; font-weight: 800; color: #fff;
}

/* Card Footer: Buttons */
.sc-footer { display: flex; gap: 10px; }
.sc-btn-join {
  flex: 1; background: #1d4ed8; color: #ffffff;
  border: none; border-radius: 10px; font-weight: 600; font-size: 0.95rem;
  padding: 12px; cursor: pointer; transition: 0.2s;
  display: flex; justify-content: center; align-items: center; gap: 6px;
  text-decoration: none;
}
.sc-btn-join:hover { background: #2563eb; color: #ffffff; }
.sc-btn-success { background: #10b981; }
.sc-btn-success:hover { background: #059669; }
.sc-btn-outline { background: transparent; border: 1px solid #1d4ed8; color: #3b82f6;}
.sc-btn-outline:hover { background: rgba(59, 130, 246, 0.1); color: #60a5fa;}

.sc-btn-chat {
  width: 46px; height: 46px; background: #1f2430; border: 1px solid #374151;
  border-radius: 10px; color: #9ca3af; display: flex; align-items: center;
  justify-content: center; font-size: 1.3rem; cursor: pointer; transition: 0.2s;
  text-decoration: none;
}
.sc-btn-chat:hover { background: #374151; color: #ffffff; }


/* ── Filter pills ───────────────────────────────────────────── */
.filter-pills { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.filter-pills::-webkit-scrollbar { display: none; }
.pill {
  padding: 7px 16px; border-radius: 99px; border: 1.5px solid var(--border);
  font-size: .82rem; font-weight: 600; white-space: nowrap; cursor: pointer;
  background: var(--card); color: var(--muted); transition: .2s; text-decoration: none;
}
.pill.active, .pill:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Stat cards ─────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.stat-card { background: var(--card); border-radius: var(--radius); border: 1px solid var(--border); padding: 18px; }
.stat-value { font-size: 1.6rem; font-weight: 800; }
.stat-label { font-size: .78rem; color: var(--muted); margin-top: 4px; }

/* ── Wallet card ────────────────────────────────────────────── */
.wallet-card {
  background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
  border-radius: var(--radius); color: #fff; padding: 28px;
}
.wallet-label { font-size: .85rem; opacity: .8; margin-bottom: 6px; }
.wallet-amount { font-size: 2.2rem; font-weight: 800; }
.wallet-sub { font-size: .8rem; opacity: .7; margin-top: 4px; }

/* ══════════════════════════════════════════════════════════════
   CHAT SYSTEM
═══════════════════════════════════════════════════════════════ */
.chat-page {
  position: fixed; top: var(--nav-h); bottom: var(--bottom-h);
  left: 0; right: 0; display: flex;
}

/* Sidebar */
.chat-sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: var(--card); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; overflow: hidden;
}
.chat-sidebar-header {
  padding: 16px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.chat-sidebar-title { font-size: 1.1rem; font-weight: 800; margin-bottom: 12px; }
.chat-search-wrap { position: relative; }
.chat-search {
  width: 100%; padding: 9px 14px 9px 38px; border: 1.5px solid var(--border);
  border-radius: 99px; font-size: .85rem; font-family: inherit; background: var(--bg);
  transition: .2s;
}
.chat-search:focus { outline: none; border-color: var(--primary); background: #fff; }
.chat-search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .9rem; }

/* Chat tabs */
.chat-tabs { display: flex; padding: 8px 16px; gap: 6px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.chat-tab {
  padding: 5px 14px; border-radius: 99px; font-size: .78rem; font-weight: 600;
  border: 1.5px solid var(--border); background: none; cursor: pointer;
  color: var(--muted); transition: .2s;
}
.chat-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Conversation list */
.conv-list { flex: 1; overflow-y: auto; }
.conv-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; cursor: pointer; transition: .15s;
  border-bottom: 1px solid var(--border-light); position: relative;
}
.conv-item:hover  { background: var(--bg); }
.conv-item.active { background: var(--primary-light); }
.conv-avatar { position: relative; flex-shrink: 0; }
.conv-avatar .avatar-40 { font-size: .8rem; }
.conv-online {
  position: absolute; bottom: 1px; right: 1px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--success); border: 2px solid #fff;
}
.conv-body { flex: 1; min-width: 0; }
.conv-name { font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display:flex; align-items:center; gap:4px; }
.conv-last { font-size: .78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.conv-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.conv-time { font-size: .7rem; color: var(--muted-2); }
.conv-unread { background: var(--primary); color: #fff; font-size: .65rem; font-weight: 700; min-width: 18px; height: 18px; border-radius: 99px; display: flex; align-items: center; justify-content: center; padding: 0 4px; }
.conv-system-preview { color: var(--muted-2); font-style: italic; }

/* Chat main panel */
.chat-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.chat-main-header {
  padding: 12px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px; flex-shrink: 0;
  background: var(--card);
}
.chat-main-header .back-btn { display: none; }
.chat-main-name { font-weight: 700; font-size: 1rem; display:flex; align-items:center; gap:4px; }
.chat-main-sub  { font-size: .75rem; color: var(--muted); }
.chat-main-actions { margin-left: auto; display: flex; gap: 8px; }

/* Messages area */
.chat-messages {
  flex: 1; overflow-y: auto; padding: 20px 16px;
  display: flex; flex-direction: column; gap: 4px;
  background: var(--bg);
}
.chat-empty {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; color: var(--muted);
  gap: 12px; text-align: center; padding: 40px;
}
.chat-empty-icon { font-size: 3rem; opacity: .4; }

/* Message bubbles */
.msg-row { display: flex; align-items: flex-end; gap: 8px; margin-bottom: 2px; }
.msg-row.mine   { flex-direction: row-reverse; }
.msg-row.system { justify-content: center; }
.msg-avatar { flex-shrink: 0; }
.msg-bubble {
  max-width: 70%; padding: 10px 14px; border-radius: 18px;
  font-size: .9rem; line-height: 1.5; word-break: break-word;
}
.msg-row.mine   .msg-bubble { background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.msg-row.theirs .msg-bubble { background: var(--card);    color: var(--text); border-bottom-left-radius: 4px; box-shadow: var(--shadow); border: 1px solid var(--border); }
.msg-row.system .msg-bubble { background: transparent; color: var(--muted); font-size: .75rem; text-align: center; padding: 4px 12px; }
.msg-name { font-size: .7rem; color: var(--muted); margin-bottom: 3px; font-weight: 600; }
.msg-time { font-size: .65rem; opacity: .7; text-align: right; margin-top: 3px; }
.msg-date-divider { text-align: center; margin: 12px 0; }
.msg-date-divider span { background: var(--border-light); color: var(--muted); font-size: .7rem; padding: 4px 14px; border-radius: 99px; }

/* Automated / welcome message styling */
.msg-automated .msg-bubble {
  background: linear-gradient(135deg, #eef2ff, #f5f3ff);
  border: 1.5px solid #c7d2fe; color: var(--text);
}
.msg-row.mine.msg-automated .msg-bubble {
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  border: none; color: #fff;
}

/* Input area */
.chat-input-bar {
  padding: 12px 16px; background: var(--card);
  border-top: 1px solid var(--border); flex-shrink: 0;
  display: flex; align-items: center; gap: 10px;
}
.chat-input-wrap { flex: 1; position: relative; }
.chat-input {
  width: 100%; border: 1.5px solid var(--border); border-radius: 24px;
  padding: 10px 50px 10px 18px; font-family: inherit; font-size: .9rem;
  resize: none; background: var(--bg); color: var(--text); transition: .2s;
  max-height: 120px; overflow-y: auto;
}
.chat-input:focus { outline: none; border-color: var(--primary); background: #fff; }
.chat-send-btn {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--primary); color: #fff; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 1rem;
  transition: .2s;
}
.chat-send-btn:hover { background: var(--primary-dark); }

/* Chat empty state */
.chat-welcome {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  gap: 14px; color: var(--muted); padding: 40px;
}
.chat-welcome-icon { font-size: 4rem; }

/* ── Mobile Chat: show only sidebar OR chat ──────────────────── */
@media (max-width: 768px) {
  .chat-sidebar { width: 100%; }
  .chat-main { display: none; position: fixed; top: var(--nav-h); bottom: var(--bottom-h); left: 0; right: 0; z-index: 100; background: var(--bg); }
  .chat-main.mobile-open { display: flex; }
  .chat-main-header .back-btn { display: flex !important; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: var(--primary-light); color: var(--primary); border: none; cursor: pointer; font-size: 1.1rem; }
  .chat-page.conv-open .chat-sidebar { display: none; }
  .msg-bubble { max-width: 85%; }
}

/* ══════════════════════════════════════════════════════════════
   ADMIN STYLES
═══════════════════════════════════════════════════════════════ */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 240px; flex-shrink: 0; background: #1e1b4b;
  display: flex; flex-direction: column; position: fixed;
  top: 0; left: 0; bottom: 0; z-index: 500; overflow-y: auto;
}
.admin-brand {
  padding: 20px 16px; border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; gap: 10px;
  font-size: 1.1rem; font-weight: 800; color: #fff;
}
.admin-brand-icon { width: 32px; height: 32px; background: var(--primary); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: .9rem; font-weight: 800; }
.admin-nav { flex: 1; padding: 12px 8px; }
.admin-nav-label { font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: rgba(255,255,255,.3); padding: 8px 8px 4px; }
.admin-nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border-radius: var(--radius-sm); color: rgba(255,255,255,.65);
  font-size: .85rem; font-weight: 500; cursor: pointer; transition: .2s;
  text-decoration: none; margin-bottom: 2px;
}
.admin-nav-item:hover  { background: rgba(255,255,255,.08); color: #fff; }
.admin-nav-item.active { background: var(--primary); color: #fff; }
.admin-nav-item .badge-sm { background: rgba(255,255,255,.2); color: #fff; font-size: .65rem; margin-left: auto; padding: 2px 7px; border-radius: 99px; }
.admin-nav-item.active .badge-sm { background: rgba(255,255,255,.3); }
.admin-content { margin-left: 240px; flex: 1; min-height: 100vh; }
.admin-header { background: var(--card); border-bottom: 1px solid var(--border); padding: 16px 24px; display: flex; align-items: center; gap: 16px; }
.admin-title { font-size: 1.15rem; font-weight: 700; }
.admin-body { padding: 24px; }
.admin-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.admin-stat-card { background: var(--card); border-radius: var(--radius); border: 1px solid var(--border); padding: 20px; }
.admin-stat-value { font-size: 1.8rem; font-weight: 800; color: var(--primary); }
.admin-stat-label { font-size: .8rem; color: var(--muted); margin-top: 4px; }
.admin-stat-change { font-size: .75rem; margin-top: 8px; }

/* Admin table */
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th { background: var(--bg); padding: 10px 16px; text-align: left; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); border-bottom: 2px solid var(--border); white-space: nowrap; }
.admin-table td { padding: 12px 16px; border-bottom: 1px solid var(--border-light); font-size: .88rem; vertical-align: middle; }
.admin-table tr:hover td { background: var(--bg); }
.table-wrap { overflow-x: auto; }

/* ── Modals ──────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5); backdrop-filter: blur(4px);
  z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal-box {
  background: var(--card); border-radius: 20px; width: 100%; max-width: 460px;
  max-height: 90vh; overflow-y: auto; box-shadow: 0 24px 64px rgba(0,0,0,.2);
  animation: modalIn .25s ease;
}
.modal-box-lg { max-width: 620px; }
@keyframes modalIn { from { opacity:0; transform:translateY(20px) scale(.97); } to { opacity:1; transform:none; } }
.modal-header { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-size: 1.05rem; font-weight: 700; }
.modal-close { background: var(--border-light); border: none; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-size: 1rem; color: var(--muted); display: flex; align-items: center; justify-content: center; }
.modal-close:hover { background: var(--danger-light); color: var(--danger); }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

/* ── Hero ────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 50%, #faf5ff 100%);
  border-radius: 20px; padding: 40px 24px; text-align: center;
  margin-bottom: 28px; position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; top: -60px; right: -60px;
  width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle, var(--primary-glow), transparent);
}
.hero-title { font-size: clamp(1.5rem, 4vw, 2.2rem); font-weight: 800; color: var(--text); margin-bottom: 12px; }
.hero-sub    { color: var(--muted); font-size: .95rem; margin-bottom: 20px; }

/* ── Toast ──────────────────────────────────────────────────── */
.toast-wrap { position: fixed; top: 74px; right: 16px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--text); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: .88rem; font-weight: 500; box-shadow: 0 8px 24px rgba(0,0,0,.2); animation: toastIn .3s ease; max-width: 320px; }
.toast.success { background: var(--success); }
.toast.error   { background: var(--danger); }
.toast.warning { background: var(--warning); }
@keyframes toastIn { from { opacity:0; transform: translateX(20px); } }

/* ── Misc ────────────────────────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.text-muted { color: var(--muted); }
.text-primary { color: var(--primary); }
.fw-bold { font-weight: 700; }
.page-title { font-size: 1.3rem; font-weight: 800; margin-bottom: 6px; }
.page-sub { font-size: .88rem; color: var(--muted); margin-bottom: 20px; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state-icon { font-size: 3rem; margin-bottom: 12px; opacity: .5; }
.empty-state h3 { font-size: 1.1rem; color: var(--text-2); margin-bottom: 8px; }
.spinner { display: inline-block; width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: spin .6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-dots::after { content: ''; animation: dots 1.2s steps(3, end) infinite; }
@keyframes dots { 0%,100%{content:''} 33%{content:'.'} 66%{content:'..'} 100%{content:'...'} }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 640px) {
  .group-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .admin-sidebar { transform: translateX(-100%); transition: .3s; }
  .admin-sidebar.open { transform: none; }
  .admin-content { margin-left: 0; }
}

/* ── Add Subscription Modal ──────────────────────────────────── */
.sub-pick-card:hover {
  border-color: var(--primary) !important;
  background: var(--primary-light) !important;
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.sub-pick-card { transition: .2s; user-select: none; }

/* ── Wallet toggle switch ───────────────────────────────────── */
.wallet-card .btn { transition: .2s; }
.wallet-card .btn:hover { filter: brightness(1.15); transform: translateY(-1px); }

/* ── Payment badge ──────────────────────────────────────────── */
.payment-secure { display:flex; align-items:center; gap:6px; font-size:.75rem; color:var(--muted); }
/* ── Super App additions ───────────────────────────── */
.nav-text-link{display:flex;align-items:center;gap:5px;padding:7px 12px;border-radius:10px;font-size:.85rem;font-weight:600;color:#4b5563;text-decoration:none;transition:.2s}
.nav-text-link:hover,.nav-text-link.active{background:var(--primary-light);color:var(--primary)}
.nav-text-link i{font-size:1rem}

/* Mobile bottom nav */
.mobile-bottom-nav{position:fixed;bottom:0;left:0;right:0;background:#fff;border-top:1px solid #e2e8f0;display:flex;z-index:900;box-shadow:0 -4px 20px rgba(0,0,0,.06)}
.mobile-bottom-nav a{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:8px 4px;text-decoration:none;color:#9ca3af;font-size:.6rem;font-weight:600;gap:2px;transition:.2s}
.mobile-bottom-nav a i{font-size:1.3rem}
.mobile-bottom-nav a.active{color:var(--primary)}
.mobile-bottom-nav a span{font-size:.6rem;white-space:nowrap}
body{padding-bottom:70px}
@media(min-width:768px){body{padding-bottom:0}}

/* Gift card brand img */
.gc-brand-img{width:60px;height:60px;object-fit:contain;margin:0 auto 10px;display:block;border-radius:10px;padding:6px;background:#f8fafc;border:1px solid #e2e8f0}
.gc-letter-avatar{width:60px;height:60px;background:var(--primary-light);border-radius:10px;display:flex;align-items:center;justify-content:center;margin:0 auto 10px;font-size:1.5rem;font-weight:800;color:var(--primary)}

/* Section quick actions */
.qa-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}
@media(min-width:576px){.qa-grid{grid-template-columns:repeat(8,1fr)}}
.qa-item{display:flex;flex-direction:column;align-items:center;gap:6px;text-decoration:none;color:#374151;padding:12px 6px;border-radius:14px;background:#fff;border:1px solid #e2e8f0;transition:.2s;font-size:.72rem;font-weight:700}
.qa-item:hover{border-color:var(--primary);color:var(--primary);transform:translateY(-2px);box-shadow:0 6px 20px rgba(79,70,229,.1)}
.qa-item i{font-size:1.5rem}
