/* =====================================================
   Ecosystem Việt Nam - Frontend Design System
   Mobile-first, professional, lightweight
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ========= TOKENS ========= */
:root {
  /* Brand */
  --primary: #16a34a;
  --primary-dark: #15803d;
  --primary-darker: #064e3b;
  --primary-soft: #dcfce7;
  --primary-tint: #f0fdf4;
  --accent: #06b6d4;

  /* Lab / Space accents */
  --neon: #4ade80;
  /* bio-luminescent green */
  --neon-soft: #86efac;
  --neon-cyan: #22d3ee;
  --space-deep: #061226;
  /* deep space navy */
  --space-mid: #0a1f2e;
  --space-soft: rgba(6, 18, 38, .85);

  /* Glow */
  --glow-green: 0 0 24px rgba(74, 222, 128, .35);
  --glow-cyan: 0 0 24px rgba(34, 211, 238, .30);
  --glow-soft: 0 0 0 1px rgba(74, 222, 128, .35), 0 8px 24px rgba(6, 182, 212, .18);

  /* Neutrals */
  --bg: #f5faf6;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --text: #334155;
  --text-dark: #0f172a;
  --text-muted: #64748b;

  /* Semantic */
  --success: #16a34a;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #0ea5e9;

  /* Effects */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
  --shadow: 0 4px 12px rgba(15, 23, 42, .06), 0 2px 4px rgba(15, 23, 42, .04);
  --shadow-lg: 0 12px 28px rgba(15, 23, 42, .10), 0 4px 8px rgba(15, 23, 42, .05);
  --ring: 0 0 0 3px rgba(22, 163, 74, .18);

  /* Radius */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* Type */
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, Menlo, monospace;

  /* Layout */
  --container: 1200px;
  --header-h: 64px;
}

/* ========= RESET / BASE ========= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 8px);
  overflow-x: hidden;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Subtle bio-grid backdrop across the whole site */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(1200px 600px at 90% -10%, rgba(34, 211, 238, .10), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(74, 222, 128, .10), transparent 60%),
    var(--bg);
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(22, 163, 74, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(22, 163, 74, .05) 1px, transparent 1px);
  background-size: 36px 36px;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 80%);
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 80%);
}

img {
  max-width: 100%;
  display: block;
  height: auto;
}

a {
  color: var(--primary-dark);
  text-decoration: none;
  transition: color .15s ease;
}

a:hover {
  color: var(--primary);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--text-dark);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
  margin: 0 0 .6em;
}

h1 {
  font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2rem);
}

h2 {
  font-size: clamp(1.25rem, 1.1rem + 0.8vw, 1.6rem);
}

h3 {
  font-size: clamp(1.05rem, 1rem + 0.4vw, 1.2rem);
}

p {
  margin: 0 0 1em;
}

ul,
ol {
  padding-left: 1.2em;
  margin: 0 0 1em;
}

code {
  font-family: 'JetBrains Mono', Consolas, Menlo, monospace;
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: .9em;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ========= LAYOUT ========= */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 16px;
}

.main-content {
  flex: 1 0 auto;
  padding: 16px 0 32px;
}

@media (min-width: 768px) {
  .container {
    padding: 0 24px;
  }

  .main-content {
    padding: 24px 0 48px;
  }
}

/* ========= NAVBAR ========= */
.site-header {
  background: rgba(255, 255, 255, .78);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: var(--header-h);
  box-shadow: 0 1px 0 rgba(74, 222, 128, .18), var(--shadow-xs);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--header-h);
}

.nav-brand a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-dark) !important;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.015em;
}

.nav-brand img {
  height: 28px;
  width: auto;
}

.nav-brand i {
  color: var(--primary);
  font-size: 1.25rem;
}

/* Hamburger */
.nav-hamburger {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  padding: 0 10px;
  transition: .2s;
  -webkit-tap-highlight-color: rgba(74, 222, 128, .15);
}

.nav-hamburger:hover {
  background: var(--primary-soft);
  border-color: var(--primary);
}

.nav-hamburger span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text-dark);
  border-radius: 2px;
  transition: .2s;
}

.nav-menu {
  position: fixed;
  inset: var(--header-h) 0 0 0;
  background: var(--surface);
  padding: 12px 16px 32px;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform .25s ease;
  z-index: 99;
  box-shadow: var(--shadow-lg);
  border-top: 1px solid var(--border);
}

.nav-menu.open {
  transform: translateX(0);
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  color: var(--text-dark);
  font-weight: 600;
  font-size: .95rem;
  border-radius: var(--radius);
  transition: .15s;
  background: transparent;
  border: none;
  font-family: inherit;
  cursor: pointer;
  width: 100%;
  text-align: left;
}

.nav-link i {
  color: var(--primary);
  width: 20px;
  text-align: center;
}

