@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg: #0b0904;
  --bg-alt: #120e07;
  --surface: rgba(31, 24, 12, 0.72);
  --surface-solid: #1a140a;
  --border: rgba(255, 193, 7, 0.16);
  --border-strong: rgba(255, 193, 7, 0.38);
  --ice: #ffc93c;
  --ice-dim: #e0a800;
  --ice-glow: rgba(255, 201, 60, 0.38);
  --accent2: #ff9d1c;
  --text: #fff6e1;
  --text-dim: #c2b191;
  --success: #35d68f;
  --danger: #ff5c7a;
  --warning: #ff8a3d;
  --radius: 16px;
  --ink: #241a04;
  --muted: var(--text-dim);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 0%, rgba(255,201,60,0.14), transparent 45%),
    radial-gradient(circle at 85% 20%, rgba(255,157,28,0.10), transparent 40%),
    radial-gradient(circle at 50% 100%, rgba(255,193,7,0.06), transparent 40%),
    var(--bg);
  background-attachment: fixed;
}

h1, h2, h3, .brand, .stat-card .value {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
}

/* ---------- NAVBAR ---------- */
.navbar {
  background: rgba(8, 12, 20, 0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  color: #fff;
  padding: 16px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 20;
}

.navbar a {
  color: var(--text-dim);
  text-decoration: none;
  margin-left: 20px;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s ease;
}
.navbar a:hover { color: var(--ice); }

.brand {
  font-weight: 700;
  font-size: 19px;
  letter-spacing: 0.3px;
  background: linear-gradient(90deg, #fff, var(--ice) 70%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand::before {
  content: '🐝 ';
  color: var(--ice);
  -webkit-text-fill-color: initial;
}

.container {
  max-width: 1100px;
  margin: 36px auto;
  padding: 0 16px;
}

/* ---------- AUTH BOX ---------- */
.auth-box {
  max-width: 430px;
  margin: 70px auto;
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  padding: 38px 34px;
  border-radius: var(--radius);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.02), 0 20px 60px rgba(0,0,0,0.5), 0 0 40px -10px var(--ice-glow);
}

.auth-box h2 {
  text-align: center;
  margin-top: 0;
  font-size: 26px;
  letter-spacing: 0.3px;
}

label { display: block; margin: 16px 0 6px; font-size: 13px; color: var(--text-dim); font-weight: 500; letter-spacing: 0.2px; }

input, select, textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--ice-dim);
  background: rgba(255,201,60,0.05);
  box-shadow: 0 0 0 3px rgba(255,201,60,0.12);
}
input::placeholder, textarea::placeholder { color: #536178; }
textarea { resize: vertical; min-height: 90px; }
select option { background: var(--surface-solid); color: var(--text); }

button {
  cursor: pointer;
  border: none;
  border-radius: 10px;
  padding: 11px 20px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
button:active { transform: translateY(1px); }

.btn-primary {
  background: linear-gradient(135deg, var(--ice) 0%, var(--accent2) 100%);
  color: #241a04;
  width: 100%;
  margin-top: 22px;
  box-shadow: 0 8px 24px -6px var(--ice-glow);
}
.btn-primary:hover { filter: brightness(1.08); box-shadow: 0 8px 30px -4px var(--ice-glow); }

.btn-small { padding: 7px 14px; font-size: 12.5px; border-radius: 8px; }
.btn-success { background: linear-gradient(135deg, #35d68f, #1fae72); color: #04180f; }
.btn-danger { background: linear-gradient(135deg, #ff5c7a, #d43a5a); color: #2a0410; }

.msg { margin-top: 16px; font-size: 13.5px; text-align: center; }
.msg.error { color: var(--danger); }
.msg.success { color: var(--success); }

.switch-link { text-align: center; margin-top: 18px; font-size: 13.5px; color: var(--text-dim); }
.switch-link a { color: var(--ice); text-decoration: none; font-weight: 500; }
.switch-link a:hover { text-decoration: underline; }

/* ---------- STAT CARDS ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
  margin-bottom: 30px;
}

.stat-card {
  background: var(--surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  padding: 22px;
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: -30%; right: -30%;
  width: 120px; height: 120px;
  background: radial-gradient(circle, var(--ice-glow), transparent 70%);
  opacity: 0.5;
  pointer-events: none;
}
.stat-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.stat-card .label { color: var(--text-dim); font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.6px; }
.stat-card .value { font-size: 26px; font-weight: 700; margin-top: 8px; color: #fff; }

/* ---------- PANELS ---------- */
.panel {
  background: var(--surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.35);
  margin-bottom: 26px;
}

.panel h3 { margin-top: 0; font-size: 17px; letter-spacing: 0.2px; }
.panel h3::before { content: '▸ '; color: var(--ice); }

/* ---------- TABLES ---------- */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--border); text-align: left; }
th { color: var(--text-dim); font-weight: 600; text-transform: uppercase; font-size: 11.5px; letter-spacing: 0.5px; }
tr:hover td { background: rgba(255,201,60,0.03); }

.badge { padding: 4px 12px; border-radius: 20px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.3px; text-transform: uppercase; }
.badge.pending { background: rgba(255,181,71,0.14); color: var(--warning); border: 1px solid rgba(255,181,71,0.3); }
.badge.approved { background: rgba(53,214,143,0.14); color: var(--success); border: 1px solid rgba(53,214,143,0.3); }
.badge.processing { background: rgba(100,160,255,0.16); color: #60aaff; border: 1px solid rgba(100,160,255,0.35); }
.badge.processed { background: rgba(53,214,143,0.14); color: var(--success); border: 1px solid rgba(53,214,143,0.3); }
.badge.rejected { background: rgba(255,92,122,0.14); color: var(--danger); border: 1px solid rgba(255,92,122,0.3); }
.badge.active { background: rgba(53,214,143,0.14); color: var(--success); border: 1px solid rgba(53,214,143,0.3); }
.badge.inactive { background: rgba(255,181,71,0.14); color: var(--warning); border: 1px solid rgba(255,181,71,0.3); }
.badge.blocked { background: rgba(255,92,122,0.14); color: var(--danger); border: 1px solid rgba(255,92,122,0.3); }
.badge.open { background: rgba(53,214,143,0.14); color: var(--success); border: 1px solid rgba(53,214,143,0.3); }
.badge.in_progress { background: rgba(255,201,60,0.14); color: var(--ice); border: 1px solid rgba(255,201,60,0.3); }
.badge.closed { background: rgba(255,92,122,0.14); color: var(--danger); border: 1px solid rgba(255,92,122,0.3); }

/* ---------- SUPPORT CHAT THREAD ---------- */
.ticket-thread { display: flex; flex-direction: column; gap: 12px; margin: 16px 0; max-height: 420px; overflow-y: auto; padding-right: 4px; }
.ticket-msg { max-width: 78%; padding: 10px 14px; border-radius: 12px; font-size: 13.5px; line-height: 1.5; border: 1px solid var(--border); }
.ticket-msg .meta { font-size: 11px; color: var(--text-dim); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.4px; }
.ticket-msg.from-user { align-self: flex-end; background: rgba(255,201,60,0.1); border-color: rgba(255,201,60,0.25); }
.ticket-msg.from-admin { align-self: flex-start; background: rgba(255,255,255,0.04); }

/* ---------- BINARY TREE ---------- */
.tree {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 24px 0;
}
.tree-row { display: flex; gap: 50px; }
.tree-node {
  background: linear-gradient(135deg, rgba(255,201,60,0.16), rgba(255,157,28,0.10));
  border: 1px solid var(--border-strong);
  color: #fff;
  padding: 14px 20px;
  border-radius: 12px;
  text-align: center;
  min-width: 130px;
  font-size: 13px;
  box-shadow: 0 4px 20px -6px var(--ice-glow);
}
.tree-node small { color: var(--text-dim); }
.tree-node.empty {
  background: rgba(255,255,255,0.02);
  border: 1px dashed var(--border);
  color: var(--text-dim);
  box-shadow: none;
}

/* ---------- TABS ---------- */
.tabs { display: flex; gap: 10px; margin-bottom: 18px; }
.tab-btn {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 9px 18px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 13.5px;
  transition: all 0.2s ease;
}
.tab-btn:hover { color: var(--ice); border-color: var(--border-strong); }
.tab-btn.active {
  background: linear-gradient(135deg, var(--ice), var(--accent2));
  color: #241a04;
  border-color: transparent;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
@media (max-width: 800px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---------- LANDING HERO ---------- */
.hero {
  max-width: 780px;
  margin: 0 auto;
  padding: 90px 20px 40px;
  text-align: center;
}
.hero .tag {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 30px;
  border: 1px solid var(--border-strong);
  background: rgba(255,201,60,0.06);
  color: var(--ice);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 22px;
}
.hero h1 {
  font-size: 44px;
  line-height: 1.15;
  margin: 0 0 16px;
  background: linear-gradient(120deg, #fff 30%, var(--ice) 70%, var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p {
  color: var(--text-dim);
  font-size: 16px;
  max-width: 520px;
  margin: 0 auto 34px;
  line-height: 1.6;
}
.hero-buttons { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-buttons button { width: auto; padding: 13px 30px; margin-top: 0; }
.btn-ghost {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-strong);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--ice); color: var(--ice); }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  max-width: 900px;
  margin: 50px auto 0;
  padding: 0 20px;
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 18px;
  text-align: left;
  backdrop-filter: blur(14px);
}
.feature-card .icon { font-size: 22px; margin-bottom: 10px; display: block; }
.feature-card h4 { margin: 0 0 6px; font-size: 14.5px; color: #fff; }
.feature-card p { margin: 0; font-size: 12.5px; color: var(--text-dim); line-height: 1.5; }

/* ---------- QUICK ACTIONS ---------- */
.quick-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 28px; }
.action-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  cursor: pointer;
  text-decoration: none;
  display: block;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.action-card:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.action-card .ic { font-size: 24px; display: block; margin-bottom: 10px; }
.action-card .t { font-weight: 700; color: #fff; font-size: 14.5px; margin-bottom: 4px; }
.action-card .d { font-size: 12px; color: var(--text-dim); }

/* ---------- SIMPLE BAR CHART (CSS only) ---------- */
.bar-chart { display: flex; align-items: flex-end; gap: 10px; height: 160px; padding: 10px 0; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.bar-fill {
  width: 100%;
  max-width: 34px;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, var(--ice), var(--accent2));
  box-shadow: 0 0 14px -2px var(--ice-glow);
  min-height: 4px;
}
.bar-label { font-size: 11px; color: var(--text-dim); white-space: nowrap; }
.bar-value { font-size: 11px; color: var(--text); font-weight: 600; }

.mini-table-title { font-size: 12px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px; }

.rank-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(255,201,60,0.12); color: var(--ice);
  font-size: 11px; font-weight: 700; margin-right: 8px;
}

/* ---------- APP LAYOUT (SIDEBAR) ---------- */
.app-layout { display: flex; min-height: 100vh; overflow-x: hidden; width: 100%; }

.sidebar {
  width: 250px;
  flex-shrink: 0;
  background: rgba(8, 12, 20, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  transition: width 0.25s ease;
  z-index: 30;
}
.sidebar.collapsed { width: 74px; }

.sidebar-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 18px;
  border-bottom: 1px solid var(--border);
}

.hamburger {
  width: 34px; height: 34px;
  flex-shrink: 0;
  display: flex; flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 9px;
  cursor: pointer;
  transition: border-color 0.2s ease;
}
.hamburger:hover { border-color: var(--border-strong); }
.hamburger span { display: block; width: 16px; height: 2px; background: var(--ice); border-radius: 2px; }

.sidebar-brand {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 17px;
  white-space: nowrap;
  overflow: hidden;
  background: linear-gradient(90deg, #fff, var(--ice) 70%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  transition: opacity 0.2s ease;
}
.sidebar.collapsed .sidebar-brand { opacity: 0; width: 0; }

.sidebar-nav { padding: 14px 10px; display: flex; flex-direction: column; gap: 4px; flex: 1; }

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 12px;
  border-radius: 10px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  transition: background 0.2s ease, color 0.2s ease;
}
.sidebar-link .ic { width: 20px; text-align: center; flex-shrink: 0; font-size: 16px; }
.sidebar-link:hover { background: rgba(255,201,60,0.06); color: var(--text); }
.sidebar-link.active {
  background: linear-gradient(135deg, rgba(255,201,60,0.16), rgba(255,157,28,0.10));
  color: #fff;
  border: 1px solid var(--border-strong);
}
.sidebar.collapsed .sidebar-link span.label { display: none; }
.sidebar.collapsed .sidebar-link { justify-content: center; }

.sidebar-bottom { padding: 14px 10px; border-top: 1px solid var(--border); }

.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; margin-bottom: 6px;
  overflow: hidden; white-space: nowrap;
}
.sidebar-user .avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--ice), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: #241a04; font-size: 13px;
}
.sidebar-user .info { overflow: hidden; }
.sidebar-user .info .n { font-size: 13px; font-weight: 600; color: #fff; text-overflow: ellipsis; overflow: hidden; }
.sidebar-user .info .r { font-size: 11px; color: var(--text-dim); }
.sidebar.collapsed .sidebar-user .info { display: none; }

.main-content { flex: 1; min-width: 0; padding: 30px 34px; -webkit-overflow-scrolling: touch; }

.page-header { margin-bottom: 26px; }
.page-header h1 { font-size: 24px; margin: 0 0 4px; font-family: 'Space Grotesk', sans-serif; }
.page-header p { color: var(--text-dim); margin: 0; font-size: 14px; }

@media (max-width: 860px) {
  /* The hamburger button only ever toggles the .collapsed class (see
     sidebar.js) — there is no separate mobile-open class anywhere in the
     JS, so the sidebar was permanently invisible on phones before this fix.
     We repurpose .collapsed for mobile: since most visitors have no
     sidebar_collapsed value in localStorage yet (so the class starts
     ABSENT), "no .collapsed" must mean closed here, and "has .collapsed"
     (after a hamburger tap) means open. This reuses the exact same click
     handler that already works on desktop, with zero JS changes. */
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: min(78vw, 288px);
    transform: translateX(-100%);
    box-shadow: 18px 0 50px -12px rgba(0,0,0,0.6);
    transition: transform 0.28s cubic-bezier(.2,.8,.3,1);
  }
  .sidebar.collapsed {
    width: min(78vw, 288px);
    transform: translateX(0);
  }
  .sidebar.collapsed .sidebar-brand,
  .sidebar.collapsed .sidebar-user .info,
  .sidebar.collapsed .sidebar-status span:last-child { opacity: 1; width: auto; display: block; }
  .sidebar.collapsed .sidebar-link span.label { display: inline; }
  .sidebar.collapsed .sidebar-link { justify-content: flex-start; }
  .sidebar.collapsed .sidebar-bot-badge { display: flex; }
  .sidebar.collapsed .sidebar-status span:last-child { display: inline; }

  /* Dim the page behind an open drawer, purely visual (no click handling
     added since that would require new JS). */
  .sidebar.collapsed::after {
    content: '';
    position: fixed;
    inset: 0;
    left: min(78vw, 288px);
    background: rgba(0,0,0,0.55);
    z-index: 29;
    pointer-events: none;
  }

  .main-content { padding: 18px 14px 28px; margin-left: 0; }
  .navbar { padding: 14px 16px; }
}

@media (max-width: 520px) {
  .main-content { padding: 14px 10px 24px; }
  .container { margin: 20px auto; padding: 0 12px; }
  .page-header h1 { font-size: 20px; }
  .cards { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat-card { padding: 16px; }
  .stat-card .value { font-size: 20px; }
  .panel { padding: 18px 16px; border-radius: 14px; }
  .quick-actions { grid-template-columns: 1fr 1fr; gap: 12px; }
  .action-card { padding: 16px; }
  .auth-box { padding: 28px 22px; margin: 40px auto; }
  .hero { padding: 60px 16px 30px; }
  .hero h1 { font-size: 30px; }
  .hero p { font-size: 14.5px; }
  .hero-buttons button { width: 100%; }
  .tabs { flex-wrap: wrap; }
  .grid-2 { gap: 16px; }
  table { font-size: 12.5px; }
  th, td { padding: 9px 7px; }
}

/* Tables scroll horizontally inside their panel instead of squashing or
   overflowing the viewport on small screens. */
.panel:has(table) { overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 700px) {
  .panel:has(table) { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .panel table { min-width: 560px; }
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: rgba(255,201,60,0.2); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,201,60,0.35); }

/* ============================================================
   INTERACTIVE MOTION KIT — page-load reveals, hover lift, ripple
   buttons, animated counters, toasts, breadcrumbs, address cards.
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes popIn {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes shimmer {
  0%   { background-position: -200px 0; }
  100% { background-position: 200px 0; }
}
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,201,60,0.35); }
  50%      { box-shadow: 0 0 0 6px rgba(255,201,60,0); }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Reveal-on-load: JS (initPageMotion in api.js) adds .reveal to panels/cards on
   DOMContentLoaded with a small stagger delay per element via --d. */
.reveal { opacity: 0; animation: fadeUp 0.5s cubic-bezier(.2,.7,.3,1) forwards; animation-delay: var(--d, 0s); }

.panel, .stat-card, .action-card, .tree-node { will-change: transform; }
.panel { transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease; }
.panel:hover { border-color: var(--border-strong); }

.action-card { transition: transform 0.22s cubic-bezier(.2,.8,.3,1), border-color 0.22s ease, box-shadow 0.22s ease; }
.action-card:hover { transform: translateY(-4px) scale(1.015); box-shadow: 0 14px 34px -12px var(--ice-glow); }

.tree-node { transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease; }
.tree-node:hover { transform: translateY(-3px); box-shadow: 0 10px 28px -10px var(--ice-glow); border-color: var(--border-strong); cursor: pointer; }
.tree-node.clickable::after { content: '↳ view'; display: block; font-size: 10.5px; color: var(--ice); margin-top: 4px; opacity: 0.8; }
.tree-node.me-node { animation: pulseGlow 2.4s ease-in-out infinite; }

/* Ripple-style buttons */
.btn-primary, .btn-small, .btn-ghost {
  position: relative;
  overflow: hidden;
}
.btn-primary:active, .btn-small:active { transform: scale(0.97); }

/* Animated counters (value text swapped via requestAnimationFrame in JS) */
.counter { font-variant-numeric: tabular-nums; transition: color 0.3s ease; }

/* Skeleton loading shimmer, used while a table/list is fetching */
.skeleton-row {
  height: 14px; border-radius: 6px; margin: 6px 0;
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.09) 37%, rgba(255,255,255,0.04) 63%);
  background-size: 400px 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}

.spinner {
  display: inline-block; width: 18px; height: 18px;
  font-size: 15px; line-height: 1;
  animation: beeSpin 0.9s cubic-bezier(.5,0,.5,1) infinite;
  vertical-align: middle;
}
.spinner::before { content: '🐝'; display: inline-block; }
@keyframes beeSpin {
  0%   { transform: rotate(0deg) translateX(0); }
  50%  { transform: rotate(180deg) translateX(1px); }
  100% { transform: rotate(360deg) translateX(0); }
}

/* Toast notifications */
#toastStack { position: fixed; top: 20px; right: 20px; z-index: 999; display: flex; flex-direction: column; gap: 10px; }
.toast {
  min-width: 220px; max-width: 320px; padding: 13px 16px; border-radius: 12px;
  background: var(--surface-solid); border: 1px solid var(--border-strong);
  box-shadow: 0 14px 34px -10px rgba(0,0,0,0.6);
  font-size: 13.5px; color: var(--text);
  animation: slideInRight 0.3s cubic-bezier(.2,.8,.3,1) forwards;
}
.toast.success { border-color: rgba(53,214,143,0.4); }
.toast.error { border-color: rgba(255,92,122,0.4); }
.toast.fade-out { animation: fadeUp 0.25s ease reverse forwards; }

/* Breadcrumb trail for the paginated genealogy tree */
.tree-breadcrumb { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; font-size: 13px; color: var(--text-dim); }
.tree-breadcrumb a { color: var(--ice); text-decoration: none; }
.tree-breadcrumb a:hover { text-decoration: underline; }
.tree-breadcrumb .sep { opacity: 0.5; }

/* Wallet-address cards on Profile */
.addr-card {
  border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px;
  background: rgba(255,255,255,0.02); transition: border-color 0.2s ease;
}
.addr-card:hover { border-color: var(--border-strong); }
.addr-card .net-label { font-size: 11.5px; letter-spacing: 0.5px; color: var(--ice); font-weight: 700; text-transform: uppercase; }
.addr-card .addr-value { font-family: monospace; font-size: 13px; color: #fff; word-break: break-all; margin: 4px 0 8px; }
.addr-card .empty-hint { color: var(--text-dim); font-size: 12.5px; font-style: italic; }

/* Small network toggle pills, used on Deposit/Withdraw to pick BEP20 / TRC20 */
.net-toggle { display: flex; gap: 8px; margin: 6px 0 16px; }
.net-pill {
  flex: 1; text-align: center; padding: 10px 12px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--border); color: var(--text-dim); font-size: 13px; font-weight: 600;
  transition: all 0.2s ease; user-select: none;
}
.net-pill:hover { border-color: var(--border-strong); color: var(--text); }
.net-pill.active { border-color: transparent; color: #241a04; background: linear-gradient(135deg, var(--ice), var(--accent2)); box-shadow: 0 8px 20px -6px var(--ice-glow); }

/* Ledger row type badges on Wallet History */
.badge.deposit { background: rgba(53,214,143,0.14); color: var(--success); border: 1px solid rgba(53,214,143,0.3); }
.badge.withdrawal { background: rgba(255,92,122,0.14); color: var(--danger); border: 1px solid rgba(255,92,122,0.3); }
.badge.referral_bonus, .badge.deposit_credit { background: rgba(255,201,60,0.14); color: var(--ice); border: 1px solid rgba(255,201,60,0.3); }
.badge.platform_fee, .badge.admin_withdrawal { background: rgba(255,181,71,0.14); color: var(--warning); border: 1px solid rgba(255,181,71,0.3); }

.amount-pos { color: var(--success); font-weight: 700; }
.amount-neg { color: var(--danger); font-weight: 700; }

/* ============================================================
   BEE-THEMED AUTH PAGES (login / register)
   ============================================================ */
.auth-page-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 16px;
  position: relative;
  overflow: hidden;
}
.auth-page-wrap::before {
  content: '';
  position: absolute;
  inset: -10%;
  background-image:
    linear-gradient(30deg, rgba(255,201,60,0.08) 1px, transparent 1px),
    linear-gradient(150deg, rgba(255,201,60,0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,201,60,0.08) 1px, transparent 1px);
  background-size: 46px 80px;
  mask-image: radial-gradient(circle at 50% 40%, rgba(0,0,0,0.9), transparent 70%);
  -webkit-mask-image: radial-gradient(circle at 50% 40%, rgba(0,0,0,0.9), transparent 70%);
  animation: honeyDrift 24s linear infinite;
  pointer-events: none;
}
.auth-page-wrap::after {
  content: '';
  position: absolute;
  top: -20%; left: 50%;
  width: 700px; height: 700px;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(255,201,60,0.16), transparent 62%);
  pointer-events: none;
}

.auth-orbit-particle {
  position: absolute;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--ice);
  box-shadow: 0 0 8px 2px var(--ice-glow);
  opacity: 0.7;
  animation: floatParticle 7s ease-in-out infinite;
}

