/* ============================================================
   MARQUIS IQ HELP — Shared Stylesheet
   help.css · All help pages link to this file
   ============================================================ */

/* ─────────────────────────────────────────────────────────────
   1. DESIGN TOKENS
   ───────────────────────────────────────────────────────────── */
:root {
  /* ── Marquis IQ brand blue (primary action color in-app) ── */
  --blue:          #2272F2;
  --blue-dk:       #1A5FCC;
  --blue-lt:       #5A9BFF;
  --blue-bg:       rgba(34, 114, 242, 0.08);
  --blue-bdr:      rgba(34, 114, 242, 0.25);
  --grad-blue:     linear-gradient(135deg, #3B82F6 0%, #2272F2 55%, #1A5FCC 100%);

  /* ── Nav chrome (dark navy matching app top bar) ── */
  --nav-bg:            #0D1B2E;   /* app bar navy */
  --nav-bg-sidebar:    #102035;   /* sidebar: just a touch lighter */
  --nav-ink:           rgba(255,255,255,0.82);
  --nav-ink-hover:     rgba(255,255,255,0.90);
  --nav-ink-active:    #ffffff;
  --nav-hover-bg:      rgba(255,255,255,0.07);
  --nav-active-bg:     rgba(34,114,242,0.22);
  --nav-active-accent: #2272F2;
  --nav-divider:       rgba(255,255,255,0.09);
  --nav-rule:          rgba(255,255,255,0.12);

  /* ── Module / IQ colors ── */
  --inv-color:     #2272F2;
  --inv-bg:        rgba(34, 114, 242, 0.08);
  --price-color:   #FF6C0C;
  --price-bg:      rgba(255, 108, 12, 0.07);
  --sales-color:   #059669;
  --sales-bg:      rgba(5, 150, 105, 0.07);
  --ops-color:     #7C3AED;
  --ops-bg:        rgba(124, 58, 237, 0.07);
  --proc-color:    #0891B2;
  --proc-bg:       rgba(8, 145, 178, 0.07);
  --enrich-color:  #B45309;
  --enrich-bg:     rgba(180, 83, 9, 0.07);

  /* ── Content area surfaces (cool blue-white) ── */
  --bg:            #F0F5FB;   /* light blue-gray page bg */
  --white:         #FFFFFF;
  --card:          #FFFFFF;
  --surface-2:     #E6EEF8;   /* secondary surface, blue-tinted */

  /* ── Text (cool slate, not warm brown) ── */
  --ink:           #1E293B;
  --ink-2:         #4A5568;
  --ink-3:         #8895A7;

  /* ── Rules (blue-gray) ── */
  --rule:          #C8D8EC;
  --rule-light:    #DCE8F5;

  /* ── Help layout ── */
  --topbar-h:      56px;
  --sidebar-w:     264px;
  --content-max:   780px;

  /* Typography */
  --font:          'Inter', system-ui, -apple-system, sans-serif;

  /* Radius */
  --r-sm:          6px;
  --r-md:          10px;
  --r-lg:          16px;

  /* Shadows */
  --shadow-sm:     0 1px 3px rgba(13,27,46,0.08), 0 1px 2px rgba(13,27,46,0.05);
  --shadow-md:     0 4px 12px rgba(13,27,46,0.12), 0 1px 3px rgba(13,27,46,0.07);

  /* Animation */
  --ease:          cubic-bezier(0.16, 1, 0.3, 1);
  --fast:          0.12s;
  --mid:           0.20s;
}

/* ─────────────────────────────────────────────────────────────
   2. BASE RESET
   ───────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: var(--font); cursor: pointer; }
ul, ol { list-style: none; }

/* ─────────────────────────────────────────────────────────────
   3. TOP BAR
   ───────────────────────────────────────────────────────────── */
.help-topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: var(--nav-bg);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  gap: 1rem;
  z-index: 300;
}

.topbar-menu-btn {
  color: rgba(255,255,255,0.7);
}
.topbar-menu-btn:hover { color: #fff; }

.topbar-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  text-decoration: none;
}

