﻿/* ================================================================
   ZN ERP DOCUMENTATION — docs.css
   Brand: Dark Navy (#0b1120) + Orange (#f97316)
   ================================================================ */

/* ── CUSTOM PROPERTIES ─────────────────────────────────────────── */
:root {
  /* Brand */
  --xn-orange:       #f97316;
  --xn-orange-light: #fb923c;
  --xn-orange-muted: rgba(249, 115, 22, 0.12);
  --xn-navy:         #0b1120;
  --xn-navy-2:       #111827;

  /* Light theme */
  --bg-base:         #ffffff;
  --bg-sidebar:      #f8f9fc;
  --bg-sidebar-hov:  #f0f2f8;
  --bg-card:         #ffffff;
  --bg-code:         #f3f4f6;
  --bg-callout-tip:  #f0fdf4;
  --bg-callout-warn: #fffbeb;
  --bg-callout-info: #eff6ff;
  --bg-callout-note: #fafafa;

  --border:          #e5e7eb;
  --border-sidebar:  #e8eaed;

  --text-primary:    #111827;
  --text-secondary:  #4b5563;
  --text-muted:      #9ca3af;
  --text-sidebar:    #374151;
  --text-sidebar-hov:#111827;
  --text-link:       #f97316;

  --topbar-bg:       #ffffff;
  --topbar-border:   #e5e7eb;
  --topbar-height:   60px;

  --sidebar-width:   272px;
  --radius:          8px;
  --radius-lg:       12px;
  --shadow-sm:       0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md:       0 4px 12px rgba(0,0,0,.10);
  --shadow-lg:       0 10px 40px rgba(0,0,0,.14);

  --font-sans:       'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:       'JetBrains Mono', 'Fira Code', monospace;

  /* Category colours */
  --clr-green:  #16a34a; --clr-green-bg:  #f0fdf4;
  --clr-blue:   #2563eb; --clr-blue-bg:   #eff6ff;
  --clr-orange: #ea580c; --clr-orange-bg: #fff7ed;
  --clr-purple: #7c3aed; --clr-purple-bg: #faf5ff;
  --clr-teal:   #0d9488; --clr-teal-bg:   #f0fdfa;
  --clr-red:    #dc2626; --clr-red-bg:    #fef2f2;

  /* Transitions */
  --transition-fast: 120ms ease;
  --transition:      200ms ease;
  --transition-slow: 300ms ease;
}

/* ── DARK THEME ─────────────────────────────────────────────────── */
[data-theme="dark"] {
  --bg-base:         #0d1117;
  --bg-sidebar:      #161b22;
  --bg-sidebar-hov:  #1f2937;
  --bg-card:         #161b22;
  --bg-code:         #1f2937;
  --bg-callout-tip:  #052e16;
  --bg-callout-warn: #1c1400;
  --bg-callout-info: #0c1a3a;
  --bg-callout-note: #1a1a1a;

  --border:          #30363d;
  --border-sidebar:  #21262d;

  --text-primary:    #f0f6fc;
  --text-secondary:  #8b949e;
  --text-muted:      #6e7681;
  --text-sidebar:    #c9d1d9;
  --text-sidebar-hov:#f0f6fc;
  --text-link:       #fb923c;

  --topbar-bg:       #161b22;
  --topbar-border:   #30363d;

  --clr-green-bg:  #052e16;
  --clr-blue-bg:   #0c1a3a;
  --clr-orange-bg: #431407;
  --clr-purple-bg: #2e1065;
  --clr-teal-bg:   #042f2e;
  --clr-red-bg:    #450a0a;
}

/* ── RESET & BASE ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background var(--transition), color var(--transition);
}

a { color: var(--text-link); text-decoration: none; transition: color var(--transition-fast); }
a:hover { text-decoration: underline; }

/* ── SCROLLBAR ──────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ================================================================
   TOP NAVBAR
   ================================================================ */
.docs-topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-height);
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--topbar-border);
  z-index: 1000;
  transition: background var(--transition), border-color var(--transition);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
[data-theme="dark"] .docs-topbar {
  background: rgba(22, 27, 34, 0.92);
}

