// module-pages.jsx, Custom module pages for Intake, Drafting, Review,
// Negotiation, Repository, Analytics, Obligations.
// Follows the same structure as ESignaturePage in esignature-page.jsx.

// ─── Shared helpers ───────────────────────────────────────────────────────────

function FeatSection({ eyebrow, title, body, bullets, mockup, flip, soft, ctaLabel, ctaHref, badge }) {
  return (
    <section className="section" style={soft ? { background: "var(--bg-soft)", borderTop: "1px solid var(--line)", borderBottom: "1px solid var(--line)" } : {}}>
      <div className="container">
        <div className={"feat-grid" + (flip ? " feat-grid--flip" : "")}>
          <div>
            <div style={{ display: "flex", alignItems: "center", gap: 8, flexWrap: "wrap" }}>
              <span className="eyebrow">{eyebrow}</span>
              {badge && (
                <span style={{ fontSize: 10.5, fontWeight: 600, letterSpacing: "0.06em", textTransform: "uppercase", padding: "3px 9px", borderRadius: 99, background: "linear-gradient(135deg, rgba(124,92,211,0.14), rgba(88,67,245,0.10))", border: "1px solid rgba(124,92,211,0.28)", color: "var(--accent)", display: "inline-flex", alignItems: "center", gap: 5 }}>
                  <svg width="9" height="9" viewBox="0 0 24 24" fill="currentColor"><path d="M12 2l2.4 7.4H22l-6.2 4.5 2.4 7.4L12 17l-6.2 4.3 2.4-7.4L2 9.4h7.6z"/></svg>
                  {badge}
                </span>
              )}
            </div>
            <h2 className="h-section" style={{ marginTop: 16, marginBottom: 20 }}
              dangerouslySetInnerHTML={{ __html: title }} />
            <p className="lede" style={{ marginBottom: 32 }}>{body}</p>
            {bullets && (
              <div style={{ display: "flex", flexDirection: "column", gap: 18 }}>
                {bullets.map((b, i) => (
                  <div key={i} style={{ display: "flex", gap: 14, alignItems: "flex-start" }}>
                    <span style={{ flex: "0 0 16px", marginTop: 3, color: "var(--accent)" }}>
                      <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5">
                        <polyline points="20 6 9 17 4 12"/>
                      </svg>
                    </span>
                    <p style={{ fontSize: 14.5, color: "var(--ink-2)", lineHeight: 1.55, margin: 0 }}>{b}</p>
                  </div>
                ))}
              </div>
            )}
            {ctaLabel && ctaHref && (
              <a href={ctaHref} className="btn btn-ghost" style={{ marginTop: 28, display: "inline-flex", alignItems: "center", gap: 6 }}>
                {ctaLabel} <Icon name="arrow" size={13} />
              </a>
            )}
          </div>
          <div>
            <div className="showcase-panel-mockup" style={{ borderRadius: 16, border: "1px solid var(--line)" }}>
              {mockup}
            </div>
          </div>
        </div>
      </div>
    </section>
  );
}

function ModuleDeptSection({ module, depts, title, lede, mockupFn }) {
  const [active, setActive] = React.useState(0);
  const dept = depts[active];
  return (
    <section className="section" style={{ background: "var(--bg-soft)", borderTop: "1px solid var(--line)", borderBottom: "1px solid var(--line)" }}>
      <div className="container">
        {/* Centered header */}
        <div className="cc-section-header" style={{ textAlign: "center", maxWidth: 640, margin: "0 auto 40px" }}>
          <span className="eyebrow">Built for every team</span>
          {title ? (
            <>
              <h2 className="h-section" style={{ marginTop: 16 }}>{title}</h2>
              {lede && <p style={{ fontSize: 17, color: "var(--ink-3)", lineHeight: 1.65, marginTop: 16 }}>{lede}</p>}
            </>
          ) : (
            <h2 className="h-section" style={{ marginTop: 16 }}>
              Who uses <em>{module}</em>?
            </h2>
          )}
        </div>

        {/* Centered pill tabs */}
        <div style={{ display: "flex", justifyContent: "center", gap: 8, flexWrap: "wrap", marginBottom: 40 }}>
          {depts.map((d, i) => (
            <button key={d.label} onClick={() => setActive(i)} style={{
              height: 38, padding: "0 20px", borderRadius: 999, border: "1px solid",
              borderColor: i === active ? "var(--accent)" : "var(--line-strong)",
              background: i === active ? "var(--accent)" : "var(--bg-elevated)",
              color: i === active ? "#fff" : "var(--ink-2)",
              fontFamily: "inherit", fontSize: 13.5, fontWeight: i === active ? 500 : 400,
              cursor: "pointer", transition: "all 140ms ease", whiteSpace: "nowrap",
            }}>
              {d.label}
            </button>
          ))}
        </div>

        {/* Two-column card */}
        <div className="card mob-stack" style={{ padding: 0, overflow: "hidden", display: "grid", gridTemplateColumns: "1fr 1fr", minHeight: 380 }}>
          {/* Left: copy */}
          <div style={{ padding: "48px 48px", display: "flex", flexDirection: "column", justifyContent: "center", borderRight: "1px solid var(--line)" }}>
            <span style={{ fontSize: 11, fontWeight: 500, letterSpacing: "0.12em", textTransform: "uppercase", color: "var(--accent)", marginBottom: 16 }}>
              {dept.label}
            </span>
            <h3 style={{ fontSize: "clamp(20px, 2.2vw, 28px)", fontWeight: 500, letterSpacing: "-0.022em", lineHeight: 1.25, color: "var(--ink-1)", margin: "0 0 16px" }}>
              {dept.tagline ? dept.tagline : <>How {dept.label} uses <em style={{ color: "var(--accent)", fontStyle: "normal" }}>{module}</em></>}
            </h3>
            <p style={{ fontSize: 14.5, color: "var(--ink-3)", lineHeight: 1.65, margin: dept.bullets ? "0 0 28px" : "0 0 24px" }}>{dept.desc}</p>
            {dept.bullets && (
              <ul style={{ margin: "0 0 32px", padding: 0, listStyle: "none", display: "flex", flexDirection: "column", gap: 10 }}>
                {dept.bullets.map((b, i) => (
                  <li key={i} style={{ display: "flex", alignItems: "flex-start", gap: 10, fontSize: 14, color: "var(--ink-2)", lineHeight: 1.5 }}>
                    <span style={{ flex: "0 0 13px", marginTop: 3, color: "var(--accent)" }}>
                      <svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.8"><polyline points="20 6 9 17 4 12"/></svg>
                    </span>
                    {b}
                  </li>
                ))}
              </ul>
            )}
            <a href={dept.href} style={{ display: "inline-flex", alignItems: "center", gap: 6, fontSize: 13.5, fontWeight: 500, color: "var(--accent)", textDecoration: "none" }}>
              {dept.tagline ? `Learn more about ${dept.label}` : `See ${dept.label} solutions`} <Icon name="arrow" size={12} />
            </a>
          </div>

          {/* Right: mockup or icon fallback */}
          <div className="showcase-panel-mockup" style={{ padding: "40px", display: "flex", alignItems: "center", justifyContent: "center" }}>
            {dept.mockup ? dept.mockup : mockupFn ? mockupFn(dept.label) : (
              <div style={{ display: "flex", flexDirection: "column", alignItems: "center", gap: 16 }}>
                <div style={{ width: 72, height: 72, borderRadius: 20, background: "var(--accent-soft)", border: "1px solid rgba(124,92,211,0.18)", display: "grid", placeItems: "center", color: "var(--accent)" }}>
                  <Icon name={dept.icon} size={32} />
                </div>
                <div style={{ fontSize: 13, fontWeight: 500, color: "var(--ink-3)", letterSpacing: "-0.01em" }}>{dept.label}</div>
              </div>
            )}
          </div>
        </div>
      </div>
    </section>
  );
}

function ModuleFAQSection({ faqs }) {
  const [open, setOpen] = React.useState(null);
  const faqSchema = {
    "@context": "https://schema.org",
    "@type": "FAQPage",
    "mainEntity": faqs.map(f => ({
      "@type": "Question",
      "name": f.q,
      "acceptedAnswer": {
        "@type": "Answer",
        "text": f.a
      }
    }))
  };
  return (
    <section className="section">
      <script
        type="application/ld+json"
        dangerouslySetInnerHTML={{ __html: JSON.stringify(faqSchema) }}
      />
      <div className="container">
        <div className="mob-stack" style={{ display: "grid", gridTemplateColumns: "0.4fr 1fr", gap: 80, alignItems: "flex-start" }}>
          <div className="cc-section-header" style={{ position: "sticky", top: 88 }}>
            <span className="eyebrow">FAQ</span>
            <h2 className="h-section" style={{ marginTop: 16 }}>
              We're here to help with any questions <em>you have</em>.
            </h2>
          </div>
          <div>
            {faqs.map((f, i) => (
              <div key={i} style={{ borderBottom: "1px solid var(--line)" }}>
                <button
                  onClick={() => setOpen(open === i ? null : i)}
                  style={{ width: "100%", display: "flex", justifyContent: "space-between", alignItems: "center", gap: 16, padding: "20px 0", background: "none", border: "none", cursor: "pointer", textAlign: "left" }}
                >
                  <span style={{ fontSize: 16, fontWeight: 400, color: open === i ? "var(--accent)" : "var(--ink-1)", transition: "color 160ms ease", lineHeight: 1.4 }}>{f.q}</span>
                  <span style={{ flex: "0 0 20px", height: 20, display: "grid", placeItems: "center", color: open === i ? "var(--accent)" : "var(--ink-4)", transition: "color 160ms ease, transform 200ms ease", transform: open === i ? "rotate(45deg)" : "rotate(0deg)" }}>
                    <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
                      <line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/>
                    </svg>
                  </span>
                </button>
                <div style={{ overflow: "hidden", maxHeight: open === i ? 240 : 0, transition: "max-height 280ms cubic-bezier(.4,0,.2,1)" }}>
                  <p style={{ fontSize: 14.5, color: "var(--ink-3)", lineHeight: 1.65, paddingBottom: 20, margin: 0 }}>{f.a}</p>
                </div>
              </div>
            ))}
          </div>
        </div>
      </div>
    </section>
  );
}

// ═══════════════════════════════════════════════════════════════════
// INTAKE
// ═══════════════════════════════════════════════════════════════════

function IntakeFormMockup() {
  return (
    <div style={{ background: "var(--bg-elevated)", border: "1px solid var(--line)", borderRadius: 16, overflow: "hidden", boxShadow: "0 30px 60px -20px rgba(14,14,16,0.10), 0 4px 12px -4px rgba(14,14,16,0.04)" }}>
      <div style={{ padding: "13px 18px", borderBottom: "1px solid var(--line)", display: "flex", alignItems: "center", gap: 8 }}>
        <span style={{ color: "var(--accent)" }}><Icon name="intake" size={13} /></span>
        <span style={{ fontSize: 12, fontWeight: 500, color: "var(--ink-1)" }}>New contract request</span>
        <span style={{ marginLeft: "auto", fontSize: 10.5, padding: "2px 8px", borderRadius: 99, background: "var(--accent-soft)", color: "var(--accent)" }}>30 sec</span>
      </div>
      <div style={{ padding: 18, display: "flex", flexDirection: "column", gap: 12 }}>
        {[
          { label: "Contract type", value: "Customer MSA", accent: true },
          { label: "Counterparty", value: "Velora Industries AB" },
          { label: "Deal value", value: "€420 000" },
          { label: "Region", value: "EU, Sweden" },
        ].map((f) => (
          <div key={f.label} style={{ display: "flex", justifyContent: "space-between", alignItems: "center", padding: "8px 12px", borderRadius: 8, background: "var(--bg-soft)", border: f.accent ? "1px solid rgba(110,86,207,0.2)" : "1px solid transparent" }}>
            <span style={{ fontSize: 12, color: "var(--ink-4)" }}>{f.label}</span>
            <span style={{ fontSize: 12.5, fontWeight: 500, color: f.accent ? "var(--accent)" : "var(--ink-1)" }}>{f.value}</span>
          </div>
        ))}
        <div style={{ marginTop: 4, padding: "10px 14px", borderRadius: 10, background: "rgba(31,138,76,0.06)", border: "1px solid rgba(31,138,76,0.2)", display: "flex", alignItems: "center", gap: 8 }}>
          <svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="var(--success)" strokeWidth="2.5"><polyline points="20 6 9 17 4 12"/></svg>
          <span style={{ fontSize: 12, color: "var(--success)", fontWeight: 500 }}>Routed → Senior Legal Review · SLA: 2 days</span>
        </div>
      </div>
    </div>
  );
}

function IntakeSlackMockup() {
  return (
    <div style={{ background: "var(--bg-elevated)", border: "1px solid var(--line)", borderRadius: 16, overflow: "hidden", boxShadow: "0 30px 60px -20px rgba(14,14,16,0.10), 0 4px 12px -4px rgba(14,14,16,0.04)", padding: 18 }}>
      <div style={{ fontSize: 11, fontWeight: 500, letterSpacing: "0.12em", textTransform: "uppercase", color: "var(--ink-4)", marginBottom: 14 }}># legal-requests</div>
      {[
        { from: "Linus Berg", msg: "/contract new NDA, Northwind AB", time: "10:14", accent: true },
        { from: "ContractControl", msg: "✓ NDA request created. Routed to Legal. SLA: today 17:00.", time: "10:14", bot: true },
        { from: "ContractControl", msg: "✓ Draft ready for review. Clause risk: Low.", time: "10:22", bot: true },
        { from: "Linus Berg", msg: "Approved 👍", time: "10:24" },
        { from: "ContractControl", msg: "✓ Sent to Northwind for signature.", time: "10:24", bot: true },
      ].map((m, i) => (
        <div key={i} style={{ display: "flex", gap: 10, marginBottom: 10 }}>
          <div style={{ width: 28, height: 28, borderRadius: "50%", flexShrink: 0, background: m.bot ? "var(--accent-soft)" : "linear-gradient(135deg, #C7D2FE, #7B61FF)", display: "grid", placeItems: "center" }}>
            {m.bot ? <Icon name="review" size={12} style={{ color: "var(--accent)" }} /> : null}
          </div>
          <div style={{ flex: 1 }}>
            <div style={{ display: "flex", alignItems: "baseline", gap: 6, marginBottom: 2 }}>
              <span style={{ fontSize: 12.5, fontWeight: 600, color: m.bot ? "var(--accent)" : "var(--ink-1)" }}>{m.from}</span>
              <span style={{ fontSize: 11, color: "var(--ink-5)" }}>{m.time}</span>
            </div>
            <div style={{ fontSize: 12.5, color: m.accent ? "var(--accent)" : "var(--ink-2)", fontFamily: m.accent ? "var(--font-mono)" : "inherit", lineHeight: 1.5 }}>{m.msg}</div>
          </div>
        </div>
      ))}
    </div>
  );
}

function IntakeRoutingMockup() {
  return (
    <div style={{ background: "var(--bg-elevated)", border: "1px solid var(--line)", borderRadius: 16, overflow: "hidden", boxShadow: "0 30px 60px -20px rgba(14,14,16,0.10), 0 4px 12px -4px rgba(14,14,16,0.04)" }}>
      <div style={{ padding: "13px 18px", borderBottom: "1px solid var(--line)", display: "flex", alignItems: "center", gap: 8 }}>
        <span style={{ color: "var(--accent)" }}><Icon name="analytics" size={13} /></span>
        <span style={{ fontSize: 12, fontWeight: 500, color: "var(--ink-1)" }}>Routing rules</span>
        <span style={{ marginLeft: "auto", fontSize: 11, color: "var(--ink-4)" }}>3 active</span>
      </div>
      <div style={{ padding: 16, display: "flex", flexDirection: "column", gap: 10 }}>
        {[
          { if: "Value > €500k", then: "Route → General Counsel", tone: "warn" },
          { if: "Type = NDA", then: "Auto-draft + send", tone: "ok" },
          { if: "Region = US", then: "Route → US Legal Team", tone: "neutral" },
        ].map((r, i) => (
          <div key={i} style={{ display: "flex", gap: 10, alignItems: "center", padding: "10px 12px", borderRadius: 10, background: "var(--bg-soft)", border: "1px solid var(--line)" }}>
            <span style={{ fontSize: 11, padding: "2px 8px", borderRadius: 99, background: r.tone === "ok" ? "rgba(31,138,76,0.08)" : r.tone === "warn" ? "rgba(232,179,57,0.10)" : "var(--bg-elevated)", color: r.tone === "ok" ? "var(--success)" : r.tone === "warn" ? "#B8860B" : "var(--ink-4)", border: "1px solid " + (r.tone === "ok" ? "rgba(31,138,76,0.2)" : r.tone === "warn" ? "rgba(232,179,57,0.2)" : "var(--line)"), fontWeight: 500, flexShrink: 0 }}>IF</span>
            <span style={{ fontSize: 12.5, color: "var(--ink-2)", flex: 1 }}>{r.if}</span>
            <span style={{ fontSize: 11, color: "var(--ink-4)" }}>→</span>
            <span style={{ fontSize: 12.5, color: "var(--ink-1)", fontWeight: 500 }}>{r.then}</span>
          </div>
        ))}
        <div style={{ padding: "8px 12px", borderRadius: 8, background: "var(--accent-soft)", border: "1px solid rgba(110,86,207,0.2)", fontSize: 12, color: "var(--accent)", textAlign: "center" }}>
          + Add rule
        </div>
      </div>
    </div>
  );
}

function IntakeTrailMockup() {
  const steps = [
    { label: "Request submitted", meta: "NDA · Kvist Group", by: "Erik Svensson, Sales", time: "Mon 09:14", done: true },
    { label: "Routed to Legal", meta: "Rule match: Type = NDA", by: "System", time: "Mon 09:14", done: true },
    { label: "Reviewed & approved", meta: "No redlines required", by: "Asha Singh, Legal", time: "Mon 11:02", done: true },
    { label: "Sent for signature", meta: "2 signers · BankID", by: "ContractControl", time: "Mon 11:03", done: true },
    { label: "Fully executed", meta: "Signed · filed to repository", by: null, time: "Mon 14:37", done: true, final: true },
  ];
  return (
    <div style={{ background: "var(--bg-elevated)", border: "1px solid var(--line)", borderRadius: 16, overflow: "hidden", boxShadow: "0 30px 60px -20px rgba(14,14,16,0.10), 0 4px 12px -4px rgba(14,14,16,0.04)" }}>
      {/* Header */}
      <div style={{ padding: "11px 16px", borderBottom: "1px solid var(--line)", display: "flex", alignItems: "center", gap: 8, background: "var(--bg-soft)" }}>
        <span style={{ fontSize: 12, fontWeight: 500, color: "var(--ink-2)" }}>REQ-118</span>
        <span style={{ fontSize: 11.5, color: "var(--ink-3)" }}>·</span>
        <span style={{ fontSize: 12, color: "var(--ink-2)" }}>NDA · Kvist Group</span>
        <span style={{ marginLeft: "auto", fontSize: 11, fontWeight: 500, padding: "2px 9px", borderRadius: 99, background: "rgba(22,163,74,0.08)", color: "#166534", border: "1px solid rgba(22,163,74,0.2)" }}>Completed</span>
      </div>
      {/* Timeline */}
      <div style={{ padding: "14px 16px", display: "flex", flexDirection: "column", gap: 0 }}>
        {steps.map((s, i) => (
          <div key={i} style={{ display: "flex", gap: 12, alignItems: "flex-start" }}>
            {/* Spine */}
            <div style={{ display: "flex", flexDirection: "column", alignItems: "center", flexShrink: 0 }}>
              <span style={{
                width: 20, height: 20, borderRadius: "50%", display: "grid", placeItems: "center",
                background: s.final ? "rgba(22,163,74,0.10)" : "var(--accent-soft)",
                border: `1.5px solid ${s.final ? "rgba(22,163,74,0.3)" : "rgba(110,86,207,0.25)"}`,
                flexShrink: 0,
              }}>
                {s.final
                  ? <svg width="9" height="9" viewBox="0 0 24 24" fill="none" stroke="#166534" strokeWidth="3"><polyline points="20 6 9 17 4 12"/></svg>
                  : <span style={{ width: 6, height: 6, borderRadius: "50%", background: "var(--accent)", display: "block" }} />
                }
              </span>
              {i < steps.length - 1 && (
                <span style={{ width: 1, height: 24, background: "var(--line)", margin: "3px 0", flexShrink: 0 }} />
              )}
            </div>
            {/* Content */}
            <div style={{ paddingBottom: i < steps.length - 1 ? 0 : 0, flex: 1, minWidth: 0 }}>
              <div style={{ display: "flex", alignItems: "baseline", justifyContent: "space-between", gap: 8 }}>
                <span style={{ fontSize: 12.5, fontWeight: 500, color: s.final ? "#166534" : "var(--ink-1)", lineHeight: 1.3 }}>{s.label}</span>
                <span style={{ fontSize: 10.5, color: "var(--ink-5)", fontFamily: "var(--font-mono)", flexShrink: 0 }}>{s.time}</span>
              </div>
              <div style={{ fontSize: 11.5, color: "var(--ink-4)", marginTop: 2, lineHeight: 1.4 }}>
                {s.meta}{s.by ? <span style={{ color: "var(--ink-5)" }}> · {s.by}</span> : null}
              </div>
              {i < steps.length - 1 && <div style={{ height: 16 }} />}
            </div>
          </div>
        ))}
      </div>
    </div>
  );
}

