/* ============================================================================
   Matat Sync — Help Center
   Styling modeled on the AppMyStore help center: dark header (#21202f),
   purple accent (#8d3dff), Roboto. Generic across ERPs — no ERP named here.
   ========================================================================== */

:root {
  --brand-bg: #21202f;
  --brand-bg-light: #34324a;
  --brand-bg-dark: #16151f;
  --accent: #8d3dff;
  --accent-dark: #7324e8;

  --ink: #1f1e2b;
  --ink-muted: #5c5c6e;
  --ink-faint: #8a8a99;
  --line: #e6e6ef;
  --line-strong: #d7d7e4;
  --surface: #ffffff;
  --surface-alt: #f6f6fb;
  --surface-code: #f2f1f9;

  --note: #3b82f6;
  --tip: #10b981;
  --warn: #f59e0b;
  --radius: 10px;
  --maxw: 880px;
  --sidebar-w: 256px;
  --header-h: 56px;

  --font: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--surface);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* ── Header ─────────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: var(--brand-bg);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.25rem;
  box-shadow: 0 1px 0 rgba(0,0,0,.25);
}
.site-header .wordmark {
  display: flex;
  align-items: baseline;
  gap: .55rem;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: .2px;
  white-space: nowrap;
}
.site-header .wordmark .dot { color: var(--accent); }
.site-header .wordmark .tag {
  font-weight: 400;
  font-size: .78rem;
  color: #b7b6c9;
}
.site-nav {
  margin-left: auto;
  display: flex;
  gap: .25rem;
}
.site-nav a {
  color: #d9d8e6;
  text-decoration: none;
  font-size: .86rem;
  padding: .4rem .7rem;
  border-radius: 6px;
}
.site-nav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.site-nav a.active { color: #fff; background: rgba(141,61,255,.28); }

.menu-toggle {
  display: none;
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
  padding: .2rem .4rem;
  line-height: 1;
}

/* ── Layout ─────────────────────────────────────────────────────────── */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  max-width: 1200px;
  margin: 0 auto;
}
.sidebar {
  border-right: 1px solid var(--line);
  padding: 1.6rem 1rem 3rem;
  position: sticky;
  top: var(--header-h);
  align-self: start;
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
}
.sidebar h4 {
  margin: 0 0 .5rem;
  padding: 0 .6rem;
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.sidebar nav a {
  display: block;
  color: var(--ink-muted);
  text-decoration: none;
  font-size: .9rem;
  padding: .45rem .6rem;
  border-radius: 7px;
  margin-bottom: 1px;
}
.sidebar nav a:hover { background: var(--surface-alt); color: var(--ink); }
.sidebar nav a.active {
  background: rgba(141,61,255,.1);
  color: var(--accent-dark);
  font-weight: 600;
}

.content {
  padding: 2.4rem 2.6rem 5rem;
  max-width: var(--maxw);
  min-width: 0;
}

/* ── Typography ─────────────────────────────────────────────────────── */
.content h1 {
  font-size: 2rem;
  line-height: 1.2;
  margin: 0 0 .4rem;
  font-weight: 700;
  letter-spacing: -.3px;
}
.content .lede {
  font-size: 1.08rem;
  color: var(--ink-muted);
  margin: 0 0 2rem;
}
.content h2 {
  font-size: 1.35rem;
  margin: 2.6rem 0 .8rem;
  padding-top: .4rem;
  font-weight: 700;
  letter-spacing: -.2px;
}
.content h3 {
  font-size: 1.05rem;
  margin: 1.8rem 0 .5rem;
  font-weight: 600;
}
.content p { margin: .7rem 0; }
.content a { color: var(--accent-dark); text-decoration: none; }
.content a:hover { text-decoration: underline; }
.content ul, .content ol { padding-left: 1.3rem; margin: .7rem 0; }
.content li { margin: .35rem 0; }
.content strong { font-weight: 600; }
.content hr { border: 0; border-top: 1px solid var(--line); margin: 2.4rem 0; }

code {
  font-family: var(--mono);
  font-size: .86em;
  background: var(--surface-code);
  color: #5b2bb3;
  padding: .12em .4em;
  border-radius: 5px;
}
pre {
  background: var(--surface-code);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  overflow-x: auto;
  font-size: .86rem;
  line-height: 1.55;
}
pre code { background: none; color: var(--ink); padding: 0; }

/* ── Tables ─────────────────────────────────────────────────────────── */
.content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.1rem 0;
  font-size: .92rem;
}
.content th, .content td {
  text-align: left;
  padding: .6rem .8rem;
  border: 1px solid var(--line);
  vertical-align: top;
}
.content th { background: var(--surface-alt); font-weight: 600; }
.content tbody tr:nth-child(even) { background: #fafafd; }

/* ── Callouts ───────────────────────────────────────────────────────── */
.callout {
  border: 1px solid var(--line);
  border-left: 4px solid var(--ink-faint);
  background: var(--surface-alt);
  border-radius: 8px;
  padding: .85rem 1rem;
  margin: 1.2rem 0;
  font-size: .94rem;
}
.callout .callout-title {
  font-weight: 600;
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: .25rem;
  display: flex;
  align-items: center;
  gap: .45rem;
}
.callout p:first-of-type { margin-top: 0; }
.callout p:last-child { margin-bottom: 0; }
.callout.note  { border-left-color: var(--note); background: #eff5ff; }
.callout.note .callout-title  { color: #1d4ed8; }
.callout.tip   { border-left-color: var(--tip);  background: #ecfdf5; }
.callout.tip .callout-title   { color: #047857; }
.callout.warn  { border-left-color: var(--warn); background: #fffaeb; }
.callout.warn .callout-title  { color: #b45309; }

/* ── Steps ──────────────────────────────────────────────────────────── */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 1.2rem 0; }
.steps > li {
  position: relative;
  padding: 0 0 1.3rem 3rem;
  margin: 0;
  border-left: 2px solid var(--line);
  margin-left: 1rem;
}
.steps > li:last-child { border-left-color: transparent; padding-bottom: 0; }
.steps > li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: -1rem;
  top: -.15rem;
  width: 2rem;
  height: 2rem;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: .9rem;
}
.steps > li .step-title { font-weight: 600; font-size: 1.02rem; display: block; margin-bottom: .1rem; }

/* ── Cards (landing) ────────────────────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1rem;
  margin: 1.6rem 0;
}
.card {
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  text-decoration: none;
  color: var(--ink);
  background: var(--surface);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.card:hover {
  border-color: var(--accent);
  box-shadow: 0 6px 20px rgba(141,61,255,.12);
  transform: translateY(-2px);
}
.card .card-ico { font-size: 1.5rem; margin-bottom: .4rem; }
.card h3 { margin: 0 0 .3rem; font-size: 1.02rem; }
.card p { margin: 0; color: var(--ink-muted); font-size: .9rem; }

/* ── Pills / badges ─────────────────────────────────────────────────── */
.pill {
  display: inline-block;
  font-size: .78rem;
  font-weight: 600;
  padding: .12rem .55rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  white-space: nowrap;
}
.pill.ok   { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.pill.wait { background: #fffaeb; color: #b45309; border-color: #fde68a; }
.pill.err  { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.pill.draft{ background: #eff5ff; color: #1d4ed8; border-color: #bfdbfe; }
.pill.arch { background: #f3f4f6; color: #4b5563; border-color: #e5e7eb; }

/* ── In-page TOC ────────────────────────────────────────────────────── */
.page-toc {
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .9rem 1.1rem;
  margin: 0 0 2rem;
  font-size: .9rem;
}
.page-toc .page-toc-title { font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-faint); margin-bottom: .4rem; }
.page-toc ul { margin: 0; padding-left: 1.1rem; }
.page-toc li { margin: .2rem 0; }

/* ── Footer ─────────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.6rem 2.6rem;
  color: var(--ink-faint);
  font-size: .85rem;
  max-width: 1200px;
  margin: 0 auto;
}
.site-footer a { color: var(--ink-muted); }

/* ── Hero (landing) ─────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--brand-bg) 0%, var(--brand-bg-light) 100%);
  color: #fff;
  border-radius: 14px;
  padding: 2.4rem 2.2rem;
  margin-bottom: 1.6rem;
}
.hero h1 { color: #fff; margin: 0 0 .5rem; font-size: 2.1rem; }
.hero p { color: #cfcee0; margin: 0; font-size: 1.05rem; max-width: 46ch; }

/* ── Prev/next ──────────────────────────────────────────────────────── */
.pager { display: flex; justify-content: space-between; gap: 1rem; margin-top: 3rem; border-top: 1px solid var(--line); padding-top: 1.4rem; }
.pager a { color: var(--accent-dark); text-decoration: none; font-weight: 600; font-size: .92rem; }
.pager a:hover { text-decoration: underline; }
.pager .spacer { flex: 1; }

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .menu-toggle { display: block; }
  .site-nav { display: none; }
  .sidebar {
    position: fixed;
    top: var(--header-h);
    left: 0;
    width: 86%;
    max-width: 320px;
    height: calc(100vh - var(--header-h));
    background: var(--surface);
    border-right: 1px solid var(--line);
    transform: translateX(-100%);
    transition: transform .2s ease;
    z-index: 40;
    box-shadow: 4px 0 24px rgba(0,0,0,.12);
  }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open::after {
    content: "";
    position: fixed; inset: var(--header-h) 0 0 0;
    background: rgba(0,0,0,.35); z-index: 30;
  }
  .content { padding: 1.6rem 1.25rem 4rem; }
  .site-footer { padding: 1.4rem 1.25rem; }
}