.topbar-logo-mark {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.topbar-logo-mark img { width: 28px; height: 28px; object-fit: contain; display: block; }

/* Fallback when img not present */
.topbar-logo-mark svg { width: 14px; height: 14px; }

.topbar-logo-name {
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.topbar-logo-name span {
  font-weight: 400;
  color: rgba(255,255,255,0.45);
  margin-left: 0.2em;
}

.topbar-divider {
  width: 1px;
  height: 20px;
  background: rgba(255,255,255,0.15);
  flex-shrink: 0;
}

/* Search bar in topbar */
.topbar-search {
  flex: 1;
  max-width: 420px;
  position: relative;
}

.topbar-search-input {
  width: 100%;
  height: 36px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: var(--r-md);
  background: rgba(255,255,255,0.09);
  padding: 0 0.75rem 0 2.25rem;
  font-family: var(--font);
  font-size: 0.875rem;
  color: #ffffff;
  transition: border-color var(--fast), background var(--fast), box-shadow var(--fast);
  outline: none;
}

.topbar-search-input::placeholder { color: rgba(255,255,255,0.38); }

.topbar-search-input:focus {
  background: rgba(255,255,255,0.14);
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(34,114,242,0.30);
}

.topbar-search-icon {
  position: absolute;
  left: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255,255,255,0.40);
  pointer-events: none;
}

/* Search results dropdown */
.topbar-search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  max-height: 480px;
  overflow-y: auto;
  z-index: 400;
  display: none;
}

.topbar-search-results.open { display: block; }

.search-result-group { padding: 0.5rem 0; }

.search-result-group-label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  padding: 0.5rem 1rem 0.25rem;
}

.search-result-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  cursor: pointer;
  transition: background var(--fast);
  text-decoration: none;
  color: inherit;
}

.search-result-item:hover { background: var(--surface-2); }

.search-result-item.active { background: var(--blue-bg); }

.sri-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
  font-size: 13px;
}

.sri-body { min-width: 0; }

.sri-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sri-snippet {
  font-size: 0.8125rem;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-empty {
  padding: 1.5rem 1rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--ink-3);
}

.topbar-spacer { flex: 1; }

.topbar-actions { display: flex; align-items: center; gap: 0.5rem; }

.topbar-btn {
  height: 32px;
  padding: 0 0.875rem;
  border-radius: var(--r-sm);
  font-size: 0.8125rem;
  font-weight: 600;
  border: 1.5px solid rgba(255,255,255,0.22);
  background: transparent;
  color: rgba(255,255,255,0.72);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: border-color var(--fast), color var(--fast);
  white-space: nowrap;
}

.topbar-btn:hover { border-color: rgba(255,255,255,0.55); color: #ffffff; }

/* ─────────────────────────────────────────────────────────────
   4. SHELL LAYOUT
   ───────────────────────────────────────────────────────────── */
.help-shell {
  display: flex;
  min-height: 100vh;
  padding-top: var(--topbar-h);
}

/* ─────────────────────────────────────────────────────────────
   5. SIDEBAR
   ───────────────────────────────────────────────────────────── */
.help-sidebar {
  position: fixed;
  top: var(--topbar-h);
  left: 0;
  width: var(--sidebar-w);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--nav-bg-sidebar);
  border-right: none;
  padding: 1rem 0 2rem;
  flex-shrink: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.12) transparent;
}

.help-sidebar::-webkit-scrollbar { width: 4px; }
.help-sidebar::-webkit-scrollbar-track { background: transparent; }
.help-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.14); border-radius: 2px; }

/* Nav group (module) */
.nav-group { margin-bottom: 0.25rem; }

.nav-group-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.875rem;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--nav-ink);
  cursor: pointer;
  user-select: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  transition: color var(--fast);
}

.nav-group-header:hover { color: var(--nav-ink-hover); }

.nav-group-chevron {
  margin-left: auto;
  transition: transform var(--mid) var(--ease);
  flex-shrink: 0;
  color: rgba(255,255,255,0.28);
}

.nav-group.collapsed .nav-group-chevron { transform: rotate(-90deg); }

.nav-group-icon {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 10px;
}