.docs-topbar-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 100%;
  padding: 0 24px;
  width: 100%;
  max-width: none;
  margin: 0;
}

/* Hamburger */
.sidebar-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
  flex-shrink: 0;
}
.sidebar-toggle-btn:hover { background: var(--bg-sidebar-hov); color: var(--text-primary); }

/* Brand */
.topbar-left { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.docs-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.brand-logo-wrap {
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, var(--xn-navy) 0%, #1e293b 100%);
  border-radius: 8px;
  padding: 4px 8px;
  gap: 2px;
}
[data-theme="dark"] .brand-logo-wrap {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  border: 1px solid var(--border);
}
.brand-xn  { font-size: 15px; font-weight: 800; color: #fff; letter-spacing: -0.5px; }
.brand-erp { font-size: 11px; font-weight: 600; color: var(--xn-orange-light); letter-spacing: 1px; }
.brand-docs-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.3px;
}
.docs-brand:hover .brand-docs-label { color: var(--text-primary); }
.docs-brand:hover { text-decoration: none; }

.version-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--xn-orange);
  background: var(--xn-orange-muted);
  border: 1px solid rgba(249, 115, 22, 0.2);
  border-radius: 99px;
  padding: 2px 8px;
  letter-spacing: 0.3px;
}

/* Search Trigger */
.topbar-search-btn {
  flex: 1;
  max-width: 480px;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-sidebar);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 13.5px;
  cursor: pointer;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
  margin: 0 auto;
}
.topbar-search-btn:hover {
  border-color: var(--xn-orange);
  box-shadow: 0 0 0 3px var(--xn-orange-muted);
  background: var(--bg-base);
}
.topbar-search-btn .bi-search { font-size: 14px; }
.topbar-search-btn span { flex: 1; text-align: left; }
.search-shortcut-hint { display: flex; gap: 3px; align-items: center; flex-shrink: 0; }
.search-shortcut-hint kbd,
.search-esc-hint {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 5px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-base);
  color: var(--text-muted);
}

/* Topbar Right */
.topbar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.topbar-link {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--text-secondary);
  padding: 6px 10px;
  border-radius: var(--radius);
  text-decoration: none;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.topbar-link:hover { background: var(--bg-sidebar-hov); color: var(--text-primary); text-decoration: none; }

.theme-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-secondary);
  font-size: 15px;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}
.theme-toggle-btn:hover { background: var(--bg-sidebar-hov); color: var(--xn-orange); border-color: var(--xn-orange); }

/* ================================================================
   DOCS LAYOUT  (topbar + sidebar + main)
   ================================================================ */
.docs-layout {
  display: flex;
  padding-top: var(--topbar-height);
  min-height: 100vh;
}

/* ================================================================
   SIDEBAR
   ================================================================ */
.docs-sidebar {
  position: fixed;
  top: var(--topbar-height);
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-sidebar);
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 900;
  transition: transform var(--transition-slow), background var(--transition), border-color var(--transition);
}
.docs-sidebar::-webkit-scrollbar { width: 4px; }

.sidebar-inner {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 20px 0 16px;
}

.sidebar-nav { flex: 1; }

/* Nav Group */
.nav-group { margin-bottom: 2px; }

.nav-group-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: var(--text-sidebar);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  border-radius: 0;
  transition: background var(--transition-fast), color var(--transition-fast);
  letter-spacing: 0.1px;
}
.nav-group-toggle:hover { background: var(--bg-sidebar-hov); color: var(--text-sidebar-hov); }

.nav-group-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  border-radius: 6px;
  font-size: 13px;
  flex-shrink: 0;
}
.nav-icon-green  { background: var(--clr-green-bg);  color: var(--clr-green);  }
.nav-icon-blue   { background: var(--clr-blue-bg);   color: var(--clr-blue);   }
.nav-icon-orange { background: var(--clr-orange-bg); color: var(--clr-orange); }
.nav-icon-purple { background: var(--clr-purple-bg); color: var(--clr-purple); }
.nav-icon-teal   { background: var(--clr-teal-bg);   color: var(--clr-teal);   }
.nav-icon-red    { background: var(--clr-red-bg);    color: var(--clr-red);    }

