/* ====================================================
   NOP Tech - Main Stylesheet
   Deep Space + Mars Red + AI Blue + RWA Gold + Silver
   ==================================================== */

/* Self-hosted variable fonts — Google Fonts is unreachable from mainland China,
   and an @import there blocks this whole stylesheet. SIL OFL, see fonts/OFL.txt */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter/inter-latin-var.woff2") format("woff2");
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("../fonts/space-grotesk/space-grotesk-latin-var.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("../fonts/jetbrains-mono/jetbrains-mono-latin-var.woff2") format("woff2");
}

/*** font type ***/
.font-display {
  font-family: "Space Grotesk", "HarmonyOS Sans", sans-serif;
  font-weight: 600;
}

:root {
  /* Backgrounds */
  --bg: #05070D;
  --bg-2: #080B12;
  --surface: #0B0F18;
  --surface-2: #11161F;
  /* Mars Red (primary accent / brand / CTA) */
  --mars: #D94A2B;
  --mars-bright: #FF5A36;
  /* AI Blue (tech / on-chain / secondary interaction) */
  --ai: #2E8CFF;
  --ai-bright: #4DA3FF;
  /* RWA Gold (assets / value / rank) */
  --gold: #D6A84F;
  --gold-bright: #F3C76A;
  /* Metallic Silver (borders / dividers) */
  --silver: #C7CDD6;
  --line: rgba(199,205,214,.14);
  /* Text */
  --text: #FFFFFF;
  --text-2: #B8C0CC;
  --text-3: #7D8794;

  /* Legacy aliases (kept to avoid breaking inline hex references) */
  --lightgold: var(--gold-bright);
  --dark: var(--bg);
  --grayx: var(--text-2);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "HarmonyOS Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  letter-spacing: 0.2px;
}

h1, h2, h3, h4, .font-display {
  font-family: "Space Grotesk", "HarmonyOS Sans", sans-serif;
  letter-spacing: 0.2px;
}

/* ── Glass Morphism (silver-edged deep space) ─────── */
.glass {
  background: linear-gradient(135deg, rgba(255,255,255,.05), rgba(255,255,255,.015));
  border: 1px solid var(--line);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.04),
    0 12px 30px rgba(0,0,0,.5);
  color: var(--text);
}

/* ── Grid Background ─────────────────────────────── */
.grid-bg {
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(199,205,214,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(199,205,214,.035) 1px, transparent 1px);
  background-size: 32px 32px;
}

/* ── Deep space backdrop with orbital arcs ───────── */
.space-bg {
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(217,74,43,.16), transparent 60%),
    radial-gradient(900px 500px at -10% 20%, rgba(46,140,255,.10), transparent 55%),
    var(--bg);
}

/* ── Bottom Nav Blur ─────────────────────────────── */
.bottom-nav-blur {
  background: rgba(5,7,13,.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--line);
}

/* ── Sidebar Collapsed ───────────────────────────── */
.sidebar-collapsed {
  width: 80px !important;
}
.sidebar-collapsed .sidebar-text,
.sidebar-collapsed .sidebar-card {
  display: none !important;
}
.main-expand {
  margin-left: 80px !important;
}

/* ── Scrollbar ───────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(255,255,255,.03);
}
::-webkit-scrollbar-thumb {
  background: rgba(199,205,214,.25);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(217,74,43,.6);
}

/* Utility: hide scrollbar while keeping scroll functionality */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* ── Form Inputs ─────────────────────────────────── */
.arbi-input {
  width: 100%;
  height: 3.5rem;
  border-radius: 1rem;
  background: rgba(0,0,0,.3);
  border: 1px solid rgba(255,255,255,.1);
  color: white;
  padding: 0 1rem;
  outline: none;
  transition: border-color .2s;
  font-size: 0.95rem;
}
.arbi-input:focus {
  border-color: rgba(46,140,255,.55);
}
.arbi-input::placeholder {
  color: var(--text-3);
}