@keyframes floatParticle {
  0%, 100% { transform: translateY(0) translateX(0); opacity: 0.3; }
  50%      { transform: translateY(-24px) translateX(10px); opacity: 0.9; }
}

.auth-shell { position: relative; z-index: 1; width: 100%; max-width: 440px; }

.auth-eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 11.5px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ice);
  margin-bottom: 18px;
}
.auth-eyebrow .pulse-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 0 rgba(53,214,143,0.6);
  animation: dotPulse 1.8s ease-out infinite;
}
@keyframes dotPulse {
  0%   { box-shadow: 0 0 0 0 rgba(53,214,143,0.55); }
  70%  { box-shadow: 0 0 0 8px rgba(53,214,143,0); }
  100% { box-shadow: 0 0 0 0 rgba(53,214,143,0); }
}

.auth-bot {
  width: 78px; height: 78px;
  margin: 0 auto 20px;
  border-radius: 50%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 35% 30%, rgba(255,201,60,0.35), rgba(255,157,28,0.06) 60%, transparent 78%), var(--surface-solid);
  border: 1px solid var(--border-strong);
  box-shadow: 0 0 0 6px rgba(255,201,60,0.05), 0 0 44px -6px var(--ice-glow);
  animation: botFloat 3.6s ease-in-out infinite;
}
.auth-bot svg { width: 38px; height: 38px; position: relative; z-index: 2; }
.auth-bot::before {
  content: '';
  position: absolute;
  inset: -9px;
  border-radius: 50%;
  border: 1px dashed rgba(255,201,60,0.35);
  animation: spin 9s linear infinite;
}
.auth-bot::after {
  content: '';
  position: absolute;
  inset: -16px;
  border-radius: 50%;
  border: 1px solid rgba(255,157,28,0.18);
}
@keyframes botFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