.nav-group-toggle span:not(.nav-group-icon) { flex: 1; }

.nav-chevron {
  font-size: 11px;
  color: var(--text-muted);
  transition: transform var(--transition);
  flex-shrink: 0;
}
.nav-group.open > .nav-group-toggle .nav-chevron { transform: rotate(90deg); }

/* Nav Group Items */
.nav-group-items {
  list-style: none;
  padding: 2px 0 6px 0;
  display: none;
}
.nav-group.open .nav-group-items { display: block; }

.nav-group-items a.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px 6px 51px;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-sidebar);
  border-left: 2px solid transparent;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
  text-decoration: none;
}
.nav-group-items a.nav-link:hover {
  background: var(--bg-sidebar-hov);
  color: var(--text-sidebar-hov);
  text-decoration: none;
}
.nav-group-items a.nav-link.active {
  color: var(--xn-orange);
  font-weight: 600;
  background: var(--xn-orange-muted);
  border-left-color: var(--xn-orange);
}
.nav-link-soon { opacity: 0.6; }
.nav-link-soon:hover { opacity: 0.85; }

.badge-soon {
  font-size: 10px;
  font-weight: 600;
  background: var(--bg-code);
  color: var(--text-muted);
  border-radius: 99px;
  padding: 1px 7px;
  letter-spacing: 0.3px;
  margin-left: auto;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 16px;
  margin-top: auto;
  border-top: 1px solid var(--border-sidebar);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sidebar-footer a {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
}
.sidebar-footer a:hover { color: var(--xn-orange); }
.sidebar-version {
  font-size: 11px;
  color: var(--text-muted);
}

/* ================================================================
   SIDEBAR OVERLAY (mobile)
   ================================================================ */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 899;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.visible { display: block; }

/* ================================================================
   MAIN CONTENT AREA
   ================================================================ */
.docs-main {
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar-width);
  transition: margin-left var(--transition-slow);
}
.docs-layout.no-sidebar .docs-main { margin-left: 0; }
.docs-layout.sidebar-collapsed .docs-main { margin-left: 0; }

/* ================================================================
   HOME PAGE
   ================================================================ */

/* Hero */
.docs-hero {
  background: linear-gradient(135deg, var(--xn-navy) 0%, #1a2744 55%, #0f172a 100%);
  padding: 72px 48px 64px;
  position: relative;
  overflow: hidden;
}
.docs-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 80% 20%, rgba(249,115,22,.18) 0%, transparent 60%),
    radial-gradient(ellipse 40% 40% at 20% 80%, rgba(37,99,235,.12) 0%, transparent 60%);
  pointer-events: none;
}
.docs-hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(249,115,22,.4), transparent);
}
.docs-hero-inner {
  position: relative;
  z-index: 1;
  max-width: none;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.95fr);
  gap: 56px;
  align-items: center;
}
.docs-hero-text { max-width: 580px; }
.docs-hero-video {
  width: 100%;
}
.docs-hero-video .video-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #000;
  box-shadow: 0 24px 60px rgba(0,0,0,.5),
              0 0 0 1px rgba(255,255,255,.08);
}
.docs-hero-video .video-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.docs-hero-video-caption {
  margin-top: 0.65rem;
  text-align: center;
  font-size: 0.85rem;
  color: rgba(255,255,255,.55);
  letter-spacing: 0.01em;
}
@media (max-width: 968px) {
  .docs-hero-inner {
    grid-template-columns: 1fr;
    gap: 32px;
    max-width: 720px;
  }
  .docs-hero-text { max-width: none; }
}

.docs-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(249,115,22,.15);
  border: 1px solid rgba(249,115,22,.3);
  color: var(--xn-orange-light);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 99px;
  margin-bottom: 20px;
  letter-spacing: 0.5px;
}

