/* ============================================================
   Generator Training Manual — style.css
   Unified Enterprise Commerce Platform by Cutting-Edge Solutions
   ============================================================ */

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: #2c2c2c;
  background: #f4f6f8;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: #0057a8; text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4, h5, h6 { color: #003d7a; font-weight: 700; line-height: 1.3; }
h3 { font-size: 1.25rem; margin-bottom: 10px; }
h4 { font-size: 1.02rem; margin: 14px 0 8px; color: #0057a8; }

code {
  background: #f0f4fa;
  border: 1px solid #dde4ee;
  border-radius: 3px;
  padding: 1px 6px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.9em;
  color: #003d7a;
}

/* ---------- Page Wrap ---------- */
.page-wrap { min-height: 100vh; display: flex; flex-direction: column; }

/* ---------- Sticky top region (header + tabs pinned together) ---------- */
.sticky-top {
  position: sticky;
  top: 0;
  z-index: 200;
}

/* ---------- Site Header ---------- */
.site-header {
  background: linear-gradient(135deg, #0057a8 0%, #003d7a 100%);
  color: #fff;
  padding: 18px 32px;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.site-header .header-left {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}
.site-header .header-mark {
  height: 52px;
  width: 52px;
  border-radius: 8px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
  display: block;
}
.site-header .header-brand { display: flex; flex-direction: column; min-width: 0; }
.site-header .header-logo {
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: .5px;
  line-height: 1.2;
}
.site-header .header-logo span {
  font-weight: 300;
  opacity: .9;
}
.site-header .header-tagline {
  font-size: .85rem;
  opacity: .85;
  margin-top: 4px;
}
.site-header .header-badge {
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.35);
  color: #fff;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .5px;
  padding: 6px 14px;
  border-radius: 20px;
  text-transform: uppercase;
}

/* ---------- Top Tab Navigation ---------- */
.top-tabs {
  background: #004080;
  display: flex;
  flex-wrap: wrap;
  box-shadow: 0 2px 4px rgba(0,0,0,.2);
}
.top-tab {
  background: transparent;
  border: none;
  color: #cce0ff;
  cursor: pointer;
  font-size: .95rem;
  font-weight: 600;
  padding: 13px 24px;
  transition: background .2s, color .2s, border-color .2s;
  letter-spacing: .3px;
  border-bottom: 3px solid transparent;
  font-family: inherit;
}
.top-tab:hover { background: #0057a8; color: #fff; }
.top-tab.active {
  background: #1d80f5;
  color: #fff;
}

/* ---------- Main Content Area ---------- */
.tab-content,
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 64px;
  width: 100%;
  flex: 1;
}

/* ---------- Tab Panels ---------- */
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---------- Panel Hero (Admin uses this) ---------- */
.panel-hero,
.sales-header,
.home-hero,
.section > .section-header {
  background: linear-gradient(135deg, #0057a8 0%, #003d7a 100%);
  color: #fff;
  border-radius: 8px;
  padding: 36px 40px;
  margin-bottom: 28px;
  box-shadow: 0 2px 8px rgba(0,0,0,.10);
}
.panel-hero h2,
.sales-header h2,
.section > .section-header h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: #fff;
}
.panel-hero p,
.sales-header p,
.section > .section-header p {
  font-size: 1.05rem;
  opacity: .92;
  max-width: 760px;
  color: #fff;
}

/* ---------- Home Panel ---------- */
.home-wrap { padding: 0; }
.home-hero h1 {
  font-size: 2.3rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: #fff;
}
.home-hero h1 span {
  font-weight: 300;
  opacity: .9;
}
.home-hero p {
  font-size: 1.05rem;
  opacity: .92;
  color: #fff;
  max-width: 760px;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 22px;
  margin-bottom: 32px;
}
.module-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  padding: 28px 22px 24px;
  text-align: center;
  cursor: pointer;
  transition: transform .18s, box-shadow .18s, border-color .18s;
  border-top: 4px solid #0057a8;
  user-select: none;
}
.module-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0,0,0,.14);
  border-top-color: #003d7a;
}
.module-card .mc-icon {
  font-size: 2.4rem;
  margin-bottom: 12px;
  line-height: 1;
}
.module-card .mc-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0057a8;
  margin-bottom: 8px;
}
.module-card .mc-desc {
  font-size: .88rem;
  color: #555;
  line-height: 1.5;
}

.home-intro {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
  padding: 26px 30px;
  margin-bottom: 24px;
}
.home-intro h2 {
  font-size: 1.4rem;
  color: #0057a8;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid #eef4ff;
}
.home-intro p { margin-bottom: 12px; }
.home-intro ul { padding-left: 22px; }
.home-intro li { margin-bottom: 6px; }