/* ── Buttons ─────────────────────────────────────── */
/* Primary = Mars Red (brand / main CTA) */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  border-radius: .75rem;
  background: linear-gradient(to right, var(--mars), var(--mars-bright));
  color: #fff;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: opacity .2s, box-shadow .2s;
  box-shadow: 0 8px 24px rgba(217,74,43,.28);
}
.btn-primary:hover { opacity: .92; }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }

/* AI Blue = secondary / on-chain action */
.btn-ai {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  border-radius: .75rem;
  background: linear-gradient(to right, var(--ai), var(--ai-bright));
  color: #fff;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: opacity .2s;
  box-shadow: 0 8px 24px rgba(46,140,255,.24);
}
.btn-ai:hover { opacity: .92; }
.btn-ai:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }

/* Gold = value / assets emphasis */
.btn-gold {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  height: 3.5rem;
  border-radius: 1rem;
  background: linear-gradient(to right, var(--gold), var(--gold-bright));
  color: #000;
  font-weight: 800;
  transition: opacity .2s;
  box-shadow: 0 8px 24px rgba(214,168,79,.22);
  border: none;
  cursor: pointer;
  width: 100%;
}
.btn-gold:hover { opacity: .9; }
.btn-gold:disabled { opacity: .5; cursor: not-allowed; }

/* Outline = neutral silver */
.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  height: 2.5rem;
  padding: 0 1.25rem;
  border-radius: .75rem;
  border: 1px solid var(--line);
  background: rgba(199,205,214,.06);
  color: var(--text);
  font-weight: 600;
  font-size: .875rem;
  cursor: pointer;
  transition: background .2s, border-color .2s;
}
.btn-outline:hover { background: rgba(199,205,214,.12); border-color: rgba(199,205,214,.3); }