.nav-link:hover {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

/* Dropdown */
.nav-dropdown {
  position: relative;
}

.dropdown-caret {
  margin-left: auto;
  font-size: .7rem !important;
  color: var(--text-muted) !important;
  transition: transform .2s ease;
  width: auto !important;
}

.nav-dropdown.active .dropdown-caret {
  transform: rotate(180deg);
}

/* Mobile: accordion-style nested list */
.dropdown-menu {
  list-style: none;
  padding: 4px 0 4px 12px;
  margin: 4px 0 0 28px;
  display: none;
  background: transparent;
  border: none;
  border-left: 2px solid var(--primary-soft);
  box-shadow: none;
  border-radius: 0;
}

.nav-dropdown.active>.dropdown-menu {
  display: block;
}

.dropdown-menu li {
  list-style: none;
}

.dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  font-size: .9rem;
  font-weight: 500;
  color: var(--text-dark);
  border-radius: 8px;
  white-space: nowrap;
}

.dropdown-menu a i {
  color: var(--primary);
  width: 18px;
  text-align: center;
}

.dropdown-menu a:hover {
  background: linear-gradient(90deg, var(--primary-soft), rgba(34, 211, 238, .12));
  color: var(--primary-dark);
}

.dropdown-menu a.text-danger {
  color: var(--danger) !important;
}

.dropdown-menu a.text-danger i {
  color: var(--danger);
}

.dropdown-menu a.text-danger:hover {
  background: #fee2e2;
}

.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 4px;
}

.nav-list .btn {
  width: 100%;
  justify-content: center;
  margin-top: 6px;
}

@media (min-width: 992px) {
  .nav-hamburger {
    display: none;
  }

  .nav-menu {
    position: static;
    inset: auto;
    padding: 0;
    background: transparent;
    box-shadow: none;
    border: none;
    transform: none;
    overflow: visible;
  }

  .nav-list {
    flex-direction: row;
    align-items: center;
    gap: 4px;
  }

  .nav-list .btn {
    width: auto;
    margin-top: 0;
  }

  .nav-link {
    padding: 8px 14px;
    font-size: .9rem;
    width: auto;
    border-radius: 999px;
  }

  .nav-link:hover {
    background: var(--primary-soft);
    color: var(--primary-dark);
  }

  /* Desktop dropdown: hover open + animation */
  .dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 220px;
    padding: 6px;
    margin: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 18px 40px -16px rgba(6, 18, 38, .18), 0 0 0 1px rgba(74, 222, 128, .18);
    display: block;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity .2s ease, transform .2s ease, visibility .2s;
    z-index: 110;
  }

  .nav-dropdown:hover>.dropdown-menu,
  .nav-dropdown.active>.dropdown-menu,
  .nav-dropdown:focus-within>.dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  /* Bridge so cursor can travel to menu without closing */
  .nav-dropdown::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 12px;
  }

  .dropdown-end {
    left: auto;
    right: 0;
  }

  .nav-cta {
    margin-left: 4px;
  }

  .nav-user .nav-link {
    background: var(--primary-soft);
    color: var(--primary-dark);
  }

  .nav-user .nav-link i.fa-user-astronaut {
    color: var(--primary-dark);
  }
}

/* ========= BUTTONS ========= */
.btn {
  --btn-bg: var(--primary);
  --btn-color: #fff;
  --btn-border: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  min-height: 40px;
  font-family: inherit;
  font-size: .92rem;
  font-weight: 600;
  line-height: 1.2;
  border-radius: 999px;
  border: 1px solid var(--btn-border);
  background: var(--btn-bg);
  color: var(--btn-color);
  cursor: pointer;
  transition: transform .12s ease, box-shadow .15s ease, background .15s ease, color .15s ease, border-color .15s ease;
  white-space: nowrap;
  text-decoration: none;
  -webkit-tap-highlight-color: rgba(74, 222, 128, .15);
  touch-action: manipulation;
}