function IntakeModulePage() {
  const data = window.ccModuleData["intake"];
  return (
    <div>
      <ModuleHero {...data.hero} />

      {/* 3-column feature section (Precisely style) */}
      <section style={{ padding: "48px 0 24px", background: "transparent" }}>
        <div className="container">
          <div className="grid grid-3" style={{ gap: "40px" }}>
            <div>
              <p style={{ fontSize: "14.5px", lineHeight: "1.6", color: "var(--ink-2)", margin: 0 }}>
                <strong style={{ fontWeight: 600, color: "var(--ink-1)" }}>ContractControl's smart request forms</strong> capture clean, structured data from day one. Guided request fields eliminate endless back-and-forth email loops.
              </p>
            </div>
            <div>
              <p style={{ fontSize: "14.5px", lineHeight: "1.6", color: "var(--ink-2)", margin: 0 }}>
                <strong style={{ fontWeight: 600, color: "var(--ink-1)" }}>Rule-based routing</strong> automatically sends every request to the right reviewer. Standard contracts get auto-drafted; complex ones route to legal.
              </p>
            </div>
            <div>
              <p style={{ fontSize: "14.5px", lineHeight: "1.6", color: "var(--ink-2)", margin: 0 }}>
                <strong style={{ fontWeight: 600, color: "var(--ink-1)" }}>Full request tracking</strong> logs every step, status, and owner. Requesters and legal teams see live progress on a single shared timeline.
              </p>
            </div>
          </div>
        </div>
      </section>

      <LogoStrip />
      <ModuleMetrics {...data.metrics} />

      <FeatSection
        eyebrow="Self-serve portal"
        title="One request. <em>No emails, no Slack threads</em>."
        body="Sales, HR, and Procurement submit contract requests through a structured portal. ContractControl captures the right context upfront and routes each request automatically, no legal involved until it matters."
        bullets={["Structured intake captures context without back-and-forth", "Requesters see live status without pinging legal", "Every request routed to the right workflow automatically"]}
        mockup={<IntakeFormMockup />}
      />
      <FeatSection
        eyebrow="Rule-based routing"
        title="The right reviewer gets the right contract, <em>automatically</em>."
        body="Set rules once by value, region, or contract type. ContractControl routes every request to the right queue, AI drafts on standard paper, legal handles the edge cases."
        bullets={["Route by deal value, region, contract type, or any combination", "Low-risk contracts auto-drafted and sent without legal touch", "Edge cases escalated with full context attached"]}
        mockup={<IntakeRoutingMockup />}
        flip
      />
      <FeatSection
        eyebrow="Full request trail"
        title="Every request tracked, <em>start to finish</em>."
        body="Each contract request moves through a clear lifecycle, captured, assigned, reviewed, and resolved. Everyone involved sees exactly where it stands, without asking."
        bullets={["Every step logged with owner, action, and timestamp", "Requesters see live status, no follow-up messages needed", "Full context attached so reviewers never start from scratch"]}
        mockup={<IntakeTrailMockup />}
        soft
      />
      <ModuleFeatures name={data.featuresName || data.name.toLowerCase()} features={data.features} />
      <ModuleQuote {...data.quote} />

      <FinalCTA />
      <ModuleFAQSection faqs={[
        { q: "How can I streamline contract requests with ContractControl Intake?", a: "ContractControl Intake provides a self-serve request portal that collects structured information and automatically routes contracts to the correct workflow. Requesters fill out guided fields, which eliminates email back-and-forth and ensures legal teams receive complete data from day one." },
        { q: "How does ContractControl automatically route contract requests?", a: "ContractControl routes requests using automated conditional rules based on contract value, region, or document type. Standard contracts are routed to templates for instant drafting, while high-risk clauses are escalated directly to specialized legal queues." },
        { q: "Can my team submit contract requests directly from Slack or Microsoft Teams?", a: "Yes, requesters can submit contract requests and track status directly inside Slack and Microsoft Teams. By using the slash command, users can fill out a simplified form and receive live status updates as direct messages without leaving their chat app." },
        { q: "What is the implementation timeline for ContractControl Intake?", a: "ContractControl Intake can be configured and deployed within a single business day. Admins define request fields, configure routing logic, and activate Slack or Teams integrations through a no-code dashboard." },
        { q: "What happens after a user submits a contract request?", a: "Submitted requests are instantly assigned a tracking status, owner, and SLA timer. The platform automatically generates a first draft for standard agreements or queues complex requests for legal review." },
      ]} />
    </div>
  );
}

// ═══════════════════════════════════════════════════════════════════
// DRAFTING
// ═══════════════════════════════════════════════════════════════════

function DraftingTemplateMockup() {
  return (
    <div style={{ background: "var(--bg-elevated)", border: "1px solid var(--line)", borderRadius: 16, overflow: "hidden", boxShadow: "0 30px 60px -20px rgba(14,14,16,0.10), 0 4px 12px -4px rgba(14,14,16,0.04)" }}>
      <div style={{ padding: "13px 18px", borderBottom: "1px solid var(--line)", display: "flex", alignItems: "center", gap: 8 }}>
        <span style={{ color: "var(--accent)" }}><Icon name="drafting" size={13} /></span>
        <span style={{ fontSize: 12, fontWeight: 500, color: "var(--ink-1)" }}>Template library</span>
        <span style={{ marginLeft: "auto", fontSize: 11, color: "var(--ink-4)" }}>14 approved</span>
      </div>
      <div style={{ padding: 16, display: "flex", flexDirection: "column", gap: 8 }}>
        {[
          { name: "Customer MSA", tag: "Sales", uses: "142 uses", locked: true },
          { name: "Vendor NDA", tag: "Procurement", uses: "89 uses", locked: true },
          { name: "Employment Agreement", tag: "HR", uses: "54 uses", locked: false },
          { name: "SaaS Order Form", tag: "Sales", uses: "38 uses", locked: true },
        ].map((t) => (
          <div key={t.name} style={{ display: "flex", alignItems: "center", gap: 12, padding: "9px 12px", borderRadius: 10, background: "var(--bg-soft)", border: "1px solid var(--line)" }}>
            <span style={{ color: "var(--accent)" }}><Icon name="legal" size={13} /></span>
            <span style={{ flex: 1, fontSize: 13, fontWeight: 500, color: "var(--ink-1)" }}>{t.name}</span>
            <span style={{ fontSize: 11, padding: "2px 8px", borderRadius: 99, background: "var(--bg-elevated)", color: "var(--ink-4)", border: "1px solid var(--line)" }}>{t.tag}</span>
            <span style={{ fontSize: 11, color: "var(--ink-5)" }}>{t.uses}</span>
            {t.locked && <svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="var(--ink-5)" strokeWidth="2"><rect x="3" y="11" width="18" height="11" rx="2"/><path d="M7 11V7a5 5 0 0 1 10 0v4"/></svg>}
          </div>
        ))}
      </div>
    </div>
  );
}

function DraftingEditorMockup() {
  return (
    <div style={{ background: "var(--bg-elevated)", border: "1px solid var(--line)", borderRadius: 16, overflow: "hidden", boxShadow: "0 30px 60px -20px rgba(14,14,16,0.10), 0 4px 12px -4px rgba(14,14,16,0.04)" }}>
      {/* Editor Title Bar */}
      <div style={{ padding: "12px 18px", borderBottom: "1px solid var(--line)", display: "flex", alignItems: "center", justifyContent: "space-between", gap: 10, background: "var(--bg-soft)" }}>
        <div style={{ display: "flex", alignItems: "center", gap: 8 }}>
          <div style={{ width: 10, height: 10, borderRadius: "50%", background: "#FF5F56" }}></div>
          <div style={{ width: 10, height: 10, borderRadius: "50%", background: "#FFBD2E" }}></div>
          <div style={{ width: 10, height: 10, borderRadius: "50%", background: "#27C93F" }}></div>
          <span style={{ fontSize: 12, fontWeight: 500, color: "var(--ink-2)", marginLeft: 8 }}>NDA_Template_v2.docx</span>
        </div>
        <div style={{ display: "flex", alignItems: "center", gap: 8 }}>
          <div style={{ fontSize: 11, padding: "3px 8px", borderRadius: 4, background: "rgba(110,86,207,0.08)", color: "var(--accent)", border: "1px solid rgba(110,86,207,0.15)", display: "flex", alignItems: "center", gap: 4, fontWeight: 500 }}>
            <svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="17 8 12 3 7 8"/><line x1="12" y1="3" x2="12" y2="15"/></svg>
            Imported Word Doc
          </div>
        </div>
      </div>

      {/* Ribbon Word-like Toolbar */}
      <div style={{ padding: "8px 18px", borderBottom: "1px solid var(--line)", background: "var(--bg-elevated)", display: "flex", flexWrap: "wrap", alignItems: "center", gap: 12 }}>
        {/* Undo/Redo & Save */}
        <div style={{ display: "flex", gap: 6, borderRight: "1px solid var(--line)", paddingRight: 10 }}>
          <button style={{ background: "none", border: "none", color: "var(--ink-4)", cursor: "default", padding: 0 }}>
            <svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><path d="M3 7v6h6"/><path d="M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13"/></svg>
          </button>
          <button style={{ background: "none", border: "none", color: "var(--ink-4)", cursor: "default", padding: 0 }}>
            <svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><path d="M21 7v6h-6"/><path d="M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3-2.3"/></svg>
          </button>
        </div>
        
        {/* Style Dropdown */}
        <div style={{ fontSize: 11, padding: "2px 6px", borderRadius: 4, background: "var(--bg-soft)", border: "1px solid var(--line)", color: "var(--ink-2)", display: "flex", alignItems: "center", gap: 12 }}>
          <span>Normal Text</span>
          <span style={{ fontSize: 8, color: "var(--ink-4)" }}>▼</span>
        </div>
        
        {/* Font Dropdown */}
        <div style={{ fontSize: 11, padding: "2px 6px", borderRadius: 4, background: "var(--bg-soft)", border: "1px solid var(--line)", color: "var(--ink-2)", display: "flex", alignItems: "center", gap: 12 }}>
          <span>Arial</span>
          <span style={{ fontSize: 8, color: "var(--ink-4)" }}>▼</span>
        </div>

        {/* Text Actions */}
        <div style={{ display: "flex", gap: 10, borderRight: "1px solid var(--line)", paddingRight: 10, alignItems: "center" }}>
          <span style={{ fontSize: 11, fontWeight: "bold", color: "var(--ink-1)", cursor: "default" }}>B</span>
          <span style={{ fontSize: 11, fontStyle: "italic", color: "var(--ink-3)", cursor: "default" }}>I</span>
          <span style={{ fontSize: 11, textDecoration: "underline", color: "var(--ink-3)", cursor: "default" }}>U</span>
          <span style={{ fontSize: 11, color: "var(--accent)", cursor: "default", borderBottom: "2px solid var(--accent)", paddingBottom: 1, lineHeight: 1 }}>A</span>
        </div>

        {/* Alignment */}
        <div style={{ display: "flex", gap: 6, borderRight: "1px solid var(--line)", paddingRight: 10 }}>
          <svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="var(--ink-3)" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><line x1="17" y1="10" x2="3" y2="10"/><line x1="21" y1="6" x2="3" y2="6"/><line x1="21" y1="14" x2="3" y2="14"/><line x1="17" y1="18" x2="3" y2="18"/></svg>
        </div>

        {/* Variables insert tool */}
        <div style={{ fontSize: 11, padding: "2px 8px", borderRadius: 4, background: "var(--accent)", color: "white", display: "flex", alignItems: "center", gap: 5, fontWeight: 500, cursor: "default", marginLeft: "auto" }}>
          <span>+ Insert Variable</span>
        </div>
      </div>

      {/* Editor Body: Left sidebar (variables list) + Right document area */}
      <div style={{ display: "grid", gridTemplateColumns: "170px 1fr", height: 280 }}>
        {/* Sidebar */}
        <div style={{ borderRight: "1px solid var(--line)", background: "var(--bg-soft)", padding: 12, display: "flex", flexDirection: "column", gap: 10, overflowY: "auto" }}>
          <div style={{ fontSize: 10, fontWeight: 600, textTransform: "uppercase", letterSpacing: "0.05em", color: "var(--ink-4)" }}>Template Fields</div>
          <div style={{ display: "flex", flexDirection: "column", gap: 6 }}>
            {[
              { name: "Company Name", type: "Text", active: true },
              { name: "Start Date", type: "Date", active: true },
              { name: "Governing Law", type: "Select", active: false },
              { name: "Contract Value", type: "Currency", active: false },
            ].map((v) => (
              <div key={v.name} style={{ padding: "6px 8px", borderRadius: 6, background: v.active ? "rgba(110,86,207,0.06)" : "transparent", border: v.active ? "1px solid rgba(110,86,207,0.15)" : "1px solid transparent", display: "flex", flexDirection: "column", gap: 1 }}>
                <span style={{ fontSize: 11.5, fontWeight: v.active ? 600 : 500, color: v.active ? "var(--accent)" : "var(--ink-2)" }}>{`{${v.name}}`}</span>
                <span style={{ fontSize: 9, color: "var(--ink-5)" }}>{v.type}</span>
              </div>
            ))}
          </div>
          
          <div style={{ marginTop: "auto", borderTop: "1px dashed var(--line)", paddingTop: 8 }}>
            <div style={{ fontSize: 9.5, color: "var(--ink-4)", fontStyle: "italic", lineHeight: 1.3 }}>
              12 fields mapped automatically from Word styles.
            </div>
          </div>
        </div>

        {/* Document Canvas */}
        <div style={{ background: "var(--bg-soft)", padding: 16, overflowY: "auto", display: "flex", justifyContent: "center" }}>
          {/* Float Page */}
          <div style={{ background: "var(--bg-elevated)", width: "100%", borderRadius: 4, border: "1px solid var(--line)", padding: 20, boxShadow: "0 2px 8px rgba(0,0,0,0.05)", display: "flex", flexDirection: "column", gap: 12 }}>
            <div style={{ textAlign: "center", fontSize: 12, fontWeight: "bold", color: "var(--ink-1)", letterSpacing: "0.02em", marginBottom: 4 }}>
              MUTUAL NON-DISCLOSURE AGREEMENT
            </div>
            
            <div style={{ fontSize: 11, color: "var(--ink-2)", lineHeight: 1.5 }}>
              This Agreement is made as of{" "}
              <span style={{ background: "rgba(110,86,207,0.12)", color: "var(--accent)", padding: "1px 4px", borderRadius: 4, fontWeight: 500, border: "1px solid rgba(110,86,207,0.2)" }}>
                Start Date
              </span>{" "}
              by and between Velora Corp and{" "}
              <span style={{ background: "rgba(110,86,207,0.12)", color: "var(--accent)", padding: "1px 4px", borderRadius: 4, fontWeight: 500, border: "1px solid rgba(110,86,207,0.2)" }}>
                Company Name
              </span>
              . The parties wish to explore a business opportunity of mutual interest.
            </div>

            {/* Locked clause section */}
            <div style={{ borderLeft: "2px solid var(--success)", background: "rgba(31,138,76,0.02)", padding: "8px 10px", borderRadius: "0 6px 6px 0", display: "flex", flexDirection: "column", gap: 4 }}>
              <div style={{ display: "flex", alignItems: "center", gap: 4 }}>
                <svg width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="var(--success)" strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round"><rect x="3" y="11" width="18" height="11" rx="2"/><path d="M7 11V7a5 5 0 0 1 10 0v4"/></svg>
                <span style={{ fontSize: 9.5, fontWeight: "bold", textTransform: "uppercase", letterSpacing: "0.04em", color: "var(--success)" }}>
                  Locked Clause - Section 8 (Indemnification)
                </span>
              </div>
              <div style={{ fontSize: 10.5, color: "var(--ink-3)", lineHeight: 1.4, userSelect: "none" }}>
                Each Party shall defend, indemnify, and hold harmless the other from and against any and all claims, liabilities, damages...
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  );
}

function ProductLibraryMockup() {
  const products = [
    { name: "ContractControl Core", sku: "CC-CORE-001", price: "€4 800 / yr", seats: "Up to 25 users" },
    { name: "eSignature Add-on", sku: "CC-ESIGN-002", price: "€1 200 / yr", seats: "Unlimited sends" },
    { name: "Obligations Module", sku: "CC-OBL-003", price: "€2 400 / yr", seats: "Per workspace" },
    { name: "Drafting AI", sku: "CC-AI-004", price: "€3 600 / yr", seats: "Up to 10 users" },
  ];
  return (
    <div style={{ background: "var(--bg-elevated)", border: "1px solid var(--line)", borderRadius: 16, overflow: "hidden", boxShadow: "0 30px 60px -20px rgba(14,14,16,0.10), 0 4px 12px -4px rgba(14,14,16,0.04)" }}>
      <div style={{ padding: "13px 18px", borderBottom: "1px solid var(--line)", display: "flex", alignItems: "center", gap: 8 }}>
        <span style={{ color: "var(--accent)" }}><Icon name="repository" size={13} /></span>
        <span style={{ fontSize: 12, fontWeight: 500, color: "var(--ink-1)" }}>Product library</span>
        <span style={{ marginLeft: "auto", fontSize: 10.5, padding: "2px 8px", borderRadius: 99, background: "var(--accent-soft)", color: "var(--accent)", border: "1px solid rgba(110,86,207,0.2)" }}>4 products</span>
      </div>
      <div style={{ padding: "0 0 8px" }}>
        {products.map((p, i) => (
          <div key={i} style={{ display: "flex", alignItems: "center", gap: 12, padding: "10px 18px", borderBottom: i < products.length - 1 ? "1px solid var(--line)" : "none" }}>
            <div style={{ width: 28, height: 28, borderRadius: 7, background: "var(--accent-soft)", display: "grid", placeItems: "center", flexShrink: 0 }}>
              <Icon name="drafting" size={13} style={{ color: "var(--accent)" }} />
            </div>
            <div style={{ flex: 1, minWidth: 0 }}>
              <div style={{ fontSize: 12.5, fontWeight: 500, color: "var(--ink-1)" }}>{p.name}</div>
              <div style={{ fontSize: 11, color: "var(--ink-4)", fontFamily: "var(--font-mono)" }}>{p.sku}</div>
            </div>
            <div style={{ textAlign: "right", flexShrink: 0 }}>
              <div style={{ fontSize: 12, fontWeight: 500, color: "var(--ink-1)" }}>{p.price}</div>
              <div style={{ fontSize: 11, color: "var(--ink-4)" }}>{p.seats}</div>
            </div>
          </div>
        ))}
      </div>
      <div style={{ padding: "10px 18px", borderTop: "1px solid var(--line)", display: "flex", alignItems: "center", gap: 8 }}>
        <button style={{ fontSize: 12, padding: "5px 12px", borderRadius: 7, background: "var(--accent)", color: "#fff", border: "none", cursor: "default", display: "flex", alignItems: "center", gap: 5 }}>
          + Add to order form
        </button>
        <span style={{ fontSize: 11.5, color: "var(--ink-4)" }}>Select products to include in contract</span>
      </div>
    </div>
  );
}

function DraftingConditionalMockup() {
  const rules = [
    { condition: "Contract value > €50,000", then: "Show: Enhanced liability clause", active: true },
    { condition: "Region = United States", then: "Show: US governing law block", active: false },
    { condition: "Product includes SaaS", then: "Show: Data processing addendum", active: true },
  ];
  return (
    <div className="mockup-frame" style={{ padding: 0, overflow: "hidden" }}>
      <div style={{ padding: "12px 18px", borderBottom: "1px solid var(--line)", display: "flex", alignItems: "center", gap: 8 }}>
        <span style={{ fontSize: 12, fontWeight: 600, color: "var(--ink-1)" }}>MSA EU · Conditional blocks</span>
        <span style={{ marginLeft: "auto", fontSize: 10.5, padding: "2px 8px", borderRadius: 99, background: "var(--accent-soft)", color: "var(--accent)", fontWeight: 500 }}>3 rules active</span>
      </div>
      <div style={{ padding: "14px 18px", borderBottom: "1px solid var(--line)", background: "var(--bg-soft)" }}>
        <div style={{ fontSize: 10.5, fontWeight: 600, letterSpacing: "0.08em", textTransform: "uppercase", color: "var(--ink-4)", marginBottom: 10 }}>Conditional logic</div>
        <div style={{ display: "flex", flexDirection: "column", gap: 8 }}>
          {rules.map((r, i) => (
            <div key={i} style={{ background: "var(--bg-elevated)", border: `1px solid ${r.active ? "rgba(124,92,211,0.2)" : "var(--line)"}`, borderRadius: 10, padding: "10px 14px", display: "grid", gridTemplateColumns: "auto 1fr", gap: "6px 12px", alignItems: "center" }}>
              <span style={{ fontSize: 10, fontWeight: 700, letterSpacing: "0.06em", textTransform: "uppercase", color: "var(--ink-4)", gridRow: 1 }}>IF</span>
              <span style={{ fontSize: 12.5, color: "var(--ink-1)", fontWeight: 500 }}>{r.condition}</span>
              <span style={{ fontSize: 10, fontWeight: 700, letterSpacing: "0.06em", textTransform: "uppercase", color: "var(--accent)", gridRow: 2 }}>THEN</span>
              <span style={{ fontSize: 12, color: "var(--ink-3)" }}>{r.then}</span>
            </div>
          ))}
        </div>
      </div>
      <div style={{ padding: "12px 18px", display: "flex", gap: 8 }}>
        <button style={{ flex: 1, padding: "8px 0", borderRadius: 8, border: "1px dashed var(--line)", background: "transparent", fontSize: 12, color: "var(--ink-4)", cursor: "pointer" }}>
          + Add condition
        </button>
        <button style={{ padding: "8px 16px", borderRadius: 8, border: "none", background: "var(--accent)", color: "#fff", fontSize: 12, fontWeight: 600, cursor: "pointer" }}>
          Save rules
        </button>
      </div>
    </div>
  );
}

