/* ============================================
   WebBuilder - Modern Design System
   Font: Be Vietnam Pro (tiếng Việt) + Plus Jakarta Sans (UI)
   ============================================ */

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

:root {
  /* Colors — Phale Solution palette: Đỏ thương hiệu + Xám + Trắng */
  --bg: #f8fafc;
  --bg-white: #ffffff;
  --bg-soft: #f1f5f9;
  --bg-dark: #1f2937;
  --bg-darker: #0f172a;

  --surface: #ffffff;
  --surface-hover: #f8fafc;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --border-dark: #334155;

  --text: #0f172a;
  --text-light: #475569;
  --text-muted: #94a3b8;
  --text-white: #f8fafc;

  /* Brand — Phale red + neutral grey */
  --primary: #dc2626;          /* đỏ chủ đạo */
  --primary-light: #ef4444;
  --primary-dark: #b91c1c;
  --accent: #475569;           /* xám đậm dùng làm accent */
  --accent-light: #64748b;

  /* Status */
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #dc2626;           /* dùng cùng đỏ chủ đạo */
  --info: #3b82f6;

  /* Gradients — đỏ + xám than */
  --gradient-primary: linear-gradient(135deg, #dc2626 0%, #ef4444 50%, #475569 120%);
  --gradient-hero: linear-gradient(135deg, #0f172a 0%, #1f2937 40%, #7f1d1d 100%);
  --gradient-accent: linear-gradient(135deg, #ef4444 0%, #475569 100%);
  --gradient-glow: radial-gradient(circle at 30% 20%, rgba(220, 38, 38, 0.18), transparent 55%);

  /* Radius */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-2xl: 32px;
  --r-full: 9999px;

  /* Shadow */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
  --shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.12);
  --shadow-xl: 0 24px 80px rgba(15, 23, 42, 0.16);
  --shadow-glow: 0 0 40px rgba(220, 38, 38, 0.28);

  /* Transition */
  --t-fast: 0.15s ease;
  --t: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --t-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);

  /* Font */
  --font-sans: 'Be Vietnam Pro', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Plus Jakarta Sans', 'Be Vietnam Pro', sans-serif;
}

/* ============= Reset & Base ============= */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'ss01', 'ss02';
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text);
}

a { color: var(--primary); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--primary-dark); }

.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

/* ============= Site Header ============= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  gap: 40px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--text);
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}

.brand-icon {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-primary);
  border-radius: var(--r-md);
  color: white;
  font-size: 1.1rem;
  box-shadow: var(--shadow-sm);
}

.brand-logo-img {
  height: 40px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  justify-content: flex-end;
}

.main-nav a {
  padding: 8px 16px;
  color: var(--text-light);
  font-weight: 500;
  font-size: 0.9rem;
  border-radius: var(--r-sm);
  transition: var(--t);
}

.main-nav a:hover { background: var(--bg-soft); color: var(--text); }
.main-nav a.active { color: var(--primary); background: rgba(220, 38, 38, 0.1); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 8px 12px;
  cursor: pointer;
  font-size: 1.1rem;
}

.btn-link {
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 8px 16px;
}

/* ============= Buttons ============= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--r-sm);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--t);
  white-space: nowrap;
  text-decoration: none;
  font-family: var(--font-sans);
}

.btn-sm { padding: 7px 14px; font-size: 0.82rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  color: white;
}

.btn-outline {
  background: white;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-outline:hover { background: var(--bg-soft); border-color: var(--text-muted); color: var(--text); }

.btn-ghost {
  background: transparent;
  color: var(--text-light);
}
.btn-ghost:hover { background: var(--bg-soft); color: var(--text); }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #dc2626; color: white; }

/* ============= Main ============= */
.site-main {
  padding: 0;
  min-height: calc(100vh - 140px);
}