/* Module icons on dark sidebar — boosted opacity so they're visible */
.nav-group[data-module="inventory"]   .nav-group-icon { background: rgba(34,114,242,0.20);  color: #60A5FA; }
.nav-group[data-module="pricing"]     .nav-group-icon { background: rgba(255,108,12,0.20);  color: #FB923C; }
.nav-group[data-module="sales"]       .nav-group-icon { background: rgba(5,150,105,0.20);   color: #34D399; }
.nav-group[data-module="operations"]  .nav-group-icon { background: rgba(124,58,237,0.20);  color: #A78BFA; }
.nav-group[data-module="procurement"] .nav-group-icon { background: rgba(8,145,178,0.20);   color: #38BDF8; }
.nav-group[data-module="enrich"]      .nav-group-icon { background: rgba(180,83,9,0.22);    color: #FBB57E; }

/* Nav items list */
.nav-items {
  overflow: hidden;
  transition: max-height var(--mid) var(--ease);
  max-height: 600px;
}

.nav-group.collapsed .nav-items { max-height: 0; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3125rem 0.875rem 0.3125rem 2.25rem;
  font-size: 0.8125rem;
  color: var(--nav-ink);
  text-decoration: none;
  border-radius: 0;
  transition: color var(--fast), background var(--fast);
  position: relative;
  line-height: 1.4;
}

.nav-link:hover { color: var(--nav-ink-hover); background: var(--nav-hover-bg); }

.nav-link.active {
  color: var(--nav-ink-active);
  font-weight: 600;
  background: var(--nav-active-bg);
}

.nav-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--nav-active-accent);
  border-radius: 0 2px 2px 0;
}

/* Top-level nav links (home, getting-started) */
.nav-top-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--nav-ink);
  text-decoration: none;
  transition: color var(--fast), background var(--fast);
  border-radius: 0;
  margin-bottom: 0.125rem;
}

.nav-top-link:hover { color: var(--nav-ink-hover); background: var(--nav-hover-bg); }
.nav-top-link.active { color: var(--nav-ink-active); font-weight: 600; background: var(--nav-active-bg); }
.nav-top-link svg { color: rgba(255,255,255,0.40); flex-shrink: 0; }

/* Sidebar divider */
.nav-divider {
  height: 1px;
  background: var(--nav-divider);
  margin: 0.625rem 0.875rem;
}

/* ─────────────────────────────────────────────────────────────
   6. MAIN CONTENT AREA
   ───────────────────────────────────────────────────────────── */
.help-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  padding: 2rem 2.5rem 4rem;
}

.help-article {
  max-width: var(--content-max);
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  color: var(--ink-3);
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.breadcrumb a { color: var(--ink-3); text-decoration: none; transition: color var(--fast); }
.breadcrumb a:hover { color: var(--blue); }
.breadcrumb-sep { color: var(--rule); }
.breadcrumb-current { color: var(--ink-2); }

/* Module eyebrow */
.module-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  margin-bottom: 0.75rem;
}

.module-eyebrow.inv      { color: var(--inv-color);    background: var(--inv-bg); }
.module-eyebrow.pricing  { color: var(--price-color);  background: var(--price-bg); }
.module-eyebrow.sales    { color: var(--sales-color);  background: var(--sales-bg); }
.module-eyebrow.ops      { color: var(--ops-color);    background: var(--ops-bg); }
.module-eyebrow.proc     { color: var(--proc-color);   background: var(--proc-bg); }
.module-eyebrow.enrich   { color: var(--enrich-color); background: var(--enrich-bg); }

/* Page heading */
.page-title {
  font-size: clamp(1.625rem, 2.5vw, 2.125rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

.page-subtitle {
  font-size: 1rem;
  color: var(--ink-2);
  line-height: 1.65;
  margin-bottom: 2rem;
  max-width: 620px;
}

/* Section anchors — offset for fixed topbar */
.anchor-target {
  scroll-margin-top: calc(var(--topbar-h) + 1.5rem);
}

/* Article headings */
.help-article h2 {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 2.25rem 0 0.625rem;
  padding-top: 0.25rem;
  scroll-margin-top: calc(var(--topbar-h) + 1rem);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.help-article h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink);
  margin: 1.5rem 0 0.5rem;
  scroll-margin-top: calc(var(--topbar-h) + 1rem);
}

.help-article p {
  font-size: 0.9375rem;
  color: var(--ink-2);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.help-article ul, .help-article ol {
  list-style: disc;
  padding-left: 1.25rem;
  margin-bottom: 1rem;
}

.help-article li {
  font-size: 0.9375rem;
  color: var(--ink-2);
  line-height: 1.65;
  margin: 0.3rem 0;
}

/* Copy link button on headings */
.anchor-link {
  opacity: 0;
  color: var(--ink-3);
  transition: opacity var(--fast);
  flex-shrink: 0;
  background: none;
  border: none;
  padding: 2px 4px;
  border-radius: var(--r-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

h2:hover .anchor-link,
h3:hover .anchor-link { opacity: 1; }
.anchor-link:hover { background: var(--surface-2); color: var(--blue); }

/* Callout boxes */
.callout {
  display: flex;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: var(--r-md);
  margin: 1.25rem 0;
  font-size: 0.875rem;
  line-height: 1.6;
}

.callout-icon { font-size: 1rem; flex-shrink: 0; margin-top: 0.1rem; }
.callout-body { color: var(--ink-2); }
.callout-body strong { color: var(--ink); }

.callout.note    { background: #EFF6FF; border: 1px solid #BFDBFE; }
.callout.tip     { background: #F0FDF4; border: 1px solid #BBF7D0; }
.callout.warning { background: #FFFBEB; border: 1px solid #FDE68A; }
.callout.caution { background: #FFF1F2; border: 1px solid #FECDD3; }

/* Inline code */
code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.8125rem;
  background: var(--surface-2);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 0.1em 0.35em;
  color: var(--ink);
}

/* ── Marquis Recommendation panel ──────────────────────────── */
.marquis-rec {
  border: 1px solid rgba(194,65,12,0.22);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: 0 2px 14px rgba(194,65,12,0.12), 0 1px 3px rgba(0,0,0,0.06);
  margin: 0 0 2rem;
}

.marquis-rec-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #C2410C;
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.625rem 1.25rem;
}

.marquis-rec-list {
  list-style: none;
  padding: 0.875rem 1.25rem 1.125rem;
  margin: 0;
  background: #FFF7ED;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.marquis-rec-list li {
  font-size: 0.875rem;
  color: #78350F;
  line-height: 1.65;
  padding-left: 1.375rem;
  position: relative;
}

.marquis-rec-list li::before {
  content: '→';
  position: absolute;
  left: 0;
  top: 0.1em;
  color: #C2410C;
  font-size: 0.8125rem;
  font-weight: 600;
}

.marquis-rec-list li strong { color: #431407; }

/* ── Coming-soon nav links ──────────────────────────────────── */
.nav-link-soon {
  opacity: 0.38;
  pointer-events: none;
  cursor: default;
}
.nav-link-soon:hover {
  color: var(--nav-ink) !important;
  background: transparent !important;
}

/* Separator */
.help-hr {
  height: 1px;
  background: var(--rule-light);
  margin: 2rem 0;
  border: none;
}

/* ─────────────────────────────────────────────────────────────
   7. SCREENSHOTS
   ───────────────────────────────────────────────────────────── */
.help-screenshot {
  margin: 1rem 0 1.5rem;
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}

.help-screenshot img {
  width: 100%;
  display: block;
}

.help-screenshot figcaption {
  font-size: 0.8125rem;
  color: var(--ink-3);
  background: var(--surface-2);
  border-top: 1px solid var(--rule);
  padding: 0.45rem 0.875rem;
  line-height: 1.5;
}

/* Narrower screenshots (dialogs, menus) */
.help-screenshot.narrow {
  max-width: 480px;
}

.help-screenshot.x-narrow {
  max-width: 320px;
}

/* ─────────────────────────────────────────────────────────────
   8. HOME PAGE
   ───────────────────────────────────────────────────────────── */
.home-hero {
  padding: 2.5rem 0 2rem;
  border-bottom: 1px solid var(--rule-light);
  margin-bottom: 2.5rem;
}

.home-hero-label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--blue);
  margin-bottom: 0.5rem;
}

.home-hero-title {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--ink);
  margin-bottom: 0.75rem;
}

.home-hero-sub {
  font-size: 1rem;
  color: var(--ink-2);
  max-width: 520px;
  margin-bottom: 1.75rem;
  line-height: 1.65;
}

/* Home search bar */
.home-search-wrap {
  position: relative;
  max-width: 560px;
}

.home-search-input {
  width: 100%;
  height: 48px;
  border: 1.5px solid var(--rule);
  border-radius: var(--r-lg);
  background: var(--white);
  padding: 0 3.5rem 0 3rem;
  font-family: var(--font);
  font-size: 0.9375rem;
  color: var(--ink);
  outline: none;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--fast), box-shadow var(--fast);
}

.home-search-input::placeholder { color: var(--ink-3); }

.home-search-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px var(--blue-bg);
}

.home-search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-3);
  pointer-events: none;
}

.home-search-kbd {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 0.6875rem;
  color: var(--ink-3);
  background: var(--surface-2);
  border: 1px solid var(--rule);
  border-radius: 5px;
  padding: 2px 6px;
  pointer-events: none;
}

/* Home search results panel */
.home-search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  max-height: 440px;
  overflow-y: auto;
  z-index: 100;
  display: none;
}