@media (max-width: 600px) {
  .btn {
    min-height: 44px;
    padding: 11px 18px;
  }

  .btn-sm {
    min-height: 36px;
    padding: 8px 14px;
  }
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn:active {
  transform: translateY(0);
}

.btn:focus-visible {
  box-shadow: var(--ring);
  outline: none;
}

.btn-primary {
  --btn-bg: var(--primary);
  --btn-color: #fff;
  --btn-border: var(--primary);
  background-image: linear-gradient(135deg, var(--primary) 0%, #22c55e 50%, var(--accent) 130%);
  box-shadow: 0 6px 18px -6px rgba(22, 163, 74, .55), inset 0 0 0 1px rgba(255, 255, 255, .12);
}

.btn-primary:hover {
  --btn-bg: var(--primary-dark);
  --btn-border: var(--primary-dark);
  color: #fff;
  box-shadow: 0 10px 24px -8px rgba(22, 163, 74, .65), 0 0 0 4px rgba(74, 222, 128, .18);
}

.btn-outline {
  --btn-bg: transparent;
  --btn-color: var(--primary-dark);
  --btn-border: var(--primary);
}

.btn-outline:hover {
  --btn-bg: var(--primary);
  --btn-color: #fff;
}

.btn-outline-light {
  --btn-bg: transparent;
  --btn-color: #fff;
  --btn-border: rgba(255, 255, 255, .7);
}

.btn-outline-light:hover {
  --btn-bg: #fff;
  --btn-color: var(--primary-dark);
  --btn-border: #fff;
}

.btn-secondary {
  --btn-bg: var(--surface);
  --btn-color: var(--text-dark);
  --btn-border: var(--border-strong);
}

.btn-secondary:hover {
  --btn-bg: var(--surface-2);
  --btn-border: var(--text-muted);
  color: var(--text-dark);
}

.btn-info {
  --btn-bg: var(--info);
  --btn-color: #fff;
  --btn-border: var(--info);
}

.btn-info:hover {
  filter: brightness(.95);
  color: #fff;
}

.btn-warning {
  --btn-bg: var(--warning);
  --btn-color: #fff;
  --btn-border: var(--warning);
}

.btn-warning:hover {
  filter: brightness(.95);
  color: #fff;
}

.btn-danger {
  --btn-bg: var(--danger);
  --btn-color: #fff;
  --btn-border: var(--danger);
}

.btn-danger:hover {
  filter: brightness(.95);
  color: #fff;
}

.btn-success {
  --btn-bg: var(--success);
  --btn-color: #fff;
  --btn-border: var(--success);
}

.btn-success:hover {
  filter: brightness(.95);
  color: #fff;
}

.btn-sm {
  padding: 6px 12px;
  font-size: .82rem;
}

.btn-lg {
  padding: 14px 26px;
  font-size: 1rem;
}

.btn-block {
  width: 100%;
}

.btn-link {
  background: none;
  border: none;
  padding: 4px 8px;
  color: var(--primary-dark);
  font: inherit;
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.btn-link:hover {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

/* ========= HERO ========= */
.hero {
  position: relative;
  background:
    radial-gradient(900px 500px at 80% -20%, rgba(34, 211, 238, .35), transparent 55%),
    radial-gradient(700px 400px at -10% 110%, rgba(74, 222, 128, .35), transparent 55%),
    radial-gradient(500px 320px at 50% 50%, rgba(16, 185, 129, .35), transparent 60%),
    linear-gradient(135deg, #061226 0%, #0a1f2e 45%, #0f3a2e 100%);
  border-radius: var(--radius-xl);
  padding: 56px 22px;
  margin: 16px 0 32px;
  color: #e6fff4;
  text-align: center;
  overflow: hidden;
  box-shadow:
    0 30px 60px -20px rgba(6, 18, 38, .55),
    inset 0 0 0 1px rgba(74, 222, 128, .18),
    inset 0 0 60px rgba(34, 211, 238, .08);
}

/* Tech grid + glow scanlines */
.hero-bg-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(74, 222, 128, .18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, .14) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 35%, transparent 85%);
  mask-image: radial-gradient(ellipse at center, #000 35%, transparent 85%);
  opacity: .55;
}

/* Orbiting particle ring */
.hero::before {
  content: '';
  position: absolute;
  width: 720px;
  height: 720px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px dashed rgba(74, 222, 128, .18);
  box-shadow:
    inset 0 0 80px rgba(34, 211, 238, .10),
    0 0 80px rgba(74, 222, 128, .06);
  pointer-events: none;
  animation: heroOrbit 60s linear infinite;
}

.hero::after {
  content: '';
  position: absolute;
  width: 380px;
  height: 380px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px solid rgba(34, 211, 238, .20);
  pointer-events: none;
  animation: heroOrbit 30s linear infinite reverse;
}

@keyframes heroOrbit {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

.floating-code-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.floating-code {
  position: absolute;
  bottom: -20px;
  font-family: var(--font-mono);
  font-size: .82rem;
  color: rgba(134, 239, 172, .7);
  text-shadow: 0 0 8px rgba(74, 222, 128, .5);
  white-space: nowrap;
  animation-name: floatUp;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}

@keyframes floatUp {
  0% {
    opacity: 0;
    transform: translateY(0);
  }

  10% {
    opacity: 1;
  }

  90% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translateY(-130vh);
  }
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 760px;
  margin: 0 auto;
}

.hero h1 {
  color: #fff;
  font-size: clamp(1.6rem, 4.5vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -.02em;
  margin-bottom: 14px;
  text-shadow: 0 0 28px rgba(74, 222, 128, .35);
}

.hero h1 i {
  color: var(--neon);
}

.hero .slogan {
  color: rgba(230, 255, 244, .9);
  font-size: clamp(.95rem, 2vw, 1.15rem);
  margin: 0 auto 22px;
  max-width: 560px;
}

.hero .badge-primary {
  background: rgba(74, 222, 128, .15);
  color: #bbf7d0;
  border: 1px solid rgba(74, 222, 128, .4);
  backdrop-filter: blur(6px);
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

@media (max-width: 480px) {
  .hero {
    padding: 40px 18px;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .hero::before {
    width: 480px;
    height: 480px;
  }

  .hero::after {
    width: 260px;
    height: 260px;
  }
}

/* ========= SECTION TITLE ========= */
.section-title {
  text-align: center;
  margin: 48px 0 28px;
  position: relative;
}

.section-title h2 {
  margin: 0 0 8px;
  position: relative;
  display: inline-block;
}

.section-title h2::after {
  content: '';
  display: block;
  width: 56px;
  height: 3px;
  margin: 10px auto 0;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 999px;
  box-shadow: 0 0 12px rgba(74, 222, 128, .55);
}

.section-title p {
  color: var(--text-muted);
  margin: 0;
}

/* ========= PILLARS ========= */
.pillars {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin: 0 0 40px;
}

.pillar-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 22px;
  text-align: center;
  box-shadow: var(--shadow-xs);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
  color: var(--text);
  overflow: hidden;
  isolation: isolate;
}

.pillar-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, transparent, rgba(74, 222, 128, .55) 40%, rgba(34, 211, 238, .45) 60%, transparent);
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity .25s ease;
  pointer-events: none;
  z-index: 1;
}

.pillar-card::after {
  content: '';
  position: absolute;
  inset: auto -40% -60% auto;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(74, 222, 128, .18), transparent 60%);
  border-radius: 50%;
  opacity: 0;
  transition: opacity .25s ease;
  pointer-events: none;
  z-index: 0;
}

.pillar-card:hover {
  transform: translateY(-4px);
  border-color: transparent;
  box-shadow: 0 20px 40px -16px rgba(6, 18, 38, .18), var(--glow-soft);
}

.pillar-card:hover::before {
  opacity: 1;
}

.pillar-card:hover::after {
  opacity: 1;
}

.pillar-card>* {
  position: relative;
  z-index: 2;
}

.pillar-icon-wrap {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  background:
    radial-gradient(circle at 30% 20%, rgba(74, 222, 128, .35), transparent 60%),
    linear-gradient(135deg, var(--primary-soft), #ecfeff);
  color: var(--primary-dark);
  font-size: 1.5rem;
  box-shadow: inset 0 0 0 1px rgba(74, 222, 128, .35), 0 4px 16px rgba(34, 211, 238, .18);
}

.pillar-card h3 {
  color: var(--text-dark);
  margin-bottom: 6px;
}

.pillar-card p {
  color: var(--text);
  font-size: .92rem;
  margin: 0 0 16px;
  flex: 1;
}

.pillar-card .btn {
  align-self: center;
}

@media (min-width: 600px) {
  .pillars {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 992px) {
  .pillars {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* ========= INFO GRID ========= */
.info-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 40px;
}

.info-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-xs);
}

.info-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  margin-bottom: 14px;
}

.info-block h3 {
  margin-bottom: 8px;
}

.info-block p {
  color: var(--text);
  margin: 0;
}

@media (min-width: 768px) {
  .info-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ========= CTA BANNER ========= */
.cta-banner {
  position: relative;
  background:
    radial-gradient(600px 300px at 100% -20%, rgba(34, 211, 238, .30), transparent 55%),
    radial-gradient(500px 240px at 0% 110%, rgba(74, 222, 128, .25), transparent 55%),
    linear-gradient(135deg, #061226, #0f3a2e);
  color: #fff;
  border-radius: var(--radius-xl);
  padding: 44px 22px;
  text-align: center;
  margin: 30px 0;
  box-shadow: 0 30px 60px -20px rgba(6, 18, 38, .55), inset 0 0 0 1px rgba(74, 222, 128, .18);
  overflow: hidden;
}

.cta-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(74, 222, 128, .10) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, .10) 1px, transparent 1px);
  background-size: 36px 36px;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 35%, transparent 85%);
  mask-image: radial-gradient(ellipse at center, #000 35%, transparent 85%);
  pointer-events: none;
}

.cta-banner>* {
  position: relative;
  z-index: 1;
}

.cta-banner h2 {
  color: #fff;
  margin-bottom: 8px;
  text-shadow: 0 0 24px rgba(74, 222, 128, .35);
}

.cta-banner p {
  color: rgba(255, 255, 255, .9);
  margin-bottom: 18px;
}

/* ========= CARDS / FORMS ========= */
.card,
.eco-card,
.form-card,
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  padding: 22px;
  margin-bottom: 20px;
}

.form-card {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.form-group {
  margin-bottom: 16px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: .9rem;
  color: var(--text-dark);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 11px 14px;
  font-family: inherit;
  font-size: 16px;
  /* prevent iOS zoom on focus */
  color: var(--text-dark);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  transition: border-color .15s, box-shadow .15s, background .15s;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.form-control::placeholder {
  color: #94a3b8;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--ring);
  background: #fff;
}

textarea.form-control {
  resize: vertical;
  min-height: 110px;
}

select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2364748b' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

@media (min-width: 992px) {
  .form-control {
    font-size: .95rem;
  }
}

.form-help {
  font-size: .82rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

@media (max-width: 480px) {
  .form-actions .btn {
    flex: 1 1 calc(50% - 5px);
  }

  .form-actions .btn:only-child {
    flex: 1 1 100%;
  }
}

/* Filter bar (consistent across listings) */
.filter-bar,
.filter-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-xs);
}

.filter-bar .form-group,
.filter-form .form-group {
  margin: 0;
}

.filter-bar .btn,
.filter-form .btn {
  align-self: flex-end;
}

@media (min-width: 768px) {
  .filter-bar {
    grid-template-columns: 1fr 220px auto auto;
    align-items: end;
  }

  .filter-form {
    grid-template-columns: repeat(4, 1fr);
    align-items: end;
  }
}

/* ========= ALERTS ========= */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  margin-bottom: 16px;
  font-size: .92rem;
  font-weight: 500;
  line-height: 1.4;
}

.alert-success {
  background: var(--primary-soft);
  color: var(--primary-darker);
  border-color: #bbf7d0;
}

.alert-error,
.alert-danger {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fecaca;
}

.alert-warning {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}

.alert-info {
  background: #e0f2fe;
  color: #075985;
  border-color: #bae6fd;
}

/* ========= BADGES ========= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .02em;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
  vertical-align: middle;
}

.badge-primary,
.badge-admin {
  background: var(--primary-soft);
  color: var(--primary-darker);
  border-color: #bbf7d0;
}

.badge-success,
.badge-active,
.badge-approved,
.badge-published,
.badge-resolved,
.badge-ongoing {
  background: #d1fae5;
  color: #065f46;
  border-color: #a7f3d0;
}

.badge-warning,
.badge-pending {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}

.badge-danger,
.badge-banned,
.badge-rejected {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fecaca;
}

.badge-info {
  background: #e0f2fe;
  color: #075985;
  border-color: #bae6fd;
}

.badge-secondary,
.badge-user,
.badge-hidden,
.badge-sold,
.badge-ended {
  background: #f1f5f9;
  color: #475569;
  border-color: #e2e8f0;
}

.badge-upcoming,
.badge-visible {
  background: #ecfeff;
  color: #0e7490;
  border-color: #cffafe;
}

/* ========= UTILITIES ========= */
.flex-between {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.flex-between h1 {
  font-size: clamp(1.25rem, 1rem + 1.6vw, 1.8rem);
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
}

@media (max-width: 600px) {
  .flex-between .btn {
    width: 100%;
  }
}

.text-center {
  text-align: center;
}

.text-muted {
  color: var(--text-muted) !important;
}

.text-primary {
  color: var(--primary-dark) !important;
}

.text-danger {
  color: var(--danger) !important;
}

.mt-1 {
  margin-top: 8px;
}

.mt-2 {
  margin-top: 16px;
}

.mt-3 {
  margin-top: 24px;
}

.mb-1 {
  margin-bottom: 8px;
}

.mb-2 {
  margin-bottom: 16px;
}

.mb-3 {
  margin-bottom: 24px;
}

/* ========= LIST ITEMS (forum, glossary, generic) ========= */
.list-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.list-item {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-xs);
  transition: border-color .2s, box-shadow .25s, transform .2s;
}

.list-item:hover {
  border-color: rgba(74, 222, 128, .55);
  box-shadow: 0 12px 28px -14px rgba(6, 18, 38, .18), 0 0 0 1px rgba(74, 222, 128, .35);
  transform: translateY(-2px);
}

.list-item h3 {
  margin: 0 0 8px;
}

.list-item h3 a {
  color: var(--text-dark);
}

.list-item h3 a:hover {
  color: var(--primary);
}

.meta {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--text-muted);
  font-size: .85rem;
  margin-bottom: 10px;
}