function DraftingApprovalMockup() {
  return (
    <div style={{ background: "var(--bg-elevated)", border: "1px solid var(--line)", borderRadius: 16, overflow: "hidden", boxShadow: "0 30px 60px -20px rgba(14,14,16,0.10), 0 4px 12px -4px rgba(14,14,16,0.04)" }}>
      <div style={{ padding: "13px 18px", borderBottom: "1px solid var(--line)", display: "flex", alignItems: "center", gap: 8 }}>
        <span style={{ color: "var(--accent)" }}><Icon name="workspace" size={13} /></span>
        <span style={{ fontSize: 12, fontWeight: 500, color: "var(--ink-1)" }}>Approval flow · MSA_Velora</span>
      </div>
      <div style={{ padding: 16, display: "flex", flexDirection: "column", gap: 0 }}>
        {[
          { step: "01", label: "Legal review", person: "Maya Holmberg", status: "approved", statusColor: "var(--success)" },
          { step: "02", label: "Finance sign-off", person: "Erik Lund, Value > €500k", status: "approved", statusColor: "var(--success)" },
          { step: "03", label: "GC approval", person: "Anna Sjöberg", status: "pending", statusColor: "#B8860B" },
          { step: "04", label: "Send for signature", person: "Auto-triggered", status: "waiting", statusColor: "var(--ink-5)" },
        ].map((s, i) => (
          <div key={i} style={{ display: "flex", alignItems: "center", gap: 12, padding: "10px 0", borderBottom: i < 3 ? "1px solid var(--line)" : "none" }}>
            <span style={{ fontSize: 10, fontFamily: "var(--font-mono)", color: "var(--ink-5)", flexShrink: 0 }}>{s.step}</span>
            <div style={{ flex: 1 }}>
              <div style={{ fontSize: 13, fontWeight: 500, color: "var(--ink-1)" }}>{s.label}</div>
              <div style={{ fontSize: 11.5, color: "var(--ink-4)" }}>{s.person}</div>
            </div>
            <span style={{ fontSize: 11, padding: "2px 9px", borderRadius: 99, fontWeight: 500, background: s.status === "approved" ? "rgba(31,138,76,0.08)" : s.status === "pending" ? "rgba(232,179,57,0.10)" : "var(--bg-soft)", color: s.statusColor, border: "1px solid " + (s.status === "approved" ? "rgba(31,138,76,0.2)" : s.status === "pending" ? "rgba(232,179,57,0.2)" : "var(--line)") }}>{s.status}</span>
          </div>
        ))}
      </div>
    </div>
  );
}

function DraftingModulePage() {
  const data = window.ccModuleData["drafting"];
  return (
    <div>
      <ModuleHero {...data.hero} />

      {/* 3-column feature section (Precisely style) */}
      <section style={{ padding: "48px 0 24px", background: "transparent" }}>
        <div className="container">
          <div className="grid grid-3" style={{ gap: "40px" }}>
            <div>
              <p style={{ fontSize: "14.5px", lineHeight: "1.6", color: "var(--ink-2)", margin: 0 }}>
                <strong style={{ fontWeight: 600, color: "var(--ink-1)" }}>Guardrail-based drafting</strong> keeps your business self-serving safely. Pre-approved templates ensure your teams never copy-paste outdated clauses.
              </p>
            </div>
            <div>
              <p style={{ fontSize: "14.5px", lineHeight: "1.6", color: "var(--ink-2)", margin: 0 }}>
                <strong style={{ fontWeight: 600, color: "var(--ink-1)" }}>Import existing paper</strong> to transition to ContractControl instantly. Our AI parses Word documents and converts static fields to dynamic tags.
              </p>
            </div>
            <div>
              <p style={{ fontSize: "14.5px", lineHeight: "1.6", color: "var(--ink-2)", margin: 0 }}>
                <strong style={{ fontWeight: 600, color: "var(--ink-1)" }}>Integrated catalog pricing</strong> pulls directly from your product library. Keep order forms and contracts aligned with finance-approved pricing.
              </p>
            </div>
          </div>
        </div>
      </section>

      <LogoStrip />
      <ModuleMetrics {...data.metrics} />

      <FeatSection
        eyebrow="Template library"
        title="Start every contract from <em>approved, compliant templates</em>."
        body="Your legal team defines the guardrails once. Everyone else drafts within them, no blank pages, no rogue clauses, no compliance surprises at review."
        bullets={["14+ template types out of the box, MSA, NDA, SOW, Order Form", "Approved language locked; editable sections clearly marked", "Templates versioned and updated centrally by legal"]}
        mockup={<DraftingTemplateMockup />}
      />
      <FeatSection
        eyebrow="Template Creator"
        title="Creating templates has <em>never been easier</em>."
        body="Build template libraries in minutes, not months. Our familiar, Word-like editor lets you create standard templates from scratch or import your existing Word documents (.docx) with a single click. The platform automatically identifies variables and lets you lock down core legal terms while keeping business fields editable."
        bullets={[
          "Word-like editing interface, standard keyboard shortcuts, and full formatting controls",
          "Instant Microsoft Word (.docx) import, mapping static text to dynamic template variables",
          "Lock down critical clauses (e.g., liability, governing law) while keeping key fields editable"
        ]}
        mockup={<DraftingEditorMockup />}
        flip soft
      />
      <FeatSection
        eyebrow="Product library"
        title="Sales adds what they sold. <em>Legal sees it instantly</em>."
        body="Define your full product catalogue once. When sales creates an order form, they pick from the library, right SKUs, right pricing, right terms. No back-and-forth to confirm what was actually sold."
        bullets={["Centralised product and pricing catalogue for all teams", "Automatically populated into order form and contract scope", "Keeps legal and finance aligned on what revenue is contracted"]}
        mockup={<ProductLibraryMockup />}
      />
      <FeatSection
        eyebrow="Approval routing"
        title="The right sign-off, <em>triggered automatically</em>."
        body="Define approval chains by deal value, contract type, or region. ContractControl triggers the right reviewers in the right order, no chasing, no missed sign-offs."
        bullets={["Sequential, parallel, or conditional approval flows", "Finance automatically included for high-value deals", "Full audit trail from draft to approved"]}
        mockup={<DraftingApprovalMockup />}
        flip soft
      />
      <ModuleFeatures name={data.featuresName || data.name.toLowerCase()} features={data.features} />
      <ModuleQuote {...data.quote} />

      <DepartmentShowcase />
      <FinalCTA />
      <ModuleFAQSection faqs={[
        { q: "How does ContractControl Drafting accelerate the contract creation process?", a: "ContractControl Drafting uses approved template libraries and automated clause checks to generate compliant contracts in under sixty seconds. The system replaces manual Word drafting with a guided interface that locks core legal language while allowing user inputs in designated fields." },
        { q: "Can external counterparties collaborate directly on contract drafts?", a: "Yes, external counterparties can be invited to collaborate on draft contracts in a secure, shared workspace. Internal notes and review comments remain completely hidden from the counterparty to protect negotiation strategy." },
        { q: "How do I import my company's existing Word contract templates?", a: "Existing templates can be imported by uploading Word documents directly to ContractControl's template manager. The platform automatically maps variables, defines editable clauses, and connects them to approval workflows within minutes." },
        { q: "How does the platform handle non-standard clauses that the AI cannot verify?", a: "Non-standard or high-risk clauses are automatically routed to your legal team for manual approval. The system highlights the deviation and attaches historical playbook context to speed up review." },
        { q: "How do the Intake, Drafting, and eSignature modules work together?", a: "ContractControl operates as a unified platform where request data flows directly into the drafting editor and moves to eSignature without manual handoffs. This integrated workflow prevents data loss and reduces total cycle times." },
      ]} />
    </div>
  );
}

// ═══════════════════════════════════════════════════════════════════
// REVIEW
// ═══════════════════════════════════════════════════════════════════

function ReviewCollaborationMockup() {
  return (
    <div style={{ background: "var(--bg-elevated)", border: "1px solid var(--line)", borderRadius: 16, overflow: "hidden", boxShadow: "0 30px 60px -20px rgba(14,14,16,0.10), 0 4px 12px -4px rgba(14,14,16,0.04)" }}>
      <div style={{ padding: "13px 18px", borderBottom: "1px solid var(--line)", display: "flex", alignItems: "center", gap: 8 }}>
        <span style={{ color: "var(--accent)" }}><Icon name="workspace" size={13} /></span>
        <span style={{ fontSize: 12, fontWeight: 500, color: "var(--ink-1)" }}>Internal Review · Clause 8.1</span>
      </div>
      <div style={{ padding: 18 }}>
        <div style={{ padding: "10px 14px", borderRadius: 10, background: "var(--bg-soft)", border: "1px solid var(--line)", fontSize: 12.5, fontFamily: "var(--font-serif)", color: "var(--ink-2)", lineHeight: 1.65, marginBottom: 16 }}>
          "…liability of either party shall be <span style={{ background: "rgba(99,102,241,0.12)", borderBottom: "1.5px dashed #6366F1", padding: "1px 0" }}>capped at €50,000 per claim</span> under this agreement."
        </div>
        
        {/* Comment Thread */}
        <div style={{ background: "var(--bg-soft)", borderRadius: 10, padding: 12, border: "1px solid var(--line)", display: "flex", flexDirection: "column", gap: 10, marginBottom: 14 }}>
          <div style={{ display: "flex", gap: 8, alignItems: "flex-start" }}>
            <div style={{ width: 18, height: 18, borderRadius: "50%", background: "#F43F5E", color: "white", fontSize: 9, fontWeight: 600, display: "grid", placeItems: "center", flexShrink: 0 }}>R</div>
            <div>
              <div style={{ display: "flex", alignItems: "center", gap: 6 }}>
                <span style={{ fontSize: 11, fontWeight: 600, color: "var(--ink-1)" }}>Raymond (Finance)</span>
                <span style={{ fontSize: 9, color: "var(--ink-4)" }}>10m ago</span>
              </div>
              <div style={{ fontSize: 11.5, color: "var(--ink-3)", marginTop: 2 }}>Can we increase this to €100,000 to match the custom plan?</div>
            </div>
          </div>
          <div style={{ height: "1px", background: "var(--line)" }} />
          <div style={{ display: "flex", gap: 8, alignItems: "flex-start" }}>
            <div style={{ width: 18, height: 18, borderRadius: "50%", background: "#818CF8", color: "white", fontSize: 9, fontWeight: 600, display: "grid", placeItems: "center", flexShrink: 0 }}>S</div>
            <div>
              <div style={{ display: "flex", alignItems: "center", gap: 6 }}>
                <span style={{ fontSize: 11, fontWeight: 600, color: "var(--ink-1)" }}>Sabina (Legal)</span>
                <span style={{ fontSize: 9, color: "var(--ink-4)" }}>Just now</span>
              </div>
              <div style={{ fontSize: 11.5, color: "var(--ink-3)", marginTop: 2 }}>Done. I've updated the cap value. Let's send for sign-off.</div>
            </div>
          </div>
        </div>

        <div style={{ display: "flex", gap: 8 }}>
          <button style={{ flex: 1, padding: "8px 0", borderRadius: 8, background: "var(--accent)", color: "#fff", border: "none", cursor: "default", fontSize: 12.5, fontWeight: 500 }}>Approve clause</button>
          <button style={{ padding: "8px 14px", borderRadius: 8, background: "var(--bg-soft)", color: "var(--ink-3)", border: "1px solid var(--line)", cursor: "default", fontSize: 12.5 }}>Reply</button>
        </div>
      </div>
    </div>
  );
}

function ReviewWorkflowsMockup() {
  return (
    <div className="card" style={{
      position: "relative",
      width: "100%",
      height: 400,
      background: "var(--bg-soft)",
      border: "1px solid var(--line)",
      borderRadius: 24,
      boxShadow: "0 24px 50px rgba(0,0,0,0.04)",
      overflow: "hidden",
      padding: "28px"
    }}>
      {/* Background Grid Pattern */}
      <div style={{
        position: "absolute",
        inset: 0,
        opacity: 0.08,
        backgroundImage: "linear-gradient(var(--line-strong) 1px, transparent 1px), linear-gradient(90deg, var(--line-strong) 1px, transparent 1px)",
        backgroundSize: "24px 24px",
        pointerEvents: "none"
      }} />

      {/* Vertical Connection Line */}
      <div style={{
        position: "absolute",
        left: 44,
        top: 48,
        bottom: 80,
        width: 2,
        background: "#3B82F6",
        opacity: 0.4,
        zIndex: 1
      }} />

      {/* Start: New MSA Workflow Node */}
      <div style={{
        position: "absolute",
        left: 31,
        top: 36,
        display: "flex",
        alignItems: "center",
        gap: 12,
        zIndex: 2
      }}>
        <span style={{
          width: 28,
          height: 28,
          borderRadius: "50%",
          background: "#2563EB",
          color: "white",
          display: "grid",
          placeItems: "center",
          fontSize: 15,
          fontWeight: 700,
          boxShadow: "0 4px 10px rgba(37,99,235,0.3)"
        }}>+</span>
        <span style={{ fontSize: 13, fontWeight: 600, color: "var(--ink-1)" }}>New MSA Workflow</span>
      </div>

      {/* Card 1: Questionnaire */}
      <div style={{
        position: "absolute",
        left: 72,
        top: 84,
        background: "var(--bg-elevated)",
        border: "1px solid var(--line-strong)",
        borderRadius: 12,
        padding: "12px 16px",
        width: 210,
        boxShadow: "0 4px 12px rgba(0,0,0,0.03)",
        zIndex: 2
      }}>
        <div style={{ fontSize: 13, fontWeight: 600, color: "var(--ink-1)" }}>Questionnaire</div>
        <div style={{ fontSize: 11, color: "var(--ink-4)", marginTop: 4 }}>Creator Party | 43 Questions</div>
        <div style={{ fontSize: 11, color: "var(--ink-4)" }}>Counter Party | 30 Questions</div>
      </div>

      {/* Line Node Plus */}
      <div style={{
        position: "absolute",
        left: 37,
        top: 196,
        width: 16,
        height: 16,
        borderRadius: "50%",
        background: "white",
        border: "1.5px solid #3B82F6",
        display: "grid",
        placeItems: "center",
        fontSize: 10,
        fontWeight: 700,
        color: "#3B82F6",
        zIndex: 3,
        boxShadow: "0 2px 6px rgba(0,0,0,0.05)"
      }}>+</div>

      {/* Card 2: Signatures */}
      <div style={{
        position: "absolute",
        left: 72,
        top: 240,
        background: "var(--bg-elevated)",
        border: "1px solid var(--line-strong)",
        borderRadius: 12,
        padding: "12px 16px",
        width: 210,
        boxShadow: "0 4px 12px rgba(0,0,0,0.03)",
        zIndex: 2
      }}>
        <div style={{ fontSize: 13, fontWeight: 600, color: "var(--ink-1)" }}>Signatures</div>
        <div style={{ display: "flex", alignItems: "center", gap: 8, marginTop: 6 }}>
          <div style={{
            width: 18,
            height: 18,
            borderRadius: "50%",
            background: "#818CF8",
            color: "white",
            fontSize: 9,
            fontWeight: 600,
            display: "grid",
            placeItems: "center"
          }}>SR</div>
          <span style={{ fontSize: 11, color: "var(--ink-2)", fontWeight: 500 }}>Shiv Roy | CEO</span>
        </div>
      </div>

      {/* Node 4: Publish Button */}
      <div style={{
        position: "absolute",
        left: 56,
        top: 326,
        zIndex: 2
      }}>
        <button style={{
          background: "#2563EB",
          color: "white",
          border: "none",
          borderRadius: 8,
          padding: "8px 24px",
          fontSize: 12,
          fontWeight: 600,
          cursor: "default",
          boxShadow: "0 4px 12px rgba(37,99,235,0.2)"
        }}>Publish</button>
      </div>

      {/* Floating Card: Approvals (Tilted, overlapping, highlighted) */}
      <div style={{
        position: "absolute",
        left: 200,
        top: 140,
        background: "#EEF2FF",
        border: "1.5px solid #818CF8",
        borderRadius: 12,
        padding: "12px 16px",
        width: 200,
        transform: "rotate(-5deg)",
        zIndex: 10,
        boxShadow: "0 12px 28px rgba(99,102,241,0.12)"
      }}>
        <div style={{ fontSize: 13, fontWeight: 600, color: "#1E1B4B" }}>Approvals</div>
        <div style={{ display: "flex", alignItems: "center", gap: 8, marginTop: 6 }}>
          <div style={{
            width: 18,
            height: 18,
            borderRadius: "50%",
            background: "#F43F5E",
            color: "white",
            fontSize: 9,
            fontWeight: 600,
            display: "grid",
            placeItems: "center"
          }}>R</div>
          <span style={{ fontSize: 11, color: "#3730A3", fontWeight: 500 }}>Raymond + 3 more</span>
        </div>
        {/* Custom cursor pointer */}
        <div style={{
          position: "absolute",
          right: -10,
          top: "40%",
          width: 0,
          height: 0,
          borderTop: "8px solid transparent",
          borderBottom: "8px solid transparent",
          borderLeft: "14px solid #8B2C0D",
          transform: "rotate(-15deg)",
          filter: "drop-shadow(0 2px 4px rgba(0,0,0,0.15))"
        }} />
      </div>


    </div>
  );
}

function ReviewModulePage() {
  const data = window.ccModuleData["review"];
  return (
    <div>
      <ModuleHero {...data.hero} />

      {/* 3-column feature section (Precisely style) */}
      <section style={{ padding: "48px 0 24px", background: "transparent" }}>
        <div className="container">
          <div className="grid grid-3" style={{ gap: "40px" }}>
            <div>
              <p style={{ fontSize: "14.5px", lineHeight: "1.6", color: "var(--ink-2)", margin: 0 }}>
                <strong style={{ fontWeight: 600, color: "var(--ink-1)" }}>Private internal feedback</strong> lets your team align behind closed doors. Leave strategic notes and comments completely invisible to the counterparty.
              </p>
            </div>
            <div>
              <p style={{ fontSize: "14.5px", lineHeight: "1.6", color: "var(--ink-2)", margin: 0 }}>
                <strong style={{ fontWeight: 600, color: "var(--ink-1)" }}>Sequential approval flows</strong> automatically route drafts through legal, finance, and security. No manual chasing, no skipped steps.
              </p>
            </div>
            <div>
              <p style={{ fontSize: "14.5px", lineHeight: "1.6", color: "var(--ink-2)", margin: 0 }}>
                <strong style={{ fontWeight: 600, color: "var(--ink-1)" }}>SLA bottleneck tracking</strong> logs every review request and measures delay times. Instantly identify and clear pipeline blockages.
              </p>
            </div>
          </div>
        </div>
      </section>

      <LogoStrip />
      <ModuleMetrics {...data.metrics} />

      <FeatSection
        eyebrow="Internal collaboration"
        title="Get the right eyes on the contract, <em>at the right time</em>."
        body="Review drafts with your internal team in one secure workspace. Share internal-only comments, resolve suggestions, and keep track of versions before inviting the counterparty."
        bullets={[
          "Internal-only notes: keep strategic comments completely hidden from counterparties",
          "Threaded discussions: resolve finance, security, and legal feedback in real-time",
          "Role assignments: control who can view, comment, or approve specific sections"
        ]}
        mockup={<ReviewCollaborationMockup />}
        flip soft
      />
      <FeatSection
        eyebrow="Workflows"
        title="Easily automate your <em>contracting processes</em>"
        body="Create your own workflows to automate key legal processes like contract creation, reviews, and approvals - no technical expertise required."
        bullets={[
          "Drag-and-drop editor: create custom workflows in minutes without any coding",
          "Conditional logic: route documents automatically by value, department, or region",
          "Automated alerts: notify reviewers, track SLAs, and push to signatures instantly"
        ]}
        mockup={<ReviewWorkflowsMockup />}
      />


      <DepartmentShowcase title="Who uses Review" />
      <FinalCTA />
      <ModuleFAQSection faqs={[
        { q: "How do internal approval chains work in ContractControl?", a: "ContractControl automatically routes contracts to the correct internal reviewers based on rules like contract value, department, or region. Approvers can sign off in sequence or parallel directly on the platform." },
        { q: "Can we keep internal comments hidden from counterparties?", a: "Yes. All internal comments, notes, and version histories are completely private and only visible to your internal team. Counterparties cannot see them when collaborating on the document." },
        { q: "How does the platform track approval bottlenecks?", a: "The system monitors pending approvals against set SLAs and sends automated reminders via Slack or email to reviewers, giving legal teams full visibility into deal velocity." },
        { q: "Do we support multiple approvers across finance, security, and legal?", a: "Yes. You can build multi-step approval chains that pull in finance for pricing, security for data privacy, and legal for final terms before a contract is finalized." },
        { q: "What is the difference between the Review and Negotiation modules?", a: "The Review module is for internal collaboration and approvals before a contract is sent out. The Negotiation module is a shared workspace where you invite the counterparty to edit and comment on the draft." },
      ]} />
    </div>
  );
}