.home-search-results.open { display: block; }

/* Module cards grid */
.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.module-card {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  padding: 1.25rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  transition: box-shadow var(--fast), border-color var(--fast), transform var(--fast);
}

.module-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--rule);
  transform: translateY(-1px);
}

.module-card-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.module-card[data-module="inventory"]   .module-card-icon { background: var(--inv-bg);    color: var(--inv-color); }
.module-card[data-module="pricing"]     .module-card-icon { background: var(--price-bg);  color: var(--price-color); }
.module-card[data-module="sales"]       .module-card-icon { background: var(--sales-bg);  color: var(--sales-color); }
.module-card[data-module="operations"]  .module-card-icon { background: var(--ops-bg);    color: var(--ops-color); }
.module-card[data-module="procurement"] .module-card-icon { background: var(--proc-bg);   color: var(--proc-color); }
.module-card[data-module="enrich"]      .module-card-icon { background: var(--enrich-bg); color: var(--enrich-color); }

.module-card-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.module-card-desc {
  font-size: 0.8125rem;
  color: var(--ink-3);
  line-height: 1.5;
  flex: 1;
}

.module-card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.25rem;
}

.module-card-link {
  font-size: 0.75rem;
  color: var(--ink-3);
  background: var(--surface-2);
  border: 1px solid var(--rule-light);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  text-decoration: none;
  transition: color var(--fast), background var(--fast);
}