.meta i {
  color: var(--primary);
}

.excerpt {
  color: var(--text);
  margin: 8px 0 12px;
  font-size: .92rem;
}

.item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

/* Empty state */
.empty-state {
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
}

.empty-state .icon {
  font-size: 2.4rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.empty-state p {
  margin: 4px 0;
}

/* ========= MARKET (cards) ========= */
.market-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 480px) {
  .market-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .market-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1100px) {
  .market-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.market-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  transition: transform .25s, box-shadow .25s, border-color .25s;
}

.market-card:hover {
  transform: translateY(-4px);
  border-color: rgba(74, 222, 128, .55);
  box-shadow: 0 18px 32px -16px rgba(6, 18, 38, .22), 0 0 0 1px rgba(74, 222, 128, .3);
}

.market-img {
  width: 100%;
  aspect-ratio: 4/3;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #cbd5e1;
  font-size: 2rem;
  overflow: hidden;
}

.market-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.market-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 14px;
  gap: 6px;
}

.market-body h3 {
  font-size: 1rem;
  margin: 0;
}

.market-body h3 a {
  color: var(--text-dark);
}

.market-body h3 a:hover {
  color: var(--primary);
}

.market-price {
  color: var(--primary);
  font-weight: 800;
  font-size: 1.05rem;
}