/* ============= Hero ============= */
.hero {
  position: relative;
  background: var(--gradient-hero);
  color: white;
  padding: 100px 0 120px;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -20%;
  left: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(220, 38, 38, 0.4), transparent 70%);
  filter: blur(80px);
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -30%;
  right: -10%;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(71, 85, 105, 0.3), transparent 70%);
  filter: blur(100px);
}

.hero-content { position: relative; z-index: 1; max-width: 820px; margin: 0 auto; text-align: center; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--r-full);
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 24px;
  backdrop-filter: blur(10px);
}

.hero-badge .dot {
  width: 6px;
  height: 6px;
  background: var(--accent-light);
  border-radius: var(--r-full);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.5); }
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  margin-bottom: 20px;
  letter-spacing: -0.035em;
  color: white;
  background: linear-gradient(180deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero h1 .accent {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.75);
  max-width: 640px;
  margin: 0 auto 36px;
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 60px;
}

.hero-actions .btn-primary {
  background: white;
  color: var(--text);
  box-shadow: 0 12px 40px rgba(220, 38, 38, 0.4);
}
.hero-actions .btn-primary:hover { transform: translateY(-2px); background: white; color: var(--primary); }

.hero-actions .btn-outline {
  background: rgba(255, 255, 255, 0.08);
  color: white;
  border-color: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
}
.hero-actions .btn-outline:hover { background: rgba(255, 255, 255, 0.15); border-color: rgba(255, 255, 255, 0.4); color: white; }

.hero-metrics {
  display: flex;
  justify-content: center;
  gap: 60px;
  flex-wrap: wrap;
  padding-top: 40px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-metrics .metric { text-align: center; }
.hero-metrics strong {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  color: white;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 4px;
}
.hero-metrics span { color: rgba(255, 255, 255, 0.6); font-size: 0.85rem; }

/* ============= Section ============= */
.section { padding: 80px 0; }
.section-sm { padding: 40px 0; }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 40px;
  gap: 20px;
  flex-wrap: wrap;
}

.section-title {
  font-size: clamp(1.75rem, 3vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}

.section-subtitle {
  color: var(--text-light);
  font-size: 1rem;
  max-width: 600px;
}

.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

/* ============= Feature Grid ============= */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 28px;
  transition: var(--t);
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-primary);
  opacity: 0;
  transition: var(--t);
}

.feature-card:hover {
  border-color: transparent;
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  color: inherit;
}
.feature-card:hover::before { opacity: 1; }

.feature-card .icon {
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.1), rgba(71, 85, 105, 0.1));
  border-radius: var(--r-md);
  font-size: 1.5rem;
  margin-bottom: 18px;
}

.feature-card h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
  font-weight: 700;
}

.feature-card p {
  color: var(--text-light);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ============= Campaign Cards ============= */
.campaign-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.campaign-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: var(--t);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}

.campaign-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
  color: inherit;
}

.campaign-card-thumb {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--bg-soft);
  display: block;
}

.campaign-card-thumb-placeholder {
  width: 100%;
  aspect-ratio: 1;
  background: linear-gradient(135deg, var(--bg-soft), var(--border-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: var(--text-muted);
}

.campaign-card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.campaign-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin: 0;
}

.campaign-card-actions {
  display: flex;
  gap: 6px;
  margin-top: auto;
}

.campaign-card-actions .btn { flex: 1; padding: 6px 8px; font-size: 0.78rem; }

/* ============= Stats ============= */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 28px;
  text-align: center;
  transition: var(--t);
}

.stat-card:hover { border-color: var(--primary-light); transform: translateY(-2px); }

.stat-card .number {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.03em;
}

.stat-card .label { color: var(--text-light); font-size: 0.9rem; margin-top: 6px; }

/* ============= CTA ============= */
.cta-section {
  position: relative;
  background: var(--gradient-hero);
  border-radius: var(--r-2xl);
  padding: 60px 40px;
  text-align: center;
  color: white;
  overflow: hidden;
  margin: 40px 0;
}