.docs-hero h1 {
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 800;
  color: #fff;
  line-height: 1.15;
  margin-bottom: 16px;
  letter-spacing: -1px;
}
.docs-hero h1 em {
  font-style: normal;
  background: linear-gradient(90deg, var(--xn-orange), var(--xn-orange-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.docs-hero p {
  font-size: 17px;
  color: rgba(255,255,255,.72);
  max-width: 560px;
  margin-bottom: 32px;
  line-height: 1.7;
}

/* Hero Search */
.hero-search-wrap {
  display: flex;
  align-items: center;
  gap: 0;
  max-width: 540px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 12px;
  padding: 0 16px;
  transition: border-color var(--transition), box-shadow var(--transition);
  cursor: text;
}
.hero-search-wrap:hover,
.hero-search-wrap:focus-within {
  border-color: rgba(249,115,22,.6);
  box-shadow: 0 0 0 4px rgba(249,115,22,.12);
}
.hero-search-wrap .bi-search { color: rgba(255,255,255,.5); font-size: 16px; flex-shrink: 0; }
.hero-search-input {
  flex: 1;
  height: 52px;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-sans);
  font-size: 15px;
  color: #fff;
  padding: 0 12px;
}
.hero-search-input::placeholder { color: rgba(255,255,255,.4); }
.hero-search-hint {
  display: flex;
  gap: 3px;
  align-items: center;
  flex-shrink: 0;
}
.hero-search-hint kbd {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 5px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 4px;
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.5);
}

/* Category Cards */
.docs-categories {
  padding: 52px 48px;
  max-width: none;
  width: 100%;
}
.docs-section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.category-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: inherit;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  position: relative;
  overflow: hidden;
}
.category-card:hover {
  border-color: var(--card-accent, var(--xn-orange));
  box-shadow: 0 4px 20px rgba(0,0,0,.1);
  transform: translateY(-2px);
  text-decoration: none;
}
.category-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--card-accent, var(--xn-orange));
  opacity: 0;
  transition: opacity var(--transition);
}
.category-card:hover::before { opacity: 1; }

.card-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border-radius: 10px;
  font-size: 20px;
  background: var(--card-bg, var(--xn-orange-muted));
  color: var(--card-accent, var(--xn-orange));
}
.category-card h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}
.category-card p {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.55;
}
.card-arrow {
  margin-top: auto;
  font-size: 13px;
  color: var(--card-accent, var(--xn-orange));
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0;
  transition: opacity var(--transition);
}
.category-card:hover .card-arrow { opacity: 1; }

/* Quick Links */
.docs-quicklinks {
  padding: 0 48px 52px;
}
.quicklinks-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.quicklink-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: border-color var(--transition-fast), color var(--transition-fast), background var(--transition-fast);
}
.quicklink-item:hover {
  border-color: var(--xn-orange);
  color: var(--xn-orange);
  background: var(--xn-orange-muted);
  text-decoration: none;
}

/* ================================================================
   ARTICLE LAYOUT (sidebar + content + on-page TOC)
   ================================================================ */
.docs-article-wrap {
  display: flex;
  gap: 0;
  min-height: calc(100vh - var(--topbar-height));
}

.docs-article {
  flex: 1;
  min-width: 0;
  padding: 40px 48px 64px;
  max-width: none;
}

/* Page TOC (right rail) */
.docs-page-toc {
  width: 220px;
  flex-shrink: 0;
  padding: 40px 24px 40px 0;
  position: sticky;
  top: calc(var(--topbar-height) + 20px);
  align-self: flex-start;
  max-height: calc(100vh - var(--topbar-height) - 40px);
  overflow-y: auto;
}
.page-toc-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.page-toc-list { list-style: none; }
.page-toc-list li + li { margin-top: 2px; }
.page-toc-list a {
  font-size: 12.5px;
  color: var(--text-muted);
  text-decoration: none;
  display: block;
  padding: 4px 8px;
  border-left: 2px solid transparent;
  border-radius: 0 4px 4px 0;
  transition: color var(--transition-fast), border-color var(--transition-fast);
  line-height: 1.4;
}
.page-toc-list a:hover { color: var(--text-primary); }
.page-toc-list a.toc-active { color: var(--xn-orange); border-left-color: var(--xn-orange); font-weight: 500; }
.page-toc-list .toc-h3 { padding-left: 20px; }

/* ================================================================
   ARTICLE TYPOGRAPHY
   ================================================================ */
.article-header { margin-bottom: 36px; border-bottom: 1px solid var(--border); padding-bottom: 28px; }