// ═══════════════════════════════════════════════════════════════════
// NEGOTIATION
// ═══════════════════════════════════════════════════════════════════

function Avatar({ initials, color, size = 28 }) {
  return (
    <div style={{ width: size, height: size, borderRadius: "50%", background: color, display: "flex", alignItems: "center", justifyContent: "center", fontSize: size * 0.38, fontWeight: 700, color: "#fff", flexShrink: 0, border: "2px solid var(--bg-elevated)" }}>
      {initials}
    </div>
  );
}

function NegotiationWorkspaceMockup() {
  return (
    <div style={{ background: "var(--bg-elevated)", border: "1px solid var(--line)", borderRadius: 16, overflow: "hidden", boxShadow: "0 30px 60px -20px rgba(14,14,16,0.10), 0 4px 12px -4px rgba(14,14,16,0.04)" }}>
      {/* Toolbar */}
      <div style={{ padding: "11px 16px", borderBottom: "1px solid var(--line)", display: "flex", alignItems: "center", gap: 8 }}>
        <svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="var(--accent)" strokeWidth="2"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/></svg>
        <span style={{ fontSize: 12, fontWeight: 500, color: "var(--ink-1)" }}>MSA · Velora Industries</span>
        <div style={{ marginLeft: "auto", display: "flex", gap: -4 }}>
          <Avatar initials="MH" color="var(--accent)" size={22} />
          <Avatar initials="KM" color="#C0713A" size={22} />
          <Avatar initials="SL" color="#22C55E" size={22} />
        </div>
      </div>

      {/* Document body */}
      <div style={{ padding: "20px 24px 16px", position: "relative" }}>

        {/* Placeholder lines */}
        {[100, 88, 94, 72].map((w, i) => (
          <div key={i} style={{ height: 7, borderRadius: 4, background: "var(--line)", marginBottom: 8, width: w + "%" }} />
        ))}

        {/* Annotated line 1, auto-renewal */}
        <div style={{ position: "relative", marginBottom: 8 }}>
          <p style={{ fontSize: 12.5, color: "var(--ink-2)", lineHeight: 1.7, margin: 0, fontFamily: "var(--font-serif)" }}>
            The agreement shall{" "}
            <span style={{ background: "rgba(180,35,24,0.10)", borderBottom: "2px solid rgba(180,35,24,0.5)", padding: "0 2px" }}>not auto-renew</span>
            {" "}annually without written notice.
          </p>
          {/* Avatar + callout */}
          <div style={{ display: "flex", alignItems: "flex-start", gap: 8, marginTop: 6, marginLeft: 8 }}>
            <Avatar initials="KM" color="#C0713A" size={26} />
            <div style={{ background: "#fff", border: "1px solid rgba(232,147,90,0.35)", borderRadius: 8, padding: "6px 10px", boxShadow: "0 2px 8px rgba(0,0,0,0.06)" }}>
              <div style={{ fontSize: 10.5, fontWeight: 600, color: "#C0713A", marginBottom: 2 }}>Kai Müller · Velora</div>
              <div style={{ fontSize: 11.5, color: "var(--ink-1)", fontWeight: 500 }}>We do not accept auto-renewal</div>
            </div>
          </div>
        </div>

        {/* Placeholder lines */}
        {[90, 80].map((w, i) => (
          <div key={i} style={{ height: 7, borderRadius: 4, background: "var(--line)", marginBottom: 8, width: w + "%" }} />
        ))}

        {/* Annotated line 2, payment terms */}
        <div style={{ position: "relative", marginBottom: 4 }}>
          <p style={{ fontSize: 12.5, color: "var(--ink-2)", lineHeight: 1.7, margin: 0, fontFamily: "var(--font-serif)" }}>
            Customer will pay within{" "}
            <span style={{ background: "rgba(232,179,57,0.18)", borderBottom: "2px solid rgba(184,134,11,0.5)", padding: "0 3px", fontWeight: 600, color: "#92680A" }}>30 days</span>
            {" "}of the date of invoice.
          </p>
          {/* Avatar + callout */}
          <div style={{ display: "flex", alignItems: "flex-start", gap: 8, marginTop: 6, marginLeft: 140 }}>
            <Avatar initials="SL" color="#22C55E" size={26} />
            <div style={{ background: "#fff", border: "1px solid rgba(34,197,94,0.3)", borderRadius: 8, padding: "6px 10px", boxShadow: "0 2px 8px rgba(0,0,0,0.06)" }}>
              <div style={{ fontSize: 10.5, fontWeight: 600, color: "#16A34A", marginBottom: 2 }}>Sofia Lindh · Legal</div>
              <div style={{ fontSize: 11.5, color: "var(--ink-1)", fontWeight: 500 }}>Extend this to 60 days</div>
            </div>
          </div>
        </div>

      </div>
    </div>
  );
}

function NegotiationCommentMockup() {
  return (
    <div style={{ background: "var(--bg-elevated)", border: "1px solid var(--line)", borderRadius: 16, overflow: "hidden", boxShadow: "0 30px 60px -20px rgba(14,14,16,0.10), 0 4px 12px -4px rgba(14,14,16,0.04)" }}>
      <div style={{ padding: "13px 18px", borderBottom: "1px solid var(--line)", display: "flex", alignItems: "center", gap: 8 }}>
        <span style={{ color: "var(--accent)" }}><Icon name="workspace" size={13} /></span>
        <span style={{ fontSize: 12, fontWeight: 500, color: "var(--ink-1)" }}>Clause 7.1 · Payment terms</span>
      </div>
      <div style={{ padding: 18 }}>
        {[
          { from: "Velora (Kai Müller)", msg: "We require Net 60, this is non-negotiable per our CFO.", internal: false, time: "Mon 14:22" },
          { from: "Your team (internal)", msg: "⚠ Internal note: CFO approved Net 45 as our floor.", internal: true, time: "Mon 15:01" },
          { from: "Maya Holmberg", msg: "Proposing Net 45 as a compromise. See updated language below.", internal: false, time: "Mon 15:45" },
          { from: "Velora (Kai Müller)", msg: "Net 45 accepted. ✓", internal: false, time: "Tue 09:12" },
        ].map((c, i) => (
          <div key={i} style={{ marginBottom: 12 }}>
            <div style={{ display: "flex", alignItems: "baseline", gap: 6, marginBottom: 3 }}>
              <span style={{ fontSize: 12, fontWeight: 600, color: c.internal ? "#B8860B" : "var(--ink-1)" }}>{c.from}</span>
              <span style={{ fontSize: 11, color: "var(--ink-5)" }}>{c.time}</span>
            </div>
            <div style={{ padding: "8px 12px", borderRadius: 8, background: c.internal ? "rgba(232,179,57,0.06)" : "var(--bg-soft)", border: "1px solid " + (c.internal ? "rgba(232,179,57,0.2)" : "var(--line)"), fontSize: 12.5, color: "var(--ink-2)", lineHeight: 1.5 }}>
              {c.msg}
            </div>
          </div>
        ))}
      </div>
    </div>
  );
}

function NegotiationModulePage() {
  const data = window.ccModuleData["negotiation"];
  return (
    <div>
      <ModuleHero {...data.hero} />

      {/* 3-column feature section (Precisely style) */}
      <section style={{ padding: "48px 0 24px", background: "transparent" }}>
        <div className="container">
          <div className="grid grid-3" style={{ gap: "40px" }}>
            <div>
              <p style={{ fontSize: "14.5px", lineHeight: "1.6", color: "var(--ink-2)", margin: 0 }}>
                <strong style={{ fontWeight: 600, color: "var(--ink-1)" }}>External party portal</strong> invites counterparties to a secure shared document. Force them to edit inside the browser to eliminate rogue files.
              </p>
            </div>
            <div>
              <p style={{ fontSize: "14.5px", lineHeight: "1.6", color: "var(--ink-2)", margin: 0 }}>
                <strong style={{ fontWeight: 600, color: "var(--ink-1)" }}>Anchored clause threads</strong> bind every redline and question to the exact text. Track why adjustments were proposed, directly on the timeline.
              </p>
            </div>
            <div>
              <p style={{ fontSize: "14.5px", lineHeight: "1.6", color: "var(--ink-2)", margin: 0 }}>
                <strong style={{ fontWeight: 600, color: "var(--ink-1)" }}>Semantic diff comparison</strong> displays side-by-side versions with color-coded additions and removals. Never sign blindly again.
              </p>
            </div>
          </div>
        </div>
      </section>

      <LogoStrip />
      <ModuleMetrics {...data.metrics} />
      <FeatSection
        eyebrow="Shared workspace"
        title="One place for every <em>redline, comment, and version</em>."
        body="Invite the counterparty to a shared workspace, they edit in the same document, scoped to their role. No email attachments, no version confusion, no lost track of who agreed to what."
        bullets={["Counterparty edits in the same document, no email back-and-forth", "Live versioning shows exactly who saw which draft", "Accept counterparty redlines into your version with one click"]}
        mockup={<NegotiationWorkspaceMockup />}
      />
      <FeatSection
        eyebrow="Per-clause comments"
        title="Threaded comments <em>on the exact clause</em>, not in email."
        body="Every comment is anchored to a specific clause. Internal notes stay invisible to the other side. The conversation history becomes your negotiation audit trail."
        bullets={["Threaded comments per clause with resolved/open states", "Internal-only notes never visible to the counterparty", "Full comment history preserved through every version"]}
        mockup={<NegotiationCommentMockup />}
        flip soft
      />
      <ModuleFeatures name={data.featuresName || data.name.toLowerCase()} features={data.features} />
      <ModuleQuote {...data.quote} />

      <DepartmentShowcase />
      <FinalCTA />
      <ModuleFAQSection faqs={[
        { q: "How does ContractControl simplify the contract negotiation process?", a: "ContractControl provides a secure, shared browser workspace where internal teams and counterparties negotiate directly in the document. The module replaces email attachments with threaded comments, real-time editing, and version control." },
        { q: "Must external counterparties register for an account to negotiate contracts?", a: "No, counterparties can access the shared workspace through a secure, encrypted link without creating an account. They can review versions, propose redlines, and resolve comments directly in their web browser." },
        { q: "How do I ensure internal team comments remain private during negotiation?", a: "Internal comments are stored on a private layer that is never visible to the counterparty. Users can toggle visibility settings to share specific remarks externally when ready." },
        { q: "How does version control work during multi-party negotiations?", a: "Every saved turn in a negotiation creates a distinct version in a complete audit history. The platform allows users to run semantic comparisons between any two versions to track changes." },
        { q: "What happens when contract negotiations are finalized?", a: "Once agreement is reached, the host locks the document and routes it to the eSignature queue. The complete negotiation record, including all comments and drafts, is archived in the Repository." },
        { q: "Can multiple team members collaborate on a contract negotiation at the same time?", a: "Yes, multiple internal reviewers can annotate, comment, and edit the document simultaneously. The platform uses real-time sync to prevent conflicts and keep the team aligned." },
      ]} />
    </div>
  );
}

// ═══════════════════════════════════════════════════════════════════
// REPOSITORY
// ═══════════════════════════════════════════════════════════════════

