/* =========================================================
   DAANAK Global — Base Stylesheet
   ========================================================= */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

/* ---------- Focus states (accessibility) ----------
   :focus-visible so mouse clicks don't show a ring, but keyboard nav always does. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}
.btn:focus-visible { outline-offset: 2px; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-body-md);
  line-height: var(--lh-normal);
  color: var(--text-primary);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p, ul, ol { margin: 0; }
ul { padding: 0; list-style: none; }
button { font-family: inherit; cursor: pointer; }

h1, h2, h3, h4 { font-weight: 600; line-height: var(--lh-tight); letter-spacing: -0.02em; }

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

@media (max-width: 640px) {
  .container { padding: 0 var(--space-md); }
}

section { position: relative; }

/* ---------- Eyebrow / Kicker ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-primary);
}
.eyebrow::before {
  content: "";
  width: 18px;
  height: 2px;
  background: var(--accent-primary);
  display: inline-block;
}
.on-dark .eyebrow { color: var(--gold-400); }
.on-dark .eyebrow::before { background: var(--gold-400); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: 13px 26px;
  border-radius: var(--radius-md);
  font-size: var(--fs-body-sm);
  font-weight: 600;
  border: 1px solid transparent;
  transition: all var(--dur-base) var(--ease-out);
  white-space: nowrap;
}
.btn-lg { padding: 16px 32px; font-size: var(--fs-body-md); }
.btn-primary, .btn-accent, .btn-gold-glossy {
  background: linear-gradient(135deg, var(--gold-soft, #f3d68c) 0%, var(--gold-bright, #d4af37) 35%, var(--accent-gold, var(--gold-500, #c5a059)) 70%, var(--gold-deep, #a48037) 100%);
  color: var(--neutral-900, #111827);
  font-weight: 700;
  box-shadow: 
    inset 0 1px 1px rgba(255, 255, 255, 0.7),
    0 4px 14px -2px var(--accent-gold, rgba(197, 160, 89, 0.45)),
    0 1px 3px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.4);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn-primary:hover, .btn-accent:hover, .btn-gold-glossy:hover {
  transform: translateY(-2px);
  box-shadow: 
    inset 0 1px 1.5px rgba(255, 255, 255, 0.9),
    0 8px 24px -2px var(--accent-gold, rgba(212, 175, 55, 0.55)),
    0 0 20px rgba(240, 213, 140, 0.4);
  filter: brightness(1.04);
}
.btn-primary:active, .btn-accent:active, .btn-gold-glossy:active {
  transform: translateY(0);
  box-shadow: 
    inset 0 1px 2px rgba(0, 0, 0, 0.2),
    0 2px 8px var(--accent-gold, rgba(197, 160, 89, 0.4));
}

/* Master Design System Button Primitives (Exact Website Parity) */
.btn-gold-glossy {
  background: linear-gradient(135deg, var(--gold-soft, #f3d68c) 0%, var(--gold-bright, #d4af37) 35%, var(--gold-500, #c5a059) 70%, var(--gold-600, #a48037) 100%);
  color: var(--neutral-900, #111827);
  font-weight: 700;
  box-shadow: 
    inset 0 1px 1px rgba(255, 255, 255, 0.7),
    0 4px 14px -2px rgba(197, 160, 89, 0.45),
    0 1px 3px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.4);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn-gold-glossy:hover {
  transform: translateY(-2px);
  box-shadow: 
    inset 0 1px 1.5px rgba(255, 255, 255, 0.9),
    0 8px 24px -2px rgba(212, 175, 55, 0.55),
    0 0 20px rgba(240, 213, 140, 0.4);
  filter: brightness(1.04);
}
.btn-gold-glossy:active {
  transform: translateY(0);
  box-shadow: 
    inset 0 1px 2px rgba(0, 0, 0, 0.2),
    0 2px 8px rgba(197, 160, 89, 0.4);
}

.btn-dark-glossy {
  background: linear-gradient(135deg, #2a313d 0%, #151b26 50%, #0d121c 100%);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 
    inset 0 1px 1px rgba(255, 255, 255, 0.25),
    0 4px 14px -2px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn-dark-glossy:hover {
  transform: translateY(-2px);
  border-color: rgba(212, 175, 55, 0.5);
  box-shadow: 
    inset 0 1px 1.5px rgba(255, 255, 255, 0.4),
    0 8px 24px -2px rgba(0, 0, 0, 0.4),
    0 0 18px rgba(197, 160, 89, 0.3);
}

.btn-glass {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(232, 217, 184, 0.7);
  box-shadow: 0 2px 8px -2px rgba(0, 0, 0, 0.05);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn-glass:hover {
  background: rgba(255, 255, 255, 0.95);
  border-color: var(--gold-500, #c5a059);
  transform: translateY(-2px);
  box-shadow: 
    0 6px 20px -2px rgba(197, 160, 89, 0.25),
    0 0 12px rgba(212, 175, 55, 0.2);
}

.btn-secondary {
  background: transparent;
  border-color: var(--border-default);
  color: var(--text-primary);
}
.btn-secondary:hover { background: var(--bg-secondary); border-color: var(--gold-400); color: var(--text-primary); }

.on-dark .btn-secondary { border-color: var(--border-on-dark); color: var(--text-on-dark); }
.on-dark .btn-secondary:hover { background: rgba(255,255,255,0.06); border-color: rgba(212, 175, 55, 0.4); }

.btn-ghost { background: transparent; color: var(--gold-600); padding-left: 8px; padding-right: 8px; }
.btn-ghost:hover { color: var(--gold-500); }
.on-dark .btn-ghost { color: var(--gold-400); }

/* ---------- Nav ---------- */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  background: transparent;
  transition: background var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out), backdrop-filter var(--dur-base) var(--ease-out);
  border-bottom: 1px solid transparent;
}
.site-nav.is-scrolled {
  background: rgba(255,255,255,0.86);
  backdrop-filter: blur(12px);
  border-bottom-color: var(--border-subtle);
}
.site-nav .nav-inner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo { display: flex; align-items: center; gap: 10px; }
.nav-logo img { height: 30px; width: auto; }
.nav-logo-word { display: flex; flex-direction: column; line-height: 1; }
.nav-logo-word b { font-size: 1.05rem; font-weight: 700; color: var(--text-primary); letter-spacing: -0.01em; }
.site-nav.is-scrolled .nav-logo-word b,
body:not(.hero-dark) .nav-logo-word b { color: var(--text-primary); }
.hero-dark .site-nav:not(.is-scrolled) .nav-logo-word b { color: var(--text-on-dark); }

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
}
.nav-links a {
  font-size: var(--fs-body-sm);
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--dur-fast) var(--ease-out);
}
.nav-links a:hover { color: var(--text-primary); }
.hero-dark .site-nav:not(.is-scrolled) .nav-links a { color: var(--text-on-dark-secondary); }
.hero-dark .site-nav:not(.is-scrolled) .nav-links a:hover { color: var(--text-on-dark); }
.nav-links a.active { color: var(--brand-primary); }
.hero-dark .site-nav:not(.is-scrolled) .nav-links a.active { color: var(--gold-400); }

.nav-cta { display: flex; align-items: center; gap: var(--space-md); }
.nav-toggle { display: none; }

@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-cta { display: none; }
  .nav-toggle { display: block; }
}
.mobile-login { color: var(--text-secondary); }

/* ---------- Nav dropdown (desktop mega-menu-lite) ---------- */
.nav-item { position: relative; }
.nav-trigger {
  display: flex; align-items: center; gap: 5px;
  background: none; border: none; padding: 0;
  font-family: inherit; font-size: var(--fs-body-sm); font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--dur-fast) var(--ease-out);
}
.nav-trigger:hover, .nav-item.open .nav-trigger { color: var(--text-primary); }
.hero-dark .site-nav:not(.is-scrolled) .nav-trigger { color: var(--text-on-dark-secondary); }
.hero-dark .site-nav:not(.is-scrolled) .nav-item.open .nav-trigger { color: var(--text-on-dark); }
.nav-trigger .chev { transition: transform var(--dur-fast) var(--ease-out); }
.nav-item.open .nav-trigger .chev { transform: rotate(180deg); }

.nav-dropdown {
  position: absolute;
  top: calc(100% + 18px);
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  min-width: 240px;
  background: var(--bg-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-sm);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out), visibility var(--dur-fast);
  z-index: 110;
}
.nav-item.open .nav-dropdown,
.nav-item:hover .nav-dropdown,
.nav-item:focus-within .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.nav-dropdown a {
  display: flex;
  flex-direction: column;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: var(--fs-body-sm);
  font-weight: 500;
  color: var(--text-primary);
}
.nav-dropdown a span.desc { font-weight: 400; font-size: var(--fs-caption); color: var(--text-tertiary); margin-top: 2px; }
.nav-dropdown a:hover { background: var(--bg-secondary); }
/* The dropdown panel always sits on a light surface (bg-primary), regardless of
   whether the page behind the nav bar is a dark hero — so its link color must
   stay dark-on-light even when .hero-dark's "unscrolled nav on dark hero" rule
   would otherwise lighten top-level .nav-links a text. Same specificity chain,
   placed later so it wins. */