.cta-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 50%, rgba(220, 38, 38, 0.3), transparent 60%),
              radial-gradient(circle at 70% 50%, rgba(71, 85, 105, 0.3), transparent 60%);
}

.cta-section > * { position: relative; z-index: 1; }

.cta-section h2 {
  color: white;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin-bottom: 12px;
}

.cta-section p {
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 28px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

/* ============= Forms ============= */
.form-container {
  max-width: 440px;
  margin: 60px auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 40px;
  box-shadow: var(--shadow);
}

.form-container h2 {
  text-align: center;
  margin-bottom: 8px;
  font-size: 1.6rem;
}

.form-container > p {
  text-align: center;
  color: var(--text-light);
  margin-bottom: 24px;
  font-size: 0.9rem;
}

.form-group { margin-bottom: 18px; }

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  transition: var(--t);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.form-actions { margin-top: 24px; }
.form-actions .btn { width: 100%; padding: 12px; font-size: 0.95rem; }

.form-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 0.88rem;
  color: var(--text-light);
}

.form-footer a { color: var(--primary); font-weight: 500; }
.form-footer a:hover { text-decoration: underline; }

.alert {
  padding: 12px 16px;
  border-radius: var(--r-sm);
  margin-bottom: 18px;
  font-size: 0.88rem;
  border: 1px solid transparent;
}