/* ── Status Badges ───────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: .2rem .75rem;
  border-radius: 99px;
  font-size: .75rem;
  font-weight: 700;
}
.badge-pending  { background: rgba(234,179,8,.15);  color: #eab308; }
.badge-approved { background: rgba(16,185,129,.15); color: #10b981; }
.badge-rejected { background: rgba(239,68,68,.15);  color: #ef4444; }
.badge-completed{ background: rgba(99,102,241,.15); color: #818cf8; }
.badge-active   { background: rgba(16,185,129,.15); color: #10b981; }
.badge-frozen   { background: rgba(156,163,175,.15);color: #9ca3af; }
.badge-processing{background: rgba(56,189,248,.15); color: #38bdf8; }
.badge-failed   { background: rgba(249,115,22,.15); color: #f97316; }
.badge-cancelled{ background: rgba(156,163,175,.15);color: #9ca3af; }

/* ── Table ───────────────────────────────────────── */
.arbi-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
.arbi-table thead tr {
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.arbi-table thead th {
  padding: .75rem 1rem;
  text-align: left;
  color: var(--text-3);
  font-weight: 600;
  white-space: nowrap;
}
.arbi-table tbody tr {
  border-bottom: 1px solid rgba(255,255,255,.04);
  transition: background .15s;
}
.arbi-table tbody tr:hover {
  background: rgba(255,255,255,.02);
}
.arbi-table tbody td {
  padding: .875rem 1rem;
  color: rgba(255,255,255,.85);
}

/* ── Alert ───────────────────────────────────────── */
.alert {
  padding: .875rem 1.25rem;
  border-radius: .875rem;
  font-size: .875rem;
  font-weight: 500;
}
.alert-success { background: rgba(16,185,129,.12); border: 1px solid rgba(16,185,129,.3); color: #34d399; }
.alert-error   { background: rgba(239,68,68,.12);  border: 1px solid rgba(239,68,68,.3);  color: #f87171; }
.alert-warning { background: rgba(234,179,8,.12);  border: 1px solid rgba(234,179,8,.3);  color: #fbbf24; }
.alert-info    { background: rgba(99,102,241,.12); border: 1px solid rgba(99,102,241,.3); color: #a5b4fc; }

/* ── Wallet Modal ────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.75);
  backdrop-filter: blur(8px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay.hidden { display: none; }

/* ── Admin Sidebar ───────────────────────────────── */
.admin-sidebar {
  background: var(--bg-2);
  border-right: 1px solid var(--line);
}

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 1023px) {
  #sidebar { transform: translateX(-100%); }
  #sidebar.open { transform: translateX(0); }
}

/* ── Animations ──────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn .3s ease forwards; }

@keyframes pulse-gold {
  0%, 100% { box-shadow: 0 0 0 0 rgba(217,74,43,.4); }
  50%       { box-shadow: 0 0 0 8px rgba(217,74,43,0); }
}
.pulse-gold { animation: pulse-gold 2s infinite; }

/* ── Toast Notification ──────────────────────────── */
#toast-container {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  pointer-events: none;
}
.toast {
  padding: .875rem 1.25rem;
  border-radius: .875rem;
  font-size: .875rem;
  font-weight: 600;
  pointer-events: auto;
  animation: fadeIn .3s ease forwards;
  max-width: 320px;
  backdrop-filter: blur(12px);
}
.toast-success { background: rgba(16,185,129,.92); color: white; }
.toast-error   { background: rgba(217,74,43,.92);  color: white; }
.toast-info    { background: rgba(46,140,255,.92);  color: #fff; }

/* ════════════════════════════════════════════════════
   NOP Tech — Mission-Control FX layer
   ════════════════════════════════════════════════════ */

/* ── Ambient background (fixed behind content) ─────── */
.fx-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.fx-backdrop > * { position: absolute; inset: 0; }

/* Starfield canvas */
#crm-starfield { width: 100%; height: 100%; opacity: .55; }

/* Static CSS star dust fallback / enhancement */
.starfield-css {
  background-image:
    radial-gradient(1px 1px at 12% 22%, rgba(255,255,255,.55), transparent 60%),
    radial-gradient(1px 1px at 78% 14%, rgba(199,205,214,.45), transparent 60%),
    radial-gradient(1px 1px at 38% 68%, rgba(255,90,54,.40), transparent 60%),
    radial-gradient(1px 1px at 64% 82%, rgba(255,255,255,.35), transparent 60%),
    radial-gradient(1px 1px at 88% 56%, rgba(46,140,255,.40), transparent 60%);
  opacity: .7;
}

/* Subtle nebula glow tied to brand palette */
.fx-nebula {
  background:
    radial-gradient(900px 480px at 82% -8%, rgba(217,74,43,.12), transparent 60%),
    radial-gradient(760px 420px at -8% 18%, rgba(46,140,255,.08), transparent 55%);
}

/* Slow-drifting scan line */
.scanline-overlay {
  background: linear-gradient(rgba(46,140,255,.05) 1px, transparent 1px);
  background-size: 100% 4px;
  mix-blend-mode: screen;
  opacity: .25;
  animation: scanDrift 12s linear infinite;
}
@keyframes scanDrift {
  from { background-position: 0 0; }
  to   { background-position: 0 200px; }
}

/* ── Tech accent line (mars → gold → ai) ───────────── */
.tech-line {
  height: 1px;
  background: linear-gradient(90deg, var(--mars), var(--gold), var(--ai));
  box-shadow: 0 0 14px rgba(46,140,255,.35);
}

/* ── Kicker label (mono uppercase) ─────────────────── */
.tech-kicker {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--text-3);
}

/* ── Tech card with bracket corners + edge glow ────── */
.tech-card {
  position: relative;
  background: linear-gradient(135deg, rgba(255,255,255,.05), rgba(255,255,255,.015));
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: border-color .25s, box-shadow .25s;
}
.tech-card::before,
.tech-card::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--silver);
  opacity: .35;
  transition: opacity .25s, border-color .25s;
}
.tech-card::before { top: 10px; left: 10px; border-right: 0; border-bottom: 0; }
.tech-card::after  { bottom: 10px; right: 10px; border-left: 0; border-top: 0; }
.tech-card:hover {
  border-color: rgba(46,140,255,.4);
  box-shadow: 0 0 26px rgba(46,140,255,.12);
}
.tech-card:hover::before,
.tech-card:hover::after { opacity: .7; border-color: var(--ai); }

/* Accent edge variants */
.edge-mars { border-left: 2px solid var(--mars); }
.edge-ai   { border-left: 2px solid var(--ai); }
.edge-gold { border-left: 2px solid var(--gold); }

/* ── Stat glows ────────────────────────────────────── */
.stat-glow-mars { text-shadow: 0 0 18px rgba(255,90,54,.45); }
.stat-glow-ai   { text-shadow: 0 0 18px rgba(46,140,255,.45); }
.stat-glow-gold { text-shadow: 0 0 18px rgba(243,199,106,.45); }

/* ── Orbit ring (decorative, slow rotate) ──────────── */
.orbit-ring { animation: orbitSpin 26s linear infinite; transform-origin: center; }
.orbit-ring-rev { animation: orbitSpin 38s linear infinite reverse; transform-origin: center; }
@keyframes orbitSpin { to { transform: rotate(360deg); } }

/* ── Status LED ────────────────────────────────────── */
.led { width: 8px; height: 8px; border-radius: 99px; display: inline-block; }
.led-active  { background: #10b981; box-shadow: 0 0 8px #10b981; animation: ledPulse 1.8s ease-in-out infinite; }
.led-pending { background: #eab308; box-shadow: 0 0 8px #eab308; }
.led-closed  { background: #6b7280; }
@keyframes ledPulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* ── Staggered entrance ────────────────────────────── */
.stagger-children > * {
  opacity: 0;
  transform: translateY(12px);
  animation: staggerIn .5s cubic-bezier(.22,.61,.36,1) forwards;
}
.stagger-children > *:nth-child(1) { animation-delay: .04s; }
.stagger-children > *:nth-child(2) { animation-delay: .10s; }
.stagger-children > *:nth-child(3) { animation-delay: .16s; }
.stagger-children > *:nth-child(4) { animation-delay: .22s; }
.stagger-children > *:nth-child(5) { animation-delay: .28s; }
.stagger-children > *:nth-child(6) { animation-delay: .34s; }
.stagger-children > *:nth-child(7) { animation-delay: .40s; }
.stagger-children > *:nth-child(8) { animation-delay: .46s; }
@keyframes staggerIn { to { opacity: 1; transform: translateY(0); } }

/* ── Reduced motion: disable all decorative animation ── */
@media (prefers-reduced-motion: reduce) {
  .scanline-overlay,
  .orbit-ring,
  .orbit-ring-rev,
  .led-active,
  .pulse-gold { animation: none !important; }
  #crm-starfield { display: none !important; }
  .stagger-children > * { opacity: 1 !important; transform: none !important; animation: none !important; }
  .fade-in { animation: none !important; }
}

/* ════════════════════════════════════════════════════════════
   LOGIN STAGE — grand deep-space sign-in (3D Mars orb + aurora)
════════════════════════════════════════════════════════════ */

/* Large blurred aurora sweeps for depth / atmosphere */
.login-aurora {
  position: fixed;
  inset: -20%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(680px 520px at 18% 28%, rgba(217,74,43,.22), transparent 60%),
    radial-gradient(720px 560px at 84% 72%, rgba(46,140,255,.18), transparent 62%),
    radial-gradient(560px 460px at 60% 6%,  rgba(214,168,79,.12), transparent 60%);
  filter: blur(36px);
  opacity: .9;
  animation: auroraDrift 18s ease-in-out infinite alternate;
}
@keyframes auroraDrift {
  from { transform: translate3d(-2%, -1%, 0) scale(1); }
  to   { transform: translate3d(2%, 1.5%, 0) scale(1.06); }
}

/* Mars orb stage — anchored bottom-right, floats slowly */
.login-orb-wrap {
  position: fixed;
  z-index: 0;
  right: -120px;
  bottom: -120px;
  width: 520px;
  height: 520px;
  pointer-events: none;
  animation: orbFloat 14s ease-in-out infinite alternate;
}
.login-orb-wrap .login-orbit {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
@keyframes orbFloat {
  from { transform: translateY(0) rotate(-2deg); }
  to   { transform: translateY(-26px) rotate(2deg); }
}

/* The 3D planet: layered radial gradients + inner shadow + outer glow */
.login-orb {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 280px;
  height: 280px;
  margin: -140px 0 0 -140px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, rgba(255,180,140,.95), rgba(217,74,43,.95) 34%, rgba(120,28,14,1) 72%, rgba(60,12,6,1) 100%),
    radial-gradient(circle at 70% 78%, rgba(46,140,255,.25), transparent 50%);
  box-shadow:
    inset -34px -30px 70px rgba(0,0,0,.7),
    inset 24px 20px 60px rgba(255,170,120,.25),
    0 0 70px rgba(217,74,43,.45),
    0 0 140px rgba(217,74,43,.25);
}
/* Subtle surface speckle for texture */
.login-orb::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background-image:
    radial-gradient(2px 2px at 40% 35%, rgba(0,0,0,.25), transparent 60%),
    radial-gradient(3px 3px at 62% 58%, rgba(0,0,0,.2), transparent 60%),
    radial-gradient(2px 2px at 30% 66%, rgba(0,0,0,.18), transparent 60%);
  opacity: .6;
  mix-blend-mode: multiply;
}

/* Login card subtle perspective depth */
.login-card { perspective: 1200px; }
.login-card .tech-card {
  transform: translateZ(0) rotateX(.6deg);
  box-shadow: 0 30px 80px rgba(0,0,0,.55), 0 0 28px rgba(214,168,79,.10);
}

@media (max-width: 640px) {
  .login-orb-wrap { width: 360px; height: 360px; right: -120px; bottom: -90px; }
  .login-orb { width: 200px; height: 200px; margin: -100px 0 0 -100px; }
}

@media (prefers-reduced-motion: reduce) {
  .login-aurora,
  .login-orb-wrap { animation: none !important; }
}

/* ════════════════════════════════════════════════════════════
   NOP POOL — Recent Weekly Payouts chart (pure SVG)
════════════════════════════════════════════════════════════ */
.pool-chart { position: relative; width: 100%; }
.pool-chart-svg { width: 100%; height: auto; display: block; overflow: visible; }

.pool-grid-line { stroke: rgba(255,255,255,.06); stroke-width: 1; }

.pool-bar {
  fill: url(#poolBarGrad);
  filter: drop-shadow(0 0 6px rgba(46,140,255,.35));
  transition: opacity .2s;
  transform-box: fill-box;
  transform-origin: bottom;
}
.pool-bar.anim { animation: poolBarRise .6s cubic-bezier(.22,.61,.36,1) backwards; }
@keyframes poolBarRise { from { transform: scaleY(0); opacity: .2; } to { transform: scaleY(1); opacity: 1; } }
.pool-bar-g:hover .pool-bar { filter: drop-shadow(0 0 12px rgba(255,90,54,.6)); }

.pool-bar-empty {
  fill: none;
  stroke: rgba(255,255,255,.12);
  stroke-width: 1.2;
  stroke-dasharray: 3 3;
}

.pool-bar-val {
  fill: var(--silver, #C7CDD6);
  font-size: 9px;
  font-weight: 700;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
.pool-axis-x {
  fill: var(--text-3, #7D8794);
  font-size: 9px;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

.pool-chart-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--text-3, #7D8794);
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .pool-bar.anim { animation: none !important; }
}

/* ── Bottom Nav (NOP-Dapp style) ─────────────────── */
.bottom-nav-dapp {
  min-height: 78px;
  padding: .5rem .5rem max(.7rem, env(safe-area-inset-bottom, 0px));
  border: 1px solid rgba(100, 116, 139, 0.25);
  border-bottom: none;
  border-radius: 22px 22px 0 0;
  background: rgba(7, 17, 31, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 -12px 36px rgba(0, 0, 0, 0.28);
}
.bottom-nav-dapp__grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: end;
  max-width: 100%;
}
.bottom-nav-dapp__item {
  display: flex;
  min-height: 3.5rem;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  border-radius: 0.75rem;
  font-size: 0.75rem; /* text-xs — project.php nav */
  line-height: 1rem;
  color: #64748b;
  text-decoration: none;
  transition: color .15s, background .15s;
}
.bottom-nav-dapp__item:hover {
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.035);
}
.bottom-nav-dapp__item.is-active {
  color: #fdba74;
  font-weight: 500;
}
.bottom-nav-dapp__item.is-active .bottom-nav-dapp__icon {
  opacity: 1;
  filter: none;
}
.bottom-nav-dapp__item:not(.is-active) .bottom-nav-dapp__icon {
  opacity: 0.45;
  filter: grayscale(1);
}
.bottom-nav-dapp__icon {
  width: 1.5rem;
  height: 1.5rem;
  flex-shrink: 0;
  transition: opacity .15s, filter .15s;
}
.bottom-nav-dapp__item span {
  line-height: 1;
  white-space: nowrap;
  font-size: 0.75rem;
}
.bottom-nav-dapp__fab-slot {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 3.5rem;
  pointer-events: none;
}
.bottom-nav-fab--placeholder {
  position: absolute;
  bottom: 1.25rem;
  display: grid;
  width: 4.375rem;
  height: 4.375rem;
  place-items: center;
  border-radius: 9999px;
  border: 1px solid rgba(253, 186, 116, 0.6);
  background: #08111f;
  padding: 2px;
  box-shadow:
    0 0 0 5px rgba(8, 17, 31, 0.92),
    0 0 28px rgba(218, 105, 54, 0.36);
  transition: box-shadow .2s, transform .2s;
}
.bottom-nav-fab__img {
  width: 100%;
  height: 100%;
  border-radius: 9999px;
  object-fit: cover;
}

/* ════════════════════════════════════════════════════════════
   RWA Home — NOP-Dapp visual migration
════════════════════════════════════════════════════════════ */
.rwa-home--dapp {
  --rwa-copper: #e78756;
  --rwa-copper-bright: #ee9b70;
  --rwa-emerald: #6ee7b7;
  --rwa-t-cols: 188px max-content 178px 196px;
  --rwa-t-min: 720px;
  --rwa-t-gap: 0.75rem;
}

/* NOP-Dapp shared utilities (project.php) */
.glass {
  background: linear-gradient(135deg, rgba(19, 31, 50, .94), rgba(5, 14, 28, .96));
  border: 1px solid rgba(142, 164, 196, .16);
}
.hero-shade {
  background:
    linear-gradient(90deg, rgba(2, 7, 17, .95) 0%, rgba(2, 7, 17, .56) 46%, rgba(2, 7, 17, .06) 80%),
    linear-gradient(0deg, #050b18 0%, transparent 36%);
}
.scrollbar-none::-webkit-scrollbar { display: none; }
.scrollbar-none { scrollbar-width: none; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Table — subgrid layout + project.php row typography */
#rwa-table-scroll.is-dragging { cursor: grabbing; user-select: none; }
.rwa-table-scroll { touch-action: pan-x pan-y; -webkit-overflow-scrolling: touch; }
.rwa-table-inner {
  display: grid;
  grid-template-columns: var(--rwa-t-cols);
  column-gap: var(--rwa-t-gap);
}
#rwa-list { display: contents; }

.rwa-table-head,
.project-row {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: subgrid;
  align-items: center;
  padding-left: 1rem;
  padding-right: 1rem;
}

.rwa-table-head {
  padding-top: 0.625rem;
  padding-bottom: 0.625rem;
  border-bottom: 1px solid rgba(30, 41, 59, 0.8);
  font-size: 0.75rem; /* text-xs */
  line-height: 1rem;
  color: #94a3b8;
}
.rwa-th-btn {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  color: inherit;
  font: inherit;
  font-size: inherit;
  cursor: pointer;
  text-align: left;
  transition: color .15s;
}
.rwa-th-btn:hover { color: #fff; }
.rwa-th-btn.is-active { color: #fff; }

.project-row {
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(30, 41, 59, 0.7);
  transition: background .12s;
}
.project-row:last-child { border-bottom: none; }
.project-row:hover { background: rgba(30, 41, 59, 0.25); }

/* Project cell — text-sm name, text-xs symbol, logo 2.5rem (compact) */
.rwa-cell-project {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  min-width: 0;
}
.rwa-cell-logo {
  display: grid;
  width: 2.5rem;
  height: 2.5rem;
  flex-shrink: 0;
  place-items: center;
  overflow: hidden;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(226, 232, 240, 0.9);
}
.rwa-cell-logo img { width: 100%; height: 100%; object-fit: cover; }
.rwa-cell-logo--fallback,
.rwa-cell-logo-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 1.125rem; /* text-lg */
  font-weight: 700;
  color: #1e293b;
}
.rwa-cell-logo--fallback { background: #f4f2eb; }
.rwa-cell-text { min-width: 0; }
.rwa-cell-name {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.875rem; /* text-sm */
  font-weight: 500;
  line-height: 1.25rem;
  color: #fff;
}
.rwa-cell-symbol {
  margin: 0;
  font-size: 0.75rem; /* text-xs */
  line-height: 1rem;
  color: rgba(253, 186, 116, 0.85);
}

/* Type pill — shared column track (subgrid), auto width, left-aligned */
.rwa-table-head > :nth-child(2),
.rwa-cell-type-wrap {
  justify-self: start;
  white-space: nowrap;
}
.rwa-cell-type {
  display: inline-flex;
  padding: 0.375rem 0.625rem;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  line-height: 1rem;
  color: #6ee7b7;
  background: rgba(6, 78, 59, 0.3);
  white-space: nowrap;
}

/* Chains — size-7 (1.75rem), gap-1.5 */
.rwa-cell-chains {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}
.rwa-cell-chain {
  display: grid;
  width: 1.75rem;
  height: 1.75rem;
  flex-shrink: 0;
  place-items: center;
  overflow: hidden;
  border-radius: 9999px;
  font-size: 0.75rem;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.rwa-cell-chain img { width: 100%; height: 100%; object-fit: cover; }
.rwa-cell-chain-fb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 0.625rem;
  font-weight: 700;
  color: #fff;
  background: rgba(99, 102, 241, 0.55);
}
.rwa-cell-chain-empty { font-size: 0.75rem; color: #64748b; }
.rwa-cell-chain-more {
  flex-shrink: 0;
  padding: 0;
  border: none;
  background: none;
  font-size: 0.75rem;
  line-height: 1.75rem;
  color: #94a3b8;
  cursor: pointer;
  transition: color .15s;
}
.rwa-cell-chain-more:hover { color: #fdba74; }

.rwa-chains-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.rwa-chains-modal.hidden { display: none; }
.rwa-chains-modal__backdrop {
  position: absolute;
  inset: 0;
  border: none;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(4px);
  cursor: pointer;
}
.rwa-chains-modal__panel {
  position: relative;
  z-index: 1;
  width: min(100%, 20rem);
  max-height: min(70vh, 24rem);
  overflow: hidden;
  border-radius: 1rem;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
}
.rwa-chains-modal__list {
  list-style: none;
  margin: 0;
  padding: 0.5rem 0;
  max-height: calc(min(70vh, 24rem) - 3rem);
  overflow-y: auto;
}
.rwa-chains-modal__item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1rem;
}
.rwa-chains-modal__name {
  font-size: 0.875rem;
  color: #e2e8f0;
}

/* APY — font-mono text-base, sparkline h-7 w-24 */
.rwa-cell-apy { text-align: left; }
.rwa-cell-apy-val {
  margin: 0;
  font-family: "JetBrains Mono", ui-monospace, Menlo, monospace;
  font-size: 1rem; /* text-base */
  font-weight: 500;
  line-height: 1.5rem;
  color: #6ee7b7;
}
.rwa-cell-apy-val--hot { color: #fdba74; }
.rwa-cell-apy-val--na { color: #64748b; }
.rwa-cell-spark {
  display: inline-block;
  margin-top: 0.25rem;
  width: 6rem;
  height: 1.75rem;
  overflow: visible;
  color: #34d399;
  line-height: 0;
}
.rwa-cell-spark--hot { color: #fb923c; }
.rwa-cell-spark .rwa-sparkline { width: 100%; height: 100%; display: block; }

.rwa-cell-chevron {
  display: block;
  font-size: 1.25rem; /* text-xl */
  line-height: 1;
  color: #64748b;
  transition: color .15s, transform .15s;
}

.rwa-no-data {
  grid-column: 1 / -1;
  padding: 3.5rem 1.25rem;
  text-align: center;
  font-size: 0.875rem;
  color: #94a3b8;
}

@media (min-width: 640px) {
  .rwa-home--dapp {
    --rwa-t-cols: 220px max-content 210px 230px;
    --rwa-t-min: 840px;
    --rwa-t-gap: 1rem;
  }
  .rwa-cell-logo { width: 2.75rem; height: 2.75rem; }
  .project-row { padding-top: 1rem; padding-bottom: 1rem; }
  .rwa-table-head { padding-left: 1.25rem; padding-right: 1.25rem; }
  .project-row { padding-left: 1.25rem; padding-right: 1.25rem; }
}

/* Fallback when subgrid unavailable: fixed type column keeps rows aligned */
@supports not (grid-template-columns: subgrid) {
  .rwa-table-inner { display: block; }
  #rwa-list { display: block; }
  .rwa-table-head,
  .project-row {
    grid-column: auto;
    grid-template-columns: var(--rwa-t-cols-fallback, 188px 6rem 178px 196px);
    column-gap: var(--rwa-t-gap);
  }
  @media (min-width: 640px) {
    .rwa-home--dapp {
      --rwa-t-cols-fallback: 220px 6.5rem 210px 230px;
    }
  }
}

/* ════════════════════════════════════════════════════════════
   ADMIN — User Hierarchy Tree (CSS nested tree)
════════════════════════════════════════════════════════════ */
.hierarchy-tree ul { list-style: none; padding-left: 22px; margin: 0; position: relative; }
.hierarchy-tree > ul { padding-left: 0; }
.hierarchy-tree li { position: relative; padding: 6px 0; }
.hierarchy-tree ul ul { border-left: 1px solid rgba(255,255,255,.12); margin-left: 8px; }
.hierarchy-tree ul ul li::before {
  content: "";
  position: absolute;
  top: 18px; left: -14px;
  width: 14px; height: 1px;
  background: rgba(255,255,255,.12);
}
.tree-node {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  padding: 5px 10px;
}
.tree-rank {
  font-size: 10px;
  font-weight: 800;
  border-radius: 6px;
  padding: 2px 6px;
  border: 1px solid;
}
.tree-uid { font-family: ui-monospace, Menlo, monospace; font-size: 12px; font-weight: 700; color: #f3dba0; }
.tree-meta { font-size: 11px; color: #b0b0b0; display: inline-flex; align-items: center; gap: 5px; }