.hero-dark .site-nav:not(.is-scrolled) .nav-dropdown a { color: var(--text-primary); }
.hero-dark .site-nav:not(.is-scrolled) .nav-dropdown a:hover { color: var(--text-primary); }

/* ---------- Mobile accordion (native details/summary — no JS required) ---------- */
.mobile-accordion { border-bottom: 1px solid var(--border-subtle); }
.mobile-accordion summary {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-sm) 0;
  font-size: var(--fs-body-md); font-weight: 500; color: var(--text-primary);
  cursor: pointer;
  list-style: none;
}
.mobile-accordion summary::-webkit-details-marker { display: none; }
.mobile-accordion summary .chev { transition: transform var(--dur-fast) var(--ease-out); }
.mobile-accordion[open] summary .chev { transform: rotate(180deg); }
.mobile-accordion .submenu { display: flex; flex-direction: column; padding: 0 0 var(--space-sm) var(--space-sm); gap: 4px; }
.mobile-accordion .submenu a { padding: 8px 0; font-size: var(--fs-body-sm); color: var(--text-secondary); border: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding-top: calc(var(--nav-height) + var(--space-5xl));
  padding-bottom: var(--space-5xl);
  overflow: hidden;
}
.hero.on-dark {
  background: radial-gradient(ellipse 120% 80% at 50% -10%, var(--teal-800) 0%, var(--surface-dark-bg) 55%, var(--neutral-950) 100%);
  color: var(--text-on-dark);
}
.hero-grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.045) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 20%, black 20%, transparent 75%);
  pointer-events: none;
}
.hero-glow {
  position: absolute;
  width: 900px; height: 900px;
  top: -420px; left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(229,170,57,0.16) 0%, transparent 65%);
  pointer-events: none;
}
.hero-content { position: relative; z-index: 2; max-width: 760px; }
.hero-content.centered { max-width: 820px; margin: 0 auto; text-align: center; }
.hero h1 { font-size: var(--fs-display-lg); margin-top: var(--space-md); }
.hero .lede {
  font-size: var(--fs-body-lg);
  color: var(--text-on-dark-secondary);
  margin-top: var(--space-lg);
  max-width: 620px;
}
.hero-content.centered .lede { margin-left: auto; margin-right: auto; }
.hero-actions { display: flex; gap: var(--space-md); margin-top: var(--space-2xl); flex-wrap: wrap; }
.hero-content.centered .hero-actions { justify-content: center; }

.hero-visual {
  position: relative; z-index: 2;
  margin-top: var(--space-4xl);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-on-dark);
  background: rgba(255,255,255,0.03);
  padding: var(--space-md);
  box-shadow: var(--shadow-xl);
}

/* ---------- Section spacing / headers ---------- */
.section { padding: var(--space-5xl) 0; }
.section-tight { padding: var(--space-4xl) 0; }
.section-header { max-width: 640px; margin-bottom: var(--space-3xl); }
.section-header.centered { max-width: 680px; margin-left: auto; margin-right: auto; text-align: center; }
.section-header h2 { font-size: var(--fs-display-md); margin-top: var(--space-md); }
.section-header p { color: var(--text-secondary); font-size: var(--fs-body-lg); margin-top: var(--space-md); }
.bg-secondary { background: var(--bg-secondary); }

