:root {
  --bg-canvas: #0a0a0a;
  --bg-raised: #0c0c0c;
  --bg-card: #111;
  --bg-hover: #171717;
  --border-subtle: #ffffff0f;
  --border-default: #ffffff1f;
  --border-strong: #fff3;
  --text-primary: #ededed;
  --text-secondary: #a1a1a1;
  --text-tertiary: #6e6e6e;
  --red-text: #dc2626;
  --red-solid: #b91c1c;
  --red-solid-hover: #dc2626;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-pill: 9999px;
  --font-sans: "Geist", Inter, -apple-system, "Segoe UI", sans-serif;
  --dash-sidebar: 256px;
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --ma-canvas: #191919;
  --ma-mute: #7d8187;
  --ma-ink: #fff;
  --ma-hairline: #212327;
  --ma-body: #dadbdf;
  --ma-primary: #b91c1c;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; min-height: 100vh;
  background: var(--bg-canvas); color: var(--text-primary);
  font-family: var(--font-sans); font-weight: 400;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; }
.hidden { display: none !important; }
.seo-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* Logo F gray lined */
.logo-f {
  display: inline-flex; align-items: center; justify-content: center;
  background: #161616; border: 1px solid #2e2e2e; border-radius: 8px;
  position: relative; overflow: hidden; flex-shrink: 0;
  font-size: 0; line-height: 0; color: transparent;
}
.logo-f::after {
  content: 'F';
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: inherit;
  line-height: 1;
  letter-spacing: -0.04em;
  color: #c4c4c4;
}
.logo-f-sm { width: 24px; height: 24px; border-radius: 9999px; font-size: 12px !important; }
.logo-f-sm::after { font-size: 12px; }
.logo-f-md { width: 48px; height: 48px; margin-bottom: 12px; font-size: 22px !important; }
.logo-f-md::after { font-size: 22px; }
.logo-f-lg { width: 96px; height: 96px; border-radius: 50%; font-size: 42px !important; }
.logo-f-lg::after { font-size: 42px; }

/* ENTER */
.ma-enter {
  z-index: 9999; background: var(--ma-canvas); cursor: pointer;
  justify-content: center; align-items: center; display: flex;
  position: fixed; inset: 0; transition: opacity .3s var(--ease-out);
}
.ma-enter.is-exiting { opacity: 0; }
.ma-enter-content {
  text-align: center; flex-direction: column; align-items: center;
  gap: 24px; padding: 24px; display: flex;
}
.ma-enter-title {
  letter-spacing: -.03em; color: #fff; margin: 0;
  font-size: clamp(28px, 6vw, 56px); font-weight: 400;
}