.article-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.article-breadcrumb a { color: var(--text-muted); text-decoration: none; }
.article-breadcrumb a:hover { color: var(--xn-orange); }
.article-breadcrumb .sep { color: var(--border); }

.article-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.article-meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.article-title {
  font-size: clamp(22px, 4vw, 36px);
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
  letter-spacing: -0.5px;
  margin: 0;
}

.article-lead {
  font-size: 17px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 16px 0 0;
}

/* Headings */
.docs-article h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 40px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  letter-spacing: -0.3px;
  scroll-margin-top: 80px;
}
.docs-article h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 28px 0 10px;
  scroll-margin-top: 80px;
}
.docs-article h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 20px 0 8px;
  scroll-margin-top: 80px;
}

/* Paragraphs & Lists */
.docs-article p { margin-bottom: 16px; font-size: 15px; line-height: 1.75; }
.docs-article ul, .docs-article ol { margin: 0 0 16px 24px; }
.docs-article li { font-size: 15px; line-height: 1.75; margin-bottom: 4px; }
.docs-article li + li { margin-top: 4px; }

/* Inline code */
.docs-article code:not(pre code) {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--bg-code);
  color: var(--xn-orange);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* Code block */
.docs-article pre {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  overflow-x: auto;
  margin: 20px 0;
}
.docs-article pre code {
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--text-primary);
  line-height: 1.65;
}

/* ================================================================
   CALLOUT BOXES
   ================================================================ */
.callout {
  display: flex;
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--radius);
  margin: 20px 0;
  border-left: 4px solid;
  font-size: 14.5px;
  line-height: 1.65;
}
.callout-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.callout-body { flex: 1; }
.callout-body strong { display: block; font-weight: 700; margin-bottom: 4px; }

.callout-tip  { background: var(--bg-callout-tip);  border-color: var(--clr-green);  }
.callout-tip  .callout-icon { color: var(--clr-green); }
.callout-tip  .callout-body strong { color: var(--clr-green); }

.callout-warn { background: var(--bg-callout-warn); border-color: #f59e0b; }
.callout-warn .callout-icon { color: #f59e0b; }
.callout-warn .callout-body strong { color: #92400e; }
[data-theme="dark"] .callout-warn .callout-body strong { color: #fbbf24; }

.callout-info { background: var(--bg-callout-info); border-color: var(--clr-blue); }
.callout-info .callout-icon { color: var(--clr-blue); }
.callout-info .callout-body strong { color: var(--clr-blue); }

.callout-note { background: var(--bg-callout-note); border-color: var(--text-muted); border-left-color: var(--border); }
.callout-note .callout-icon { color: var(--text-muted); }

/* ================================================================
   STEP CARDS
   ================================================================ */
.steps-list {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.step-item {
  display: flex;
  gap: 20px;
  position: relative;
}
.step-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 19px;
  top: 40px;
  bottom: -16px;
  width: 2px;
  background: var(--border);
}
.step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--xn-orange);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  flex-shrink: 0;
  z-index: 1;
  box-shadow: 0 0 0 4px var(--xn-orange-muted);
}
.step-content {
  flex: 1;
  padding-bottom: 32px;
}
.step-content h4 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 8px 0 8px;
}
.step-content p { margin-bottom: 10px; }

/* ================================================================
   VIDEO EMBED
   ================================================================ */
.video-embed {
  background: var(--xn-navy);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: 24px 0;
  position: relative;
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
}
.video-embed iframe {
  width: 100%; height: 100%;
  border: none;
  display: block;
}
.video-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: rgba(255,255,255,.6);
  text-align: center;
  padding: 32px;
}
.video-placeholder .bi-play-circle { font-size: 52px; color: var(--xn-orange); }
.video-placeholder h4 { color: rgba(255,255,255,.85); font-size: 16px; }
.video-placeholder p { font-size: 13px; }

/* ================================================================
   ARTICLE FOOTER: FEEDBACK + PREV/NEXT
   ================================================================ */
.article-footer { margin-top: 52px; }