/* ---------- Grid utilities ---------- */
.grid { display: grid; gap: var(--space-lg); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ---------- Cards (Master Design System Parity) ---------- */
.card {
  background: var(--card-bg, var(--bg-primary, #ffffff));
  border: 1px solid var(--card-border, var(--border-default, #e5e7eb));
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  color: var(--card-text-primary, inherit);
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out), background var(--dur-base) var(--ease-out);
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px -4px rgba(0, 0, 0, 0.08), 0 0 24px -2px var(--accent-gold, rgba(197, 160, 89, 0.2));
  border-color: var(--accent-gold, var(--gold-bright, #d4af37));
}

/* Master Interactive Glossy Card */
.card-glossy {
  background: var(--card-bg, var(--bg-primary, #ffffff));
  border: 1px solid var(--card-border, var(--border-default, #e5e7eb));
  border-radius: var(--radius-xl, 20px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.02);
  color: var(--card-text-primary, inherit);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.card-glossy:hover {
  transform: translateY(-3px);
  border-color: var(--gold-bright, #d4af37);
  box-shadow: 
    0 12px 30px -4px rgba(0, 0, 0, 0.08),
    0 0 24px -2px rgba(197, 160, 89, 0.2);
}

/* Master Dark Luxury Card */
.card-dark-glossy {
  background: linear-gradient(145deg, var(--surface-dark-bg-alt, #151b26) 0%, var(--surface-dark-bg, #0d121c) 100%);
  border: 1px solid var(--border-on-dark, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius-xl, 20px);
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.4);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--text-on-dark, #ffffff);
}
.card-dark-glossy:hover {
  transform: translateY(-3px);
  border-color: var(--border-on-dark-gold, rgba(212, 175, 55, 0.45));
  box-shadow: 
    0 12px 36px -4px rgba(0, 0, 0, 0.6),
    0 0 28px -2px var(--accent-gold, rgba(197, 160, 89, 0.25));
}

/* Master Ambient Glows & Gradients */
.glow-gold {
  box-shadow: 0 0 28px -4px rgba(197, 160, 89, 0.35);
}
.glow-gold-lg {
  box-shadow: 0 0 50px -8px rgba(197, 160, 89, 0.45);
}
.glow-gold-text {
  text-shadow: 0 0 24px rgba(212, 175, 55, 0.4);
}
.bg-gold-gradient {
  background-image: linear-gradient(135deg, var(--gold-soft, #f0d58c) 0%, var(--gold-bright, #d4af37) 40%, var(--gold-500, #c5a059) 70%, var(--gold-600, #9a7a3a) 100%);
}
.text-gold-gradient {
  background-image: linear-gradient(135deg, var(--gold-bright, #d4af37) 0%, var(--gold-600, #8f6f33) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.card-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  background: var(--gold-50, #faf5ea);
  color: var(--gold-600, #9a7a3a);
  border: 1px solid var(--gold-line, #e8d9b8);
  margin-bottom: var(--space-lg);
}
.card-icon.gold { background: var(--gold-50); color: var(--gold-600); border-color: var(--gold-line); }
.card-icon.sage { background: #f4f6f5; color: #425649; border-color: #d0d9d4; }
.card h3 { font-size: var(--fs-h4); margin-bottom: var(--space-sm); }
.card p { color: var(--text-secondary); font-size: var(--fs-body-sm); }

/* ---------- Badge / Pill ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: var(--fs-caption);
  font-weight: 600;
  background: var(--brand-subtle-bg);
  color: var(--brand-primary);
}
.badge.gold { background: var(--accent-subtle-bg); color: var(--gold-700); }
.badge.sage { background: var(--sage-subtle-bg); color: var(--sage-700); }
.badge.outline { background: transparent; border: 1px solid var(--border-default); color: var(--text-secondary); }

/* ---------- Logo strip ---------- */
.example-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  border-radius: var(--radius-full);
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  font-size: var(--fs-caption);
  color: var(--text-secondary);
}
.example-tag .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sage-500); }

/* ---------- Flow diagram (Old Way -> DAANAK) ---------- */
.flow-row { display: flex; align-items: center; gap: var(--space-md); flex-wrap: wrap; }
.flow-step {
  flex: 1;
  min-width: 160px;
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  background: var(--bg-primary);
  border: 1px solid var(--border-default);
  text-align: center;
}
.flow-arrow { color: var(--text-tertiary); font-size: 1.25rem; }

/* ---------- CTA banner ---------- */
.cta-banner {
  border-radius: var(--radius-xl);
  padding: var(--space-4xl) var(--space-3xl);
  text-align: center;
  position: relative;
  overflow: hidden;
  background: radial-gradient(ellipse 100% 100% at 50% 0%, var(--teal-800) 0%, var(--surface-dark-bg) 60%, var(--neutral-950) 100%);
  color: var(--text-on-dark);
}
.cta-banner h2 { font-size: var(--fs-display-md); }
.cta-banner p { color: var(--text-on-dark-secondary); margin-top: var(--space-md); font-size: var(--fs-body-lg); }
.cta-banner .hero-actions { justify-content: center; margin-top: var(--space-2xl); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--neutral-950);
  color: var(--text-on-dark-secondary);
  padding: var(--space-4xl) 0 var(--space-xl);
}
.footer-top {
  display: grid;
  grid-template-columns: 1.4fr repeat(4, 1fr);
  gap: var(--space-xl);
  padding-bottom: var(--space-3xl);
  border-bottom: 1px solid var(--border-on-dark);
}
.footer-brand img { height: 28px; margin-bottom: var(--space-md); }
.footer-brand p { font-size: var(--fs-body-sm); max-width: 260px; color: var(--text-on-dark-secondary); }
.footer-col h4 { font-size: var(--fs-caption); text-transform: uppercase; letter-spacing: 0.08em; color: var(--neutral-400); margin-bottom: var(--space-md); }
.footer-col ul { display: flex; flex-direction: column; gap: var(--space-sm); }
.footer-col a { font-size: var(--fs-body-sm); color: var(--text-on-dark-secondary); transition: color var(--dur-fast); }
.footer-col a:hover { color: var(--text-on-dark); }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: var(--space-xl);
  font-size: var(--fs-caption);
  color: var(--neutral-500);
  flex-wrap: wrap; gap: var(--space-md);
}
@media (max-width: 900px) {
  .footer-top { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Reveal-on-scroll ----------
   Progressive enhancement: content is fully visible by default.
   The opacity/transform hiding only applies once JS has confirmed
   it's running (html.js, set by an inline script in <head>) AND
   IntersectionObserver is supported — so a slow/blocked/no-JS load
   never leaves real content permanently invisible. */
html.js.io-supported .reveal { opacity: 0; transform: translateY(24px); transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out); }
html.js.io-supported .reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: 80ms; }
.reveal-delay-2 { transition-delay: 160ms; }
.reveal-delay-3 { transition-delay: 240ms; }

@media (prefers-reduced-motion: reduce) {
  html.js.io-supported .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Mobile menu ---------- */
.mobile-menu {
  display: none;
  position: absolute;
  top: var(--nav-height);
  left: 0; right: 0;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-default);
  box-shadow: var(--shadow-lg);
  flex-direction: column;
  padding: var(--space-md) var(--space-lg) var(--space-lg);
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  padding: var(--space-sm) 0;
  font-size: var(--fs-body-md);
  font-weight: 500;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-subtle);
}
.nav-toggle {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-primary);
  line-height: 1;
}
.hero-dark .site-nav:not(.is-scrolled) .nav-toggle { color: var(--text-on-dark); }

/* ---------- Misc ---------- */
.text-secondary { color: var(--text-secondary); }
.mx-auto { margin-left: auto; margin-right: auto; }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }

.stat-row { display: flex; gap: var(--space-3xl); flex-wrap: wrap; }
.stat-item .num { font-size: var(--fs-display-md); font-weight: 700; color: var(--brand-primary); }
.on-dark .stat-item .num { color: var(--gold-400); }
.stat-item .label { color: var(--text-secondary); font-size: var(--fs-body-sm); margin-top: 4px; }
.on-dark .stat-item .label { color: var(--text-on-dark-secondary); }

.placeholder-note {
  font-size: var(--fs-caption);
  color: var(--text-tertiary);
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-sm);
  padding: var(--space-xs) var(--space-sm);
  display: inline-block;
}

/* =========================================================
   Design-system foundation patterns
   Not all of these appear on the Phase 1 flagship pages —
   they exist so signup, dashboard and other later-phase pages
   have a consistent base to build on instead of inventing new
   styles per page.
   ========================================================= */

/* ---------- Form fields ---------- */
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: var(--fs-label); font-weight: 600; color: var(--text-primary); }
.required-mark { color: var(--error-500); margin-left: 3px; }
.form-optional { font-weight: 400; color: var(--text-tertiary); text-transform: none; letter-spacing: 0; }
.form-hint { font-size: var(--fs-caption); color: var(--text-tertiary); }
.form-error-text { font-size: var(--fs-caption); color: var(--error-500); }

.input, .select, .textarea {
  width: 100%;
  font-family: var(--font-sans);
  font-size: var(--fs-body-md);
  color: var(--text-primary);
  background: var(--bg-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 11px 14px;
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.textarea { resize: vertical; min-height: 96px; }
.input::placeholder, .textarea::placeholder { color: var(--text-tertiary); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--text-tertiary); }
/* PHASE 12 (§18) — form controls had no perceivable keyboard focus.
   `outline: none` cancelled the site-wide :focus-visible ring, and the
   replacement glow used --brand-subtle-bg (#F5FAFA), a near-white ring
   on a white page: measured as present but invisible. Every input in the
   product was affected — login, signup, checkout, support, settings.
   The soft glow is kept as the designed treatment, now in a teal that
   can actually be seen, and the SAME 2px gold :focus-visible ring the
   rest of the design system already uses for links and buttons is
   restored for keyboard users. Consistency with the existing system,
   not a new visual language. */
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--gold-500, #c5a059);
  box-shadow: 0 0 0 3px rgba(197, 160, 89, 0.22);
}
.input:focus-visible, .select:focus-visible, .textarea:focus-visible {
  outline: 2px solid var(--gold-500, #c5a059);
  outline-offset: 2px;
}
.input.has-error, .textarea.has-error { border-color: var(--error-500); }
.input.has-error:focus, .textarea.has-error:focus { box-shadow: 0 0 0 3px var(--status-error-bg); }
.input:disabled, .select:disabled, .textarea:disabled {
  background: var(--bg-secondary); color: var(--text-tertiary); cursor: not-allowed;
}

/* ---------- Dropdown / Select ---------- */
.select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23545F5C' stroke-width='2'><path d='m6 9 6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

/* ---------- Alerts ---------- */
.alert {
  display: flex;
  gap: var(--space-sm);
  align-items: flex-start;
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-size: var(--fs-body-sm);
}
.alert-title { font-weight: 600; margin-bottom: 2px; }
.alert-info { background: var(--brand-subtle-bg); border-color: var(--teal-200); color: var(--teal-900); }
.alert-success { background: var(--status-success-bg); border-color: var(--success-500); color: var(--status-success-text); }
.alert-warning { background: var(--status-warning-bg); border-color: var(--gold-300); color: var(--status-warning-text); }
.alert-error { background: var(--status-error-bg); border-color: var(--error-500); color: var(--status-error-text); }

/* ---------- Loading (skeleton) ---------- */
.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--neutral-100);
  border-radius: var(--radius-sm);
}
.skeleton::after {
  content: "";
  position: absolute; inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
  animation: skeleton-sweep 1.6s infinite;
}
@keyframes skeleton-sweep { 100% { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) {
  .skeleton::after { animation: none; }
}

/* ---------- Empty / Error states (in-page, not full pages) ---------- */
.state-panel {
  text-align: center;
  padding: var(--space-4xl) var(--space-lg);
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-lg);
}
.state-panel .state-icon {
  width: 56px; height: 56px;
  margin: 0 auto var(--space-lg);
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-secondary);
  color: var(--text-tertiary);
}
.state-panel.is-error .state-icon { background: var(--status-error-bg); color: var(--error-500); }
.state-panel h3 { font-size: var(--fs-h4); margin-bottom: var(--space-sm); }
.state-panel p { color: var(--text-secondary); font-size: var(--fs-body-sm); max-width: 380px; margin: 0 auto; }
.state-panel .btn { margin-top: var(--space-lg); }

/* ---------- Breadcrumb ---------- */
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: var(--fs-caption); color: var(--text-tertiary); margin-bottom: var(--space-lg); flex-wrap: wrap; }
.breadcrumb a { color: var(--text-tertiary); }
.breadcrumb a:hover { color: var(--brand-primary); }
.breadcrumb .sep { color: var(--border-default); }
.breadcrumb .current { color: var(--text-secondary); }
.on-dark .breadcrumb, .on-dark .breadcrumb a { color: var(--text-on-dark-secondary); }
.on-dark .breadcrumb a:hover { color: var(--text-on-dark); }
.on-dark .breadcrumb .current { color: var(--text-on-dark); }
.on-dark .breadcrumb .sep { color: var(--border-on-dark); }

/* ---------- Search / filter bar ---------- */
.search-bar {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--bg-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 12px 16px;
}
.search-bar input {
  border: none; outline: none; flex: 1;
  font-family: var(--font-sans); font-size: var(--fs-body-md); background: transparent; color: var(--text-primary);
}
.search-bar svg { color: var(--text-tertiary); flex-shrink: 0; }
.filter-row { display: flex; gap: var(--space-sm); flex-wrap: wrap; margin-top: var(--space-md); }
.filter-chip {
  padding: 7px 16px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-default);
  font-size: var(--fs-body-sm);
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-primary);
  transition: all var(--dur-fast) var(--ease-out);
}
.filter-chip {
  padding: 7px 18px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-default);
  font-size: var(--fs-body-sm);
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-primary);
  transition: all var(--dur-fast) var(--ease-out);
}
.filter-chip.active {
  background: linear-gradient(135deg, var(--gold-soft, #f3d68c) 0%, var(--gold-bright, #d4af37) 35%, var(--gold-500, #c5a059) 70%, var(--gold-600, #a48037) 100%);
  border-color: rgba(255, 255, 255, 0.4);
  color: var(--neutral-900, #111827);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.7), 0 2px 8px -2px rgba(197, 160, 89, 0.35);
}
.filter-chip:hover:not(.active) { border-color: var(--gold-400); color: var(--text-primary); }

/* ---------- Product card (Master Design System Parity) ---------- */
.product-card {
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl, 20px);
  overflow: hidden;
  background: var(--bg-primary);
  display: flex; flex-direction: column;
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out);
}
.product-card:hover {
  transform: translateY(-4px);
  border-color: var(--gold-bright, #d4af37);
  box-shadow: 0 12px 30px -4px rgba(0, 0, 0, 0.08), 0 0 24px -2px rgba(197, 160, 89, 0.2);
}
.product-card-media {
  aspect-ratio: 16/10;
  background: linear-gradient(135deg, #151b26 0%, #0d121c 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex; align-items: center; justify-content: center;
  color: var(--gold-400);
}
.product-card-body { padding: var(--space-lg); display: flex; flex-direction: column; gap: 8px; flex: 1; }
.product-card-body h3 { font-size: var(--fs-body-md); font-weight: 700; color: var(--text-primary); }
.product-card-body p { font-size: var(--fs-body-sm); color: var(--text-secondary); flex: 1; line-height: 1.5; }
.product-card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: var(--space-sm); }

/* ---------- Blog card ---------- */
.blog-card { display: flex; flex-direction: column; gap: var(--space-sm); }
.blog-card-media {
  aspect-ratio: 16/9;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--sage-100), var(--teal-100));
}
.blog-card h3 { font-size: var(--fs-h4); margin-top: var(--space-xs); }
.blog-card .meta { font-size: var(--fs-caption); color: var(--text-tertiary); }

/* ---------- Pagination ---------- */
.pagination { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: var(--space-2xl); }
.pagination a, .pagination span {
  min-width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md);
  font-size: var(--fs-body-sm); font-weight: 500;
  color: var(--text-secondary);
}
.pagination a:hover { background: var(--bg-secondary); }
.pagination .current { background: var(--brand-primary); color: var(--on-brand); }

/* ---------- FAQ (native details/summary) ---------- */
.faq-item { border-bottom: 1px solid var(--border-default); }
.faq-item summary {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-md);
  padding: var(--space-lg) 0;
  font-size: var(--fs-body-md); font-weight: 600; color: var(--text-primary);
  cursor: pointer; list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .chev { flex-shrink: 0; transition: transform var(--dur-fast) var(--ease-out); color: var(--text-tertiary); }
.faq-item[open] summary .chev { transform: rotate(180deg); }
.faq-item .faq-answer { padding: 0 0 var(--space-lg); color: var(--text-secondary); font-size: var(--fs-body-sm); max-width: 720px; }

/* ---------- Simple table (for compare / structured data) ---------- */
.simple-table { width: 100%; border-collapse: collapse; font-size: var(--fs-body-sm); }
.simple-table th, .simple-table td { text-align: left; padding: var(--space-md); border-bottom: 1px solid var(--border-subtle); }
.simple-table th { font-size: var(--fs-caption); text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-tertiary); }

/* ---------- 404 ---------- */
.error-hero { text-align: center; padding: var(--space-6xl) 0 var(--space-4xl); }
.error-hero .code { font-size: 6rem; font-weight: 700; color: var(--brand-primary); line-height: 1; letter-spacing: -0.02em; }

/* ---------- Convergence visual (fragmented tools -> DAANAK) ---------- */
.convergence { position: relative; height: 460px; margin-top: var(--space-2xl); }
.convergence-lines { position: absolute; inset: 0; width: 100%; height: 100%; }
.convergence-chip {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  background: var(--bg-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  font-size: var(--fs-body-sm);
  font-weight: 500;
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}
.convergence-center {
  position: absolute;
  left: 50%; bottom: 0;
  transform: translate(-50%, 0);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 20px 32px;
  background: var(--brand-primary);
  color: var(--on-brand);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-glow-gold);
  font-weight: 700;
}
.convergence-center img { height: 28px; }
.convergence-mobile { display: none; }
@media (max-width: 860px) {
  .convergence { display: none; }
  .convergence-mobile { display: flex; flex-direction: column; gap: var(--space-sm); margin-top: var(--space-2xl); }
}

/* =========================================================
   Phase 3 — Onboarding / Auth shells
   ========================================================= */

/* ---------- Minimal onboarding top bar (no marketing nav) ---------- */
.onboarding-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-height);
  border-bottom: 1px solid var(--border-subtle);
}
.onboarding-topbar .brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: var(--fs-body-lg);
}
.onboarding-topbar .brand img { height: 26px; }
.onboarding-topbar .exit-link { font-size: var(--fs-body-sm); color: var(--text-tertiary); }
.onboarding-topbar .exit-link:hover { color: var(--text-primary); }