.module-card-link:hover { color: var(--blue); background: var(--blue-bg); border-color: var(--blue-bdr); }

/* Popular topics list */
.topic-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.topic-list-item {
  border-bottom: 1px solid var(--rule-light);
}

.topic-list-item:last-child { border-bottom: none; }

.topic-list-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 0;
  font-size: 0.875rem;
  color: var(--ink-2);
  text-decoration: none;
  gap: 0.5rem;
  transition: color var(--fast);
}

.topic-list-link:hover { color: var(--blue); }

.topic-list-badge {
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  flex-shrink: 0;
}

/* ─────────────────────────────────────────────────────────────
   9. GLOSSARY CARDS
   ───────────────────────────────────────────────────────────── */
.gloss-toolbar {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.gloss-search-wrap {
  flex: 1;
  min-width: 200px;
  position: relative;
}

.gloss-search-input {
  width: 100%;
  height: 38px;
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  background: var(--white);
  padding: 0 0.75rem 0 2.25rem;
  font-family: var(--font);
  font-size: 0.875rem;
  outline: none;
  transition: border-color var(--fast);
}

.gloss-search-input:focus { border-color: var(--blue); }

.gloss-search-icon {
  position: absolute;
  left: 0.65rem; top: 50%;
  transform: translateY(-50%);
  color: var(--ink-3);
  pointer-events: none;
}

.gloss-btn {
  height: 38px;
  padding: 0 0.875rem;
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  background: var(--white);
  font-family: var(--font);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--fast), color var(--fast);
}

.gloss-btn:hover { background: var(--surface-2); color: var(--ink); }

.gloss-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--ink-2);
  cursor: pointer;
  user-select: none;
}

.gloss-toggle-wrap input { width: 15px; height: 15px; accent-color: var(--blue); cursor: pointer; }

.gloss-counter {
  font-size: 0.8125rem;
  color: var(--ink-3);
  margin-bottom: 1rem;
}

.gloss-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 700px) {
  .gloss-grid { grid-template-columns: 1fr 1fr; }
}