function RepositoryDeptMockup({ rows, label }) {
  const statusStyle = {
    active:   { bg: "rgba(34,197,94,0.10)",   color: "#15803D" },
    signed:   { bg: "rgba(110,86,207,0.10)",  color: "var(--accent-deep)" },
    expiring: { bg: "rgba(234,179,8,0.12)",   color: "#92400E" },
    review:   { bg: "rgba(234,179,8,0.10)",   color: "#854d0e" },
    flagged:  { bg: "rgba(220,38,38,0.08)",   color: "#991b1b" },
  };
  return (
    <div style={{ width: "100%", maxWidth: 420 }}>
      <div style={{ background: "var(--bg-elevated)", border: "1px solid var(--line)", borderRadius: 10, overflow: "hidden", fontSize: 12 }}>
        <div style={{ padding: "10px 14px", background: "var(--bg-soft)", borderBottom: "1px solid var(--line)", display: "flex", alignItems: "center", justifyContent: "space-between" }}>
          <div style={{ display: "flex", alignItems: "center", gap: 7 }}>
            <svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="var(--ink-4)" strokeWidth="2"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>
            <span style={{ fontWeight: 500, color: "var(--ink-2)", fontSize: 12 }}>Repository · {label} view</span>
          </div>
          <span style={{ fontFamily: "var(--font-mono)", fontSize: 11, color: "var(--ink-4)" }}>{rows.length} results</span>
        </div>
        {rows.map((r, i) => {
          const s = statusStyle[r.status] || statusStyle.active;
          return (
            <div key={i} style={{ display: "flex", alignItems: "center", gap: 10, padding: "9px 14px", borderBottom: i < rows.length - 1 ? "1px solid var(--line)" : "none", background: i === 0 ? "rgba(110,86,207,0.025)" : "transparent" }}>
              <div style={{ flex: 1, minWidth: 0 }}>
                <div style={{ fontSize: 12, fontWeight: 500, color: "var(--ink-1)", whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis" }}>{r.name}</div>
                <div style={{ fontSize: 10.5, color: "var(--ink-4)", marginTop: 1 }}>{r.meta}</div>
              </div>
              <span style={{ fontSize: 10.5, padding: "2px 7px", borderRadius: 99, background: "rgba(110,86,207,0.07)", border: "1px solid rgba(110,86,207,0.15)", color: "var(--accent)", fontWeight: 500, whiteSpace: "nowrap", flexShrink: 0 }}>{r.type}</span>
              <span style={{ fontSize: 10.5, padding: "2px 7px", borderRadius: 99, background: s.bg, color: s.color, fontWeight: 500, whiteSpace: "nowrap", flexShrink: 0 }}>{r.statusLabel}</span>
            </div>
          );
        })}
      </div>
    </div>
  );
}

function RepositoryBulkImportMockup() {
  const fields = [
    { label: "Counterparty",     value: "Velora Industries AB",      done: true },
    { label: "Contract type",    value: "Master Service Agreement",  done: true },
    { label: "Effective date",   value: "2024-03-01",                done: true },
    { label: "Expiry / renewal", value: "2026-03-01 · auto-renew",   done: true },
    { label: "Liability cap",    value: "Extracting…",               done: false },
    { label: "Governing law",    value: "",                          done: false },
    { label: "Payment terms",    value: "",                          done: false },
  ];

  // Scan-line position, static at 62% through the doc
  const scanPct = 62;

  return (
    <div style={{ background: "var(--bg-elevated)", border: "1px solid var(--line)", borderRadius: 16, overflow: "hidden", boxShadow: "0 30px 60px -20px rgba(14,14,16,0.10), 0 4px 12px -4px rgba(14,14,16,0.04)" }}>
      {/* Header */}
      <div style={{ padding: "11px 16px", borderBottom: "1px solid var(--line)", display: "flex", alignItems: "center", gap: 8 }}>
        <svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="var(--accent)" strokeWidth="2"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/></svg>
        <span style={{ fontSize: 12, fontWeight: 500, color: "var(--ink-1)" }}>Velora_MSA_2024.pdf</span>
        <span style={{ marginLeft: "auto", fontSize: 11, padding: "2px 8px", borderRadius: 99, background: "rgba(88,67,245,0.08)", color: "var(--accent)", border: "1px solid rgba(88,67,245,0.2)" }}>AI indexing…</span>
      </div>

      {/* Two-column: document + metadata */}
      <div style={{ display: "grid", gridTemplateColumns: "1fr 1fr" }}>

        {/* Document preview with scan line */}
        <div style={{ padding: "14px 14px", borderRight: "1px solid var(--line)", position: "relative", background: "var(--bg-soft)" }}>
          {/* Scanned (above line), normal */}
          <div style={{ display: "flex", flexDirection: "column", gap: 6 }}>
            {[92, 78, 85, 65, 90, 72].map((w, i) => (
              <div key={i} style={{ height: 6, borderRadius: 3, width: w + "%", background: i < 4 ? "rgba(88,67,245,0.15)" : "var(--line)" }} />
            ))}
            {/* Scan line */}
            <div style={{ position: "relative", margin: "2px 0" }}>
              <div style={{ height: 2, background: "linear-gradient(90deg, transparent, var(--accent), transparent)", borderRadius: 2, boxShadow: "0 0 8px rgba(88,67,245,0.5)" }} />
            </div>
            {[80, 55, 70, 40].map((w, i) => (
              <div key={i} style={{ height: 6, borderRadius: 3, width: w + "%", background: "var(--line)", opacity: 0.5 }} />
            ))}
          </div>
          {/* AI label */}
          <div style={{ marginTop: 12, display: "flex", alignItems: "center", gap: 5 }}>
            <div style={{ width: 6, height: 6, borderRadius: "50%", background: "var(--accent)" }} />
            <span style={{ fontSize: 10.5, color: "var(--ink-4)" }}>AI · page 2 of 4</span>
          </div>
        </div>

        {/* Metadata population */}
        <div style={{ padding: "12px 14px", display: "flex", flexDirection: "column", gap: 7 }}>
          <div style={{ fontSize: 10.5, fontWeight: 600, color: "var(--ink-4)", letterSpacing: "0.04em", textTransform: "uppercase", marginBottom: 2 }}>Extracted metadata</div>
          {fields.map((f, i) => (
            <div key={i} style={{ display: "flex", flexDirection: "column", gap: 1 }}>
              <span style={{ fontSize: 10, color: "var(--ink-5)", textTransform: "uppercase", letterSpacing: "0.03em" }}>{f.label}</span>
              {f.value ? (
                <div style={{ display: "flex", alignItems: "center", gap: 5 }}>
                  {f.done && f.value !== "Extracting…" && <svg width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="var(--success)" strokeWidth="3"><polyline points="20 6 9 17 4 12"/></svg>}
                  <span style={{ fontSize: 11.5, fontWeight: 500, color: f.done && f.value !== "Extracting…" ? "var(--ink-1)" : "var(--accent)", fontStyle: "normal" }}>{f.value}</span>
                </div>
              ) : (
                <div style={{ height: 6, width: "60%", borderRadius: 3, background: "var(--line)", opacity: 0.5 }} />
              )}
            </div>
          ))}
        </div>
      </div>

      {/* Progress bar */}
      <div style={{ padding: "10px 16px", borderTop: "1px solid var(--line)", background: "var(--bg-elevated)" }}>
        <div style={{ display: "flex", justifyContent: "space-between", marginBottom: 5 }}>
          <span style={{ fontSize: 11, color: "var(--ink-4)" }}>Indexing archive</span>
          <span style={{ fontSize: 11, color: "var(--ink-4)", fontFamily: "var(--font-mono)" }}>99 / 142</span>
        </div>
        <div style={{ height: 4, background: "var(--line)", borderRadius: 99, overflow: "hidden" }}>
          <div style={{ height: "100%", width: "70%", background: "var(--accent)", borderRadius: 99 }} />
        </div>
      </div>
    </div>
  );
}

function RepositorySearchMockup() {
  const Highlight = ({ children }) => (
    <mark style={{ background: "rgba(124,92,211,0.18)", color: "var(--accent)", borderRadius: 3, padding: "0 2px", fontWeight: 500 }}>{children}</mark>
  );
  const hits = [
    {
      name: "Velora Industries MSA", type: "MSA", page: "§ 11.3",
      excerpt: [
        "Liability of either party shall not exceed ", <Highlight key="h1">twelve (12) times</Highlight>, " the monthly fees paid in the preceding 12-month period, except in cases of gross negligence."
      ]
    },
    {
      name: "Northwind Framework Agreement", type: "Framework", page: "§ 9.1",
      excerpt: [
        "Neither party shall be liable for ", <Highlight key="h2">indirect or consequential damages</Highlight>, ", including loss of revenue or profits, whether foreseeable or not."
      ]
    },
    {
      name: "Brevia Holdings SaaS Order", type: "SaaS", page: "§ 14.2",
      excerpt: [
        "Total aggregate liability shall be capped at ", <Highlight key="h3">EUR 50,000</Highlight>, " per incident, regardless of the form of action or legal theory asserted."
      ]
    },
  ];
  return (
    <div style={{ background: "var(--bg-elevated)", border: "1px solid var(--line)", borderRadius: 16, overflow: "hidden", boxShadow: "0 30px 60px -20px rgba(14,14,16,0.10), 0 4px 12px -4px rgba(14,14,16,0.04)" }}>
      {/* Search bar */}
      <div style={{ padding: "11px 16px", borderBottom: "1px solid var(--line)", display: "flex", alignItems: "center", gap: 8, background: "var(--bg-soft)" }}>
        <svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="var(--ink-3)" strokeWidth="2"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>
        <span style={{ fontSize: 12.5, color: "var(--ink-2)", flex: 1 }}>limitation of liability clause</span>
        <span style={{ fontSize: 10.5, color: "var(--ink-5)", fontFamily: "var(--font-mono)" }}>0.3s</span>
      </div>
      {/* Result count */}
      <div style={{ padding: "7px 16px", borderBottom: "1px solid var(--line)", display: "flex", alignItems: "center", gap: 8 }}>
        <span style={{ fontSize: 11, color: "var(--ink-4)" }}>Clause matches across <span style={{ color: "var(--ink-2)", fontWeight: 500 }}>31 contracts</span></span>
        <span style={{ marginLeft: "auto", fontSize: 10.5, padding: "2px 8px", borderRadius: 99, background: "var(--accent-soft)", color: "var(--accent)", fontWeight: 500 }}>Semantic search</span>
      </div>
      {/* Clause hits */}
      <div style={{ padding: "10px 14px", display: "flex", flexDirection: "column", gap: 8 }}>
        {hits.map((h, i) => (
          <div key={i} style={{ borderRadius: 10, border: "1px solid var(--line)", padding: "11px 14px", background: "var(--bg-soft)" }}>
            <div style={{ display: "flex", alignItems: "center", gap: 7, marginBottom: 8 }}>
              <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="var(--ink-4)" strokeWidth="2"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/></svg>
              <span style={{ fontSize: 12.5, fontWeight: 600, color: "var(--ink-1)" }}>{h.name}</span>
              <span style={{ fontSize: 10, padding: "1px 6px", borderRadius: 99, background: "rgba(88,67,245,0.08)", border: "1px solid rgba(88,67,245,0.16)", color: "var(--accent)" }}>{h.type}</span>
              <span style={{ marginLeft: "auto", fontSize: 10.5, color: "var(--ink-4)", fontFamily: "var(--font-mono)" }}>{h.page}</span>
            </div>
            <p style={{ fontSize: 11.5, color: "var(--ink-3)", lineHeight: 1.6, margin: 0 }}>"{h.excerpt}"</p>
          </div>
        ))}
      </div>
    </div>
  );
}

function RepositoryExtractionMockup() {
  return (
    <div style={{ background: "var(--bg-elevated)", border: "1px solid var(--line)", borderRadius: 16, overflow: "hidden", boxShadow: "0 30px 60px -20px rgba(14,14,16,0.10), 0 4px 12px -4px rgba(14,14,16,0.04)" }}>
      <div style={{ padding: "13px 18px", borderBottom: "1px solid var(--line)", display: "flex", alignItems: "center", gap: 8 }}>
        <span style={{ color: "var(--accent)" }}><Icon name="analytics" size={13} /></span>
        <span style={{ fontSize: 12, fontWeight: 500, color: "var(--ink-1)" }}>AI extraction · Velora_MSA_2024.pdf</span>
      </div>
      <div style={{ padding: 16, display: "flex", flexDirection: "column", gap: 8 }}>
        {[
          { field: "Counterparty", value: "Velora Industries AB" },
          { field: "Contract type", value: "Master Service Agreement" },
          { field: "Effective date", value: "2024-03-01" },
          { field: "Expiry / renewal", value: "2026-03-01 · auto-renew 90d" },
          { field: "Governing law", value: "Sweden" },
          { field: "Liability cap", value: "12× monthly fees" },
          { field: "Payment terms", value: "Net 30" },
        ].map((f) => (
          <div key={f.field} style={{ display: "flex", justifyContent: "space-between", padding: "7px 12px", borderRadius: 8, background: "var(--bg-soft)", border: "1px solid var(--line)" }}>
            <span style={{ fontSize: 12, color: "var(--ink-4)" }}>{f.field}</span>
            <span style={{ fontSize: 12.5, fontWeight: 500, color: "var(--ink-1)" }}>{f.value}</span>
          </div>
        ))}
        <div style={{ marginTop: 4, padding: "8px 12px", borderRadius: 8, background: "rgba(31,138,76,0.06)", border: "1px solid rgba(31,138,76,0.2)", fontSize: 11.5, color: "var(--success)" }}>
          ✓ 60+ fields extracted · confidence: high
        </div>
      </div>
    </div>
  );
}

function RepositoryAccessMockup() {
  const users = [
    { name: "Maya Holmberg",  role: "Legal Counsel",  access: "Full access",    color: "var(--accent)",  initials: "MH" },
    { name: "Erik Lindström", role: "Finance",         access: "View only",      color: "#22C55E",        initials: "EL" },
    { name: "Kai Müller",     role: "Sales",           access: "NDAs & MSAs",    color: "#F59E0B",        initials: "KM" },
    { name: "Sara Johansson", role: "Procurement",     access: "Vendor contracts",color: "#8B5CF6",       initials: "SJ" },
  ];
  return (
    <div style={{ background: "var(--bg-elevated)", border: "1px solid var(--line)", borderRadius: 16, overflow: "hidden", boxShadow: "0 30px 60px -20px rgba(14,14,16,0.10), 0 4px 12px -4px rgba(14,14,16,0.04)" }}>
      {/* Header */}
      <div style={{ padding: "11px 16px", borderBottom: "1px solid var(--line)", display: "flex", alignItems: "center", gap: 8 }}>
        <svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="var(--accent)" strokeWidth="2"><rect x="3" y="11" width="18" height="11" rx="2" ry="2"/><path d="M7 11V7a5 5 0 0 1 10 0v4"/></svg>
        <span style={{ fontSize: 12, fontWeight: 500, color: "var(--ink-1)" }}>Access control · Contract Repository</span>
        <div style={{ marginLeft: "auto", display: "flex", alignItems: "center", gap: 5 }}>
          <svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="var(--success)" strokeWidth="2.5"><polyline points="20 6 9 17 4 12"/></svg>
          <span style={{ fontSize: 11, color: "var(--success)" }}>ISO 27001</span>
        </div>
      </div>
      {/* User permission rows */}
      <div>
        {users.map((u, i) => (
          <div key={i} style={{ padding: "10px 16px", borderBottom: i < users.length - 1 ? "1px solid var(--line)" : "none", display: "flex", alignItems: "center", gap: 12 }}>
            <div style={{ width: 30, height: 30, borderRadius: "50%", background: u.color, display: "flex", alignItems: "center", justifyContent: "center", fontSize: 11, fontWeight: 700, color: "#fff", flexShrink: 0 }}>{u.initials}</div>
            <div style={{ flex: 1, minWidth: 0 }}>
              <div style={{ fontSize: 12.5, fontWeight: 500, color: "var(--ink-1)" }}>{u.name}</div>
              <div style={{ fontSize: 11, color: "var(--ink-4)", marginTop: 1 }}>{u.role}</div>
            </div>
            <span style={{ fontSize: 11, padding: "2px 9px", borderRadius: 99, background: "var(--bg-soft)", border: "1px solid var(--line)", color: "var(--ink-2)", whiteSpace: "nowrap" }}>{u.access}</span>
          </div>
        ))}
      </div>
      {/* Encryption footer */}
      <div style={{ padding: "10px 16px", borderTop: "1px solid var(--line)", background: "var(--bg-soft)", display: "flex", alignItems: "center", gap: 12 }}>
        <div style={{ display: "flex", alignItems: "center", gap: 5 }}>
          <svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="var(--success)" strokeWidth="2.2"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/></svg>
          <span style={{ fontSize: 11, color: "var(--ink-3)" }}>End-to-end encrypted</span>
        </div>
        <div style={{ width: 1, height: 12, background: "var(--line)" }} />
        <div style={{ display: "flex", alignItems: "center", gap: 5 }}>
          <svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="var(--success)" strokeWidth="2.2"><polyline points="20 6 9 17 4 12"/></svg>
          <span style={{ fontSize: 11, color: "var(--ink-3)" }}>Audit log on every access</span>
        </div>
      </div>
    </div>
  );
}

function RepositoryMissingContractsMockup() {
  const vendors = [
    { name: "Acme Corporation", source: "NetSuite ERP", spend: "€142,000 / yr", status: "Missing contract", isMissing: true },
    { name: "Amazon Web Services", source: "Workday ERP", spend: "€380,000 / yr", status: "Active contract", isMissing: false },
    { name: "Salesforce.com, Inc.", source: "SAP ERP", spend: "€95,000 / yr", status: "Active contract", isMissing: false },
    { name: "Slack Technologies", source: "NetSuite ERP", spend: "€18,000 / yr", status: "Missing contract", isMissing: true },
  ];
  return (
    <div style={{ background: "var(--bg-elevated)", border: "1px solid var(--line)", borderRadius: 16, overflow: "hidden", boxShadow: "0 30px 60px -20px rgba(14,14,16,0.10), 0 4px 12px -4px rgba(14,14,16,0.04)" }}>
      {/* Header */}
      <div style={{ padding: "11px 16px", borderBottom: "1px solid var(--line)", display: "flex", alignItems: "center", gap: 8 }}>
        <svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="var(--accent)" strokeWidth="2">
          <path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2" />
          <circle cx="9" cy="7" r="4" />
          <path d="M23 21v-2a4 4 0 0 0-3-3.87" />
          <path d="M16 3.13a4 4 0 0 1 0 7.75" />
        </svg>
        <span style={{ fontSize: 12, fontWeight: 500, color: "var(--ink-1)" }}>ERP Reconciliation · Missing Contracts</span>
        <div style={{ marginLeft: "auto", display: "flex", alignItems: "center", gap: 5 }}>
          <span style={{ width: 8, height: 8, borderRadius: "50%", background: "var(--accent)" }} />
          <span style={{ fontSize: 11, color: "var(--accent)", fontWeight: 500 }}>Live ERP Sync</span>
        </div>
      </div>
      {/* Table headers */}
      <div style={{ display: "grid", gridTemplateColumns: "1.2fr 1fr 1fr", padding: "8px 16px", background: "var(--bg-soft)", borderBottom: "1px solid var(--line)", fontSize: 10.5, fontWeight: 600, color: "var(--ink-4)", textTransform: "uppercase", letterSpacing: "0.03em" }}>
        <span>Supplier / ERP Source</span>
        <span>Annual Spend</span>
        <span>Contract Status</span>
      </div>
      {/* Vendor rows */}
      <div>
        {vendors.map((v, i) => (
          <div key={i} style={{ padding: "12px 16px", borderBottom: i < vendors.length - 1 ? "1px solid var(--line)" : "none", display: "grid", gridTemplateColumns: "1.2fr 1fr 1fr", alignItems: "center" }}>
            <div>
              <div style={{ fontSize: 12.5, fontWeight: 600, color: "var(--ink-1)" }}>{v.name}</div>
              <div style={{ fontSize: 10.5, color: "var(--ink-4)", marginTop: 1, display: "flex", alignItems: "center", gap: 4 }}>
                <svg width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
                  <path d="M22 12h-4l-3 9L9 3l-3 9H2" />
                </svg>
                {v.source}
              </div>
            </div>
            <span style={{ fontSize: 12, color: "var(--ink-2)", fontFamily: "var(--font-mono)" }}>{v.spend}</span>
            <div>
              <span style={v.isMissing ? {
                fontSize: 10.5, fontWeight: 600, padding: "3px 9px", borderRadius: 99,
                background: "rgba(220,38,38,0.08)", border: "1px solid rgba(220,38,38,0.18)", color: "var(--danger)",
                display: "inline-flex", alignItems: "center", gap: 4
              } : {
                fontSize: 10.5, fontWeight: 600, padding: "3px 9px", borderRadius: 99,
                background: "rgba(34,197,94,0.08)", border: "1px solid rgba(34,197,94,0.18)", color: "var(--success)",
                display: "inline-flex", alignItems: "center", gap: 4
              }}>
                {v.isMissing ? (
                  <svg width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="3">
                    <line x1="12" y1="9" x2="12" y2="13" />
                    <line x1="12" y1="17" x2="12.01" y2="17" />
                    <path d="M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z" />
                  </svg>
                ) : (
                  <svg width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="3">
                    <polyline points="20 6 9 17 4 12" />
                  </svg>
                )}
                {v.status}
              </span>
            </div>
          </div>
        ))}
      </div>
      {/* Alert Banner / Stats */}
      <div style={{ padding: "12px 16px", borderTop: "1px solid var(--line)", background: "rgba(220,38,38,0.03)", display: "flex", alignItems: "center", gap: 10 }}>
        <span style={{ color: "var(--danger)", display: "flex" }}>
          <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5">
            <circle cx="12" cy="12" r="10" />
            <line x1="12" y1="8" x2="12" y2="12" />
            <line x1="12" y1="16" x2="12.01" y2="16" />
          </svg>
        </span>
        <span style={{ fontSize: 11.5, color: "var(--ink-2)", fontWeight: 500 }}>
          Reconciliation Alert: <strong>2 active suppliers</strong> have spend but no matching contract in the repository.
        </span>
      </div>
    </div>
  );
}

function RepositoryModulePage() {
  const data = window.ccModuleData["repository"];
  return (
    <div>
      <ModuleHero {...data.hero} />

      {/* 3-column feature section (Precisely style) */}
      <section style={{ padding: "48px 0 24px", background: "transparent" }}>
        <div className="container">
          <div className="grid grid-3" style={{ gap: "40px" }}>
            <div>
              <p style={{ fontSize: "14.5px", lineHeight: "1.6", color: "var(--ink-2)", margin: 0 }}>
                <strong style={{ fontWeight: 600, color: "var(--ink-1)" }}>Smart bulk importing</strong> uploads and parses legacy archives with AI. Relate contract documents and index terms automatically in seconds.
              </p>
            </div>
            <div>
              <p style={{ fontSize: "14.5px", lineHeight: "1.6", color: "var(--ink-2)", margin: 0 }}>
                <strong style={{ fontWeight: 600, color: "var(--ink-1)" }}>Faceted search queries</strong> let you locate metadata, values, or clauses instantly. Build custom views and share filter criteria with your team.
              </p>
            </div>
            <div>
              <p style={{ fontSize: "14.5px", lineHeight: "1.6", color: "var(--ink-2)", margin: 0 }}>
                <strong style={{ fontWeight: 600, color: "var(--ink-1)" }}>Spend reconciliation</strong> connects active vendors with payment flows. Instantly flag active invoicing that lacks a corresponding contract.
              </p>
            </div>
          </div>
        </div>
      </section>

      <LogoStrip />
      <ModuleMetrics {...data.metrics} />
      <FeatSection
        eyebrow="Bulk import"
        title="Bring your entire contract archive <em>in one step</em>."
        body="Upload your existing contracts in bulk. ContractControl uses AI to read every document, links related records automatically, and indexes metadata across your entire archive instantly."
        bullets={["AI reads and tags every document automatically", "Link related records and contracts automatically", "Run AI on legacy contracts to index their metadata instantly"]}
        mockup={<RepositoryBulkImportMockup />}
      />
      <FeatSection
        eyebrow="Search & filter"
        title="Find exactly what you need, <em>instantly</em>."
        body="Search by any contract detail, term, or clause across your entire portfolio. Filter, share, and export views, so every stakeholder sees exactly what they need."
        bullets={["Search by any contract detail, clause, or term", "Access complete records of every version and comment", "Export data and share filtered views with stakeholders"]}
        mockup={<RepositorySearchMockup />}
        flip soft
      />
      <FeatSection
        eyebrow="Access & security"
        title="Only the right people see <em>the right contracts</em>."
        body="ContractControl safeguards your data with ISO 27001-aligned security and gives you granular permission controls, so sensitive contracts stay visible only to those who need them."
        bullets={["End-to-end encryption protecting every contract and document", "Set precise user and role-based permissions down to contract type", "Full audit log of every access, export, and change for compliance"]}
        mockup={<RepositoryAccessMockup />}
        soft
        ctaLabel="Read more"
        ctaHref="/platform/power-modules/permissions"
      />
      <FeatSection
        eyebrow="ERP Reconciliation"
        title="Identify missing contracts <em>with ERP integration</em>."
        body="Reconcile active vendor spend against your contract repository automatically. By linking your ERP (like NetSuite, SAP, or Workday), ContractControl identifies which suppliers you are paying but lack an active, signed contract with, reducing compliance risk."
        bullets={[
          "Automated reconciliation: match active general ledger spend against active agreements",
          "Identify compliance gaps: instantly flag active suppliers missing a valid contract",
          "One-click action: generate new contract requests or upload missing files directly from alerts"
        ]}
        mockup={<RepositoryMissingContractsMockup />}
        flip
      />
      <ModuleFeatures name={data.featuresName || data.name.toLowerCase()} features={data.features} />
      <ModuleQuote {...data.quote} />

      <ModuleDeptSection module="Repository" depts={[
        { icon: "legal", label: "Legal Ops", tagline: "Find any contract or clause in seconds.", desc: "Legal Ops teams use ContractControl to eliminate manual searching. Every document is automatically OCR'd and extracted into structured metadata.", href: "/solutions/team/legal",
          bullets: [
            "Plain-language search across the entire portfolio",
            "Instant key term and obligation extraction",
            "Standardized folder and metadata structure",
          ],
          mockup: <RepositoryDeptMockup label="Legal" rows={[
            { name: "Velora Industries MSA",    meta: "Renewed 2026-03-01",  type: "MSA",         status: "active",   statusLabel: "Active" },
            { name: "Brevia Holdings NDA",      meta: "Signed 2025-11-04",   type: "NDA",         status: "signed",   statusLabel: "Signed" },
            { name: "Northwind Framework",      meta: "Expires 2025-11-15",  type: "Framework",   status: "expiring", statusLabel: "Expiring" },
            { name: "Modulor GmbH DPA",         meta: "Under legal review",  type: "DPA",         status: "review",   statusLabel: "In review" },
          ]} /> },
        { icon: "analytics", label: "Finance", tagline: "Revenue leakage starts in the contract.", desc: "Finance teams query the portfolio to track payment terms, auto-renewals, and price uplifts before they impact the budget.", href: "/solutions/team/finance",
          bullets: [
            "Complete visibility into price escalation clauses",
            "Audit-ready contract records in one click",
            "Granular visibility into payment terms and schedules",
          ],
          mockup: <RepositoryDeptMockup label="Finance" rows={[
            { name: "Velora Industries MSA",    meta: "€240k · uplift 3.5% Nov", type: "MSA",     status: "active",   statusLabel: "Active" },
            { name: "Helix Legal SaaS",         meta: "€84k/yr · renews Nov 30",  type: "License", status: "expiring", statusLabel: "Expiring" },
            { name: "Modulor GmbH SOW",         meta: "€38k · payment due",       type: "SOW",     status: "review",   statusLabel: "In review" },
            { name: "Northwind Framework",      meta: "€112k · auto-renew",       type: "Framework",status: "active",  statusLabel: "Active" },
          ]} /> },
        { icon: "obligations", label: "Procurement", tagline: "Vendor agreements under control, not in a folder.", desc: "Every supplier agreement is searchable with key renewal dates, SLAs, and liability terms surfaced automatically.", href: "/solutions/team/procurement",
          bullets: [
            "Proactive alerts on opt-out and renewal windows",
            "Spend and commitment forecasting across vendors",
            "Easy tracking of active vs expired agreements",
          ],
          mockup: <RepositoryDeptMockup label="Procurement" rows={[
            { name: "Modulor GmbH",             meta: "Vendor · SaaS tools",     type: "Vendor",   status: "active",   statusLabel: "Active" },
            { name: "Brevia Cloud",             meta: "Vendor · Infrastructure",  type: "Vendor",   status: "expiring", statusLabel: "Expiring" },
            { name: "Helix Security",           meta: "Vendor · Pen testing",     type: "SOW",      status: "signed",   statusLabel: "Signed" },
            { name: "Northwind Consulting",     meta: "Vendor · Advisory",        type: "Vendor",   status: "review",   statusLabel: "In review" },
          ]} /> },
        { icon: "negotiation", label: "Sales", tagline: "Pull up precedents and customer terms instantly.", desc: "Sales teams access past agreements and standard clauses on the fly to accelerate negotiations and close deals faster.", href: "/solutions/team/sales",
          bullets: [
            "Instant search for approved non-standard terms",
            "Full historical customer record visibility",
            "Seamless lookup of active pricing agreements",
          ],
          mockup: <RepositoryDeptMockup label="Sales" rows={[
            { name: "Velora Industries MSA",    meta: "Customer · 2024 precedent", type: "MSA",    status: "active",   statusLabel: "Active" },
            { name: "Kvist Group Order Form",   meta: "Customer · €84k/yr",        type: "Order",  status: "signed",   statusLabel: "Signed" },
            { name: "Brevia Holdings NDA",      meta: "Customer · mutual",         type: "NDA",    status: "signed",   statusLabel: "Signed" },
            { name: "Northwind AB MSA",         meta: "Customer · in negotiation", type: "MSA",    status: "review",   statusLabel: "In review" },
          ]} /> },
        { icon: "workspace", label: "Compliance", tagline: "Audit your entire portfolio in minutes, not weeks.", desc: "Ensure every contract matches active regulatory standards, with automated checks for missing clauses or invalid terms.", href: "/solutions/team/legal",
          bullets: [
            "Bulk search for custom and standard clauses",
            "Automated tracking of regulatory requirements",
            "Role-based permissions to protect sensitive data",
          ],
          mockup: <RepositoryDeptMockup label="Compliance" rows={[
            { name: "Velora Industries MSA",    meta: "DPA reference missing",    type: "MSA",     status: "flagged",  statusLabel: "Flagged" },
            { name: "Helix Legal SaaS",         meta: "Liability cap: ✓ present", type: "License", status: "active",   statusLabel: "Verified" },
            { name: "Modulor GmbH DPA",         meta: "GDPR clause: ✓ present",   type: "DPA",     status: "active",   statusLabel: "Verified" },
            { name: "Brevia Cloud",             meta: "Termination clause: check", type: "Vendor",  status: "review",   statusLabel: "In review" },
          ]} /> },
      ]} />
      <FinalCTA />
      <ModuleFAQSection faqs={[
        { q: "How does ContractControl Repository help organize signed agreements?", a: "ContractControl Repository provides a smart, central database that uses AI to extract metadata from every stored document. The system indexes over sixty contract fields, making your entire archive searchable using plain-English questions." },
        { q: "How can I import legacy agreements into the smart repository?", a: "Legacy contracts can be uploaded in bulk by dragging PDF, DOCX, or ZIP archives directly into the interface. The AI engine processes the files, extracts metadata, and populates your database within hours." },
        { q: "What document types does the ContractControl Repository support?", a: "The repository supports any contract type, including MSAs, NDAs, vendor contracts, SOWs, and employment agreements. The extraction model is trained on over eighty document classes across twelve languages." },
        { q: "How does the platform handle document access control and security?", a: "Access is managed through granular, role-based permissions that restrict document visibility by team, type, or folder. Sensitive files, such as executive employment contracts, can be restricted to specific HR stakeholders." },
        { q: "Does the contract repository integrate with CRM and ERP platforms?", a: "Yes, the repository integrates with Salesforce, HubSpot, and other business systems via our open API. This connection allows teams to sync contract records with account data automatically." },
        { q: "How does the repository sync with the Obligations module?", a: "Every uploaded contract is scanned for critical dates, pricing schedules, and SLA commitments. These terms are automatically pushed to the Obligations module to set up active alerts." },
      ]} />
    </div>
  );
}

// ═══════════════════════════════════════════════════════════════════
// ANALYTICS
// ═══════════════════════════════════════════════════════════════════

function AnalyticsDashboardMockup() {
  return (
    <div style={{ background: "var(--bg-elevated)", border: "1px solid var(--line)", borderRadius: 16, overflow: "hidden", boxShadow: "0 30px 60px -20px rgba(14,14,16,0.10), 0 4px 12px -4px rgba(14,14,16,0.04)" }}>
      <div style={{ padding: "13px 18px", borderBottom: "1px solid var(--line)", display: "flex", alignItems: "center", gap: 8 }}>
        <span style={{ color: "var(--accent)" }}><Icon name="analytics" size={13} /></span>
        <span style={{ fontSize: 12, fontWeight: 500, color: "var(--ink-1)" }}>Contract health overview</span>
        <span style={{ marginLeft: "auto", fontSize: 11, color: "var(--ink-4)" }}>4,287 contracts</span>
      </div>
      <div style={{ padding: 18 }}>
        <div style={{ display: "grid", gridTemplateColumns: "1fr 1fr 1fr", gap: 10, marginBottom: 16 }}>
          {[
            { label: "Healthy", value: "76%", color: "var(--success)", bg: "rgba(31,138,76,0.07)" },
            { label: "Needs attention", value: "18%", color: "#B8860B", bg: "rgba(232,179,57,0.07)" },
            { label: "At risk", value: "6%", color: "var(--danger)", bg: "rgba(180,35,24,0.06)" },
          ].map((s) => (
            <div key={s.label} style={{ padding: "10px 12px", borderRadius: 10, background: s.bg, border: "1px solid " + s.color + "30", textAlign: "center" }}>
              <div style={{ fontSize: 22, fontWeight: 600, color: s.color, letterSpacing: "-0.02em" }}>{s.value}</div>
              <div style={{ fontSize: 11, color: "var(--ink-4)", marginTop: 3 }}>{s.label}</div>
            </div>
          ))}
        </div>
        <div style={{ fontSize: 11, fontWeight: 500, letterSpacing: "0.1em", textTransform: "uppercase", color: "var(--ink-4)", marginBottom: 8 }}>Avg cycle time · last 30d</div>
        <div style={{ display: "flex", alignItems: "flex-end", gap: 4, height: 56, marginBottom: 6 }}>
          {[42, 55, 38, 62, 48, 71, 54, 60, 72, 56, 65, 80].map((h, i) => (
            <div key={i} style={{ flex: 1, height: h + "%", background: i === 11 ? "var(--accent)" : "var(--line-strong)", borderRadius: 2, transition: "height 400ms ease" }} />
          ))}
        </div>
        <div style={{ fontSize: 11, color: "var(--ink-4)", display: "flex", justifyContent: "space-between" }}>
          <span>May 7</span><span style={{ color: "var(--accent)", fontWeight: 500 }}>2.4d avg ↓ 67%</span><span>Today</span>
        </div>
      </div>
    </div>
  );
}

function AnalyticsRenewalMockup() {
  return (
    <div style={{ background: "var(--bg-elevated)", border: "1px solid var(--line)", borderRadius: 16, overflow: "hidden", boxShadow: "0 30px 60px -20px rgba(14,14,16,0.10), 0 4px 12px -4px rgba(14,14,16,0.04)" }}>
      <div style={{ padding: "13px 18px", borderBottom: "1px solid var(--line)", display: "flex", alignItems: "center", gap: 8 }}>
        <span style={{ color: "var(--accent)" }}><Icon name="obligations" size={13} /></span>
        <span style={{ fontSize: 12, fontWeight: 500, color: "var(--ink-1)" }}>Renewal radar · next 12 months</span>
      </div>
      <div style={{ padding: 16 }}>
        {[
          { month: "Jun", count: 4, value: "€240k", risk: "ok" },
          { month: "Jul", count: 7, value: "€1.1M", risk: "warn" },
          { month: "Aug", count: 2, value: "€80k", risk: "ok" },
          { month: "Sep", count: 11, value: "€2.4M", risk: "high" },
        ].map((r, i) => (
          <div key={i} style={{ display: "flex", alignItems: "center", gap: 12, padding: "9px 0", borderBottom: i < 3 ? "1px solid var(--line)" : "none" }}>
            <span style={{ fontSize: 12, fontFamily: "var(--font-mono)", color: "var(--ink-4)", width: 28 }}>{r.month}</span>
            <div style={{ flex: 1, height: 6, borderRadius: 99, background: "var(--bg-soft)", overflow: "hidden" }}>
              <div style={{ height: "100%", borderRadius: 99, width: (r.count / 11 * 100) + "%", background: r.risk === "high" ? "var(--danger)" : r.risk === "warn" ? "var(--warning)" : "var(--success)" }} />
            </div>
            <span style={{ fontSize: 12, color: "var(--ink-3)", width: 28 }}>{r.count}</span>
            <span style={{ fontSize: 12, fontWeight: 500, color: "var(--ink-1)", width: 52, textAlign: "right" }}>{r.value}</span>
          </div>
        ))}
        <div style={{ marginTop: 14, padding: "10px 12px", borderRadius: 8, background: "rgba(180,35,24,0.05)", border: "1px solid rgba(180,35,24,0.15)", fontSize: 12, color: "var(--danger)" }}>
          ⚠ September: 3 contracts at auto-renew risk, action required
        </div>
      </div>
    </div>
  );
}

function AnalyticsLeakageMockup() {
  const contracts = [
    { supplier: "Acme Software GmbH",    type: "SaaS",       agreed: "€48,000",  invoiced: "€57,340", delta: "+€9,340",  tone: "high" },
    { supplier: "Northwind Logistics",   type: "Service",    agreed: "€120,000", invoiced: "€122,400", delta: "+€2,400", tone: "warn" },
    { supplier: "Velora Cloud Services", type: "Infra",      agreed: "€36,000",  invoiced: "€36,000", delta: null,       tone: "ok" },
    { supplier: "Brevia Consulting",     type: "Framework",  agreed: "€75,000",  invoiced: "€81,500", delta: "+€6,500",  tone: "high" },
  ];
  const toneColor = { high: "var(--danger)", warn: "var(--warning)", ok: "var(--success)" };
  return (
    <div style={{ background: "var(--bg-elevated)", border: "1px solid var(--line)", borderRadius: 16, overflow: "hidden", boxShadow: "0 30px 60px -20px rgba(14,14,16,0.10), 0 4px 12px -4px rgba(14,14,16,0.04)" }}>
      {/* Header */}
      <div style={{ padding: "12px 16px", borderBottom: "1px solid var(--line)", display: "flex", alignItems: "center", gap: 8, background: "var(--bg-soft)" }}>
        <svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="var(--accent)" strokeWidth="2"><rect x="2" y="3" width="20" height="14" rx="2"/><line x1="8" y1="21" x2="16" y2="21"/><line x1="12" y1="17" x2="12" y2="21"/></svg>
        <span style={{ fontSize: 12, fontWeight: 500, color: "var(--ink-1)" }}>Terms vs invoice · Q2 2025</span>
        <span style={{ marginLeft: "auto", fontSize: 10.5, padding: "2px 8px", borderRadius: 99, background: "rgba(180,35,24,0.07)", border: "1px solid rgba(180,35,24,0.18)", color: "var(--danger)", fontWeight: 600 }}>3 over-billed</span>
      </div>
      {/* Column headers */}
      <div style={{ display: "grid", gridTemplateColumns: "1fr 84px 88px 68px", padding: "7px 16px", borderBottom: "1px solid var(--line)", background: "var(--bg-soft)" }}>
        {["Supplier", "Agreed", "Invoiced", "Delta"].map((h, i) => (
          <span key={i} style={{ fontSize: 10.5, fontWeight: 600, letterSpacing: "0.06em", textTransform: "uppercase", color: "var(--ink-4)", textAlign: i > 0 ? "right" : "left" }}>{h}</span>
        ))}
      </div>
      {/* Rows */}
      <div>
        {contracts.map((r, i) => (
          <div key={i} style={{ display: "grid", gridTemplateColumns: "1fr 84px 88px 68px", padding: "10px 16px", borderBottom: i < contracts.length - 1 ? "1px solid var(--line)" : "none", background: r.delta ? "rgba(180,35,24,0.022)" : "transparent" }}>
            <div>
              <div style={{ fontSize: 12.5, fontWeight: 500, color: "var(--ink-1)" }}>{r.supplier}</div>
              <div style={{ fontSize: 10.5, color: "var(--ink-4)", marginTop: 2 }}>{r.type}</div>
            </div>
            <span style={{ fontSize: 12, color: "var(--ink-3)", textAlign: "right", fontFamily: "var(--font-mono)", alignSelf: "center" }}>{r.agreed}</span>
            <span style={{ fontSize: 12, fontWeight: r.delta ? 600 : 400, color: r.delta ? "var(--danger)" : "var(--ink-3)", textAlign: "right", fontFamily: "var(--font-mono)", alignSelf: "center" }}>{r.invoiced}</span>
            <span style={{ fontSize: 12, fontWeight: 700, color: toneColor[r.tone], textAlign: "right", fontFamily: "var(--font-mono)", alignSelf: "center" }}>{r.delta || "✓"}</span>
          </div>
        ))}
      </div>
      {/* Footer */}
      <div style={{ borderTop: "1px solid var(--line)", padding: "10px 16px", display: "flex", justifyContent: "space-between", alignItems: "center", background: "rgba(180,35,24,0.04)" }}>
        <span style={{ fontSize: 12, color: "var(--ink-3)" }}>Total overbilling identified</span>
        <span style={{ fontSize: 15, fontWeight: 700, color: "var(--danger)", fontFamily: "var(--font-mono)" }}>+€18,240</span>
      </div>
    </div>
  );
}

function AnalyticsModulePage() {
  const data = window.ccModuleData["analytics"];
  return (
    <div>
      <ModuleHero {...data.hero} />

      {/* 3-column feature section (Precisely style) */}
      <section style={{ padding: "48px 0 24px", background: "transparent" }}>
        <div className="container">
          <div className="grid grid-3" style={{ gap: "40px" }}>
            <div>
              <p style={{ fontSize: "14.5px", lineHeight: "1.6", color: "var(--ink-2)", margin: 0 }}>
                <strong style={{ fontWeight: 600, color: "var(--ink-1)" }}>Live risk indexing</strong> scores every contract on data completeness and clause hygiene. Keep a clean dashboard of portfolio health.
              </p>
            </div>
            <div>
              <p style={{ fontSize: "14.5px", lineHeight: "1.6", color: "var(--ink-2)", margin: 0 }}>
                <strong style={{ fontWeight: 600, color: "var(--ink-1)" }}>Twelve-month forecast</strong> displays upcoming auto-renewals and triggers. Stay ahead of contract deadlines and value at risk.
              </p>
            </div>
            <div>
              <p style={{ fontSize: "14.5px", lineHeight: "1.6", color: "var(--ink-2)", margin: 0 }}>
                <strong style={{ fontWeight: 600, color: "var(--ink-1)" }}>Overbilling audit</strong> matches active billing lines with contracted pricing catalogs. Identify invoice leakage automatically.
              </p>
            </div>
          </div>
        </div>
      </section>

      <LogoStrip />
      <ModuleMetrics {...data.metrics} />
      <FeatSection
        eyebrow="Contract health"
        title="A health score for every contract, <em>updated live</em>."
        body="ContractControl scores every agreement on metadata completeness, clause coverage, and obligation hygiene, giving legal and finance a shared view of portfolio risk at a glance."
        bullets={["R/Y/G health scores on every contract and entity", "Drill down from portfolio view to individual clause gaps", "Shared dashboard for legal, finance, and procurement"]}
        mockup={<AnalyticsDashboardMockup />}
      />
      <FeatSection
        eyebrow="Renewal radar"
        title="Renewals and leakage <em>forecast 12 months ahead</em>."
        body="ContractControl shows you every renewal, every auto-renew trigger, and every price escalation due in the next 12 months, with the value at stake and actions to take."
        bullets={["12-month renewal forecast with confidence scores", "Auto-renew triggers flagged before the notice window closes", "Value-at-risk calculated per renewal and per quarter"]}
        mockup={<AnalyticsRenewalMockup />}
        flip soft
      />
      <FeatSection
        eyebrow="Terms vs invoice"
        title="See exactly where invoices <em>exceed what was agreed</em>."
        body="ContractControl puts your contract value next to what suppliers actually invoice, so you can immediately see who is billing above terms, and by how much, before it slips through."
        bullets={["Compare agreed contract value against actual invoices per supplier", "Flag suppliers invoicing above contracted amounts automatically", "Track cumulative overbilling across your entire vendor portfolio"]}
        mockup={<AnalyticsLeakageMockup />}
      />
      <ModuleFeatures name={data.featuresName || data.name.toLowerCase()} features={data.features} />
      <ModuleQuote {...data.quote} />

      <DepartmentShowcase />
      <FinalCTA />
      <ModuleFAQSection faqs={[
        { q: "How does ContractControl Analytics surface insights from contract portfolios?", a: "ContractControl Analytics translates active contract data into dashboards showing cycle times, renewal forecasts, and revenue leakage. The reporting engine tracks performance metrics without requiring manual spreadsheets or custom BI setups." },
        { q: "Must we configure a separate database to run contract analytics?", a: "No, Analytics runs natively on the contract database and generates insights automatically as contracts are processed. You do not need to configure data pipelines or purchase additional BI software." },
        { q: "How is the contract health score calculated?", a: "The health score evaluates contracts based on metadata completeness, clause compliance, and obligation tracking status. Each document is graded red, yellow, or green, which highlights areas that need update." },
        { q: "Can we export analytics data to external business intelligence platforms?", a: "Yes, you can export raw contract metadata to Snowflake, Looker, or other data warehouses using our REST API. This allows finance and ops teams to combine contract metrics with broader ERP records." },
        { q: "How does the renewal radar forecast upcoming contract milestones?", a: "The renewal radar scans contract metadata to map expiration dates on a rolling twelve-month timeline. The dashboard highlights high-value agreements and sends alerts to prevent accidental auto-renewals." },
        { q: "Can the analytics dashboard identify which contract clauses cause negotiation bottlenecks?", a: "Yes, the Negotiation Insights dashboard tracks which clauses receive the most counterparty redlines and how often your team deviates from standard terms. This data helps legal teams optimize standard templates to speed up future deals." },
      ]} />
    </div>
  );
}

// ═══════════════════════════════════════════════════════════════════
// OBLIGATIONS
// ═══════════════════════════════════════════════════════════════════

function ObligationsBulkImportMockup() {
  const files = [
    { name: "Velora MSA 2023.pdf",        size: "1.2 MB", status: "indexed",    tags: ["MSA", "Auto-renewal"] },
    { name: "Northwind Framework.docx",   size: "840 KB", status: "scanning",   tags: [] },
    { name: "Kvist License Agreement.pdf",size: "2.1 MB", status: "linked",     tags: ["License", "SLA"] },
    { name: "Brevia NDA.pdf",             size: "340 KB", status: "indexed",    tags: ["NDA"] },
    { name: "Tandem Supply Contract.pdf", size: "1.8 MB", status: "queued",     tags: [] },
  ];
  const statusStyle = {
    indexed:  { color: "var(--success)",  bg: "rgba(31,138,76,0.08)",  border: "rgba(31,138,76,0.2)",  label: "AI indexed" },
    scanning: { color: "var(--accent)",   bg: "rgba(88,67,245,0.08)",  border: "rgba(88,67,245,0.2)",  label: "Scanning…"  },
    linked:   { color: "#0EA5E9",         bg: "rgba(14,165,233,0.08)", border: "rgba(14,165,233,0.2)", label: "Linked"     },
    queued:   { color: "var(--ink-4)",    bg: "var(--bg-soft)",        border: "var(--line)",          label: "Queued"     },
  };
  return (
    <div style={{ background: "var(--bg-elevated)", border: "1px solid var(--line)", borderRadius: 16, overflow: "hidden", boxShadow: "0 30px 60px -20px rgba(14,14,16,0.10), 0 4px 12px -4px rgba(14,14,16,0.04)" }}>
      <div style={{ padding: "13px 18px", borderBottom: "1px solid var(--line)", display: "flex", alignItems: "center", gap: 8 }}>
        <svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="var(--accent)" strokeWidth="2.2"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="17 8 12 3 7 8"/><line x1="12" y1="3" x2="12" y2="15"/></svg>
        <span style={{ fontSize: 12, fontWeight: 500, color: "var(--ink-1)" }}>Bulk import · 24 contracts</span>
        <div style={{ marginLeft: "auto", display: "flex", gap: 6 }}>
          <span style={{ fontSize: 11, padding: "2px 8px", borderRadius: 99, background: "rgba(31,138,76,0.08)", color: "var(--success)", border: "1px solid rgba(31,138,76,0.2)" }}>18 indexed</span>
          <span style={{ fontSize: 11, padding: "2px 8px", borderRadius: 99, background: "rgba(88,67,245,0.08)", color: "var(--accent)", border: "1px solid rgba(88,67,245,0.2)" }}>6 processing</span>
        </div>
      </div>
      <div>
        {files.map((f, i) => {
          const s = statusStyle[f.status];
          return (
            <div key={i} style={{ display: "flex", alignItems: "center", gap: 12, padding: "10px 16px", borderBottom: i < files.length - 1 ? "1px solid var(--line)" : "none" }}>
              <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="var(--ink-4)" strokeWidth="1.8"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/></svg>
              <div style={{ flex: 1, minWidth: 0 }}>
                <div style={{ fontSize: 12.5, fontWeight: 500, color: "var(--ink-1)", whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis" }}>{f.name}</div>
                <div style={{ display: "flex", alignItems: "center", gap: 6, marginTop: 3 }}>
                  <span style={{ fontSize: 11, color: "var(--ink-4)" }}>{f.size}</span>
                  {f.tags.map((t, j) => (
                    <span key={j} style={{ fontSize: 10.5, padding: "1px 6px", borderRadius: 99, background: "var(--bg-soft)", border: "1px solid var(--line)", color: "var(--ink-3)" }}>{t}</span>
                  ))}
                </div>
              </div>
              <span style={{ fontSize: 11, padding: "2px 9px", borderRadius: 99, background: s.bg, color: s.color, border: `1px solid ${s.border}`, whiteSpace: "nowrap", flexShrink: 0 }}>{s.label}</span>
            </div>
          );
        })}
      </div>
      <div style={{ padding: "10px 16px", borderTop: "1px solid var(--line)", background: "var(--bg-soft)", display: "flex", alignItems: "center", gap: 8 }}>
        <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="var(--accent)" strokeWidth="2.2"><circle cx="12" cy="12" r="10"/><path d="M12 8v4l3 3"/></svg>
        <span style={{ fontSize: 11.5, color: "var(--ink-3)" }}>AI running on legacy contracts, metadata indexed in seconds</span>
      </div>
    </div>
  );
}

function ObligationsExtractionMockup() {
  return (
    <div style={{ background: "var(--bg-elevated)", border: "1px solid var(--line)", borderRadius: 16, overflow: "hidden", boxShadow: "0 30px 60px -20px rgba(14,14,16,0.10), 0 4px 12px -4px rgba(14,14,16,0.04)" }}>
      <div style={{ padding: "13px 18px", borderBottom: "1px solid var(--line)", display: "flex", alignItems: "center", gap: 8 }}>
        <span style={{ color: "var(--accent)" }}><Icon name="obligations" size={13} /></span>
        <span style={{ fontSize: 12, fontWeight: 500, color: "var(--ink-1)" }}>Obligations extracted · Velora MSA</span>
        <span style={{ marginLeft: "auto", fontSize: 11, padding: "2px 8px", borderRadius: 99, background: "rgba(31,138,76,0.08)", color: "var(--success)", border: "1px solid rgba(31,138,76,0.2)" }}>8 found</span>
      </div>
      <div style={{ padding: 0 }}>
        {[
          { type: "Auto-renewal", detail: "90-day notice required · 2026-03-01", tone: "warn" },
          { type: "Price escalation", detail: "+4.5% CPI · effective Jan 2026", tone: "neutral" },
          { type: "SLA review", detail: "Quarterly performance review due", tone: "neutral" },
          { type: "Insurance cert", detail: "Annual update required by legal", tone: "ok" },
          { type: "DPA review", detail: "Biannual data processing review", tone: "ok" },
        ].map((o, i) => (
          <div key={i} style={{ display: "flex", alignItems: "center", gap: 12, padding: "10px 16px", borderBottom: "1px solid var(--line)" }}>
            <span style={{ width: 8, height: 8, borderRadius: "50%", flexShrink: 0, background: o.tone === "warn" ? "var(--warning)" : o.tone === "ok" ? "var(--success)" : "var(--ink-5)" }} />
            <div style={{ flex: 1 }}>
              <div style={{ fontSize: 12.5, fontWeight: 500, color: "var(--ink-1)" }}>{o.type}</div>
              <div style={{ fontSize: 11.5, color: "var(--ink-4)" }}>{o.detail}</div>
            </div>
            <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="var(--ink-5)" strokeWidth="2"><polyline points="9 18 15 12 9 6"/></svg>
          </div>
        ))}
      </div>
    </div>
  );
}

function ObligationsAlertMockup() {
  return (
    <div style={{ background: "var(--bg-elevated)", border: "1px solid var(--line)", borderRadius: 16, overflow: "hidden", boxShadow: "0 30px 60px -20px rgba(14,14,16,0.10), 0 4px 12px -4px rgba(14,14,16,0.04)" }}>
      <div style={{ padding: "13px 18px", borderBottom: "1px solid var(--line)", display: "flex", alignItems: "center", gap: 8 }}>
        <span style={{ color: "var(--accent)" }}><Icon name="intake" size={13} /></span>
        <span style={{ fontSize: 12, fontWeight: 500, color: "var(--ink-1)" }}>Upcoming · next 30 days</span>
        <span style={{ marginLeft: "auto", fontSize: 11, color: "var(--ink-4)" }}>7 alerts</span>
      </div>
      <div style={{ padding: 16, display: "flex", flexDirection: "column", gap: 10 }}>
        {[
          { label: "Auto-renewal · Velora MSA", days: 14, tone: "high", action: "Renew / Terminate" },
          { label: "Price escalation · Northwind", days: 22, tone: "warn", action: "Review" },
          { label: "SLA review · Brevia Holdings", days: 28, tone: "ok", action: "Schedule" },
        ].map((a, i) => (
          <div key={i} style={{ padding: "12px 14px", borderRadius: 10, background: "var(--bg-soft)", border: "1px solid " + (a.tone === "high" ? "rgba(180,35,24,0.2)" : a.tone === "warn" ? "rgba(232,179,57,0.2)" : "var(--line)") }}>
            <div style={{ display: "flex", alignItems: "center", gap: 8, marginBottom: 8 }}>
              <span style={{ flex: 1, fontSize: 13, fontWeight: 500, color: "var(--ink-1)" }}>{a.label}</span>
              <span style={{ fontSize: 11.5, fontFamily: "var(--font-mono)", color: a.tone === "high" ? "var(--danger)" : a.tone === "warn" ? "var(--warning)" : "var(--success)", fontWeight: 600 }}>{a.days}d</span>
            </div>
            <button style={{ fontSize: 11.5, padding: "4px 12px", borderRadius: 6, background: "var(--bg-elevated)", border: "1px solid var(--line)", color: "var(--ink-2)", cursor: "pointer" }}>{a.action} →</button>
          </div>
        ))}
      </div>
    </div>
  );
}

function ObligationsHealthMockup() {
  const tooltip = 4;

  const rows = [
    { initials: "EK", color: "#3B82F6", name: "Employment Agreement f…", type: "Employee Agreement",   renewal: "1 Jul 2026",  score: 89, bar: "#F59E0B", handled: true,  status: "active"  },
    { initials: "SA", color: "#22C55E", name: "Software as a Service (Sa…", type: "Supplier Agreement", renewal: "Jun 2026",    score: 74, bar: "#F59E0B", handled: true,  status: "handle"  },
    { initials: "CR", color: "#8B5CF6", name: "CRM",                        type: "Client Project",     renewal: "31 Jan 2027", score: 95, bar: "#22C55E", handled: true,  status: "active"  },
    { initials: "LA", color: "#EF4444", name: "Laboratory Services…",       type: "Supplier Agreement", renewal: "1 Feb 2026",  score: 43, bar: "#EF4444", handled: false, status: "handle"  },
    { initials: "ST", color: "#F59E0B", name: "Städavtalet",                type: "Supplier Agreement", renewal: "30 Oct 2026", score: 91, bar: "#22C55E", handled: true,  status: "active"  },
  ];

  const tooltipFactors = [
    { ok: true,  label: "Notice Deadline",   note: "Notice deadline is not approaching", delta: 0   },
    { ok: true,  label: "Expiration",        note: "Contract has been handled",          delta: 0   },
    { ok: false, label: "Contract Value",    note: "Top 25% contract by value",          delta: -6  },
    { ok: true,  label: "Tasks",             note: "No overdue tasks",                   delta: 0   },
    { ok: false, label: "Data Completeness", note: "Missing: no contacts",               delta: -5  },
  ];

  return (
    <div style={{ background: "var(--bg-elevated)", border: "1px solid var(--line)", borderRadius: 16, overflow: "hidden", boxShadow: "0 30px 60px -20px rgba(14,14,16,0.10), 0 4px 12px -4px rgba(14,14,16,0.04)", position: "relative" }}>
      {/* Header */}
      <div style={{ padding: "11px 16px", borderBottom: "1px solid var(--line)", display: "flex", alignItems: "center", gap: 8, background: "var(--bg-soft)" }}>
        <span style={{ color: "var(--accent)" }}><Icon name="analytics" size={12} /></span>
        <span style={{ fontSize: 11.5, fontWeight: 500, color: "var(--ink-1)" }}>Contract health · Repository</span>
        <span style={{ marginLeft: "auto", fontSize: 10.5, color: "var(--ink-4)" }}>5 factors · weighted</span>
      </div>

      {/* Column headers */}
      <div style={{ display: "grid", gridTemplateColumns: "1fr 80px 100px 85px", padding: "6px 14px", borderBottom: "1px solid var(--line)", background: "var(--bg-soft)" }}>
        {["Contract", "Renewal", "Health", "Status"].map((h, i) => (
          <span key={i} style={{ fontSize: 10, fontWeight: 600, letterSpacing: "0.07em", textTransform: "uppercase", color: "var(--ink-4)", textAlign: i === 3 ? "right" : "left" }}>{h}</span>
        ))}
      </div>

      {/* Rows */}
      {rows.map((r, i) => (
        <div key={i}
          style={{ display: "grid", gridTemplateColumns: "1fr 80px 100px 85px", alignItems: "center", padding: "8px 14px", borderBottom: i < rows.length - 1 ? "1px solid var(--line)" : "none", background: tooltip === i ? "var(--bg-soft)" : "transparent", cursor: "default", position: "relative" }}>
          {/* Contract name */}
          <div style={{ display: "flex", alignItems: "center", gap: 8, minWidth: 0 }}>
            <span style={{ width: 24, height: 24, borderRadius: 6, background: r.color + "22", border: "1px solid " + r.color + "44", display: "grid", placeItems: "center", fontSize: 9, fontWeight: 700, color: r.color, flexShrink: 0 }}>{r.initials}</span>
            <div style={{ minWidth: 0 }}>
              <div style={{ fontSize: 11.5, fontWeight: 500, color: "var(--ink-1)", whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis" }}>{r.name}</div>
              <div style={{ fontSize: 10, color: "var(--ink-4)" }}>{r.type}</div>
            </div>
          </div>
          {/* Renewal */}
          <span style={{ fontSize: 10.5, color: "var(--ink-3)" }}>{r.renewal}</span>
          {/* Health bar + score */}
          <div style={{ display: "flex", alignItems: "center", gap: 6 }}>
            <div style={{ flex: 1, height: 5, borderRadius: 99, background: "var(--bg-soft)", overflow: "hidden" }}>
              <div style={{ height: "100%", borderRadius: 99, background: r.bar, width: r.score + "%" }} />
            </div>
            <span style={{ fontSize: 11, fontWeight: 600, color: r.bar, minWidth: 22, textAlign: "right" }}>{r.score}</span>
          </div>
          {/* Status */}
          <div style={{ display: "flex", alignItems: "center", justifyContent: "flex-end" }}>
            <span style={{ fontSize: 10, fontWeight: 500, padding: "4px 10px", borderRadius: 99, whiteSpace: "nowrap",
              background: r.status === "active" ? "transparent" : "rgba(232,179,57,0.10)",
              border: "1px solid " + (r.status === "active" ? "var(--line-strong)" : "rgba(232,179,57,0.3)"),
              color: r.status === "active" ? "var(--ink-3)" : "var(--warning)",
            }}>
              {r.status === "active" ? (r.handled ? "✓ Handled" : "Active") : "Handle"}
            </span>
          </div>
        </div>
      ))}

    </div>
  );
}
function AnimatedExtraction() {
  const [cycle, setCycle] = React.useState(0);
  React.useEffect(() => {
    let raf, t0 = performance.now();
    const loop = (t) => { setCycle(((t - t0) / 1000) % 6); raf = requestAnimationFrame(loop); };
    raf = requestAnimationFrame(loop);
    return () => cancelAnimationFrame(raf);
  }, []);

  const s1 = cycle > 1.0 && cycle < 3.0; // Show scan line moving down
  const s2 = cycle >= 3.0; // Finish scan, start popping obligations
  const s3 = cycle > 3.5; // Obligation 1 pops
  const s4 = cycle > 4.0; // Obligation 2 pops

  return (
    <div style={{ background: "var(--bg-elevated)", border: "1px solid var(--line)", borderRadius: 16, overflow: "hidden", boxShadow: "0 32px 64px -24px rgba(14,14,16,0.14)", height: 320, display: "flex", flexDirection: "column" }}>
      <div style={{ padding: "12px 16px", borderBottom: "1px solid var(--line)", display: "flex", alignItems: "center", gap: 8, background: "var(--bg-soft)" }}>
        <span style={{ width: 8, height: 8, borderRadius: "50%", background: s2 ? "var(--success)" : "var(--accent)", transition: "background 300ms" }} />
        <span style={{ fontSize: 12, fontWeight: 500, color: "var(--ink-1)" }}>{s2 ? "Extracted" : "Extracting obligations..."}</span>
      </div>
      <div style={{ padding: 20, flex: 1, display: "flex", gap: 20, position: "relative" }}>
        
        {/* Document Silhouette */}
        <div style={{ width: 140, background: "white", borderRadius: 8, border: "1px solid var(--line)", padding: 12, position: "relative", overflow: "hidden", alignSelf: "flex-start", height: "100%" }}>
           <div style={{ height: 4, width: "60%", background: "var(--bg-mute)", borderRadius: 2, marginBottom: 12 }} />
           <div style={{ height: 3, width: "100%", background: "var(--bg-mute)", borderRadius: 2, marginBottom: 6 }} />
           <div style={{ height: 3, width: "100%", background: "var(--bg-mute)", borderRadius: 2, marginBottom: 6 }} />
           <div style={{ height: 3, width: "80%", background: "var(--bg-mute)", borderRadius: 2, marginBottom: 16 }} />
           
           <div style={{ height: 4, width: "40%", background: "var(--bg-mute)", borderRadius: 2, marginBottom: 12 }} />
           <div style={{ height: 3, width: "100%", background: "var(--bg-mute)", borderRadius: 2, marginBottom: 6 }} />
           <div style={{ height: 3, width: "90%", background: "var(--bg-mute)", borderRadius: 2, marginBottom: 6 }} />
           
           {/* Scan line */}
           {!s2 && (
             <div style={{ position: "absolute", left: 0, right: 0, height: 2, background: "var(--accent)", top: `${((cycle - 1) / 2.0) * 100}%`, boxShadow: "0 0 8px var(--accent)", opacity: s1 ? 1 : 0 }} />
           )}
        </div>

        {/* Extracted Pills */}
        <div style={{ flex: 1, display: "flex", flexDirection: "column", gap: 10, justifyContent: "center" }}>
           <div style={{ 
              background: "var(--bg-soft)", border: "1px solid var(--line)", borderRadius: 8, padding: "10px 14px",
              transform: s3 ? "translateX(0)" : "translateX(20px)", opacity: s3 ? 1 : 0, transition: "all 400ms cubic-bezier(0.16, 1, 0.3, 1)"
           }}>
              <div style={{ fontSize: 9, fontWeight: 700, letterSpacing: "0.06em", color: "var(--warning)", marginBottom: 4 }}>DUE IN 90 DAYS</div>
              <div style={{ fontSize: 12, fontWeight: 500, color: "var(--ink-1)" }}>Auto-renewal Notice</div>
           </div>
           
           <div style={{ 
              background: "var(--bg-soft)", border: "1px solid var(--line)", borderRadius: 8, padding: "10px 14px",
              transform: s4 ? "translateX(0)" : "translateX(20px)", opacity: s4 ? 1 : 0, transition: "all 400ms cubic-bezier(0.16, 1, 0.3, 1)"
           }}>
              <div style={{ fontSize: 9, fontWeight: 700, letterSpacing: "0.06em", color: "var(--accent)", marginBottom: 4 }}>ESCALATION</div>
              <div style={{ fontSize: 12, fontWeight: 500, color: "var(--ink-1)" }}>CPI + 4.5% Price Cap</div>
           </div>
        </div>

      </div>
    </div>
  );
}

function AnimatedRiskAction() {
  const [cycle, setCycle] = React.useState(0);
  React.useEffect(() => {
    let raf, t0 = performance.now();
    const loop = (t) => { setCycle(((t - t0) / 1000) % 7); raf = requestAnimationFrame(loop); };
    raf = requestAnimationFrame(loop);
    return () => cancelAnimationFrame(raf);
  }, []);

  const s1 = cycle > 1.0; // Highlight the middle item in red
  const s2 = cycle > 2.5; // AI suggestion slides up

  return (
    <div style={{ background: "var(--bg-elevated)", border: "1px solid var(--line)", borderRadius: 16, overflow: "hidden", boxShadow: "0 32px 64px -24px rgba(14,14,16,0.14)", height: 320, position: "relative", display: "flex", flexDirection: "column" }}>
      <div style={{ padding: "12px 16px", borderBottom: "1px solid var(--line)", display: "flex", alignItems: "center", gap: 8, background: "var(--bg-soft)" }}>
         <svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2"><polyline points="22 12 18 12 15 21 9 3 6 12 2 12"/></svg>
        <span style={{ fontSize: 12, fontWeight: 500, color: "var(--ink-1)" }}>Risk Scoring</span>
      </div>

      <div style={{ padding: 16, display: "flex", flexDirection: "column", gap: 8 }}>
         {[
           { name: "Insurance Certificate", date: "Jan 2026", color: "var(--line)" },
           { name: "SLA Quarterly Report", date: "Oct 2025", color: "var(--line)", dynamic: true },
           { name: "DPA Review", date: "Dec 2025", color: "var(--line)" },
         ].map((item, i) => (
           <div key={i} style={{ 
              display: "flex", justifyContent: "space-between", alignItems: "center", padding: "12px 16px", borderRadius: 8,
              border: "1px solid", 
              borderColor: item.dynamic && s1 ? "rgba(239,68,68,0.3)" : item.color,
              background: item.dynamic && s1 ? "rgba(239,68,68,0.04)" : "var(--bg-soft)",
              transition: "all 400ms"
           }}>
              <span style={{ fontSize: 12, fontWeight: 500, color: item.dynamic && s1 ? "var(--danger)" : "var(--ink-1)" }}>{item.name}</span>
              <span style={{ fontSize: 11, color: item.dynamic && s1 ? "var(--danger)" : "var(--ink-4)" }}>{item.date}</span>
           </div>
         ))}
      </div>

      {/* AI Suggestion Card sliding from bottom */}
      <div style={{ 
         position: "absolute", bottom: 16, left: 16, right: 16,
         background: "white", border: "1px solid rgba(110,86,207,0.3)", borderRadius: 12, padding: 16,
         boxShadow: "0 12px 24px rgba(110,86,207,0.15)",
         transform: s2 ? "translateY(0)" : "translateY(120%)", opacity: s2 ? 1 : 0, transition: "all 500ms cubic-bezier(0.16, 1, 0.3, 1)"
      }}>
         <div style={{ display: "flex", gap: 8, marginBottom: 12 }}>
            <span style={{ color: "var(--accent)", background: "rgba(110,86,207,0.1)", borderRadius: 6, padding: 4, height: "fit-content" }}>
               <svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor"><path d="M12 2l2.4 7.4H22l-6.2 4.5 2.4 7.4L12 17l-6.2 4.3 2.4-7.4L2 9.4h7.6z"/></svg>
            </span>
            <div>
               <div style={{ fontSize: 10, fontWeight: 700, color: "var(--accent)", letterSpacing: "0.05em", textTransform: "uppercase" }}>AI Suggestion</div>
               <div style={{ fontSize: 12, fontWeight: 500, color: "var(--ink-1)", marginTop: 2 }}>Action recommended: Request SLA Report</div>
            </div>
         </div>
         <button style={{ width: "100%", padding: "8px 0", background: "var(--accent)", color: "white", border: "none", borderRadius: 6, fontSize: 11.5, fontWeight: 600, cursor: "pointer", transition: "transform 100ms" }}>
            Draft Request Email
         </button>
      </div>

    </div>
  );
}

function AdvancedObligationsSection() {
  const [showModal, setShowModal] = React.useState(false);
  const [form, setForm] = React.useState({ firstName: "", lastName: "", email: "", company: "" });
  const [focused, setFocused] = React.useState(null);
  const [submitted, setSubmitted] = React.useState(false);
  const [submitting, setSubmitting] = React.useState(false);

  const set = (k) => (e) => setForm({ ...form, [k]: e.target.value });

  const handleSubmit = (e) => {
    e.preventDefault();
    if (form.firstName && form.lastName && form.email && form.company) {
      setSubmitting(true);
      const portalId = "144265445";
      const formGuid = "8cbd4023-6aba-4ede-bbff-7dd4d200563f";
      const submitUrl = `https://api-eu1.hsforms.com/submissions/v3/integration/submit/${portalId}/${formGuid}`;

      const hutkMatch = document.cookie.match(/(?:^|; )hubspotutk=([^;]*)/);
      const hutk = hutkMatch ? hutkMatch[1] : undefined;

      const payload = {
        fields: [
          { name: "firstname", value: form.firstName },
          { name: "lastname", value: form.lastName },
          { name: "email", value: form.email },
          { name: "company", value: form.company }
        ],
        context: {
          hutk: hutk,
          pageUri: window.location.href,
          pageName: document.title
        }
      };

      fetch(submitUrl, {
        method: "POST",
        headers: {
          "Content-Type": "application/json"
        },
        body: JSON.stringify(payload)
      })
      .then(() => {
        setSubmitting(false);
        setSubmitted(true);
      })
      .catch((err) => {
        console.error("Hubspot submission error:", err);
        setSubmitting(false);
        setSubmitted(true);
      });
    }
  };

  const inputStyle = (key) => ({
    width: "100%", height: 44, padding: "0 14px",
    borderRadius: "var(--r-md)",
    border: "1px solid " + (focused === key ? "var(--accent)" : "var(--line-strong)"),
    background: "var(--bg-elevated)", fontFamily: "inherit", fontSize: 14,
    color: "var(--ink-1)", outline: "none", transition: "border-color 150ms ease",
    boxShadow: focused === key ? "0 0 0 3px rgba(110,86,207,0.10)" : "none",
    boxSizing: "border-box",
  });

  const labelStyle = { display: "block", fontSize: 12.5, fontWeight: 500, color: "var(--ink-3)", marginBottom: 6, letterSpacing: "0.01em" };

  return (
    <>
      <section className="section" style={{ background: "var(--bg-soft)", borderTop: "1px solid var(--line)", borderBottom: "1px solid var(--line)" }}>
        <div className="container">
          <div style={{ display: "flex", alignItems: "center", gap: 8, marginBottom: 16, flexWrap: "wrap" }}>
            <span className="eyebrow">Coming soon</span>
            <span style={{ fontSize: 10.5, fontWeight: 600, letterSpacing: "0.06em", textTransform: "uppercase", padding: "3px 9px", borderRadius: 99, background: "linear-gradient(135deg, rgba(124,92,211,0.14), rgba(88,67,245,0.10))", border: "1px solid rgba(124,92,211,0.28)", color: "var(--accent)", display: "inline-flex", alignItems: "center", gap: 5 }}>
              <svg width="9" height="9" viewBox="0 0 24 24" fill="currentColor"><path d="M12 2l2.4 7.4H22l-6.2 4.5 2.4 7.4L12 17l-6.2 4.3 2.4-7.4L2 9.4h7.6z"/></svg>
              Power module
            </span>
          </div>
          <div style={{ display: "grid", gridTemplateColumns: "1fr 1fr", gap: 48, alignItems: "flex-start", marginBottom: 52 }}>
            <div>
              <h2 className="h-section" style={{ marginTop: 0, marginBottom: 20 }}>
                Advanced Obligations <em style={{ color: "var(--accent)" }}>is coming.</em>
              </h2>
              <p className="lede" style={{ marginBottom: 32 }}>
                A deeper layer of obligation intelligence: per-contract obligation timelines, cross-portfolio risk scoring, and AI-suggested actions so your team always knows what to do next.
              </p>
              <button onClick={() => setShowModal(true)} className="btn btn-accent btn-lg" style={{ border: "none", cursor: "pointer" }}>
                Join the waitlist <svg width="13" height="13" viewBox="0 0 14 14" fill="none" style={{ marginLeft: 4 }}><path d="M2.5 7h9M7.5 3l4 4-4 4" stroke="currentColor" strokeWidth="1.6" strokeLinecap="round" strokeLinejoin="round"/></svg>
              </button>
            </div>
            <div style={{ display: "flex", flexDirection: "column", gap: 10 }}>
              {[
                { icon: <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/></svg>, label: "Per-contract obligation timelines", desc: "See every upcoming deadline mapped to the contract it came from." },
                { icon: <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><polyline points="22 12 18 12 15 21 9 3 6 12 2 12"/></svg>, label: "Cross-portfolio risk scoring", desc: "AI ranks your riskiest obligations across all contracts in one view." },
                { icon: <svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor"><path d="M12 2l2.4 7.4H22l-6.2 4.5 2.4 7.4L12 17l-6.2 4.3 2.4-7.4L2 9.4h7.6z"/></svg>, label: "AI-suggested next actions", desc: "Smart prompts tell each owner exactly what to do, and when." },
                { icon: <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg>, label: "Obligation coupling", desc: "Link obligations to renewals, invoices, and clauses automatically." },
              ].map((f, i) => (
                <div key={i} style={{ display: "flex", gap: 14, alignItems: "flex-start", padding: "14px 16px", borderRadius: 12, border: "1px solid var(--line)", background: "var(--bg-elevated)" }}>
                  <span style={{ width: 28, height: 28, borderRadius: 7, background: "rgba(110,86,207,0.10)", border: "1px solid rgba(110,86,207,0.18)", display: "grid", placeItems: "center", color: "var(--accent)", flexShrink: 0 }}>{f.icon}</span>
                  <div>
                    <div style={{ fontSize: 13.5, fontWeight: 600, color: "var(--ink-1)", marginBottom: 3 }}>{f.label}</div>
                    <div style={{ fontSize: 13, color: "var(--ink-4)", lineHeight: 1.5 }}>{f.desc}</div>
                  </div>
                </div>
              ))}
            </div>
          </div>

          {/* Two-panel mockup */}
          <div style={{ display: "grid", gridTemplateColumns: "1fr 1fr", gap: 20, alignItems: "start" }}>
            <AnimatedExtraction />
            <AnimatedRiskAction />
          </div>
        </div>
      </section>

      {/* Waitlist modal */}
      {showModal && (
        <div onClick={() => setShowModal(false)} style={{ position: "fixed", inset: 0, background: "rgba(14,14,16,0.55)", backdropFilter: "blur(4px)", zIndex: 9999, display: "flex", alignItems: "center", justifyContent: "center" }}>
          <div onClick={e => e.stopPropagation()} style={{ maxWidth: 480, width: "90%", position: "relative" }}>
            <button onClick={() => setShowModal(false)} style={{ position: "absolute", top: -12, right: -12, zIndex: 1, width: 32, height: 32, borderRadius: 99, border: "1px solid var(--line)", background: "var(--bg-elevated)", cursor: "pointer", display: "grid", placeItems: "center", color: "var(--ink-3)", boxShadow: "0 2px 8px rgba(14,14,16,0.08)" }}>
              <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>
            </button>

            <div className="card" style={{ padding: 32 }}>
              {submitted ? (
                <div style={{ textAlign: "center", padding: "24px 0" }}>
                  <div style={{ width: 48, height: 48, borderRadius: "50%", background: "var(--success-soft)", display: "grid", placeItems: "center", color: "var(--success)", margin: "0 auto 20px" }}>
                    <svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5"><polyline points="20 6 9 17 4 12"/></svg>
                  </div>
                  <h2 style={{ fontSize: 22, fontWeight: 500, margin: "0 0 10px", letterSpacing: "-0.02em" }}>You're on the list.</h2>
                  <p style={{ fontSize: 14.5, color: "var(--ink-3)", lineHeight: 1.6, margin: "0 0 28px" }}>
                    We'll reach out to <strong style={{ color: "var(--ink-1)" }}>{form.email}</strong> as soon as Advanced Obligations opens up.
                  </p>
                  <button onClick={() => setShowModal(false)} className="btn btn-ghost">Close</button>
                </div>
              ) : (
                <>
                  <div style={{ marginBottom: 24 }}>
                    <span className="eyebrow" style={{ marginBottom: 12 }}>Coming soon</span>
                    <h2 style={{ fontSize: 20, fontWeight: 500, margin: "12px 0 6px", letterSpacing: "-0.02em" }}>Join the waitlist</h2>
                    <p style={{ fontSize: 13.5, color: "var(--ink-3)", margin: 0 }}>Early access opens to waitlist members first.</p>
                  </div>

                  <form onSubmit={handleSubmit} style={{ display: "flex", flexDirection: "column", gap: 16 }}>
                    <div style={{ display: "grid", gridTemplateColumns: "1fr 1fr", gap: 14 }}>
                      <div>
                        <label style={labelStyle}>First name</label>
                        <input type="text" required placeholder="Linnea"
                          value={form.firstName} onChange={set("firstName")}
                          onFocus={() => setFocused("firstName")} onBlur={() => setFocused(null)}
                          style={inputStyle("firstName")} />
                      </div>
                      <div>
                        <label style={labelStyle}>Last name</label>
                        <input type="text" required placeholder="Andersson"
                          value={form.lastName} onChange={set("lastName")}
                          onFocus={() => setFocused("lastName")} onBlur={() => setFocused(null)}
                          style={inputStyle("lastName")} />
                      </div>
                    </div>
                    <div>
                      <label style={labelStyle}>Work email</label>
                      <input type="email" required placeholder="linnea@volantis.se"
                        value={form.email} onChange={set("email")}
                        onFocus={() => setFocused("email")} onBlur={() => setFocused(null)}
                        style={inputStyle("email")} />
                    </div>
                    <div>
                      <label style={labelStyle}>Company name</label>
                      <input type="text" required placeholder="Volantis AB"
                        value={form.company} onChange={set("company")}
                        onFocus={() => setFocused("company")} onBlur={() => setFocused(null)}
                        style={inputStyle("company")} />
                    </div>
                    <button type="submit" disabled={submitting} className="btn btn-primary btn-lg" style={{ width: "100%", marginTop: 4 }}>
                      {submitting ? "Submitting..." : <>Join the waitlist <Icon name="arrow" size={14} /></>}
                    </button>
                    <p style={{ fontSize: 11.5, color: "var(--ink-4)", textAlign: "center", margin: 0, lineHeight: 1.6 }}>
                      No spam. We'll only contact you about Advanced Obligations access.
                    </p>
                  </form>
                </>
              )}
            </div>

            <div style={{ marginTop: 14, display: "flex", gap: 20, justifyContent: "center" }}>
              {["GDPR compliant", "eIDAS certified", "SOC 2 Type II"].map((t) => (
                <span key={t} style={{ fontSize: 12, color: "var(--ink-4)", display: "inline-flex", alignItems: "center", gap: 5 }}>
                  <svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/></svg>
                  {t}
                </span>
              ))}
            </div>
          </div>
        </div>
      )}
    </>
  );
}

function ObligationsDeptMockup({ dept }) {
  const data = {
    Legal: {
      title: "Compliance obligations",
      rows: [
        { label: "DPA review · Velora MSA",         days: 18, tone: "#F59E0B", status: "Due soon"   },
        { label: "SLA milestone · Brevia SLA",       days: 26, tone: "#22C55E", status: "On track"   },
        { label: "Insurance cert · Kvist Group",     days: 31, tone: "#22C55E", status: "On track"   },
        { label: "Compliance audit · Northwind",     days: 44, tone: "#22C55E", status: "On track"   },
      ],
    },
    Finance: {
      title: "Payment obligations",
      rows: [
        { label: "Price escalation · Northwind",    days: 9,  tone: "#EF4444", status: "Urgent"     },
        { label: "Quarterly true-up · Velora",      days: 21, tone: "#F59E0B", status: "Due soon"   },
        { label: "Invoice cap · Brevia Holdings",   days: 38, tone: "#22C55E", status: "On track"   },
        { label: "Budget review · Städavtalet",     days: 52, tone: "#22C55E", status: "On track"   },
      ],
    },
    Procurement: {
      title: "Vendor obligations",
      rows: [
        { label: "Auto-renewal · Velora MSA",       days: 14, tone: "#EF4444", status: "Urgent"     },
        { label: "Insurance cert · Kvist Group",    days: 31, tone: "#F59E0B", status: "Due soon"   },
        { label: "Service review · Brevia",         days: 40, tone: "#22C55E", status: "On track"   },
        { label: "SoW renewal · NW Supply",         days: 58, tone: "#22C55E", status: "On track"   },
      ],
    },
    "HR & People": {
      title: "Employment milestones",
      rows: [
        { label: "Probation review · E. Karlsson",  days: 7,  tone: "#EF4444", status: "Urgent"     },
        { label: "Salary review · M. Lindqvist",    days: 24, tone: "#F59E0B", status: "Due soon"   },
        { label: "Contract renewal · S. Hedström",  days: 37, tone: "#22C55E", status: "On track"   },
        { label: "Benefits review · J. Hedberg",    days: 61, tone: "#22C55E", status: "On track"   },
      ],
    },
    Sales: {
      title: "Customer SLA milestones",
      rows: [
        { label: "SLA review · Helix Legal",        days: 11, tone: "#EF4444", status: "Urgent"     },
        { label: "Renewal window · Acme Corp",      days: 22, tone: "#F59E0B", status: "Due soon"   },
        { label: "Upsell trigger · Brevia",         days: 35, tone: "#22C55E", status: "On track"   },
        { label: "QBR · Velora AB",                 days: 48, tone: "#22C55E", status: "On track"   },
      ],
    },
  };
  const d = data[dept] || data["Legal"];
  return (
    <div style={{ background: "var(--bg-elevated)", border: "1px solid var(--line)", borderRadius: 14, overflow: "hidden", boxShadow: "0 16px 40px -12px rgba(14,14,16,0.10)", width: "100%", maxWidth: 380 }}>
      <div style={{ padding: "11px 16px", borderBottom: "1px solid var(--line)", display: "flex", alignItems: "center", gap: 8, background: "var(--bg-soft)" }}>
        <span style={{ color: "var(--accent)" }}><Icon name="obligations" size={12} /></span>
        <span style={{ fontSize: 11.5, fontWeight: 500, color: "var(--ink-1)" }}>{d.title}</span>
        <span style={{ marginLeft: "auto", fontSize: 10.5, color: "var(--ink-4)" }}>{d.rows.length} tracked</span>
      </div>
      <div style={{ padding: "10px 14px", display: "flex", flexDirection: "column", gap: 7 }}>
        {d.rows.map((r, i) => (
          <div key={i} style={{ display: "flex", alignItems: "center", gap: 10, padding: "8px 10px", borderRadius: 8, background: "var(--bg-soft)", border: "1px solid var(--line)" }}>
            <div style={{ flex: 1, minWidth: 0 }}>
              <div style={{ fontSize: 11.5, fontWeight: 500, color: "var(--ink-1)", whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis" }}>{r.label}</div>
            </div>
            <span style={{ fontSize: 10, fontWeight: 500, padding: "2px 8px", borderRadius: 99, whiteSpace: "nowrap",
              background: r.tone === "#EF4444" ? "rgba(239,68,68,0.08)" : r.tone === "#F59E0B" ? "rgba(232,179,57,0.08)" : "rgba(34,197,94,0.08)",
              color: r.tone, border: "1px solid " + r.tone + "33"
            }}>{r.status}</span>
            <span style={{ fontSize: 10.5, fontFamily: "var(--font-mono)", fontWeight: 700, color: r.tone, minWidth: 28, textAlign: "right" }}>{r.days}d</span>
          </div>
        ))}
      </div>
    </div>
  );
}

function ObligationsModulePage() {
  const data = window.ccModuleData["obligations"];
  return (
    <div>
      <ModuleHero {...data.hero} />

      {/* 3-column feature section (Precisely style) */}
      <section style={{ padding: "48px 0 24px", background: "transparent" }}>
        <div className="container">
          <div className="grid grid-3" style={{ gap: "40px" }}>
            <div>
              <p style={{ fontSize: "14.5px", lineHeight: "1.6", color: "var(--ink-2)", margin: 0 }}>
                <strong style={{ fontWeight: 600, color: "var(--ink-1)" }}>Proactive deadline alerts</strong> warn stakeholders via email, Slack, or SMS. Ensure notice windows never expire unnoticed.
              </p>
            </div>
            <div>
              <p style={{ fontSize: "14.5px", lineHeight: "1.6", color: "var(--ink-2)", margin: 0 }}>
                <strong style={{ fontWeight: 600, color: "var(--ink-1)" }}>Automated escalation chains</strong> hand off tasks to backup owners. Protect the organization against key-person operational risks.
              </p>
            </div>
            <div>
              <p style={{ fontSize: "14.5px", lineHeight: "1.6", color: "var(--ink-2)", margin: 0 }}>
                <strong style={{ fontWeight: 600, color: "var(--ink-1)" }}>Direct actions from alerts</strong> let users renew, terminate, or renegotiate contracts with one click. Reduce manual step friction.
              </p>
            </div>
          </div>
        </div>
      </section>

      <LogoStrip />
      <ModuleMetrics {...data.metrics} />
      <FeatSection
        eyebrow="Bulk import"
        title="Bring in your existing contracts <em>with one step</em>."
        body="Upload your entire contract archive at once. ContractControl uses AI to scan and tag every document, links related records automatically, and indexes metadata on legacy contracts instantly."
        bullets={["Bulk scan, upload, and tag documents with AI", "Link related records automatically", "Index metadata on legacy contracts instantly"]}
        mockup={<ObligationsBulkImportMockup />}
      />
      <FeatSection
        eyebrow="Smart alerts"
        title="Alerts land <em>before the deadline</em>, not after."
        body="ContractControl routes every obligation to the right owner with configurable lead times. Reminders escalate automatically if not acknowledged, so nothing slips through."
        bullets={["Alerts via email and SMS, per obligation, per owner", "Escalate to a backup owner if the primary doesn't respond", "Act on renewals, renew, terminate, or renegotiate, from the alert itself"]}
        mockup={<ObligationsAlertMockup />}
        flip soft
      />
      <FeatSection
        eyebrow="Contract health"
        title="Spot the contracts that need attention <em>before they cost you</em>."
        body="Every contract in your portfolio is continuously assessed for missing metadata, open obligations, and unresolved gaps. Red flags surface before they become liabilities, giving legal, finance, and procurement a shared view of where to act."
        bullets={["R/Y/G health scores across your entire portfolio", "Drill down from portfolio view to individual clause gaps", "Health score improves automatically as you fill gaps and close obligations"]}
        mockup={<ObligationsHealthMockup />}
      />

      {/* Advanced Obligations coming soon */}
      <AdvancedObligationsSection />

      <ModuleFeatures name={data.featuresName || data.name.toLowerCase()} features={data.features} />
      <ModuleDeptSection module="Obligations"
        title={<>The platform your whole org <em>actually uses.</em></>}
        lede="Obligations don't belong to one team. ContractControl gives every department the view they need, with alerts routed to the right owner automatically."
        depts={[
          { icon: "legal", label: "Legal Ops", tagline: "Track compliance and SLA milestones.", desc: "SLA milestones, DPA reviews, and compliance obligations tracked and owned.", href: "/solutions/team/legal",
            bullets: ["DPA review deadlines and compliance obligations assigned to legal owners", "SLA milestones flagged before breach windows open", "Audit-ready evidence attached per obligation"] },
          { icon: "analytics", label: "Finance", tagline: "Flag price changes before the invoice.", desc: "Price escalations and payment obligations flagged before they hit the invoice.", href: "/solutions/team/finance",
            bullets: ["Price escalation clauses surfaced before invoices arrive", "Payment milestones and true-ups tracked by contract", "Budget impact calculated per upcoming obligation"] },
          { icon: "obligations", label: "Procurement", tagline: "Never miss a renewal window.", desc: "Vendor renewals, insurance certs, and service reviews never missed.", href: "/solutions/team/procurement",
            bullets: ["Auto-renewal windows flagged 90+ days in advance", "Insurance certificate renewals tracked per vendor", "Service review schedules owned and escalated automatically"] },
          { icon: "workspace", label: "HR & People", tagline: "Track probation and salary review dates.", desc: "Employment contract milestones and probation reviews tracked automatically.", href: "/solutions/team/hr",
            bullets: ["Probation end dates and review windows tracked per employee", "Salary review milestones assigned to HR owners", "Contract renewals and benefit review deadlines never missed"] },
          { icon: "negotiation", label: "Sales", tagline: "Proactively manage customer renewal cycles.", desc: "Customer SLA milestones and renewal windows surfaced before they become issues.", href: "/solutions/team/sales",
            bullets: ["Customer SLA milestones routed to account owners before breach", "Renewal windows surfaced in time to renegotiate or expand", "Upsell triggers and QBR obligations tracked per account"] },
        ]}
        mockupFn={(label) => <ObligationsDeptMockup dept={label} />}
      />
      <FinalCTA />
      <ModuleFAQSection faqs={[
        { q: "How does ContractControl Obligations track post-signature commitments?", a: "ContractControl Obligations extracts expiration dates, service level agreements, and price escalation clauses from signed contracts and schedules automated alerts. The system routes notifications to designated owners before deadlines to prevent missed milestones." },
        { q: "Which post-signature obligation types can the platform identify?", a: "The platform identifies over thirty-five obligation categories, including notice periods, payment milestones, SLA reviews, and compliance certifications. The AI extracts these details during the ingestion phase." },
        { q: "How does the system assign and escalate alert owners for contract tasks?", a: "Alert owners are assigned using routing rules based on contract type, department, or owner tags. If a primary owner fails to acknowledge an alert within a set window, the system automatically escalates the task." },
        { q: "Can I renew or terminate agreements directly from an alert notification?", a: "Yes, alert notifications include action buttons to renew, renegotiate, snooze, or terminate contracts directly. Clicking an action button initiates the corresponding workflow or drafts a termination letter." },
        { q: "Can we customize the lead time for contract obligation alerts?", a: "Yes, lead times can be adjusted per obligation type, with a default setting of fourteen days. For instance, you can trigger auto-renewal warnings one hundred twenty days before the deadline." },
        { q: "What channels does the system use to deliver deadline alerts?", a: "Alerts are delivered via email, SMS, and in-app notifications according to user preference profiles. Escalations will trigger secondary notifications to backup owners if necessary." },
      ]} />

    </div>
  );
}

Object.assign(window, {
  IntakeModulePage,
  DraftingModulePage,
  ReviewModulePage,
  NegotiationModulePage,
  RepositoryModulePage,
  AnalyticsModulePage,
  ObligationsModulePage,
});
