:root {
  --primary: #8b5cf6;
  --primary-dark: #6d28d9;
  --primary-light: #ede9fe;
  --text: #1a1a1a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --bg: #f8fafc;
  --sidebar-width: 280px;
  --header-height: 64px;
}

* { box-sizing: border-box; }

body {
  font-family: "Roboto", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  margin: 0;
}

a {
  color: var(--primary);
  text-decoration: none;
}
a:hover { color: var(--primary-dark); }

.d-none {
  display: none !important;
}

.support-wrapper {
  display: flex;
  min-height: 100vh;
}

.support-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  z-index: 1000;
  gap: 1rem;
}

.support-header .brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}
.support-header .brand img { height: 32px; }
.support-header .brand span { font-size: 1.1rem; }

.sidebar-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  color: var(--text);
}

.header-spacer { flex: 1; }

.header-link {
  font-size: 0.9rem;
  color: var(--text-muted);
}
.header-link:hover { color: var(--primary); }

.support-sidebar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  width: var(--sidebar-width);
  height: calc(100vh - var(--header-height));
  background: #fff;
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 1rem 0;
  z-index: 900;
  transition: transform 0.25s ease;
}

.nav-section-title {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 0.75rem 1.25rem 0.35rem;
  margin: 0;
}

.support-nav { list-style: none; padding: 0; margin: 0 0 0.5rem; }
.support-nav li a {
  display: block;
  padding: 0.45rem 1.25rem;
  color: var(--text);
  font-size: 0.925rem;
  border-left: 3px solid transparent;
}
.support-nav li a:hover {
  background: var(--primary-light);
  color: var(--primary-dark);
  text-decoration: none;
}
.support-nav li a.active {
  background: var(--primary-light);
  color: var(--primary-dark);
  border-left-color: var(--primary);
  font-weight: 500;
}

.support-nav-guides .nav-sub-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding: 0.55rem 1.25rem 0.2rem;
  opacity: 0.85;
}
.support-nav-guides li a {
  padding-left: 1.5rem;
  font-size: 0.875rem;
}
.support-nav-guides > li:first-child a {
  padding-left: 1.25rem;
  font-size: 0.925rem;
}

.support-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  margin-top: var(--header-height);
  padding: 2rem 2.5rem 4rem;
  max-width: 900px;
}

.page-title {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  line-height: 1.2;
}

.page-lead {
  font-size: 1.125rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.breadcrumb-nav {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.breadcrumb-nav a { color: var(--text-muted); }
.breadcrumb-nav a:hover { color: var(--primary); }

.where-box {
  background: var(--primary-light);
  border: 1px solid #c4b5fd;
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 2rem;
}
.where-box strong { color: var(--primary-dark); }

h2.doc-h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
}

h3.doc-h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 1.75rem 0 0.75rem;
}

ol.steps, ul.checklist {
  padding-left: 1.25rem;
}
ol.steps li, ul.checklist li {
  margin-bottom: 0.5rem;
}

.callout {
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
  border-left: 4px solid;
}
.callout-tip { background: #ecfdf5; border-color: #10b981; }
.callout-note { background: #eff6ff; border-color: #3b82f6; }
.callout-admin { background: #fef3c7; border-color: #f59e0b; }
.callout-perm { background: #fce7f3; border-color: #ec4899; }
.callout strong { display: block; margin-bottom: 0.25rem; }

.screenshot-placeholder {
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  padding: 2.5rem 1.5rem;
  text-align: center;
  margin: 1.25rem 0;
  color: var(--text-muted);
}
.screenshot-placeholder i {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  display: block;
  opacity: 0.5;
}
.screenshot-placeholder p { margin: 0; font-size: 0.95rem; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
  margin: 2rem 0;
}

.feature-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.feature-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.12);
}
.feature-card i {
  font-size: 1.5rem;
  color: var(--primary);
  margin-bottom: 0.75rem;
}
.feature-card h3 {
  font-size: 1rem;
  margin: 0 0 0.5rem;
}
.feature-card p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0 0 0.75rem;
}
.feature-card a {
  font-size: 0.875rem;
  font-weight: 500;
}

.search-box {
  position: relative;
  max-width: 480px;
  margin: 1.5rem 0 2rem;
}
.search-box input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 1rem;
}
.search-box input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}
.search-box i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.search-results {
  list-style: none;
  padding: 0;
  margin: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  display: none;
}
.search-results.visible { display: block; }
.search-results li a {
  display: block;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.search-results li:last-child a { border-bottom: none; }
.search-results li a:hover {
  background: var(--primary-light);
  text-decoration: none;
}
.search-results .result-title { font-weight: 500; }
.search-results .result-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}