.auth-border-glow {
  position: relative;
  border-radius: calc(var(--radius) + 3px);
  padding: 1.5px;
  background: conic-gradient(from var(--angle, 0deg), var(--ice), var(--accent2), var(--success), var(--accent2), var(--ice));
  animation: rotateBorder 7s linear infinite;
  box-shadow: 0 24px 70px -20px rgba(0,0,0,0.7);
}
@property --angle {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}
@keyframes rotateBorder {
  to { --angle: 360deg; }
}

.auth-border-glow .auth-box {
  margin: 0;
  max-width: none;
  position: relative;
  overflow: hidden;
}
.auth-border-glow .auth-box::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 90px;
  background: linear-gradient(180deg, transparent, rgba(255,201,60,0.10), transparent);
  top: -90px;
  animation: scanSweep 3.6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes scanSweep {
  0%   { top: -90px; }
  60%  { top: 110%; }
  100% { top: 110%; }
}

.auth-box h2 { position: relative; }
.auth-subtitle {
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  margin: -6px 0 4px;
}

.auth-footnote {
  text-align: center;
  color: var(--text-dim);
  font-size: 12px;
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.auth-footnote svg { width: 13px; height: 13px; opacity: 0.7; }

/* ============================================================
   GENEALOGY — HOLOGRAPHIC ORG-CHART TREE
   ============================================================ */
.gen-scroll { overflow-x: auto; padding-bottom: 6px; }
.gen-tree {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: max-content;
  padding: 10px 20px 24px;
}

.gen-row {
  display: flex;
  justify-content: center;
  gap: 30px;
  position: relative;
  padding-top: 26px;
}
.gen-row::before {
  content: '';
  position: absolute;
  top: 0;
  left: 25%;
  right: 25%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-strong) 15%, var(--border-strong) 85%, transparent);
}
.gen-row.single::before { display: none; }