/* AUTH */
.auth-page { background: var(--ma-canvas); min-height: 100vh; color: var(--ma-ink); }
.auth-stage { justify-content: center; align-items: center; min-height: 100vh; display: flex; padding: 24px; }
.auth-card-simple {
  width: 100%; max-width: 380px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.auth-card-simple h2 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.auth-tagline { color: var(--ma-mute); font-size: 14px; margin: 0 0 8px; }
.auth-tabs { display: flex; gap: 4px; width: 100%; background: #0c0c0c; border-radius: 8px; padding: 4px; }
.auth-tab {
  flex: 1; border: 0; background: transparent; color: var(--text-tertiary);
  padding: 8px; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 500;
}
.auth-tab.active { background: var(--bg-hover); color: var(--text-primary); }
.auth-form { width: 100%; display: flex; flex-direction: column; gap: 10px; }
.auth-form input {
  background: var(--bg-raised); border: 1px solid var(--border-default); border-radius: 8px;
  color: var(--text-primary); padding: 12px 14px; font-size: 14px; outline: none;
}
.auth-form input:focus { border-color: var(--border-strong); }
.auth-divider {
  display: flex; align-items: center; gap: 12px; width: 100%; color: var(--text-tertiary); font-size: 12px;
}
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border-subtle); }
.auth-discord {
  width: 100%; height: 48px; background: #5865f2; color: #fff; border: 0; border-radius: 9999px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-size: 15px; font-weight: 500; cursor: pointer;
}
.auth-discord:hover { opacity: .92; }
.error-msg { color: #f87171; font-size: 13px; min-height: 18px; }

/* DASH PAGE */
.dash-page {
  background: var(--bg-canvas); color: var(--text-primary); min-height: 100vh;
  font-family: var(--font-sans);
}
.dash-layout { min-height: 100vh; display: flex; }
.dash-top {
  border-bottom: 1px solid var(--border-subtle); background: var(--bg-raised);
  justify-content: space-between; align-items: center; height: 64px; padding: 0 24px; display: none;
}
.dash-brand {
  color: var(--text-primary); align-items: center; gap: 10px; font-size: 14px;
  font-weight: 500; text-decoration: none; display: inline-flex; border: 0; background: 0; cursor: pointer;
}
.dash-brand--rail { padding: 24px 20px 16px; }
.dash-sidebar {
  width: var(--dash-sidebar); background: var(--bg-raised); border-right: 1px solid var(--border-subtle);
  z-index: 20; flex-direction: column; flex-shrink: 0; display: flex;
  position: fixed; top: 0; bottom: 0; left: 0;
  animation: dash-sidebar-in .4s var(--ease-out) forwards;
}
@keyframes dash-sidebar-in { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
.dash-nav { flex-direction: column; flex: 1; gap: 2px; padding: 8px 12px; display: flex; }
.dash-nav-item {
  border-radius: var(--radius-sm); color: var(--text-secondary); cursor: pointer;
  text-align: left; width: 100%; background: 0; border: 0;
  align-items: center; gap: 10px; padding: 8px 12px; font-size: 14px; font-weight: 500;
  text-decoration: none; display: flex; position: relative;
  transition: background .15s, color .15s;
}
.dash-nav-item:hover, .dash-nav-item.active { background: var(--bg-hover); color: var(--text-primary); }
.dash-nav-item.active:before {
  content: ""; background: var(--red-text); border-radius: 1px; width: 2px;
  position: absolute; top: 8px; bottom: 8px; left: 0;
}
.dash-sidebar-footer { border-top: 1px solid var(--border-subtle); flex-direction: column; gap: 8px; padding: 16px 12px; display: flex; }
.dash-username { color: var(--text-primary); font-size: 13px; font-weight: 500; display: block; }
.dash-user-role { color: var(--text-tertiary); font-size: 12px; }
.dash-signout { color: var(--text-tertiary) !important; }
.dash-main {
  margin-left: var(--dash-sidebar); flex: 1; justify-content: center; min-width: 0;
  padding: 32px 48px 64px; display: flex;
}
.dash-canvas { width: 100%; max-width: 1120px; }
.dash-header { margin-bottom: 32px; }
.dash-header h1 {
  letter-spacing: -.02em; color: var(--text-primary); margin: 0;
  font-size: 28px; font-weight: 600; line-height: 1.2;
}
.dash-header p { color: var(--text-secondary); margin: 6px 0 0; font-size: 14px; }
.dash-mobile-nav { border-bottom: 1px solid var(--border-subtle); gap: 4px; padding: 8px 16px; display: none; overflow-x: auto; }
.dash-mobile-nav .dash-nav-item { flex-shrink: 0; width: auto; }

.dash-btn, .buy-btn, .redeem-btn, .btn-primary, .btn-danger {
  background: var(--red-solid); color: #fff; border: 1px solid var(--red-solid);
  border-radius: var(--radius-sm); height: 40px; cursor: pointer; white-space: nowrap;
  justify-content: center; align-items: center; padding: 0 16px; font-size: 14px; font-weight: 500;
  text-decoration: none; display: inline-flex;
  transition: background .15s, transform .1s;
}
.dash-btn:hover:not(:disabled), .buy-btn:hover:not(:disabled), .redeem-btn:hover:not(:disabled) {
  background: var(--red-solid-hover); border-color: var(--red-solid-hover);
}
.dash-btn:disabled, .buy-btn:disabled { opacity: .4; cursor: not-allowed; }
.dash-btn--ghost {
  color: var(--text-secondary); border: 1px solid var(--border-default); border-radius: var(--radius-sm);
  height: 32px; font-size: 13px; font-weight: 500; cursor: pointer; background: 0;
  justify-content: center; align-items: center; padding: 0 12px; display: inline-flex;
}
.dash-btn--ghost:hover { color: var(--text-primary); border-color: var(--border-strong); background: var(--bg-hover); }
.btn-danger { background: #7f1d1d; border-color: #7f1d1d; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }

.dash-balance {
  border-bottom: 1px solid var(--border-subtle);
  justify-content: space-between; align-items: flex-end; gap: 16px;
  margin-bottom: 32px; padding-bottom: 32px; display: flex;
}
.dash-balance-label { color: var(--text-tertiary); margin-bottom: 8px; font-size: 13px; }
.dash-balance-value {
  letter-spacing: -.03em; color: var(--text-primary); font-variant-numeric: tabular-nums;
  font-size: 48px; font-weight: 600; line-height: 1;
}
.dash-balance-value span { color: var(--text-tertiary); margin-left: 8px; font-size: 14px; font-weight: 400; }
.dash-balance-meta { color: var(--text-secondary); margin-top: 8px; font-size: 13px; }

.section-title { color: var(--text-primary); margin: 0 0 16px; font-size: 15px; font-weight: 500; }

.category-cards-grid {
  grid-template-columns: repeat(3, 1fr); gap: 16px; display: grid;
}
.category-card {
  border-radius: var(--radius-md); background: var(--bg-card); border: 1px solid var(--border-subtle);
  cursor: pointer; overflow: hidden; transition: transform .2s, background .2s, border-color .2s;
  display: flex; flex-direction: column;
}
.category-card:hover { background: var(--bg-hover); border-color: var(--border-default); transform: translateY(-2px); }
.category-card.out-of-stock { opacity: .5; }
.category-card-img-wrap {
  background: var(--bg-raised); justify-content: center; align-items: center;
  min-height: 140px; padding: 8px; display: flex;
}
.category-card-img {
  object-fit: contain; max-width: 100%; max-height: 140px; display: block;
  image-rendering: pixelated; filter: drop-shadow(0 8px 16px rgba(0,0,0,.4));
}
.category-card-body { padding: 12px 14px 14px; }
.category-card-name { color: var(--text-primary); margin-bottom: 4px; font-size: 14px; font-weight: 500; }
.category-card-price, .category-card-stock { color: var(--text-secondary); font-size: 13px; }
.category-card-stock.empty { color: var(--text-tertiary); }
.category-card-actions { display: flex; gap: 8px; margin-top: 10px; align-items: center; }
.qty-input {
  width: 56px; background: var(--bg-raised); border: 1px solid var(--border-default);
  border-radius: var(--radius-sm); color: var(--text-primary); padding: 6px 8px; font-size: 13px;
  -moz-appearance: textfield; appearance: textfield;
}
.qty-input::-webkit-outer-spin-button, .qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.category-card .buy-btn { width: auto; flex: 1; height: 32px; font-size: 13px; }

.activity-header { justify-content: space-between; align-items: center; margin-bottom: 8px; display: flex; }
.activity-view-all { color: var(--red-text); font-size: 13px; font-weight: 500; background: 0; border: 0; cursor: pointer; }
.activity-list { flex-direction: column; display: flex; }
.activity-row {
  border-bottom: 1px solid var(--border-subtle); grid-template-columns: 1fr auto;
  align-items: center; gap: 16px; padding: 12px 0; display: grid;
}
.activity-title { color: var(--text-primary); font-size: 14px; font-weight: 500; }
.activity-sub { color: var(--text-tertiary); margin-top: 2px; font-size: 12px; }
.activity-cost { font-variant-numeric: tabular-nums; font-size: 14px; color: var(--text-primary); }
.list-empty, .activity-empty { color: var(--text-secondary); padding: 16px 0; font-size: 14px; }

.redeem-row { max-width: 480px; gap: 12px; display: flex; }
.redeem-input {
  flex: 1; height: 40px; background: var(--bg-raised); border: 1px solid var(--border-default);
  border-radius: var(--radius-sm); color: var(--text-primary); padding: 8px 12px; font-size: 14px;
  letter-spacing: .06em; text-transform: uppercase; outline: none;
}
.redeem-input:focus { border-color: var(--border-strong); }
.redeem-btn { height: 40px; }

.history-wrap { display: flex; flex-direction: column; }
.history-row { border-bottom: 1px solid var(--border-subtle); padding: 14px 0; }
.history-title { color: var(--text-primary); font-size: 14px; font-weight: 500; }
.history-sub { color: var(--text-tertiary); margin-top: 2px; font-size: 12px; }
.history-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.history-action-btn {
  background: var(--bg-raised); height: 32px; color: var(--text-primary);
  border: 1px solid var(--border-default); border-radius: var(--radius-sm);
  padding: 0 12px; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}

.credit-pack-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; display: grid; }
.credit-pack, .topup-pkg {
  background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-md);
  color: inherit; padding: 16px; text-align: left; cursor: pointer; font-size: 14px; font-weight: 500;
}
.credit-pack:hover, .topup-pkg:hover { background: var(--bg-hover); border-color: var(--border-default); }

/* Admin */
.admin-tabs {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 24px;
  padding-bottom: 16px; border-bottom: 1px solid var(--border-subtle);
}
.admin-tab {
  background: transparent; border: 1px solid transparent; border-radius: 6px;
  color: var(--text-tertiary); padding: 8px 14px; font-size: 13px; font-weight: 500; cursor: pointer;
  transition: background .15s, color .15s;
}
.admin-tab:hover { color: var(--text-secondary); background: var(--bg-hover); }
.admin-tab.active {
  background: var(--bg-hover); color: var(--text-primary); border-color: var(--border-subtle);
}
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-bottom: 16px; }
.card {
  background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: 8px; padding: 16px;
}
.card h3 { margin: 0 0 12px; font-size: 14px; font-weight: 500; }
.stack-form { display: flex; flex-direction: column; gap: 10px; }
.stack-form input, .stack-form select, .stack-form textarea {
  background: var(--bg-raised); border: 1px solid var(--border-default); border-radius: 6px;
  color: var(--text-primary); padding: 10px 12px; font-size: 13px; outline: none;
}
.list { display: flex; flex-direction: column; }
.list-item {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--border-subtle); font-size: 13px;
}
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.stat-card, .stat-pill {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 14px 16px;
}
.stat-label {
  display: block;
  color: var(--text-tertiary);
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 6px;
}
.stat-card strong, .stat-pill strong {
  display: block;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.bar-chart { display: flex; flex-direction: column; gap: 10px; font-size: 13px; color: var(--text-secondary); }
.bar-row { display: grid; grid-template-columns: 72px 1fr 28px; align-items: center; gap: 10px; }
.bar-row span:first-child { color: var(--text-tertiary); font-size: 12px; font-variant-numeric: tabular-nums; }
.bar-fill-track { height: 6px; background: var(--border-subtle); border-radius: 3px; overflow: hidden; }
.bar-fill { height: 100%; background: #525252; border-radius: 3px; min-width: 2px; }
.bar-row strong { text-align: right; font-size: 12px; color: var(--text-primary); font-weight: 500; }
.muted { color: var(--text-tertiary); }
.msg { font-size: 13px; margin-top: 8px; }
.msg.ok { color: #4ade80; }
.msg.err { color: #f87171; }
.check-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); }
.row-btns { display: flex; gap: 8px; }
.file-label { font-size: 13px; color: var(--text-secondary); }
.file-label input[type=file] {
  display: block; width: 100%; margin-top: 6px; padding: 10px;
  background: var(--bg-raised); border: 1px dashed #333; border-radius: 8px; color: #a3a3a3; font-size: 13px;
}
.img-preview { max-width: 120px; max-height: 120px; border-radius: 8px; margin: 8px 0; object-fit: contain; background: #0c0c0c; border: 1px solid #2a2a2a; }
.upload-zone { position: relative; border: 1px dashed #333; border-radius: 8px; padding: 16px; text-align: center; }
.upload-zone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text-secondary); pointer-events: none; }
.pkg-row { display: grid; grid-template-columns: 80px 1fr; gap: 8px; }

.modal {
  position: fixed; inset: 0; z-index: 100; background: #000000b8;
  justify-content: center; align-items: center; padding: 16px; display: flex;
}
.modal-card {
  background: var(--bg-card); border: 1px solid var(--border-default); border-radius: var(--radius-md);
  width: 100%; max-width: 440px; max-height: calc(100vh - 32px); padding: 24px; overflow-y: auto;
}
.modal-card h3 { margin: 0 0 16px; font-size: 18px; font-weight: 600; }

.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  background: var(--bg-card); border: 1px solid var(--border-default); border-radius: 8px;
  padding: 12px 16px; font-size: 14px; max-width: 340px;
}
.announce-bar {
  background: #1a1a1a; border-bottom: 1px solid var(--border-subtle);
  padding: 10px 16px; text-align: center; font-size: 13px; color: var(--text-secondary);
}

/* Onboarding */
.onboard-root { z-index: 10050; pointer-events: none; position: fixed; inset: 0; }
.onboard-root:not(.hidden) { pointer-events: auto; }
.onboard-dim { pointer-events: auto; background: #0c0c0c9e; position: absolute; inset: 0; }
.onboard-spot {
  pointer-events: none; z-index: 1; border: 1px solid #ffffff80; border-radius: 12px;
  position: fixed; box-shadow: 0 0 0 1px #00000059;
}
.onboard-card {
  pointer-events: auto; color: #fff; z-index: 2; background: #111; border: 1px solid #ffffff1f;
  border-radius: 18px; width: 340px; padding: 22px; position: fixed;
  box-shadow: 0 24px 64px #00000073;
}
.onboard-kicker { color: #8a8e93; margin: 0 0 10px; font-size: 13px; font-weight: 500; }
.onboard-title { letter-spacing: -.03em; color: #fff; margin: 0 0 10px; font-size: 22px; font-weight: 600; }
.onboard-body { color: #dadbdf; margin: 0 0 20px; font-size: 14px; line-height: 1.55; }
.onboard-actions { display: flex; gap: 8px; justify-content: flex-end; }
.onboard-btn {
  cursor: pointer; height: 40px; border-radius: 9999px; padding: 0 16px; font-size: 14px; font-weight: 500;
  border: 1px solid transparent; display: inline-flex; align-items: center;
}
.onboard-btn--primary { color: #191919; background: #fff; }
.onboard-btn--ghost { color: #fff; background: #ffffff0f; border-color: #ffffff24; }

@media (max-width: 900px) {
  .dash-top { display: flex; }
  .dash-sidebar { display: none; }
  .dash-main { margin-left: 0; padding: 24px 16px 48px; }
  .dash-mobile-nav { display: flex; }
  .category-cards-grid { grid-template-columns: 1fr 1fr; }
  .dash-balance { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 560px) {
  .category-cards-grid { grid-template-columns: 1fr; }
  .dash-balance-value { font-size: 36px; }
  .dash-header h1 { font-size: 24px; }
  .redeem-row { flex-direction: column; }
}

.admin-grid .card, #atab-dashboard .card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 18px 20px;
}
#atab-dashboard .card h3 {
  margin: 0 0 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}
#top-buyers .list-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle);
}
#top-buyers .list-item:last-child { border-bottom: 0; }

.discord-setup-help { line-height: 1.6; }
.discord-setup-help code { overflow-wrap: anywhere; color: var(--text-primary); }
/* Keep admin Discord settings controls interactive above decorative layers. */
#discord-settings-form, #discord-settings-form input, #discord-settings-form button { position: relative; pointer-events: auto; }


/* =========================================================
   Top bar (bell is visible on desktop AND mobile)
   ========================================================= */
.dash-top { display: flex; position: sticky; top: 0; z-index: 40; background: #0a0a0acc; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.dash-top-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
@media (min-width: 901px) {
  .dash-top {
    position: fixed; top: 0; right: 0; left: var(--dash-sidebar); height: 56px;
    background: transparent; border-bottom: 0; backdrop-filter: none; -webkit-backdrop-filter: none;
    pointer-events: none; padding: 0 32px;
  }
  .dash-top .dash-brand--top, .dash-top .topbar-signout { display: none; }
  .dash-top-actions { pointer-events: auto; }
  .dash-main { padding-top: 72px; }
}

/* =========================================================
   Notification bell + panel (dark theme)
   ========================================================= */
.notif-wrap { position: relative; display: inline-flex; z-index: 1001; }
.notif-bell {
  width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
  background: var(--bg-card); border: 1px solid var(--border-default); border-radius: var(--radius-md);
  color: var(--text-secondary); cursor: pointer; position: relative;
  transition: background .15s, border-color .15s, color .15s;
}
.notif-bell:hover, .notif-bell[aria-expanded="true"] { background: var(--bg-hover); border-color: var(--border-strong); color: var(--text-primary); }
.notif-bell.ring svg { animation: bell-ring .9s ease; transform-origin: 50% 3px; }
@keyframes bell-ring {
  0%,100% { transform: rotate(0); } 15% { transform: rotate(16deg); } 30% { transform: rotate(-14deg); }
  45% { transform: rotate(10deg); } 60% { transform: rotate(-8deg); } 75% { transform: rotate(4deg); }
}
.notif-badge {
  position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px;
  background: var(--red-solid-hover); color: #fff; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 600; display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg-canvas); font-variant-numeric: tabular-nums;
}
.notif-panel {
  position: absolute; top: 48px; right: 0; width: min(380px, calc(100vw - 24px));
  background: var(--bg-card); border: 1px solid var(--border-default); border-radius: 12px;
  box-shadow: 0 24px 64px #000000b3; z-index: 10000; overflow: hidden;
  animation: notif-pop .18s var(--ease-out);
}
@keyframes notif-pop { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }
.notif-panel-heading {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; border-bottom: 1px solid var(--border-subtle); font-size: 14px;
}
.notif-panel-heading strong { font-weight: 600; }
.notif-count { margin-left: 8px; font-size: 11px; color: #fca5a5; background: #dc262626; border: 1px solid #dc262640; padding: 2px 8px; border-radius: var(--radius-pill); }
.notif-actions { display: flex; gap: 4px; }
.notif-link { background: 0; border: 0; color: var(--text-secondary); font: inherit; font-size: 12px; padding: 5px 8px; border-radius: 6px; cursor: pointer; }
.notif-link:hover:not(:disabled) { background: var(--bg-hover); color: var(--text-primary); }
.notif-link:disabled { opacity: .35; cursor: default; }
.notif-link--muted { color: var(--text-tertiary); }
.notif-list { max-height: min(420px, 64vh); overflow-y: auto; padding: 6px; }
.notif-item {
  display: flex; align-items: flex-start; gap: 12px; width: 100%; text-align: left; position: relative;
  background: 0; border: 0; border-radius: 8px; padding: 10px; color: inherit; font: inherit; cursor: pointer;
  transition: background .12s;
}
.notif-item:hover { background: var(--bg-hover); }
.notif-item.is-read { opacity: .6; }
.notif-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; font-size: 13px; color: var(--text-secondary); overflow-wrap: anywhere; }
.notif-text strong { color: var(--text-primary); font-weight: 500; font-size: 13.5px; }
.notif-text em { font-style: normal; color: var(--text-tertiary); font-size: 11px; margin-top: 3px; }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red-solid-hover); flex-shrink: 0; margin-top: 6px; box-shadow: 0 0 0 3px #dc262630; }
.notif-ico, .ntoast-icon {
  width: 34px; height: 34px; flex-shrink: 0; border-radius: 9px; display: flex; align-items: center; justify-content: center;
  background: #ffffff0d; border: 1px solid var(--border-subtle); color: var(--text-secondary);
}
.notif-ico svg, .ntoast-icon svg { width: 17px; height: 17px; }
.notif-ico--credits, .ntoast--credits .ntoast-icon { color: #4ade80; background: #22c55e14; border-color: #22c55e30; }
.notif-ico--gift, .ntoast--gift .ntoast-icon { color: #f0abfc; background: #d946ef14; border-color: #d946ef30; }
.notif-ico--product, .ntoast--product .ntoast-icon { color: #fca5a5; background: #dc262618; border-color: #dc262635; }
.notif-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 36px 20px; text-align: center; color: var(--text-tertiary); font-size: 13px; }
.notif-empty > div { width: 40px; height: 40px; color: var(--text-tertiary); } .notif-empty svg { width: 100%; height: 100%; }
.notif-empty strong { color: var(--text-primary); font-weight: 500; font-size: 14px; }

/* Popup toasts */
.toast-stack { position: fixed; top: 16px; right: 16px; z-index: 10001; display: flex; flex-direction: column; gap: 10px; width: min(360px, calc(100vw - 32px)); pointer-events: none; }
.ntoast {
  pointer-events: auto; position: relative; overflow: hidden; cursor: pointer;
  display: flex; align-items: flex-start; gap: 12px; padding: 14px 40px 16px 14px;
  background: var(--bg-card); border: 1px solid var(--border-default); border-radius: 12px;
  box-shadow: 0 16px 48px #000000a6; opacity: 0; transform: translateX(24px) scale(.98);
  transition: opacity .25s var(--ease-out), transform .25s var(--ease-out);
}
.ntoast.show { opacity: 1; transform: none; }
.ntoast:hover { border-color: var(--border-strong); background: var(--bg-hover); }
.ntoast-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 13px; color: var(--text-secondary); overflow-wrap: anywhere; }
.ntoast-body strong { color: var(--text-primary); font-weight: 600; font-size: 14px; }
.ntoast-x { position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; border: 0; background: 0; color: var(--text-tertiary); font-size: 18px; line-height: 1; border-radius: 6px; cursor: pointer; }
.ntoast-x:hover { background: #ffffff14; color: var(--text-primary); }
.ntoast-bar { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--red-solid-hover); transform-origin: left; animation: ntoast-bar linear forwards; opacity: .8; }
.ntoast--credits .ntoast-bar { background: #22c55e; } .ntoast--gift .ntoast-bar { background: #d946ef; }
@keyframes ntoast-bar { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@media (max-width: 900px) { .toast-stack { top: 72px; } .notif-panel { position: fixed; top: 70px; right: 12px; left: 12px; width: auto; } }

/* =========================================================
   Admin polish
   ========================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-sm);
  border: 1px solid var(--border-default); background: var(--bg-card); color: var(--text-primary);
  cursor: pointer; font-weight: 500; font-size: 13px; padding: 0 12px; height: 32px; white-space: nowrap;
  transition: background .15s, border-color .15s;
}
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn:hover { background: var(--bg-hover); border-color: var(--border-strong); color: var(--text-primary); }
.btn.btn-danger { background: #7f1d1d33; border-color: #7f1d1d; color: #fca5a5; }
.btn.btn-danger:hover { background: #7f1d1d; color: #fff; }
.btn-lg { height: 40px !important; padding: 0 16px !important; font-size: 14px !important; }
.btn-danger { height: 40px; }
.btn.btn-sm.btn-danger { height: 32px; }

.admin-tabs { position: sticky; top: 56px; z-index: 30; background: var(--bg-canvas); padding-top: 4px; overflow-x: auto; flex-wrap: nowrap; gap: 2px; scrollbar-width: none; }
.admin-tabs::-webkit-scrollbar { display: none; }
.admin-tab { position: relative; white-space: nowrap; border-radius: 6px 6px 0 0; }
.admin-tab.active { background: transparent; border-color: transparent; color: var(--text-primary); }
.admin-tab.active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -17px; height: 2px; background: var(--red-text); border-radius: 2px; }
.atab { animation: atab-in .22s var(--ease-out); }
@keyframes atab-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.atab > .card { margin-bottom: 16px; }

.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.card-head h3 { margin: 0 !important; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; }
.toolbar-input, .toolbar-select, .stack-form input, .stack-form select, .stack-form textarea {
  background: var(--bg-raised); border: 1px solid var(--border-default); border-radius: 6px; color: var(--text-primary);
  padding: 9px 12px; font-size: 13px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.toolbar-input { min-width: 260px; }
.toolbar-input:focus, .toolbar-select:focus, .stack-form input:focus, .stack-form select:focus, .stack-form textarea:focus { border-color: #dc262699; box-shadow: 0 0 0 3px #dc262622; }
.stack-form label, .modal-card label { font-size: 12px; color: var(--text-tertiary); margin-bottom: -4px; display: block; }
.form-row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.form-row3 > div { display: flex; flex-direction: column; gap: 6px; }
.form-row3 input { width: 100%; }
.form-divider { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-tertiary); padding-top: 8px; border-top: 1px solid var(--border-subtle); margin-top: 4px; }
.help { font-size: 12.5px; line-height: 1.6; margin: 0 0 12px; }

.stats-row { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.stat-card { position: relative; padding: 16px; border-radius: 12px; transition: border-color .15s, transform .15s; }
.stat-card:hover { border-color: var(--border-default); transform: translateY(-1px); }
.stat-ico { position: absolute; top: 14px; right: 14px; width: 30px; height: 30px; border-radius: 8px; background: #dc262614; border: 1px solid #dc262628; color: #f87171; display: flex; align-items: center; justify-content: center; }
.stat-ico svg { width: 16px; height: 16px; }
.stat-card small { display: block; margin-top: 4px; color: var(--text-tertiary); font-size: 12px; }
.bar-fill { background: linear-gradient(90deg, #7f1d1d, #dc2626); }
.bar-row { grid-template-columns: 84px 1fr 40px; }

.alert { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 10px; font-size: 13px; margin-bottom: 10px; border: 1px solid; }
.alert--warn { background: #f59e0b12; border-color: #f59e0b38; color: #fcd34d; }
.alert--info { background: #ffffff08; border-color: var(--border-default); color: var(--text-secondary); }
.alert-link { background: 0; border: 0; color: inherit; text-decoration: underline; font: inherit; cursor: pointer; padding: 0; }

.list-item { transition: background .12s; }
.li-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.li-main > div { min-width: 0; overflow-wrap: anywhere; }
.li-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.li-thumb { width: 38px; height: 38px; border-radius: 8px; object-fit: cover; border: 1px solid var(--border-default); background: var(--bg-raised); }
.avatar { width: 36px; height: 36px; flex-shrink: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: #1f1f1f; border: 1px solid var(--border-default); color: var(--text-secondary); font-weight: 600; font-size: 14px; }
.avatar--sq { border-radius: 8px; }
.rank { width: 22px; height: 22px; border-radius: 6px; background: var(--bg-hover); color: var(--text-tertiary); font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.chip { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: var(--radius-pill); background: var(--bg-hover); border: 1px solid var(--border-subtle); color: var(--text-secondary); font-size: 12px; font-variant-numeric: tabular-nums; }
.chip--credits { color: #4ade80; background: #22c55e12; border-color: #22c55e30; }
.badge { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: var(--radius-pill); font-size: 11px; font-weight: 500; background: #dc262622; color: #fca5a5; border: 1px solid #dc262640; vertical-align: middle; }
.badge.bad { background: #ffffff0d; color: var(--text-tertiary); border-color: var(--border-default); }
.badge.disc { background: #5865f220; color: #a5b0ff; border-color: #5865f240; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.ok-text { color: #4ade80; } .err-text { color: #f87171; } .warn-text { color: #fbbf24; }
.pill { font-size: 12px; padding: 3px 10px; border-radius: var(--radius-pill); background: var(--bg-hover); color: var(--text-tertiary); border: 1px solid var(--border-default); }
.pill--ok { color: #4ade80; background: #22c55e12; border-color: #22c55e30; }
.pill--warn { color: #fbbf24; background: #f59e0b12; border-color: #f59e0b30; }

.check-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.check { display: flex; gap: 10px; padding: 10px 12px; border-radius: 8px; border: 1px solid; font-size: 13px; }
.check > span { font-weight: 700; }
.check div div { color: var(--text-secondary); margin-top: 2px; font-size: 12.5px; }
.check--ok { background: #22c55e0f; border-color: #22c55e30; color: #4ade80; }
.check--bad { background: #ef44440f; border-color: #ef444440; color: #f87171; }
#discord-last-join { margin-top: 12px; }

.modal-card--wide { max-width: 560px; }
.modal { backdrop-filter: blur(3px); }
.modal-card { animation: notif-pop .2s var(--ease-out); }
.user-meta { margin-bottom: 16px; }
.meta-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.meta-grid > div { background: var(--bg-raised); border: 1px solid var(--border-subtle); border-radius: 8px; padding: 10px 12px; }
.meta-grid span { display: block; font-size: 11px; color: var(--text-tertiary); margin-bottom: 2px; }
.meta-grid b { font-weight: 500; font-size: 13px; overflow-wrap: anywhere; }
.user-history { margin-top: 14px; }
.fold { border-top: 1px solid var(--border-subtle); padding: 10px 0; font-size: 13px; }
.fold summary { cursor: pointer; color: var(--text-secondary); font-weight: 500; }
.ip-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 12.5px; color: var(--text-secondary); }
.skeleton { color: var(--text-tertiary); font-size: 13px; padding: 12px 0; }
.upload-files { color: var(--text-tertiary); }

@media (max-width: 700px) {
  .form-row3 { grid-template-columns: 1fr; }
  .toolbar-input { min-width: 0; flex: 1; }
  .list-item { flex-wrap: wrap; }
  .admin-tabs { top: 64px; }
}