.onboarding-shell { min-height: 100vh; display: flex; flex-direction: column; }
.onboarding-main { flex: 1; padding: var(--space-3xl) 0 var(--space-4xl); }
.onboarding-wrap { max-width: 640px; margin: 0 auto; padding: 0 var(--space-lg); }
.onboarding-wrap.wide { max-width: 880px; }
.onboarding-footer { padding: var(--space-lg) 0; border-top: 1px solid var(--border-subtle); }

/* ---------- Stepper / progress ---------- */
.stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: var(--space-2xl);
  flex-wrap: wrap;
}
.stepper .step {
  display: flex; align-items: center; gap: 8px;
  font-size: var(--fs-caption);
  color: var(--text-tertiary);
}
.stepper .step-dot {
  width: 26px; height: 26px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border-default);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 600;
  color: var(--text-tertiary);
  background: var(--bg-primary);
  flex-shrink: 0;
}
.stepper .step.is-done .step-dot { background: var(--accent-gold, #c5a059); border-color: var(--accent-gold, #c5a059); color: #ffffff; }
.stepper .step.is-active .step-dot { border-color: var(--accent-gold, #c5a059); color: var(--gold-600, #9a7a3a); box-shadow: 0 0 0 3px rgba(197, 160, 89, 0.22); font-weight: 700; }
.stepper .step.is-active .step-label { color: var(--text-primary); font-weight: 600; }
.stepper .step-label { display:none; }
.stepper .connector { width: 24px; height: 1px; background: var(--border-default); flex-shrink: 0; }
@media (min-width: 720px) {
  .stepper .step-label { display: inline; }
}

/* ---------- Onboarding intro / progress copy ---------- */
.onboarding-eyebrow-row { display:flex; align-items:center; justify-content:space-between; margin-bottom: var(--space-sm); }
.step-count { font-size: var(--fs-caption); color: var(--text-tertiary); }

/* ---------- Question option lists (single/multi select) ---------- */
.option-list { display: flex; flex-direction: column; gap: 10px; }
.option-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.option-item:hover { border-color: var(--text-tertiary); }
.option-item input { accent-color: var(--brand-primary); width: 18px; height: 18px; flex-shrink: 0; }
.option-item.is-selected { border-color: var(--brand-primary); background: var(--brand-subtle-bg); }

/* ---------- Recommendation cards ---------- */
.recommendation-card {
  display: flex; gap: var(--space-md);
  padding: var(--space-lg);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  background: var(--bg-primary);
}
.recommendation-card .rec-why {
  margin-top: 8px;
  font-size: var(--fs-caption);
  color: var(--sage-700);
  background: var(--sage-subtle-bg);
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

/* ---------- Success state (workspace created / trial confirmation) ---------- */
.success-badge {
  width: 64px; height: 64px;
  border-radius: var(--radius-full);
  background: var(--gold-50, #faf5ea);
  color: var(--gold-600, #9a7a3a);
  border: 1px solid var(--gold-line, #e8d9b8);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto var(--space-lg);
  box-shadow: 0 0 24px rgba(197, 160, 89, 0.2);
}

/* ---------- Authenticated shell (minimal, Phase 3 scope only) ---------- */
.auth-topbar {
  display: flex; align-items: center; justify-content: space-between;
  height: var(--nav-height);
  border-bottom: 1px solid var(--border-subtle);
}
.auth-topbar .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.auth-topbar .brand img { height: 24px; }
.workspace-pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: var(--fs-body-sm); font-weight: 500;
  padding: 6px 14px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  background: var(--bg-secondary);
}
.workspace-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success-500); }
.auth-user { display: flex; align-items: center; gap: var(--space-md); }
.auth-avatar {
  width: 32px; height: 32px; border-radius: var(--radius-full);
  background: var(--brand-primary); color: var(--on-brand);
  display: flex; align-items: center; justify-content: center;
  font-size: var(--fs-caption); font-weight: 700;
}

/* ---------- Product tour ---------- */
.tour-track { display: flex; flex-direction: column; gap: var(--space-md); }
.tour-panel {
  display: none;
  padding: var(--space-2xl);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  text-align: center;
}
.tour-panel.is-active { display: block; }
.tour-panel .badge { margin-bottom: var(--space-md); }
.tour-dots { display: flex; justify-content: center; gap: 8px; margin-top: var(--space-lg); }
.tour-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border-default); border: none; padding: 0; cursor: pointer; }
.tour-dot.is-active { background: var(--brand-primary); width: 20px; border-radius: 4px; transition: width var(--dur-fast) var(--ease-out); }

/* ---------- Demo state switcher (frontend-only demo aid, clearly labeled) ---------- */
.demo-switcher {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding: var(--space-md);
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-md);
  margin-top: var(--space-2xl);
  background: var(--bg-secondary);
}
.demo-switcher .demo-label { font-size: var(--fs-caption); color: var(--text-tertiary); width: 100%; margin-bottom: 4px; }

@media (max-width: 640px) {
  .onboarding-main { padding: var(--space-2xl) 0 var(--space-3xl); }
  .recommendation-card { flex-direction: column; }
}

/* =========================================================
   Phase 4 — Authenticated application shell
   ========================================================= */

.app-shell { display: flex; min-height: 100vh; }

/* ---------- Sidebar ---------- */
/* ---------- Sidebar (Adapts to DAANAK Website Theme & Dark Theme) ---------- */
.app-sidebar {
  width: 248px; flex-shrink: 0;
  background-color: var(--bg-sidebar, #ffffff);
  border-right: 1px solid var(--sidebar-border, #e5e7eb);
  color: var(--sidebar-text, #4b5563);
  display: flex; flex-direction: column;
  padding: var(--space-lg) var(--space-md);
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  transition: background var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out);
}
[data-theme="dark"] .app-sidebar {
  background-image: radial-gradient(120% 160px at 50% 0%, rgba(197, 160, 89, 0.08) 0%, transparent 100%);
}
.app-sidebar .brand {
  display: flex; align-items: center; gap: 10px;
  padding: var(--space-xs) var(--space-sm);
  margin-bottom: var(--space-xl);
  text-decoration: none;
}
.app-sidebar .brand img {
  height: 28px; width: auto;
  filter: drop-shadow(0 2px 8px rgba(197, 160, 89, 0.3));
}
.app-sidebar .brand span {
  color: var(--sidebar-text-bright, #111827);
  font-weight: 700; font-size: 1.1rem;
  letter-spacing: -0.02em;
  display: inline-flex; align-items: center; gap: 6px;
}
.sidebar-section-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--sidebar-section-color, var(--gold-600, #9a7a3a));
  opacity: 0.95;
  font-weight: 700;
  padding: var(--space-lg) var(--space-sm) var(--space-2xs);
}
.sidebar-nav { display: flex; flex-direction: column; gap: 3px; }
.sidebar-nav-item {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  padding: 9px 14px;
  border-radius: var(--radius-md);
  color: var(--sidebar-text, #4b5563);
  font-size: var(--fs-body-sm); font-weight: 500;
  border: 1px solid transparent;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.sidebar-nav-item svg {
  flex-shrink: 0;
  color: var(--sidebar-text, #5b6270);
  opacity: 0.85;
  transition: transform 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}
.sidebar-nav-item:hover {
  background: var(--sidebar-hover-bg, #f4f2ec);
  color: var(--sidebar-text-bright, #111827);
  border-color: var(--sidebar-border, #e5e7eb);
  transform: translateX(3px);
}
.sidebar-nav-item:hover svg {
  opacity: 1;
  color: var(--accent-gold, var(--gold-500, #c5a059));
}
.sidebar-nav-item.is-active {
  background: var(--sidebar-active-bg, #faf5ea);
  color: var(--sidebar-active-text, #9a7a3a);
  border-color: var(--sidebar-active-border, #e8d9b8);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(197, 160, 89, 0.15);
}
.sidebar-nav-item.is-active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 18px;
  border-radius: 2px;
  background: var(--accent-gold, #c5a059);
  box-shadow: 0 0 8px var(--accent-gold, #c5a059);
}
.sidebar-nav-item.is-active svg {
  color: var(--accent-gold, #c5a059);
  opacity: 1;
  filter: drop-shadow(0 0 6px rgba(212, 175, 55, 0.4));
}
.sidebar-nav-item .item-badge { margin-left: auto; }
.sidebar-spacer { flex: 1; }
.sidebar-foot {
  border-top: 1px solid var(--sidebar-border, #e5e7eb);
  padding-top: var(--space-md);
  margin-top: var(--space-md);
  font-size: var(--fs-caption);
  color: var(--sidebar-text, var(--text-on-dark-secondary, #9ca3af));
  opacity: 0.75;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-sidebar-toggle { display: none; }

/* ---------- Main column ---------- */
.app-main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg-surface, var(--bg-secondary, #fafaf9)); transition: background var(--dur-base) var(--ease-out); }
.app-topbar {
  height: var(--nav-height);
  border-bottom: 1px solid var(--card-border, var(--border-default));
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--space-lg);
  gap: var(--space-lg);
  position: sticky; top: 0;
  background: var(--topbar-bg, var(--card-bg, rgba(255, 255, 255, 0.92)));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 20;
}
.app-search { position: relative; flex: 1; max-width: 420px; }
.app-search input {
  width: 100%; border: 1px solid var(--border-default); border-radius: var(--radius-md);
  padding: 9px 14px 9px 38px; font-family: var(--font-sans); font-size: var(--fs-body-sm);
  background: var(--bg-primary); color: var(--text-primary);
  transition: all var(--dur-fast) var(--ease-out);
}
.app-search input:focus {
  outline: none;
  border-color: var(--gold-500, #c5a059);
  background: var(--bg-primary);
  box-shadow: 0 0 0 3px rgba(197, 160, 89, 0.22);
}
.app-search .search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-tertiary); pointer-events: none; }
.search-panel {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: var(--bg-primary); border: 1px solid var(--border-default); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); max-height: 360px; overflow-y: auto; display: none; z-index: 30;
}
.search-panel.is-open { display: block; }
.search-result { display: block; padding: 10px 14px; border-bottom: 1px solid var(--border-subtle); }
.search-result:last-child { border-bottom: none; }
.search-result:hover { background: var(--bg-secondary); }
.search-result .sr-title { font-size: var(--fs-body-sm); font-weight: 600; }
.search-result .sr-snippet { font-size: var(--fs-caption); color: var(--text-tertiary); margin-top: 2px; }
.search-empty { padding: var(--space-lg); text-align: center; font-size: var(--fs-body-sm); color: var(--text-tertiary); }

.app-topbar-actions { display: flex; align-items: center; gap: var(--space-md); flex-shrink: 0; }
.icon-btn {
  width: 38px; height: 38px; border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); position: relative; border: 1px solid var(--border-default);
  background: var(--bg-primary);
  transition: all var(--dur-fast) var(--ease-out);
}
.icon-btn:hover { background: var(--bg-secondary); color: var(--text-primary); border-color: var(--gold-400); }
.notif-badge {
  position: absolute; top: 4px; right: 4px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--error-500);
  border: 1.5px solid var(--bg-primary); display: none;
}
.notif-badge.is-visible { display: block; }
.notif-panel, .user-menu-panel {
  position: absolute; top: calc(100% + 10px); right: 0;
  width: 340px; background: var(--bg-primary); border: 1px solid var(--border-default); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl); display: none; z-index: 30; overflow: hidden;
}
.notif-panel.is-open, .user-menu-panel.is-open { display: block; }
.notif-panel-head { display: flex; justify-content: space-between; align-items: center; padding: var(--space-md) var(--space-lg); border-bottom: 1px solid var(--border-subtle); }
.notif-panel-head h4 { font-size: var(--fs-body-sm); font-weight: 600; }
.notif-list { max-height: 360px; overflow-y: auto; }
.notif-item { padding: var(--space-md) var(--space-lg); border-bottom: 1px solid var(--border-subtle); font-size: var(--fs-body-sm); }
.notif-item:last-child { border-bottom: none; }
.notif-item.is-unread { background: var(--gold-50, #faf5ea); }
.notif-item .ni-title { font-weight: 600; }
.notif-item .ni-body { color: var(--text-secondary); font-size: var(--fs-caption); margin-top: 2px; }
.notif-item .ni-time { color: var(--text-tertiary); font-size: var(--fs-caption); margin-top: 4px; }

.topbar-user { display: flex; align-items: center; gap: 10px; position: relative; }
.topbar-workspace { font-size: var(--fs-body-sm); font-weight: 500; color: var(--text-secondary); display: none; }
@media (min-width: 900px) { .topbar-workspace { display: inline; } }
.user-menu-panel { padding: var(--space-sm); width: 220px; }
.user-menu-panel a, .user-menu-panel button {
  display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: var(--radius-sm);
  font-size: var(--fs-body-sm); color: var(--text-primary);
  border: none; background: transparent; cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}
.user-menu-panel a:hover, .user-menu-panel button:hover { background: var(--gold-50, #faf5ea); color: var(--gold-600, #9a7a3a); }
.user-menu-panel .umi-email { padding: 9px 12px; font-size: var(--fs-caption); color: var(--text-tertiary); border-bottom: 1px solid var(--border-subtle); margin-bottom: 4px; }

.app-main { flex: 1; padding: var(--space-2xl) var(--space-lg) var(--space-4xl); }
.app-container { max-width: 1140px; margin: 0 auto; }

/* ---------- Shared app-page components ---------- */
.stat-tile {
  position: relative;
  overflow: hidden;
  padding: var(--space-xl) var(--space-lg);
  border: 1px solid var(--card-border, var(--border-default, #e5e7eb));
  border-radius: var(--radius-xl, 20px);
  background: var(--card-bg, #ffffff);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.02);
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
.stat-tile::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--accent-gold, #c5a059) 50%, transparent 100%);
  opacity: 0;
  transition: opacity 0.28s ease;
}
.stat-tile:hover {
  border-color: var(--gold-bright, #d4af37);
  box-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.08), 0 0 22px -2px rgba(197, 160, 89, 0.22);
  transform: translateY(-3px);
}
.stat-tile:hover::before {
  opacity: 1;
}
.stat-tile .stat-label {
  font-size: 11px;
  color: var(--text-tertiary, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: 700;
}
.stat-tile .stat-value {
  font-size: clamp(1.6rem, 1.4rem + 0.8vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-top: 8px;
  color: var(--text-primary, #111827);
}

.card-action-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-body-sm);
  font-weight: 600;
  color: var(--accent-gold, #c5a059);
  margin-top: var(--space-md);
  transition: transform 0.2s ease, color 0.2s ease;
}
.card:hover .card-action-link {
  transform: translateX(4px);
  color: var(--gold-600, #9a7a3a);
}

.role-badge {
  font-size: var(--fs-caption);
  padding: 3px 12px;
  border-radius: var(--radius-full);
  font-weight: 600;
  text-transform: capitalize;
  border: 1px solid transparent;
}
.role-badge.owner { background: var(--gold-50, #faf5ea); color: var(--gold-600, #9a7a3a); border-color: var(--gold-line, #e8d9b8); }
.role-badge.admin { background: #f4f2ec; color: #111827; border-color: #e5e7eb; }
.role-badge.member { background: #f8fafc; color: #475569; border-color: #e2e8f0; }

.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.status-dot.active { background: var(--success-500); }
.status-dot.invited { background: var(--gold-500); }
.status-dot.deactivated { background: var(--neutral-400); }

.app-table { width: 100%; border-collapse: collapse; background: var(--bg-primary); border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--border-default); }
@media (max-width: 720px) {
  .app-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }
  .app-table th, .app-table td { white-space: nowrap; }
}
.app-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  padding: 12px var(--space-md);
  border-bottom: 1px solid var(--border-default);
  background: var(--bg-secondary);
  font-weight: 600;
}
.app-table td {
  padding: 14px var(--space-md);
  border-bottom: 1px solid var(--border-subtle);
  font-size: var(--fs-body-sm);
  color: var(--text-primary);
}
.app-table tbody tr:hover { background: rgba(197, 160, 89, 0.04); }

/* ---------- Responsive: collapse sidebar to a drawer ---------- */
@media (max-width: 960px) {
  .app-sidebar {
    position: fixed; left: 0; top: 0; z-index: 50;
    transform: translateX(-100%);
    transition: transform var(--dur-base) var(--ease-out);
    box-shadow: var(--shadow-xl);
  }
  .app-sidebar.is-open { transform: translateX(0); }
  .app-sidebar-toggle { display: flex; }
  .app-search { max-width: none; }
  .topbar-workspace { display: none; }
  .app-main { padding: var(--space-lg) var(--space-md) var(--space-3xl); }
}
.sidebar-scrim {
  display: none; position: fixed; inset: 0; background: rgba(13,18,17,0.4); z-index: 40;
}
.sidebar-scrim.is-visible { display: block; }