.gen-col {
  flex: 1 1 0;
  min-width: 108px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}
.gen-col::before {
  content: '';
  position: absolute;
  top: -26px;
  left: 50%;
  width: 1px;
  height: 26px;
  background: linear-gradient(180deg, var(--border-strong), rgba(255,201,60,0.2));
  transform: translateX(-0.5px);
}

.gen-stub {
  width: 1px;
  height: 14px;
  background: linear-gradient(180deg, rgba(255,201,60,0.2), var(--border-strong));
  margin-bottom: -1px;
}
.gen-root-wrap { display: flex; flex-direction: column; align-items: center; }

/* Row of grandchild branches — each branch is its own mini gen-row hanging off a stub,
   so it lines up under whichever level-1 card it belongs to. */
.gen-group { display: flex; justify-content: center; gap: 30px; align-items: flex-start; }
.gen-branch { display: flex; flex-direction: column; align-items: center; }

/* ---- the card itself — a small, thin-bordered box, not a big panel ---- */
.gen-card {
  position: relative;
  width: 108px;
  border-radius: 8px;
  padding: 8px 8px 7px;
  text-align: center;
  text-decoration: none;
  display: block;
  background: linear-gradient(160deg, rgba(15,23,37,0.92), rgba(10,15,26,0.92));
  border: 1px solid var(--border-strong);
  box-shadow: 0 4px 12px -8px rgba(0,0,0,0.6);
  transition: transform 0.15s cubic-bezier(.2,.8,.3,1), box-shadow 0.15s ease, border-color 0.15s ease;
}
.gen-card:hover {
  transform: translateY(-2px);
  border-color: var(--ice);
  box-shadow: 0 10px 20px -10px var(--ice-glow);
}
.gen-card.is-me {
  border-color: var(--ice);
  box-shadow: 0 0 0 1px rgba(255,201,60,0.25), 0 0 16px -4px var(--ice-glow);
  animation: pulseGlow 2.6s ease-in-out infinite;
}
.gen-card-top { display: flex; align-items: center; justify-content: center; margin-bottom: 4px; }
.gen-avatar {
  width: 20px; height: 20px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 35% 30%, rgba(255,201,60,0.4), rgba(255,157,28,0.08) 65%, transparent 80%), rgba(255,255,255,0.03);
  border: 1px solid var(--border-strong);
  color: var(--ice);
  flex-shrink: 0;
}
.gen-avatar svg { width: 11px; height: 11px; }
.gen-you-tag {
  font-size: 8px; font-weight: 800; letter-spacing: 0.6px;
  color: #241a04; background: linear-gradient(135deg, var(--ice), var(--accent2));
  padding: 1px 5px; border-radius: 5px; position: absolute; top: -7px; left: 50%; transform: translateX(-50%);
  white-space: nowrap;
}
/* expand affordance is now just the whole card being a link — no separate chevron button
   in the compact layout, keeps the box small and uncluttered */