/* ---------- Table of Contents ---------- */
.toc {
  background: #eef4ff;
  border: 1px solid #c0d8f5;
  border-radius: 6px;
  padding: 18px 24px;
  margin-bottom: 28px;
  font-size: .94rem;
  line-height: 1.9;
}
.toc strong {
  display: block;
  font-size: 1rem;
  color: #003d7a;
  margin-bottom: 8px;
  letter-spacing: .3px;
}
.toc a {
  color: #0057a8;
  font-size: .92rem;
  white-space: nowrap;
}
.toc a:hover { color: #003d7a; text-decoration: underline; }
.toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 4px 16px;
}
.toc ul li { margin: 0; }

/* ---------- Sales Nav (chip-style anchor strip) ---------- */
.sales-nav {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
  padding: 14px 18px;
  margin-bottom: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
}
.card-nav-link {
  display: inline-block;
  background: #eef4ff;
  color: #0057a8;
  border: 1px solid #c0d8f5;
  border-radius: 14px;
  padding: 4px 12px;
  font-size: .82rem;
  font-weight: 600;
  transition: background .15s, color .15s, border-color .15s;
}
.card-nav-link:hover {
  background: #0057a8;
  color: #fff;
  border-color: #0057a8;
  text-decoration: none;
}

/* ---------- Section Wrapper (Purchasing / Inventory / Marketing) ---------- */
.section {
  margin-bottom: 0;
}
/* When a .section is a wrapper for header + content, the inner .section-header gets the hero style above */

/* ---------- Subsection (cards under each tab) ---------- */
.subsection {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
  margin-bottom: 22px;
  overflow: hidden;
  border-left: 4px solid #0057a8;
}
/* Subsections that use the <h3> form (Purchasing, Inventory, Marketing top-level subsection content) */
.subsection > h3 {
  background: #f0f5ff;
  color: #003d7a;
  font-size: 1.05rem;
  font-weight: 700;
  padding: 12px 20px;
  margin: 0;
  border-bottom: 1px solid #dde4ee;
}
/* Direct content after h3 (no .section-body wrapper) */
.subsection > h3 ~ * {
  margin-left: 22px;
  margin-right: 22px;
}
.subsection > h3 + p,
.subsection > h3 + h4,
.subsection > h3 + ol,
.subsection > h3 + ul,
.subsection > h3 + table,
.subsection > h3 + .tip,
.subsection > h3 + .warning,
.subsection > h3 + img {
  margin-top: 18px;
}
.subsection > h3 ~ img:last-child,
.subsection > h3 ~ p:last-child,
.subsection > h3 ~ ol:last-child,
.subsection > h3 ~ ul:last-child,
.subsection > h3 ~ table:last-child,
.subsection > h3 ~ .tip:last-child,
.subsection > h3 ~ .warning:last-child,
.subsection > h3 ~ div:last-child {
  margin-bottom: 22px;
}

/* Subsections that use the .section-header + .section-body form (Marketing/Admin) */
.subsection .section-header {
  background: #f0f5ff;
  color: #003d7a;
  font-size: 1.05rem;
  font-weight: 700;
  padding: 12px 20px;
  border-bottom: 1px solid #dde4ee;
}
.subsection .section-header h2,
.subsection .section-header h3 {
  color: #003d7a;
  font-size: 1.05rem;
  background: none;
  padding: 0;
  margin: 0;
}
.subsection .section-body {
  padding: 18px 22px 22px;
}
.subsection .section-body p { margin-bottom: 12px; }
.subsection .section-body ol,
.subsection .section-body ul {
  padding-left: 22px;
  margin-bottom: 14px;
}
.subsection .section-body li { margin-bottom: 6px; }
.subsection .section-body img,
.subsection > h3 ~ img {
  display: block;
  max-width: 100%;
  border: 1px solid #dde4ee;
  border-radius: 5px;
  margin-top: 14px;
}

/* Generic inner-element styling inside any subsection */
.subsection p { margin-bottom: 12px; }
.subsection ol.steps,
.subsection ol,
.subsection ul {
  padding-left: 22px;
  margin-bottom: 14px;
}
.subsection ol.steps li,
.subsection ol li,
.subsection ul li { margin-bottom: 6px; }
.subsection ol.steps ul,
.subsection ol ul { margin-top: 6px; margin-bottom: 6px; }
.subsection img.screenshot {
  display: block;
  max-width: 100%;
  border: 1px solid #dde4ee;
  border-radius: 5px;
  margin-top: 14px;
}