/* Feedback */
.article-feedback {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 32px;
}
.feedback-label { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.feedback-label small { display: block; font-weight: 400; color: var(--text-secondary); font-size: 13px; margin-top: 2px; }
.feedback-btns { display: flex; gap: 8px; }
.feedback-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--text-secondary);
}
.feedback-btn:hover { border-color: var(--xn-orange); color: var(--xn-orange); background: var(--xn-orange-muted); }
.feedback-btn.yes:hover { border-color: var(--clr-green); color: var(--clr-green); background: var(--clr-green-bg); }
.feedback-btn.no:hover  { border-color: var(--clr-red);   color: var(--clr-red);   background: var(--clr-red-bg);   }
.feedback-success { font-size: 14px; color: var(--clr-green); display: none; align-items: center; gap: 6px; }

/* Prev / Next Navigation */
.article-prevnext {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.prevnext-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.prevnext-link:hover { border-color: var(--xn-orange); box-shadow: var(--shadow-sm); text-decoration: none; }
.prevnext-link.next { text-align: right; }
.prevnext-direction {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}
.prevnext-link.next .prevnext-direction { justify-content: flex-end; }
.prevnext-title { font-size: 14px; font-weight: 600; color: var(--text-primary); }

/* ================================================================
   OVERVIEW PAGE  (Getting Started landing)
   ================================================================ */
.overview-hero {
  background: linear-gradient(135deg, var(--clr-green-bg) 0%, transparent 60%);
  border: 1px solid rgba(22, 163, 74, .2);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 36px;
  display: flex;
  align-items: center;
  gap: 20px;
}
[data-theme="dark"] .overview-hero { border-color: rgba(22,163,74,.15); }
.overview-hero-icon {
  font-size: 44px;
  color: var(--clr-green);
  flex-shrink: 0;
}
.overview-hero h2 { font-size: 22px; font-weight: 800; color: var(--text-primary); margin: 0 0 6px; }
.overview-hero p  { font-size: 15px; color: var(--text-secondary); margin: 0; }

.learn-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.learn-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-primary);
}
.learn-item i { color: var(--clr-green); font-size: 16px; flex-shrink: 0; }

/* Chapter card */
.chapter-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 20px 0;
}
.chapter-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.chapter-card:hover { border-color: var(--xn-orange); box-shadow: var(--shadow-sm); text-decoration: none; }
.chapter-num {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-muted);
  width: 28px;
  flex-shrink: 0;
}
.chapter-info { flex: 1; }
.chapter-info h4 { font-size: 15px; font-weight: 700; margin: 0 0 2px; color: var(--text-primary); }
.chapter-info p  { font-size: 13px; color: var(--text-secondary); margin: 0; }
.chapter-arrow { color: var(--text-muted); transition: color var(--transition), transform var(--transition); }
.chapter-card:hover .chapter-arrow { color: var(--xn-orange); transform: translateX(4px); }

/* ================================================================
   SEARCH MODAL
   ================================================================ */
.search-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
}
.search-modal.open { display: flex; }
.search-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.search-modal-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 600px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.search-modal-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  border-bottom: 1px solid var(--border);
}
.search-modal-input-wrap .bi-search { font-size: 17px; color: var(--text-muted); flex-shrink: 0; }
.search-modal-input-wrap input {
  flex: 1;
  height: 56px;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-sans);
  font-size: 16px;
  color: var(--text-primary);
}
.search-modal-input-wrap input::placeholder { color: var(--text-muted); }
.search-results { padding: 12px; min-height: 80px; max-height: 400px; overflow-y: auto; }
.search-placeholder {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 20px 8px;
  color: var(--text-muted);
  font-size: 14px;
}
.search-result-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: background var(--transition-fast);
}
.search-result-item:hover { background: var(--bg-sidebar-hov); text-decoration: none; }
.search-result-title { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.search-result-section { font-size: 12px; color: var(--text-muted); }
.search-result-item mark { background: var(--xn-orange-muted); color: var(--xn-orange); border-radius: 2px; padding: 0 2px; }

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 1024px) {
  .docs-page-toc { display: none; }
  .docs-article { max-width: 100%; }
}