.gen-expand { display: none; }

.gen-code { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 11.5px; color: var(--ice); letter-spacing: 0.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gen-name { font-size: 10.5px; font-weight: 600; color: #fff; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* small active/inactive status chip, not a text label */
.gen-status {
  display: inline-block;
  font-size: 8.5px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase;
  margin-top: 4px; padding: 1px 6px; border-radius: 999px;
}
.gen-status.active { color: var(--success); background: rgba(53,214,143,0.12); border: 1px solid rgba(53,214,143,0.35); }
.gen-status.inactive { color: var(--text-dim); background: rgba(255,255,255,0.04); border: 1px solid var(--border-strong); }

.gen-footer {
  display: flex; justify-content: center; gap: 10px;
  margin-top: 6px; padding-top: 5px;
  border-top: 1px solid var(--border);
  font-size: 9.5px; color: var(--text-dim); font-weight: 600;
}
.gen-footer b { color: var(--text); font-weight: 700; }

.gen-card.empty {
  background: rgba(255,255,255,0.015);
  border: 1px dashed var(--border-strong);
  box-shadow: none;
  text-align: center;
  cursor: pointer;
}
.gen-card.empty:hover { border-color: var(--ice); background: rgba(255,201,60,0.04); }
.gen-plus {
  width: 18px; height: 18px; border-radius: 50%;
  border: 1px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  color: var(--ice); font-size: 12px; font-weight: 700;
  margin: 0 auto 4px;
}
.gen-card.empty .gen-code { color: var(--ice); font-size: 10.5px; text-align: center; }
.gen-card.empty .gen-status { color: var(--text-dim); background: transparent; border: none; }
.gen-card.empty .gen-footer { justify-content: center; gap: 12px; }

@media (max-width: 700px) {
  .gen-card { width: 92px; padding: 7px 6px 6px; }
  .gen-row { gap: 18px; }
}

/* ============================================================
   SITE-WIDE "AI ROBOT" POLISH
   ============================================================ */

/* Sidebar robot badge + brand */
.sidebar-top { gap: 10px; }
.sidebar-bot-badge {
  width: 32px; height: 32px;
  flex-shrink: 0;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--ice);
  background: radial-gradient(circle at 35% 30%, rgba(255,201,60,0.32), rgba(255,157,28,0.06) 65%, transparent 78%), rgba(255,255,255,0.02);
  border: 1px solid var(--border-strong);
  box-shadow: 0 0 16px -4px var(--ice-glow);
}
.sidebar-bot-badge svg { width: 17px; height: 17px; }
@media (min-width: 861px) {
  .sidebar.collapsed .sidebar-bot-badge { display: none; }
}

.sidebar-status {
  display: flex; align-items: center; gap: 7px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase;
  color: var(--success);
  padding: 0 10px 10px;
  white-space: nowrap; overflow: hidden;
}
@media (min-width: 861px) {
  .sidebar.collapsed .sidebar-status span:last-child { display: none; }
}
.pulse-dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
  background: var(--success);
  box-shadow: 0 0 0 0 rgba(53,214,143,0.6);
  animation: dotPulse 1.8s ease-out infinite;
}