.gloss-card {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  padding: 1rem 1rem 0.875rem;
  box-shadow: var(--shadow-sm);
  scroll-margin-top: calc(var(--topbar-h) + 1rem);
}

.gloss-card.core {
  border-color: #FFB36A;
  box-shadow: 0 2px 6px rgba(255,140,0,0.1);
}

.gloss-term {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #030E37;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  flex-wrap: wrap;
  line-height: 1.35;
}

.gloss-aka {
  font-weight: 500;
  color: #51608C;
  font-size: 0.8125rem;
  margin-left: 2px;
}

.badge-core {
  display: inline-block;
  padding: 2px 8px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.015em;
  color: #A04900;
  background: #FFE8D2;
  border: 1px solid #FF9A4A;
  border-radius: 999px;
  vertical-align: middle;
  white-space: nowrap;
}

.gloss-def {
  font-size: 0.875rem;
  color: var(--ink-2);
  line-height: 1.6;
  margin-bottom: 0;
}

.gloss-note {
  margin-top: 0.625rem;
  font-size: 0.8125rem;
  color: var(--ink-2);
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: var(--r-sm);
  padding: 0.5rem 0.625rem;
  line-height: 1.5;
}

.gloss-bullets {
  margin: 0.5rem 0 0 1rem;
  padding-left: 0.5rem;
  list-style: disc;
}

.gloss-bullets li {
  font-size: 0.8125rem;
  color: var(--ink-2);
  margin: 0.25rem 0;
  line-height: 1.5;
}

mark {
  background: #fff2a8;
  padding: 0 2px;
  border-radius: 3px;
}

/* Copy-link anchor button on gloss terms */
.gloss-anchor-btn {
  opacity: 0;
  margin-left: auto;
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink-3);
  padding: 2px 4px;
  border-radius: 4px;
  transition: opacity var(--fast), color var(--fast), background var(--fast);
  display: inline-flex;
  align-items: center;
}

.gloss-card:hover .gloss-anchor-btn { opacity: 1; }
.gloss-anchor-btn:hover { color: var(--blue); background: var(--blue-bg); }

/* Copied toast */
.copy-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: var(--ink);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: var(--r-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 999;
  white-space: nowrap;
}

.copy-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ─────────────────────────────────────────────────────────────
   9. OVERVIEW PAGE (module landing)
   ───────────────────────────────────────────────────────────── */
.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.875rem;
  margin: 1.5rem 0;
}

.overview-card {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  padding: 1.125rem 1.125rem 1rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: box-shadow var(--fast), transform var(--fast);
}

.overview-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.overview-card-label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
}

.overview-card-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.overview-card-desc {
  font-size: 0.8125rem;
  color: var(--ink-3);
  line-height: 1.5;
}

.overview-card-arrow {
  margin-top: auto;
  color: var(--ink-3);
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  transition: color var(--fast);
}

.overview-card:hover .overview-card-arrow { color: var(--blue); }

/* Coming-soon badge */
.badge-soon {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 2px 7px;
  background: var(--surface-2);
  border: 1px solid var(--rule);
  color: var(--ink-3);
  border-radius: 999px;
}

/* ─────────────────────────────────────────────────────────────
   10. RESPONSIVE
   ───────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .help-sidebar {
    transform: translateX(-100%);
    transition: transform var(--mid) var(--ease);
    z-index: 250;
  }

  .help-sidebar.open { transform: translateX(0); }

  .help-main {
    margin-left: 0;
    padding: 1.5rem 1.25rem 3rem;
  }

  .topbar-search { display: none; }
}

@media (max-width: 600px) {
  .gloss-grid { grid-template-columns: 1fr; }
  .module-grid { grid-template-columns: 1fr 1fr; }
}

/* ─────────────────────────────────────────────────────────────
   11. MOBILE MENU BUTTON
   ───────────────────────────────────────────────────────────── */
.topbar-menu-btn {
  display: none;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  padding: 4px;
  color: rgba(255,255,255,0.70);
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  transition: background var(--fast), color var(--fast);
}

.topbar-menu-btn:hover { background: rgba(255,255,255,0.09); color: #ffffff; }

@media (max-width: 900px) {
  .topbar-menu-btn { display: flex; }
}

/* Sidebar overlay (mobile) */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 240;
  backdrop-filter: blur(2px);
}

.sidebar-overlay.open { display: block; }