.alert-error { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.alert-success { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
.alert-info { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }

/* ============= Badges ============= */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: var(--bg-soft);
  color: var(--text-light);
}

.badge-admin, .badge-suspended, .badge-banned { background: #fee2e2; color: #b91c1c; }
.badge-creator, .badge-active, .badge-published, .badge-ready { background: #dcfce7; color: #166534; }
.badge-pending, .badge-draft, .badge-generating { background: #fef3c7; color: #92400e; }
.badge-ended, .badge-scrubbed { background: #e0e7ff; color: #3730a3; }

/* ============= Footer ============= */
.site-footer {
  background: var(--bg-darker);
  color: rgba(255, 255, 255, 0.6);
  padding: 40px 0;
  margin-top: 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-brand {
  font-weight: 700;
  color: white;
  font-family: var(--font-display);
}

.footer-links {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.88rem;
}

.footer-links a:hover { color: white; }

.footer-copy { font-size: 0.85rem; }

/* ============= Responsive ============= */
@media (max-width: 900px) {
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 16px;
    flex-direction: column;
    gap: 4px;
    box-shadow: var(--shadow-lg);
  }
  .main-nav.open { display: flex; align-items: stretch; }
  .main-nav a { padding: 10px 14px; }
  .nav-toggle { display: block; }
  .hero { padding: 60px 0 80px; }
  .hero-metrics { gap: 30px; padding-top: 30px; }
  .hero-metrics strong { font-size: 1.5rem; }
  .section { padding: 50px 0; }
  .cta-section { padding: 40px 20px; border-radius: var(--r-xl); }
  .header-inner { gap: 20px; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .form-container { padding: 28px 20px; margin: 30px 16px; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { width: 100%; }
  .footer-inner { flex-direction: column; text-align: center; }
  .campaign-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .campaign-card-body { padding: 10px 12px; }
  .campaign-card-title { font-size: 0.82rem; }
}

/* ============= CTA Button Animations ============= */
@keyframes btnShine {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}
@keyframes btnPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4); }
  50% { box-shadow: 0 0 0 12px rgba(220, 38, 38, 0); }
}
@keyframes arrowBounce {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(4px); }
}

.btn-primary, .hp-hero-actions .btn-primary, .hp-cta-center .btn--primary, .hp-final-cta .btn-register {
  position: relative;
  overflow: hidden;
}
.btn-primary::after, .hp-hero-actions .btn-primary::after, .hp-cta-center .btn--primary::after, .hp-final-cta .btn-register::after {
  content: '';
  position: absolute;
  top: 0; left: -100%; width: 50%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  animation: btnShine 3s ease-in-out infinite;
}
.btn-primary:hover svg, .hp-hero-actions .btn-primary:hover svg, .hp-final-cta .btn-register:hover svg {
  animation: arrowBounce 0.6s ease infinite;
}
.hp-final-cta .btn-register {
  animation: btnPulse 2.5s ease-in-out infinite;
}
.hp-final-cta .btn-register:hover {
  animation: none;
}

/* Remove footer margin-top that causes white gap */
.site-footer, .site-footer-v2 {
  margin-top: 0 !important;
}


/* ============= Header dropdown menu ============= */
.nav-dropdown {
  position: relative;
}
.nav-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}
/* Invisible bridge between toggle and menu so the cursor doesn't lose :hover
   when crossing the visual gap. */
.nav-dropdown::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 12px;
  background: transparent;
  pointer-events: none;
}
.nav-dropdown:hover::after,
.nav-dropdown:focus-within::after {
  pointer-events: auto;
}
.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 200px;
  background: var(--surface, #fff);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 8px;
  display: none;
  flex-direction: column;
  gap: 2px;
  z-index: 50;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  display: flex;
}
.nav-dropdown-menu a {
  padding: 9px 14px !important;
  border-radius: 8px;
  font-size: 0.92rem !important;
  white-space: nowrap;
}
@media (max-width: 900px) {
  .nav-dropdown { width: 100%; }
  .nav-dropdown-menu {
    position: static;
    box-shadow: none;
    border: none;
    border-left: 2px solid var(--border);
    margin-left: 14px;
    border-radius: 0;
    padding: 4px 0 4px 8px;
  }
  .nav-dropdown:hover .nav-dropdown-menu,
  .nav-dropdown:focus-within .nav-dropdown-menu { display: flex; }
}


/* ============= Header user dropdown ============= */
.nav-admin-link {
  /* Admin link uses outline button-style for clarity */
  border: 1px solid var(--border);
  border-radius: 999px !important;
  padding: 6px 14px !important;
  font-weight: 600;
  font-size: 0.85rem !important;
  color: var(--text) !important;
  background: var(--bg-soft, #f8fafc) !important;
}
.nav-admin-link:hover { color: var(--primary) !important; border-color: var(--primary); }

.nav-user-dropdown { position: relative; }
.nav-user-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  transition: all 0.15s;
}
.nav-user-toggle:hover { background: var(--bg-soft, #f8fafc); border-color: var(--primary-light, #fecaca); }
.nav-user-dropdown.is-open .nav-user-toggle { background: var(--bg-soft, #f8fafc); border-color: var(--primary); }

.nav-user-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #dc2626, #475569);
  color: white;
  font-weight: 700;
  font-size: 0.82rem;
  flex-shrink: 0;
}
.nav-user-avatar-lg { width: 44px; height: 44px; font-size: 1.1rem; }
.nav-user-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-user-caret { color: var(--text-muted); transition: transform 0.15s; }
.nav-user-dropdown.is-open .nav-user-caret { transform: rotate(180deg); }

.nav-user-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 240px;
  background: var(--surface, #fff);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.12);
  padding: 8px;
  display: none;
  z-index: 60;
  animation: nav-user-fade 0.15s ease-out;
}
.nav-user-dropdown.is-open .nav-user-menu { display: block; }
@keyframes nav-user-fade {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* User card head inside menu */
.nav-user-menu-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: linear-gradient(135deg, rgba(220, 38, 38,0.06), rgba(71, 85, 105,0.05));
  border-radius: 10px;
  margin-bottom: 6px;
}
.nav-user-menu-name { font-weight: 700; font-size: 0.95rem; color: var(--text); line-height: 1.2; }
.nav-user-menu-email { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; word-break: break-all; }
.nav-user-menu-badge {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 8px;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: white;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.nav-user-menu-item {
  display: flex !important;
  align-items: center;
  gap: 12px;
  padding: 10px 12px !important;
  border-radius: 8px;
  font-size: 0.88rem !important;
  color: var(--text) !important;
  background: transparent !important;
  text-decoration: none;
}
.nav-user-menu-item:hover { background: var(--bg-soft, #f1f5f9) !important; }
.nav-user-menu-item .ico { font-size: 1rem; flex-shrink: 0; width: 22px; text-align: center; }
.nav-user-menu-item.is-danger { color: var(--danger, #ef4444) !important; }
.nav-user-menu-item.is-danger:hover { background: #fef2f2 !important; }
.nav-user-menu-divider { height: 1px; background: var(--border); margin: 6px 4px; }

/* Mobile fallback — show inline */
@media (max-width: 900px) {
  .nav-user-dropdown { width: 100%; }
  .nav-user-toggle { width: 100%; justify-content: flex-start; border-radius: 10px; }
  .nav-user-menu {
    position: static;
    box-shadow: none;
    border: none;
    border-left: 2px solid var(--border);
    margin: 4px 0 0 14px;
    padding: 4px 0 4px 8px;
    border-radius: 0;
    animation: none;
    min-width: 0;
  }
  .nav-user-name { max-width: none; }
}


/* ============= Header auth buttons (login + register) ============= */
.nav-auth-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: 4px;
}

/* Đăng nhập — outline pill, subtle */
.btn-auth-login {
  display: inline-flex !important;
  align-items: center;
  gap: 7px;
  padding: 8px 16px !important;
  border-radius: 999px !important;
  font-size: 0.88rem !important;
  font-weight: 600;
  color: var(--text) !important;
  background: var(--bg-soft, #f8fafc) !important;
  border: 1px solid var(--border);
  transition: all 0.18s ease;
}
.btn-auth-login:hover {
  color: var(--primary) !important;
  border-color: var(--primary-light, #fecaca);
  background: white !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.12);
}
.btn-auth-login.is-active {
  color: var(--primary) !important;
  border-color: var(--primary);
  background: rgba(220, 38, 38, 0.08) !important;
}
.btn-auth-login svg { transition: transform 0.18s; }
.btn-auth-login:hover svg { transform: translateX(2px); }

/* Đăng ký miễn phí — gradient primary, eye-catching */
.btn-auth-register {
  position: relative;
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  padding: 9px 20px !important;
  border-radius: 999px !important;
  font-size: 0.88rem !important;
  font-weight: 700 !important;
  color: white !important;
  background: linear-gradient(135deg, #dc2626 0%, #475569 50%, #475569 100%) !important;
  background-size: 200% 100%;
  background-position: 0% 50%;
  border: none;
  overflow: hidden;
  box-shadow:
    0 6px 16px rgba(220, 38, 38, 0.32),
    0 2px 4px rgba(71, 85, 105, 0.18);
  transition: all 0.25s ease;
}
.btn-auth-register:hover {
  background-position: 100% 50%;
  transform: translateY(-1px);
  box-shadow:
    0 10px 24px rgba(220, 38, 38, 0.42),
    0 4px 8px rgba(71, 85, 105, 0.25);
  color: white !important;
}
.btn-auth-register:active { transform: translateY(0); }
.btn-auth-register svg { transition: transform 0.2s; }
.btn-auth-register:hover svg { transform: translateX(3px); }

/* Shine sweep on hover */
.btn-auth-shine {
  position: absolute;
  top: 0; left: -75%;
  width: 50%; height: 100%;
  background: linear-gradient(110deg, transparent, rgba(255,255,255,0.45), transparent);
  transform: skewX(-20deg);
  pointer-events: none;
}
.btn-auth-register:hover .btn-auth-shine {
  animation: btn-auth-shine-sweep 0.8s ease-out;
}
@keyframes btn-auth-shine-sweep {
  0% { left: -75%; }
  100% { left: 130%; }
}

/* Mobile: stack auth actions full width */
@media (max-width: 900px) {
  .nav-auth-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-left: 0;
    padding-top: 6px;
  }
  .btn-auth-login,
  .btn-auth-register {
    width: 100%;
    justify-content: center;
  }
}


/* ============= Credit pill (header + admin topbar) ============= */
.nav-credit-pill,
.admin-credit-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background: linear-gradient(135deg, #fef2f2 0%, #fff5f5 100%);
  border: 1px solid #fecaca;
  border-radius: 999px;
  color: #dc2626;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  font-family: 'Plus Jakarta Sans', 'Be Vietnam Pro', sans-serif;
  transition: all 0.18s ease;
  white-space: nowrap;
}
.nav-credit-pill:hover,
.admin-credit-pill:hover {
  background: linear-gradient(135deg, #fee2e2, #fecaca);
  border-color: #dc2626;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.18);
  color: #b91c1c;
}
.nav-credit-pill svg,
.admin-credit-pill svg { color: #dc2626; flex-shrink: 0; }
.nav-credit-num,
.admin-credit-num {
  font-variant-numeric: tabular-nums;
  font-size: 0.92rem;
  letter-spacing: -0.01em;
}
.nav-credit-label,
.admin-credit-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.7;
}
.nav-credit-pill.is-unlimited,
.admin-credit-pill.is-unlimited {
  background: linear-gradient(135deg, #fff7ed, #fef3c7);
  border-color: #fcd34d;
  color: #b45309;
  cursor: default;
}
.nav-credit-pill.is-unlimited svg,
.admin-credit-pill.is-unlimited svg { color: #d97706; }

/* Counter animation flash */
.nav-credit-pill.is-flash,
.admin-credit-pill.is-flash {
  animation: creditFlash 0.6s ease;
}
@keyframes creditFlash {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); box-shadow: 0 6px 20px rgba(220, 38, 38, 0.35); }
  100% { transform: scale(1); }
}

@media (max-width: 900px) {
  .nav-credit-label { display: none; }
}
@media (max-width: 540px) {
  .nav-credit-pill { padding: 5px 10px; font-size: 0.78rem; }
}


/* ============= Campaign meta card (avatar/card show) ============= */
.campaign-meta-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: start;
  background: linear-gradient(135deg, #ffffff 0%, #fafbff 60%, #fef9f9 100%);
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 18px 22px;
  margin-bottom: 18px;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.04);
}
.campaign-meta-card .cmc-title h1 {
  font-family: 'Plus Jakarta Sans', 'Be Vietnam Pro', sans-serif;
  font-size: clamp(1.2rem, 2.4vw, 1.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0f172a;
  margin: 0 0 4px;
  line-height: 1.2;
}
.campaign-meta-card .cmc-desc {
  font-size: 0.88rem;
  color: #64748b;
  margin: 0;
  line-height: 1.5;
  max-width: 64ch;
}

.campaign-meta-card .cmc-side {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.campaign-meta-card .cmc-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
}
.campaign-meta-card .cmc-label {
  color: #94a3b8;
  text-transform: uppercase;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  min-width: 78px;
}
.campaign-meta-card .cmc-value {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #0f172a;
  font-weight: 500;
}
.campaign-meta-card .cmc-value svg { color: #dc2626; }
.campaign-meta-card .cmc-avatar {
  width: 22px; height: 22px;
  background: linear-gradient(135deg, #dc2626, #ef4444);
  color: white;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 0.7rem;
  font-weight: 800;
  flex-shrink: 0;
}

@media (max-width: 720px) {
  .campaign-meta-card {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 16px 18px;
  }
  .campaign-meta-card .cmc-side {
    border-top: 1px dashed #e2e8f0;
    padding-top: 10px;
  }
}