/* Faint animated honeycomb backdrop behind every app page */
.main-content { position: relative; overflow-x: hidden; }
.main-content::before {
  content: '';
  position: absolute;
  inset: -10%;
  background-image:
    linear-gradient(30deg, rgba(255,201,60,0.055) 1px, transparent 1px),
    linear-gradient(150deg, rgba(255,201,60,0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,201,60,0.055) 1px, transparent 1px);
  background-size: 46px 80px;
  background-position: 0 0, 0 0, 0 0;
  mask-image: radial-gradient(circle at 20% 0%, rgba(0,0,0,0.85), transparent 65%);
  -webkit-mask-image: radial-gradient(circle at 20% 0%, rgba(0,0,0,0.85), transparent 65%);
  animation: honeyDrift 30s linear infinite;
  pointer-events: none;
  z-index: 0;
}
@keyframes honeyDrift {
  from { background-position: 0 0, 0 0, 0 0; }
  to   { background-position: 46px 80px, -46px 80px, 92px 0; }
}
.main-content > * { position: relative; z-index: 1; }

/* Glowing circular badges for quick-action + panel icons, instead of flat glyphs */
.action-card .ic {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255,201,60,0.3), rgba(255,157,28,0.06) 65%, transparent 78%), rgba(255,255,255,0.02);
  border: 1px solid var(--border-strong);
  color: var(--ice);
  box-shadow: 0 0 18px -6px var(--ice-glow);
  margin-bottom: 12px;
}