@media (max-width: 768px) {
  .docs-sidebar {
    transform: translateX(-100%);
    box-shadow: none;
  }
  .docs-sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }
  .docs-main { margin-left: 0 !important; }

  .docs-hero { padding: 48px 24px 40px; }
  .docs-categories { padding: 36px 24px; }
  .docs-quicklinks { padding: 0 24px 36px; }
  .docs-article { padding: 28px 24px 48px; }

  .topbar-search-btn .search-shortcut-hint { display: none; }
  .topbar-search-btn span { display: none; }
  .topbar-search-btn { max-width: 40px; padding: 0 11px; flex: 0; }

  .article-prevnext { grid-template-columns: 1fr; }
  .article-feedback { flex-direction: column; align-items: flex-start; }

  .category-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  :root { --topbar-height: 56px; }
  .docs-hero h1 { font-size: 26px; }
  .hero-search-wrap { display: none; }
}

/* ================================================================
   UTILITIES
   ================================================================ */
.d-none { display: none !important; }
.d-lg-inline { display: inline; }
@media (max-width: 992px) { .d-lg-inline { display: none; } }

/* Fade-in animation */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeInUp .35s ease both; }
.fade-in-delay-1 { animation-delay: .05s; }
.fade-in-delay-2 { animation-delay: .10s; }
.fade-in-delay-3 { animation-delay: .15s; }
.fade-in-delay-4 { animation-delay: .20s; }
.fade-in-delay-5 { animation-delay: .25s; }
.fade-in-delay-6 { animation-delay: .30s; }



/* ================================================================
   ADDITIONAL COMPONENTS (Phase 2)
   ================================================================ */