.market-meta {
  font-size: .82rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
}

/* ========= USERS GRID ========= */
.users-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 480px) {
  .users-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .users-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1100px) {
  .users-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.user-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 16px;
  text-align: center;
  box-shadow: var(--shadow-xs);
  transition: .2s;
}

.user-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  box-shadow: var(--shadow);
}

.user-avatar-link {
  display: inline-block;
  margin-bottom: 10px;
}

.user-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--primary-soft);
  background: var(--primary-soft);
  color: var(--primary-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

.user-avatar-placeholder {
  background: var(--primary-soft);
}

.user-card h3 {
  font-size: 1rem;
  margin: 6px 0 4px;
}

.user-card h3 a {
  color: var(--text-dark);
}

.user-card h3 a:hover {
  color: var(--primary);
}

.user-username {
  font-size: .82rem;
  margin: 0 0 8px;
}

.user-bio {
  font-size: .85rem;
  color: var(--text);
  margin: 8px 0;
}

.user-actions {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 8px;
}

/* ========= CONTEST GRID ========= */
.contest-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 600px) {
  .contest-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 992px) {
  .contest-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.contest-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: .2s;
}

.contest-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  box-shadow: var(--shadow);
}

.contest-card h3 a {
  color: var(--text-dark);
}

.contest-card h3 a:hover {
  color: var(--primary);
}