.panel h3 {
  display: flex; align-items: center; gap: 8px;
}
.panel h3::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--ice);
  box-shadow: 0 0 8px 1px var(--ice-glow);
  display: inline-block;
  flex-shrink: 0;
}

/* Reusable copy-link row (input + button) that doesn't collapse the input like a raw
   flex row with a width:100% button does. */
.copy-row { display: flex; gap: 8px; align-items: stretch; }
.copy-row input { flex: 1 1 auto; min-width: 0; }
.copy-row button { flex: 0 0 auto; width: auto; margin-top: 0; white-space: nowrap; }

/* ─── OVERLAY (shared by desktop & mobile drawer) ─── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}
.sidebar-overlay.visible { opacity: 1; pointer-events: auto; }

/* ─── MOBILE TOP NAVBAR ─── */
.mobile-navbar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  background: rgba(8,12,20,0.97);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
  z-index: 150;
  align-items: center;
  padding: 0 12px 0 10px;
  gap: 10px;
}

/* Hamburger button (left) */
.mob-hamburger {
  width: 38px; height: 38px;
  flex-shrink: 0;
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  gap: 5px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.mob-hamburger span {
  display: block; width: 16px; height: 2px;
  background: var(--ice); border-radius: 2px;
}

/* Logo + brand (centre) */
.mob-logo-wrap {
  flex: 1;
  display: flex; align-items: center; gap: 8px;
  min-width: 0;
}
.mob-logo-icon {
  width: 26px; height: 26px; flex-shrink: 0;
  color: var(--ice); display: flex; align-items: center;
}
.mob-logo-icon svg { width: 26px; height: 26px; }
.mob-brand {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700; font-size: 15px;
  background: linear-gradient(90deg, #fff, var(--ice) 70%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Logout button (top-right, always visible) */
.mob-logout-btn {
  flex-shrink: 0;
  display: flex; align-items: center; gap: 5px;
  padding: 7px 12px;
  background: rgba(255,60,60,0.12);
  border: 1px solid rgba(255,80,80,0.28);
  border-radius: 9px;
  color: #ff7070;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  font-family: inherit;
}
.mob-logout-btn:active { background: rgba(255,60,60,0.22); }
.mob-logout-icon { font-size: 14px; }
.mob-logout-label { display: inline; }

/* ─── MOBILE DRAWER ─── */
.mob-drawer {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: min(80vw, 290px);
  height: 100dvh; /* dynamic viewport height — avoids browser chrome overlap */
  background: rgba(8,12,20,0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--border);
  z-index: 300;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.28s cubic-bezier(.2,.8,.3,1);
  overflow: hidden; /* clip; inner nav scrolls */
}
.mob-drawer.open {
  transform: translateX(0);
}

/* Drawer header: avatar + name + close button */
.mob-drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 14px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.mob-drawer-user {
  display: flex; align-items: center; gap: 10px; min-width: 0;
}
.mob-drawer-close {
  width: 32px; height: 32px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 14px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  font-family: inherit;
}

/* Scrollable nav list */
.mob-drawer-nav {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 10px 10px;
  display: flex; flex-direction: column; gap: 3px;
}
.mob-drawer-link {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 14px;
  border-radius: 10px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 15px; font-weight: 500;
  transition: background 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.mob-drawer-link .ic { width: 22px; text-align: center; font-size: 17px; flex-shrink: 0; }
.mob-drawer-link:hover,
.mob-drawer-link:active { background: rgba(255,201,60,0.08); color: #fff; }
.mob-drawer-link.active {
  background: linear-gradient(135deg, rgba(255,201,60,0.18), rgba(255,157,28,0.10));
  color: #fff;
  border: 1px solid var(--border-strong);
}

.mob-drawer-footer {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* ─── MOBILE: activate navbar & drawer, hide desktop sidebar ─── */
@media (max-width: 860px) {
  .mobile-navbar { display: flex; }
  .mob-drawer   { display: flex; }

  /* Desktop sidebar hidden on mobile */
  #sidebarEl { display: none !important; }

  /* Page content clears the fixed navbar */
  .app-layout { flex-direction: column; min-height: 100vh; }
  .main-content {
    padding-top: 70px !important;
    overflow: visible !important;
    min-height: calc(100vh - 56px);
  }
  .sidebar-overlay { display: block; }

  /* Body scrolls normally; don't let main-content trap scroll */
  body { overflow-y: auto !important; overflow-x: hidden; }
}

@media (min-width: 861px) {
  .mobile-navbar  { display: none !important; }
  .mob-drawer     { display: none !important; }
  .sidebar-overlay { display: none !important; }
}

/* ─── NOTIFICATION BELL ─── */
.notif-bell-wrap { position: relative; }
.notif-bell-btn {
  position: relative;
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-dim);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.notif-bell-btn:hover, .notif-bell-btn.active { background: rgba(255,201,60,0.10); color: var(--ice); border-color: var(--border-strong); }
.notif-bell-btn svg { width: 18px; height: 18px; }
.notif-bell-badge {
  position: absolute;
  top: -4px; right: -4px;
  min-width: 16px; height: 16px;
  padding: 0 3px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  border: 1.5px solid var(--bg);
  display: none;
}
.notif-bell-badge.show { display: block; }

.notif-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(360px, 88vw);
  max-height: 420px;
  display: flex;
  flex-direction: column;
  background: rgba(15,11,5,0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.5);
  z-index: 400;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
}
.notif-panel.open { opacity: 1; transform: translateY(0); pointer-events: auto; }
.notif-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.notif-panel-head h4 { margin: 0; font-size: 14px; color: var(--text); }
.notif-panel-markall {
  background: none; border: none; color: var(--ice); font-size: 12px;
  cursor: pointer; font-family: inherit; padding: 2px 0;
}
.notif-panel-markall:disabled { color: var(--muted); cursor: default; }
.notif-panel-list { overflow-y: auto; flex: 1; }
.notif-item {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.12s;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: rgba(255,201,60,0.06); }
.notif-item.unread { background: rgba(255,201,60,0.05); }
.notif-item-top { display: flex; align-items: center; gap: 8px; }
.notif-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ice); flex-shrink: 0; }
.notif-dot.hidden { visibility: hidden; }
.notif-item-title { font-size: 13.5px; font-weight: 600; color: var(--text); flex: 1; }
.notif-item-msg { font-size: 12.5px; color: var(--text-dim); margin: 5px 0 4px 15px; line-height: 1.4; }
.notif-item-time { font-size: 11px; color: var(--muted); margin-left: 15px; }
.notif-panel-empty { padding: 30px 14px; text-align: center; color: var(--muted); font-size: 13px; }

/* ─── ADMIN: NOTIFICATION MANAGER ─── */
.notif-audience-toggle { display: flex; gap: 10px; margin-bottom: 4px; }
.notif-audience-toggle label {
  display: flex; align-items: center; gap: 6px;
  font-size: 13.5px; color: var(--text-dim); cursor: pointer;
}
.notif-sent-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px 10px; border-bottom: 1px solid var(--border); }
.notif-sent-row:last-child { border-bottom: none; }
.notif-sent-title { font-weight: 600; color: var(--text); font-size: 14px; }
.notif-sent-msg { color: var(--text-dim); font-size: 13px; margin-top: 4px; line-height: 1.5; }
.notif-sent-meta { color: var(--muted); font-size: 11.5px; margin-top: 6px; }
.notif-audience-badge {
  display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px;
  border-radius: 20px; background: rgba(255,201,60,0.14); color: var(--ice);
  margin-right: 8px;
}

/* Ensure all form inputs are always tappable above decorative layers */
input, select, textarea, button, a, [role="button"], .net-pill, .net-toggle {
  position: relative;
  z-index: 2;
}