/* ---------- Sales Cards ---------- */
.card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
  margin-bottom: 22px;
  overflow: hidden;
  border-left: 4px solid #0057a8;
  scroll-margin-top: 150px;
}
.card-header {
  background: #f0f5ff;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #dde4ee;
}
.card-header .card-icon {
  font-size: 1.4rem;
  line-height: 1;
}
.card-header h3 {
  font-size: 1.05rem;
  color: #003d7a;
  margin: 0;
  display: inline;
}
.card-header .card-sub {
  font-size: .82rem;
  font-weight: 500;
  color: #6a7a8c;
  margin-left: 8px;
}
.card-body {
  padding: 18px 22px 22px;
  font-size: .95rem;
}
.card-body p { margin-bottom: 12px; }
.card-body ol,
.card-body ul {
  padding-left: 22px;
  margin-bottom: 14px;
}
.card-body li { margin-bottom: 6px; }
.card-body h4 {
  margin-top: 16px;
  margin-bottom: 8px;
}
.card-body h4:first-child { margin-top: 0; }
.card-body img.screenshot {
  display: block;
  max-width: 100%;
  border: 1px solid #dde4ee;
  border-radius: 5px;
  margin-top: 14px;
}

/* ---------- Anchor scroll offset for in-page links ---------- */
.subsection,
.card,
[id^="sales-"],
[id^="pur-"],
[id^="inv-"],
[id^="mkt-"],
[id^="adm-"] { scroll-margin-top: 150px; }

/* ---------- Tip & Warning Callouts ---------- */
.tip {
  background: #edfaf1;
  border-left: 4px solid #28a745;
  border-radius: 4px;
  padding: 10px 16px;
  margin: 14px 0;
  font-size: .92rem;
  color: #1a5e2a;
}
.tip strong { color: #155724; }

.warning {
  background: #fffbe6;
  border-left: 4px solid #ffc107;
  border-radius: 4px;
  padding: 10px 16px;
  margin: 14px 0;
  font-size: .92rem;
  color: #7a5c00;
}
.warning strong { color: #5c4200; }

/* ---------- Tables (Quick Reference, Summary, Code) ---------- */
.ref-table,
.summary-table,
.code-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .92rem;
  margin: 10px 0 6px;
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,.05);
}
.ref-table th,
.summary-table th,
.code-table th {
  background: #0057a8;
  color: #fff;
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  font-size: .9rem;
  letter-spacing: .2px;
}
.ref-table td,
.summary-table td,
.code-table td {
  padding: 9px 14px;
  border-bottom: 1px solid #e0e7f0;
  vertical-align: top;
}
.ref-table tr:nth-child(even) td,
.summary-table tr:nth-child(even) td,
.code-table tr:nth-child(even) td { background: #f6f9fd; }
.ref-table tr:last-child td,
.summary-table tr:last-child td,
.code-table tr:last-child td { border-bottom: none; }
.ref-table tr:hover td,
.summary-table tr:hover td,
.code-table tr:hover td { background: #eef4ff; }

/* ---------- Footer ---------- */
.site-footer {
  background: #003d7a;
  color: #cce0ff;
  text-align: center;
  padding: 22px 16px;
  margin-top: 48px;
  font-size: .88rem;
}
.site-footer .footer-inner { max-width: 1100px; margin: 0 auto; }
.site-footer p { margin: 0; }
.site-footer .footer-tagline {
  opacity: .7;
  margin-top: 4px;
  font-style: italic;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .panel-hero,
  .sales-header,
  .home-hero,
  .section > .section-header { padding: 28px 24px; }
  .panel-hero h2,
  .sales-header h2,
  .section > .section-header h2,
  .home-hero h1 { font-size: 1.6rem; }
  .toc ul { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 700px) {
  .site-header { padding: 14px 18px; }
  .site-header .header-mark { height: 40px; width: 40px; border-radius: 6px; }
  .site-header .header-left { gap: 12px; }
  .site-header .header-logo { font-size: 1.2rem; }
  .site-header .header-tagline { font-size: .78rem; }
  .site-header .header-badge { font-size: .72rem; padding: 4px 10px; }
  .top-tab { padding: 10px 14px; font-size: .85rem; }
  .tab-content,
  main { padding: 20px 12px 48px; }
  .panel-hero,
  .sales-header,
  .home-hero { padding: 22px 18px; }
  .panel-hero h2,
  .sales-header h2,
  .home-hero h1 { font-size: 1.4rem; }
  .panel-hero p,
  .sales-header p,
  .home-hero p { font-size: .95rem; }
  .module-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
  .module-card { padding: 22px 16px 18px; }
  .module-card .mc-icon { font-size: 2rem; }
  .home-intro { padding: 20px 18px; }
  .subsection .section-body,
  .card-body { padding: 14px 16px 18px; }
  .subsection > h3 ~ * { margin-left: 16px; margin-right: 16px; }
  .ref-table,
  .summary-table,
  .code-table { font-size: .82rem; }
  .ref-table th, .ref-table td,
  .summary-table th, .summary-table td,
  .code-table th, .code-table td { padding: 7px 9px; }
  .toc { padding: 14px 16px; }
  .toc ul { grid-template-columns: 1fr; }
  .sales-nav { padding: 12px 14px; gap: 5px 8px; }
  .card-nav-link { font-size: .78rem; padding: 3px 10px; }
}

@media (max-width: 420px) {
  .module-grid { grid-template-columns: 1fr; }
  .site-header .header-badge { display: none; }
}