.contest-card .prize {
  color: var(--primary-dark);
  font-weight: 600;
  margin: 4px 0;
}

.contest-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: .85rem;
  color: var(--text-muted);
}

.contest-meta i {
  color: var(--primary);
}

/* ========= PROFILE ========= */
.profile-header {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 22px;
}

.profile-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  overflow: hidden;
  flex-shrink: 0;
  border: 3px solid var(--primary-soft);
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-avatar-placeholder {
  width: 100%;
  height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.profile-info {
  flex: 1;
  min-width: 220px;
}

.profile-info h1 {
  margin: 0 0 4px;
}

.profile-username {
  font-size: .9rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.profile-bio {
  color: var(--text);
  margin: 8px 0;
}

.profile-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 16px 0 24px;
}

@media (min-width: 600px) {
  .profile-stats {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stat-mini {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-xs);
}

.stat-mini i {
  font-size: 1.2rem;
  color: var(--primary);
}

.stat-mini strong {
  display: block;
  font-size: 1.1rem;
  color: var(--text-dark);
  line-height: 1.1;
}

.stat-mini span {
  font-size: .78rem;
  color: var(--text-muted);
}

.profile-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.profile-list li {
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.profile-list li:last-child {
  border: none;
}

.profile-list li a {
  font-weight: 600;
  color: var(--text-dark);
}

.profile-list li a:hover {
  color: var(--primary);
}

/* ========= FORUM POST DETAIL & COMMENTS ========= */
.post-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: .88rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.post-author {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dark);
  font-weight: 600;
}

.post-author img,
.post-author .author-placeholder {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--primary-soft);
  color: var(--primary-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.post-content {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.7;
  color: var(--text);
}

.comment-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 14px;
  border-radius: var(--radius);
  margin-bottom: 12px;
}

.comment-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.comment-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.comment-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.comment-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.comment-author {
  font-weight: 700;
  color: var(--text-dark);
  font-size: .9rem;
}

.comment-time {
  font-size: .75rem;
  color: var(--text-muted);
}

.comment-content {
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.comment-actions {
  margin-top: 6px;
}

.comment-replies {
  margin-top: 10px;
  margin-left: 16px;
  padding-left: 12px;
  border-left: 2px solid var(--border-strong);
}

.reply-form {
  margin-top: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
}

.reply-form textarea {
  margin-bottom: 6px;
}

/* ========= CHAT ========= */
.chat-page {
  display: flex;
  flex-direction: column;
  height: clamp(420px, 70vh, 720px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}

@media (max-width: 600px) {
  .chat-page {
    height: calc(100dvh - var(--header-h) - 24px);
    margin: 0 -16px;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  background:
    radial-gradient(400px 160px at 100% 0%, rgba(34, 211, 238, .35), transparent 60%),
    linear-gradient(135deg, #061226 0%, #0f3a2e 100%);
  color: #fff;
  font-weight: 600;
  border-bottom: 1px solid rgba(74, 222, 128, .25);
  text-shadow: 0 0 12px rgba(74, 222, 128, .35);
}

.chat-header a {
  color: #fff;
}

.chat-partner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.partner-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, .3);
}

.partner-name {
  color: #fff !important;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 50vw;
}

.chat-partner-username {
  font-size: .8rem;
  opacity: .85;
  display: none;
}

@media (min-width: 600px) {
  .chat-partner-username {
    display: inline;
  }
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-msg {
  display: flex;
  gap: 8px;
  max-width: 90%;
  align-items: flex-end;
}

@media (min-width: 600px) {
  .chat-msg {
    max-width: 78%;
  }
}

.chat-msg.mine {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.msg-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  font-size: .85rem;
}

.msg-avatar.msg-avatar-fa {
  background: var(--primary-soft);
}

.msg-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.msg-body {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 8px 12px;
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  box-shadow: var(--shadow-xs);
  min-width: 0;
}

.chat-msg.mine .msg-body {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary-dark);
  border-bottom-left-radius: 14px;
  border-bottom-right-radius: 4px;
}

.chat-msg.mine .msg-body .sender a {
  color: #fff;
}

.sender {
  font-size: .75rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.sender a {
  color: var(--primary-dark);
}

.msg-text {
  word-break: break-word;
  white-space: pre-wrap;
  line-height: 1.45;
  font-size: .92rem;
}

.msg-quote {
  font-size: .78rem;
  background: rgba(0, 0, 0, .05);
  border-left: 3px solid var(--primary);
  padding: 4px 8px;
  border-radius: 6px;
  margin-bottom: 4px;
}

.chat-msg.mine .msg-quote {
  background: rgba(255, 255, 255, .18);
  border-color: #fff;
}

.msg-reply {
  cursor: pointer;
  font-size: .72rem;
  color: var(--text-muted);
}

.msg-reply:hover {
  color: var(--primary);
}

.chat-reply-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: var(--primary-soft);
  border-top: 1px solid var(--border);
  font-size: .85rem;
  color: var(--primary-darker);
  gap: 10px;
}

.chat-reply-bar .btn-link {
  color: var(--primary-darker);
}

.chat-input-wrap {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.chat-input-wrap input[type="text"] {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 10px 16px;
  font: inherit;
  font-size: 16px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.chat-input-wrap input[type="text"]:focus {
  border-color: var(--primary);
  box-shadow: var(--ring);
}

.chat-input-wrap .btn {
  border-radius: 999px;
  flex-shrink: 0;
  min-width: 44px;
}

/* Inbox list */
.inbox-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}

.inbox-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-dark);
  transition: background .15s;
}

.inbox-item:last-child {
  border-bottom: none;
}

.inbox-item:hover {
  background: var(--primary-tint);
}

.inbox-item.has-unread {
  background: var(--primary-soft);
}

.inbox-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.inbox-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.inbox-body {
  flex: 1;
  min-width: 0;
}

.inbox-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.inbox-top strong {
  color: var(--text-dark);
}

.inbox-time {
  font-size: .78rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.inbox-preview {
  font-size: .85rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inbox-unread {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ========= TABLES ========= */
.data-table-wrap,
.table-responsive {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  box-shadow: var(--shadow-xs);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
  font-size: .9rem;
}

.data-table th,
.data-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table th {
  background: var(--surface-2);
  color: var(--text-dark);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  font-size: .75rem;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background: var(--primary-tint);
}

.data-table .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ========= PAGINATION ========= */
.pagination,
.pagination ul {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dark);
  font-weight: 600;
  font-size: .85rem;
  transition: .15s;
}

.pagination a:hover {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary-dark);
}

.pagination .active,
.pagination .active span,
.pagination li.active span {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ========= FOOTER ========= */
.site-footer {
  position: relative;
  background:
    radial-gradient(800px 300px at 80% -10%, rgba(34, 211, 238, .18), transparent 60%),
    radial-gradient(600px 240px at 0% 110%, rgba(74, 222, 128, .18), transparent 60%),
    linear-gradient(180deg, #061226, #04101e);
  color: #d1fae5;
  margin-top: 60px;
  flex-shrink: 0;
  overflow: hidden;
}

.site-footer::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(74, 222, 128, .06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, .06) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 80%);
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 80%);
}

.site-footer .container {
  padding: 40px 16px 0;
  position: relative;
  z-index: 1;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
  padding-bottom: 30px;
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.site-footer h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  margin-bottom: 14px;
  font-size: 1.05rem;
}

.footer-logo {
  height: 24px;
  width: auto;
}

.footer-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-list li {
  margin-bottom: 8px;
  font-size: .92rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-list a {
  color: #a7f3d0;
}

.footer-list a:hover {
  color: #fff;
}

.footer-bottom {
  background: rgba(0, 0, 0, .25);
  padding: 14px 0;
  font-size: .85rem;
  color: #a7f3d0;
}

.footer-bottom .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
}

.footer-bottom p {
  margin: 0;
}

/* ========= TINY HELPERS ========= */
.note {
  color: var(--text-muted);
  font-size: .85rem;
}

/* Avatar preview (edit profile) */
.avatar-preview {
  margin: 12px 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.avatar-preview img,
.avatar-preview .avatar-fallback {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--primary);
  background: var(--primary-soft);
  color: var(--primary-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 2.6rem;
}

/* Market detail */
.market-detail {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .market-detail {
    grid-template-columns: minmax(320px, 480px) 1fr;
    align-items: start;
  }
}

.market-detail-img {
  width: 100%;
  aspect-ratio: 4/3;
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #cbd5e1;
  font-size: 2rem;
  overflow: hidden;
  border: 1px solid var(--border);
}

.market-detail-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Auth (login/register) tighter form */
.auth-card {
  max-width: 480px;
  margin: 24px auto;
}

/* Image preview helper */
.img-preview {
  max-width: 240px;
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin: 8px 0;
}

/* Print */
@media print {

  .site-header,
  .site-footer,
  .nav-hamburger,
  .btn {
    display: none !important;
  }

  body {
    background: #fff;
  }
}

/* ========= Virtual Home Button (mobile only, iPhone-style) ========= */
.vhome {
  display: none;
}

@media (max-width: 991px) {

  /* Mobile uses the floating home button instead of the hamburger menu */
  .nav-hamburger,
  .nav-menu {
    display: none !important;
  }

  .vhome {
    display: block;
    position: fixed;
    z-index: 1100;
    left: auto;
    right: 14px;
    bottom: 90px;
    width: 56px;
    height: 56px;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
  }

  .vhome.dragging .vhome-btn {
    transition: none;
  }

  .vhome-btn {
    position: relative;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 0;
    padding: 0;
    cursor: pointer;
    background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .35), rgba(255, 255, 255, 0) 55%),
      linear-gradient(145deg, rgba(22, 163, 74, .92), rgba(6, 182, 212, .92));
    box-shadow:
      0 8px 22px rgba(15, 23, 42, .28),
      0 2px 6px rgba(15, 23, 42, .18),
      inset 0 1px 0 rgba(255, 255, 255, .35),
      inset 0 -2px 4px rgba(0, 0, 0, .15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: .55;
    transition: opacity .25s ease, transform .15s ease, box-shadow .25s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .vhome-btn:active {
    transform: scale(.94);
  }

  .vhome.active .vhome-btn,
  .vhome-btn:focus-visible,
  .vhome:hover .vhome-btn {
    opacity: 1;
    box-shadow:
      0 12px 28px rgba(15, 23, 42, .32),
      0 0 0 4px rgba(74, 222, 128, .25),
      inset 0 1px 0 rgba(255, 255, 255, .4);
    outline: none;
  }

  .vhome-ring {
    position: absolute;
    inset: 8px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .85);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08);
  }

  .vhome-dot {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 10px;
    height: 10px;
    margin: -5px 0 0 -5px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 6px rgba(255, 255, 255, .8);
  }

  .vhome-menu {
    position: absolute;
    bottom: calc(100% + 12px);
    right: 0;
    min-width: 240px;
    max-width: 78vw;
    max-height: 70vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: 16px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, .22), 0 4px 12px rgba(15, 23, 42, .12);
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    opacity: 0;
    transform: translateY(8px) scale(.96);
    transform-origin: bottom right;
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
  }

  .vhome-section {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .vhome-section + .vhome-section-title {
    margin-top: 6px;
    border-top: 1px solid rgba(15, 23, 42, .06);
    padding-top: 8px;
  }

  .vhome-section-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .5px;
    padding: 4px 12px 2px;
  }

  .vhome-actions {
    margin-top: 6px;
    border-top: 1px solid rgba(15, 23, 42, .06);
    padding-top: 6px;
  }

  .vhome.left .vhome-menu {
    right: auto;
    left: 0;
    transform-origin: bottom left;
  }

  .vhome.up .vhome-menu {
    bottom: auto;
    top: calc(100% + 12px);
    transform-origin: top right;
  }

  .vhome.left.up .vhome-menu {
    transform-origin: top left;
  }

  .vhome.active .vhome-menu {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
  }

  .vhome-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--text-dark);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    background: transparent;
    border: 0;
    cursor: pointer;
    text-align: left;
    width: 100%;
  }

  .vhome-item i {
    width: 20px;
    text-align: center;
    color: var(--primary);
    font-size: 15px;
  }

  .vhome-item:hover,
  .vhome-item:active {
    background: var(--primary-tint);
  }

  .vhome-item.vhome-danger {
    color: var(--danger);
  }

  .vhome-item.vhome-danger i {
    color: var(--danger);
  }

  .vhome-item.vhome-danger:hover,
  .vhome-item.vhome-danger:active {
    background: #fee2e2;
  }

  body.vhome-open {
    overflow: hidden;
  }

  body.vhome-open::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .25);
    z-index: 1099;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .vhome-btn,
  .vhome-menu {
    transition: none;
  }
}

@media print {
  .vhome {
    display: none !important;
  }
}