table.doc-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.925rem;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
}
table.doc-table th,
table.doc-table td {
  padding: 0.65rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
table.doc-table th {
  background: #f1f5f9;
  font-weight: 600;
}
table.doc-table tr:last-child td { border-bottom: none; }

code.route {
  background: #f1f5f9;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.85em;
  color: var(--primary-dark);
}

.faq-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 0.75rem;
  overflow: hidden;
}
.faq-item summary {
  padding: 1rem 1.25rem;
  cursor: pointer;
  font-weight: 500;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  float: right;
  font-weight: 300;
}
.faq-item[open] summary::after { content: "−"; }
.faq-item .faq-body {
  padding: 0 1.25rem 1rem;
  color: var(--text-muted);
}

.support-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* How-To Flow guides */
.flow-goal {
  background: linear-gradient(135deg, var(--primary-light) 0%, #fff 100%);
  border: 1px solid #c4b5fd;
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.75rem;
}
.flow-goal strong { color: var(--primary-dark); font-size: 1.05rem; }

.flow-modules {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
}
.module-badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--text);
  border: 1px solid var(--border);
}
.module-badge.settings { background: #fef3c7; border-color: #fcd34d; }
.module-badge.products { background: #dbeafe; border-color: #93c5fd; }
.module-badge.purchases { background: #d1fae5; border-color: #6ee7b7; }
.module-badge.sales { background: #ede9fe; border-color: #c4b5fd; }
.module-badge.people { background: #fce7f3; border-color: #f9a8d4; }
.module-badge.inventory { background: #ffedd5; border-color: #fdba74; }
.module-badge.reports { background: #e0e7ff; border-color: #a5b4fc; }
.module-badge.accounting { background: #ecfdf5; border-color: #6ee7b7; }
.module-badge.hrm { background: #f3e8ff; border-color: #d8b4fe; }
.module-badge.pos { background: #fee2e2; border-color: #fca5a5; }

.flow-diagram {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.5rem;
  margin: 1.5rem 0 2rem;
}
.flow-step {
  flex: 1;
  min-width: 120px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  text-align: center;
  position: relative;
}
.flow-step-num {
  display: inline-block;
  width: 28px;
  height: 28px;
  line-height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.flow-step-title { font-weight: 600; font-size: 0.9rem; margin-bottom: 0.25rem; }
.flow-step-module { font-size: 0.75rem; color: var(--text-muted); }
.flow-arrow {
  display: flex;
  align-items: center;
  color: var(--text-muted);
  font-size: 1.25rem;
  padding: 0 0.25rem;
}

.flow-phase {
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}
.flow-phase-header {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary-dark);
  margin-bottom: 0.75rem;
}
.flow-phase-meta {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.flow-phase-link {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.flow-verify {
  background: #ecfdf5;
  border: 1px solid #6ee7b7;
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
}
.flow-verify strong { color: #047857; }

.flow-mistakes {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}
.flow-mistakes strong { color: #b91c1c; }

.guides-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin: 2rem 0;
}
.guide-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.guide-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.12);
}
.guide-card .guide-icon {
  font-size: 1.5rem;
  color: var(--primary);
  margin-bottom: 0.75rem;
}
.guide-card h3 { font-size: 1rem; margin: 0 0 0.5rem; }
.guide-card p { font-size: 0.875rem; color: var(--text-muted); margin: 0 0 0.75rem; }
.guide-card .guide-modules { margin-bottom: 0.75rem; }
.guide-card a { font-size: 0.875rem; font-weight: 500; }

@media (max-width: 991px) {
  .sidebar-toggle { display: block; }
  .support-sidebar {
    transform: translateX(-100%);
  }
  .support-wrapper.sidebar-open .support-sidebar {
    transform: translateX(0);
    box-shadow: 4px 0 20px rgba(0,0,0,0.1);
  }
  .support-main {
    margin-left: 0;
    padding: 1.5rem 1.25rem 3rem;
  }
}
