/* AI ERP System Guide — shared styles (extends the PCWB v2 look) */
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #1a1f2c; background: #f6f7f9;
  -webkit-font-smoothing: antialiased;
}

/* ---- top bar ---- */
header.topbar {
  background: #0f1726; color: #f6f7f9; padding: 13px 22px;
  display: flex; align-items: center; gap: 14px;
  position: sticky; top: 0; z-index: 40;
}
header.topbar .logo { font-weight: 700; font-size: 16px; letter-spacing: 0.3px; }
header.topbar .logo .v { color: #14b8a6; }
header.topbar .spacer { flex: 1; }
header.topbar .home-link { color: #95a3b9; text-decoration: none; font-size: 12.5px; }
header.topbar .home-link:hover { color: #f6f7f9; }
header.topbar .menu-toggle {
  display: none; background: none; border: 1px solid #2a3550; color: #cdd6e6;
  border-radius: 6px; padding: 5px 9px; font-size: 15px; cursor: pointer;
}

/* ---- doc shell (sidebar + content) ---- */
.doc { display: flex; align-items: flex-start; }
.sidebar {
  width: 258px; flex: 0 0 258px; position: sticky; top: 47px; align-self: flex-start;
  height: calc(100vh - 47px); overflow-y: auto;
  background: #fff; border-right: 1px solid #e4e7ee; padding: 14px 10px 60px;
}
.sidebar .grp { margin-bottom: 4px; }
.sidebar .grp > summary {
  list-style: none; cursor: pointer; user-select: none;
  font-size: 11px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase;
  color: #8a94a8; padding: 9px 10px 5px; display: flex; align-items: center; gap: 6px;
}
.sidebar .grp > summary::-webkit-details-marker { display: none; }
.sidebar .grp > summary::before {
  content: "▸"; font-size: 9px; color: #b3bccd; transition: transform 0.15s;
}
.sidebar .grp[open] > summary::before { transform: rotate(90deg); }
.sidebar a {
  display: block; text-decoration: none; color: #46506a; font-size: 13px;
  padding: 6px 10px 6px 24px; border-radius: 6px; line-height: 1.35;
}
.sidebar a:hover { background: #f1f3f6; color: #0f1726; }
.sidebar a.active { background: #ecfdf5; color: #0f766e; font-weight: 600; }
.sidebar a .sub { display: block; font-size: 10.5px; color: #98a1b3; font-weight: 400; }
.sidebar a.top { padding-left: 10px; font-weight: 600; color: #0f1726; }

.content { flex: 1; min-width: 0; }
.crumbs {
  background: #fff; border-bottom: 1px solid #e4e7ee;
  padding: 9px 32px; font-size: 12px; color: #67718b;
}
.crumbs a { color: #14b8a6; text-decoration: none; }
.layout { max-width: 1000px; margin: 26px auto; padding: 0 32px 100px; }

h1 { font-size: 25px; margin: 0 0 6px; color: #0f1726; letter-spacing: -0.3px; }
h2 { font-size: 19px; margin: 34px 0 10px; color: #0f1726; }
h3 { font-size: 15px; color: #0f1726; margin: 22px 0 8px; }
.lead { font-size: 14.5px; color: #67718b; margin: 0 0 22px; line-height: 1.62; max-width: 860px; }
.content p { font-size: 14px; line-height: 1.68; color: #2f3849; }
.content ul, .content ol { font-size: 14px; line-height: 1.72; color: #2f3849; padding-left: 22px; }
.content li { margin: 3px 0; }
code, .mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.content :not(pre) > code, td code, li code {
  background: #f1f3f6; border: 1px solid #e4e7ee; border-radius: 3px; padding: 1px 6px;
  font-size: 12px; color: #b5177e;
}

/* ---- cards / grids ---- */
.step-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 15px; margin: 20px 0 30px; }
.card {
  background: #fff; border: 1px solid #e4e7ee; border-radius: 10px; padding: 17px 18px;
  text-decoration: none; color: inherit; display: block;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
a.card:hover { border-color: #14b8a6; transform: translateY(-2px); box-shadow: 0 6px 18px rgba(20,184,166,0.12); }
.card h3 { margin: 0 0 6px; font-size: 15px; color: #0f1726; }
.card p { font-size: 12.8px; color: #67718b; margin: 0; line-height: 1.5; }
.card .num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 13px; background: #14b8a6; color: #fff;
  font-size: 12px; font-weight: 700; margin-right: 9px; vertical-align: middle;
}
.card .eyebrow { font-size: 10.5px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; color: #14b8a6; margin-bottom: 5px; }

/* ---- tables ---- */
.field-table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 12px 0; }
.field-table th, .field-table td { text-align: left; padding: 9px 11px; border-bottom: 1px solid #eef0f4; vertical-align: top; }
.field-table th { color: #67718b; font-weight: 600; background: #fafbfc; }
.field-table tr:last-child td { border-bottom: none; }
.table-scroll { overflow-x: auto; border: 1px solid #e4e7ee; border-radius: 8px; }
.table-scroll .field-table { margin: 0; }

/* ---- callouts ---- */
.callout { background: #ecfdf5; border-left: 3px solid #14b8a6; padding: 12px 16px; border-radius: 4px; font-size: 13px; margin: 14px 0; line-height: 1.6; }
.callout.warn { background: #fff7ed; border-color: #f59e0b; }
.callout.info { background: #eff6ff; border-color: #3b82f6; }
.callout.new  { background: #f5f3ff; border-color: #8b5cf6; }
.callout strong { color: #0f1726; }

/* ---- flow map ---- */
.flow-map { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; margin: 18px 0; }
.flow-step { flex: 1 1 140px; background: #fff; border: 1px solid #e4e7ee; border-radius: 8px; padding: 11px 13px; }
.flow-step .n { font-size: 10.5px; font-weight: 700; color: #14b8a6; letter-spacing: 0.5px; }
.flow-step .t { font-size: 13px; font-weight: 600; color: #0f1726; margin-top: 3px; }
.flow-step .d { font-size: 11px; color: #7a8499; margin-top: 3px; line-height: 1.4; }
.flow-arrow { align-self: center; color: #b3bccd; font-size: 16px; }

/* ---- up/down stream chips ---- */
.io-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 14px 0; }
.io-box { background: #fff; border: 1px solid #e4e7ee; border-radius: 9px; padding: 14px 16px; }
.io-box h4 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: #8a94a8; }
.io-box.up h4 { color: #3b82f6; }
.io-box.down h4 { color: #14b8a6; }
.io-box ul { margin: 0; padding-left: 18px; font-size: 13px; }

/* ---- feature list ---- */
.feat { list-style: none; padding: 0; margin: 12px 0; }
.feat li { padding: 10px 0 10px 26px; border-bottom: 1px solid #eef0f4; position: relative; font-size: 13.5px; line-height: 1.55; }
.feat li:last-child { border-bottom: none; }
.feat li::before { content: "✦"; position: absolute; left: 4px; top: 10px; color: #14b8a6; font-size: 12px; }
.feat li b { color: #0f1726; }

/* ---- screenshots ---- */
.screenshot { margin: 16px 0; border: 1px solid #e4e7ee; border-radius: 8px; overflow: hidden; background: #fff; box-shadow: 0 1px 3px rgba(15,23,38,0.05); }
.screenshot img { width: 100%; display: block; }
.screenshot figcaption { padding: 9px 13px; font-size: 12px; color: #67718b; background: #fafbfc; border-top: 1px solid #eef0f4; line-height: 1.5; }
.screenshot figcaption b { color: #0f1726; }

/* ---- misc ---- */
.kbd { display: inline-block; padding: 1px 6px; border: 1px solid #d4d8e1; border-bottom-width: 2px; border-radius: 3px; font-size: 11px; font-family: ui-monospace, monospace; background: #fafbfc; }
.tag { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.tag-master { background: #e0e7ff; color: #3730a3; }
.tag-sales { background: #dcfce7; color: #15803d; }
.tag-purchase { background: #ffedd5; color: #9a3412; }
.tag-fulfil { background: #cffafe; color: #0e7490; }
.tag-finance { background: #fce7f3; color: #9d174d; }
.tag-tool { background: #f1f5f9; color: #475569; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; background: #f1f3f6; color: #475569; margin: 2px 4px 2px 0; }
.footer-nav { display: flex; justify-content: space-between; margin-top: 34px; padding-top: 18px; border-top: 1px solid #e4e7ee; gap: 10px; }
.footer-nav a { display: inline-block; padding: 9px 17px; background: #14b8a6; color: #fff; border-radius: 6px; text-decoration: none; font-size: 13px; font-weight: 500; }
.footer-nav a.prev { background: #fff; color: #2f3849; border: 1px solid #d4d8e1; }
.footer-nav a.disabled { visibility: hidden; }
.meta-line { font-size: 12px; color: #98a1b3; margin-top: 40px; padding-top: 14px; border-top: 1px dashed #e4e7ee; }

/* ---- responsive ---- */
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 47px; z-index: 30; transform: translateX(-100%); transition: transform 0.2s; box-shadow: 4px 0 24px rgba(15,23,38,0.12); }
  .sidebar.open { transform: translateX(0); }
  header.topbar .menu-toggle { display: inline-block; }
  .io-grid { grid-template-columns: 1fr; }
  .layout { padding: 0 20px 80px; }
}