/* Aliases so .callout-warning / .callout-success work alongside .callout-warn */
.callout-warning { background: var(--bg-callout-warn); border-color: #f59e0b; }
.callout-warning .callout-icon { color: #f59e0b; }
.callout-warning .callout-body strong { color: #92400e; }
[data-theme="dark"] .callout-warning .callout-body strong { color: #fbbf24; }

.callout-success { background: var(--clr-green-bg); border-color: var(--clr-green); }
.callout-success .callout-icon { color: var(--clr-green); }
.callout-success .callout-body strong { color: var(--clr-green); }

/* Inline keyboard key */
.kbd {
  display: inline-block;
  padding: 2px 8px;
  font: 600 12px/1 'JetBrains Mono', monospace;
  color: var(--text-primary);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 5px;
  vertical-align: middle;
  white-space: nowrap;
  box-shadow: 0 1px 0 rgba(0,0,0,.04);
}

/* Documentation tables */
.docs-table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  font-size: 14.5px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.docs-table thead { background: var(--bg-secondary); }
.docs-table th, .docs-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.docs-table th { font-weight: 600; color: var(--text-primary); }
.docs-table tr:last-child td { border-bottom: 0; }
.docs-table tbody tr:hover { background: var(--bg-secondary); }

/* Screenshot placeholder (until real screenshots are added) */
.screenshot-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 18px 0;
  padding: 40px 24px;
  background: var(--bg-secondary);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  text-align: center;
}
.screenshot-placeholder .bi { font-size: 36px; color: var(--xn-orange); opacity: .65; }
.screenshot-placeholder span { font-weight: 600; color: var(--text-primary); font-size: 14px; }
.screenshot-placeholder small { font-size: 12px; opacity: .85; }
.screenshot-placeholder small code {
  background: var(--bg-primary);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* ==================================================================
   NESTED SUB-GROUPS (added 2026-05 for deep menu structure)
   ================================================================== */
.nav-group-items .nav-subgroup { list-style: none; }
.nav-subgroup-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px 6px 51px;
  background: none;
  border: 0;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-sidebar);
  text-align: left;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.nav-subgroup-toggle:hover {
  background: var(--bg-sidebar-hov);
  color: var(--text-sidebar-hov);
}
.nav-subgroup-toggle span { flex: 1; }
.nav-subgroup-toggle .nav-chevron {
  font-size: 10px;
  color: var(--text-muted);
  transition: transform var(--transition);
}
.nav-subgroup.open > .nav-subgroup-toggle .nav-chevron { transform: rotate(90deg); }

.nav-subgroup-items {
  list-style: none;
  padding: 0;
  margin: 0;
  display: none;
}
.nav-subgroup.open .nav-subgroup-items { display: block; }
.nav-subgroup-items a.nav-link {
  padding-left: 67px;
  font-size: 12.5px;
}
.nav-group-items li.nav-sub a.nav-link,
.nav-subgroup-items li.nav-sub a.nav-link {
  padding-left: 83px;
  font-size: 12px;
  color: var(--text-muted);
}
.nav-group-items li.nav-sub2 a.nav-link,
.nav-subgroup-items li.nav-sub2 a.nav-link {
  padding-left: 99px;
  font-size: 11.5px;
  color: var(--text-muted);
  opacity: 0.85;
}

/* callouts */
.docs-article .callout { margin: 1.2rem 0; padding: 0.85rem 1rem; border-left: 4px solid #1d72e8; background: rgba(29,114,232,0.06); border-radius: 6px; color: var(--text-default, #1b1f24); font-size: 0.95rem; line-height: 1.55; }
.docs-article .callout strong { font-weight: 600; color: var(--text-default, #1b1f24); }
.docs-article .callout p { color: inherit; }
.docs-article .callout p:last-child { margin-bottom: 0; }
.docs-article .callout-tip { border-left-color: #1f9d55; background: rgba(31,157,85,0.07); }
.docs-article .callout-warning { border-left-color: #d97706; background: rgba(217,119,6,0.08); }
.docs-article dl { margin: 1rem 0 1.5rem; }
.docs-article dl dt { font-weight: 600; margin-top: 0.6rem; color: var(--text-default, #1b1f24); }
.docs-article dl dd { margin: 0 0 0.3rem 1.25rem; color: var(--text-muted, #57606a); }
.docs-article kbd { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.85em; padding: 0.1rem 0.4rem; border: 1px solid rgba(0,0,0,0.18); border-bottom-width: 2px; border-radius: 4px; background: #f6f8fa; color: #1b1f24; }

/* Dark mode overrides for callouts / kbd */
[data-theme="dark"] .docs-article .callout { background: rgba(29,114,232,0.14); color: var(--text-default); }
[data-theme="dark"] .docs-article .callout strong { color: var(--text-default); }
[data-theme="dark"] .docs-article .callout-tip { background: rgba(31,157,85,0.18); border-left-color: #2ecc71; }
[data-theme="dark"] .docs-article .callout-warning { background: rgba(217,119,6,0.20); border-left-color: #f59e0b; }
[data-theme="dark"] .docs-article dl dt { color: var(--text-default); }
[data-theme="dark"] .docs-article dl dd { color: var(--text-muted); }
[data-theme="dark"] .docs-article kbd { background: #1f2428; color: #f0f3f6; border-color: rgba(255,255,255,0.22); }


/* Brief highlight when jumping to an anchor via smart-hash resolver */
.docs-article .hash-flash { animation: hashFlash 1.5s ease-out; }
@keyframes hashFlash {
  0%   { background-color: rgba(255, 213, 79, 0.55); }
  100% { background-color: transparent; }
}
[data-theme="dark"] .docs-article .hash-flash { animation: hashFlashDark 1.5s ease-out; }
@keyframes hashFlashDark {
  0%   { background-color: rgba(255, 213, 79, 0.28); }
  100% { background-color: transparent; }
}


/* ── DOC FIGURES (screenshots) ─────────────────────────────────── */
.doc-figure {
  margin: 1.75rem 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.doc-figure img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  background: var(--bg-card);
}
.doc-figure figcaption {
  margin-top: 0.6rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  text-align: center;
  font-style: italic;
}
[data-theme="dark"] .doc-figure img {
  box-shadow: 0 1px 3px rgba(0,0,0,.45), 0 1px 2px rgba(0,0,0,.30);
}

/* ── DOC VIDEO EMBEDS (16:9 responsive iframes) ────────────────── */
.doc-video {
  margin: 2.25rem 0;
}
.doc-video h2,
.doc-video h3 {
  margin-bottom: 0.75rem;
}
.doc-video .video-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #000;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}
.doc-video .video-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.doc-video .video-caption {
  margin-top: 0.6rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  text-align: center;
}

