/* ===========================
   WORKCORE DOCUMENTATION CSS
   Industrial/Technical Theme
   =========================== */

:root {
  --bg-base: #0d0f12;
  --bg-surface: #141720;
  --bg-raised: #1c2030;
  --bg-card: #1e2235;
  --bg-hover: #252a3a;

  --amber: #f59e0b;
  --amber-dim: #d97706;
  --amber-glow: rgba(245, 158, 11, 0.15);
  --amber-border: rgba(245, 158, 11, 0.25);

  --text-primary: #e8eaf0;
  --text-secondary: #8b92a8;
  --text-muted: #535c75;
  --text-accent: #f59e0b;

  --border: rgba(255,255,255,0.07);
  --border-strong: rgba(255,255,255,0.12);

  --green: #22c55e;
  --red: #ef4444;
  --blue: #3b82f6;
  --orange: #f97316;
  --purple: #a855f7;

  --radius: 10px;
  --radius-sm: 6px;
  --sidebar-w: 270px;
  --topbar-h: 58px;

  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Instrument Sans', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.7;
  overflow-x: hidden;
}

/* ============= TOPBAR ============= */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: rgba(13, 15, 18, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 100;
}

.topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar-right { display: flex; align-items: center; gap: 14px; }

.logo-mark {
  display: flex; align-items: center; gap: 8px;
  text-decoration: none;
}

.logo-icon {
  font-size: 20px;
  color: var(--amber);
  filter: drop-shadow(0 0 8px var(--amber));
  line-height: 1;
}

.logo-text {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 17px;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.doc-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

.version-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--amber);
  letter-spacing: 0.05em;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.menu-toggle span {
  display: block;
  width: 20px; height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: all 0.3s;
}

/* ============= LAYOUT ============= */
.layout {
  display: flex;
  padding-top: var(--topbar-h);
  min-height: 100vh;
}

/* ============= SIDEBAR ============= */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  position: fixed;
  top: var(--topbar-h);
  left: 0;
  bottom: 0;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  z-index: 50;
  transition: transform 0.3s ease;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--bg-raised); border-radius: 2px; }

.sidebar-nav {
  padding: 20px 0;
  flex: 1;
}

.nav-section {
  margin-bottom: 8px;
}

.nav-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 12px 20px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: all 0.2s;
  border-left: 2px solid transparent;
  position: relative;
}

.nav-item:hover {
  color: var(--text-primary);
  background: var(--bg-raised);
  border-left-color: var(--border-strong);
}

.nav-item.active {
  color: var(--amber);
  background: var(--amber-glow);
  border-left-color: var(--amber);
}

.nav-num {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  min-width: 20px;
}

.nav-item.active .nav-num { color: var(--amber-dim); }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.progress-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  display: block;
  margin-bottom: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.progress-bar {
  height: 3px;
  background: var(--bg-raised);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--amber-dim), var(--amber));
  border-radius: 2px;
  width: 0%;
  transition: width 0.2s ease;
}

/* ============= CONTENT ============= */
.content {
  flex: 1;
  margin-left: var(--sidebar-w);
  padding: 0;
  min-width: 0;
}

/* ============= HERO ============= */
.hero-section {
  padding: 72px 64px 60px;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse 60% 50% at 80% 20%, rgba(245, 158, 11, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse 40% 60% at 10% 80%, rgba(59, 130, 246, 0.04) 0%, transparent 60%);
}

.hero-section::before {
  content: '';
  position: absolute;
  top: -100px; right: -100px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(245,158,11,0.05) 0%, transparent 70%);
  pointer-events: none;
}

.hero-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero-tag::before {
  content: '';
  display: inline-block;
  width: 20px; height: 1px;
  background: var(--amber);
}

.hero-title {
  font-family: var(--font-display);
  font-size: 56px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -1.5px;
  color: var(--text-primary);
  margin-bottom: 20px;
}

.hero-sub {
  display: block;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 42px;
}

.hero-desc {
  max-width: 580px;
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.75;
  margin-bottom: 44px;
}

.hero-pillars {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 48px;
  flex-wrap: wrap;
}

.pillar {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 20px 24px;
  min-width: 150px;
  transition: all 0.2s;
}

.pillar:hover {
  border-color: var(--amber-border);
  background: var(--bg-hover);
  transform: translateY(-2px);
}

.pillar-icon { font-size: 24px; margin-bottom: 8px; }

.pillar-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.pillar-desc { font-size: 12px; color: var(--text-muted); }

.pillar-divider {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  color: var(--text-muted);
  padding: 0 4px;
}

/* ============= IMAGE PLACEHOLDERS ============= */
.img-placeholder {
  background: var(--bg-raised);
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  margin: 32px 0;
  overflow: hidden;
  transition: border-color 0.2s;
}

.img-placeholder:hover { border-color: var(--amber-border); }

.hero-img-placeholder { min-height: 280px; }
.img-placeholder.large { min-height: 320px; }
.img-placeholder:not(.hero-img-placeholder):not(.large) { min-height: 220px; }

.img-placeholder-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: inherit;
  gap: 10px;
  padding: 40px;
}

.img-icon { font-size: 32px; opacity: 0.5; }

.img-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--text-secondary);
}

.img-hint {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  max-width: 360px;
  line-height: 1.6;
}

/* ============= SCREENSHOT CARDS ============= */
.screenshot-card {
  background: var(--bg-raised);
  border: 2px solid var(--border-strong);
  border-radius: var(--radius);
  margin: 32px 0;
  overflow: hidden;
}

.screenshot-card img {
  display: block;
  width: 100%;
  height: clamp(300px, 45vw, 600px);
  object-fit: contain;
  background: #0f1117;
}

.screenshot-card figcaption {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 18px 22px 22px;
}

.screenshot-card .img-hint {
  max-width: none;
  text-align: left;
}

.hero-screenshot img {
  height: clamp(350px, 50vw, 700px);
}

/* ============= SECTION DIVIDER ============= */
.section-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
  margin: 0 48px;
}

/* ============= DOC SECTIONS ============= */
.doc-section {
  padding: 60px 64px;
  animation: fadeInUp 0.4s ease both;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.section-num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--amber);
  background: var(--amber-glow);
  border: 1px solid var(--amber-border);
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

.section-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}

.module-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 4px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.module-badge.core {
  background: rgba(245,158,11,0.12);
  border-color: var(--amber-border);
  color: var(--amber);
}

.module-badge.killer {
  background: rgba(239,68,68,0.12);
  border-color: rgba(239,68,68,0.3);
  color: #ef4444;
}

.section-intro {
  color: var(--text-secondary);
  font-size: 15.5px;
  line-height: 1.8;
  max-width: 680px;
  margin-bottom: 32px;
}

.subsection-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 36px 0 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.subsection-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
  max-width: 120px;
}

/* ============= ARCH GRID ============= */
.arch-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.arch-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: all 0.2s;
}

.arch-card:hover {
  border-color: var(--border-strong);
  background: var(--bg-hover);
  transform: translateY(-2px);
}

.arch-card-icon { font-size: 26px; margin-bottom: 12px; }
.arch-card h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.arch-card p { font-size: 13.5px; color: var(--text-secondary); margin-bottom: 14px; }

.tech-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tech-tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--amber-dim);
  background: var(--amber-glow);
  border: 1px solid var(--amber-border);
  padding: 2px 8px;
  border-radius: 3px;
}

/* ============= MVP GRID ============= */
.mvp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 28px;
}

.mvp-col {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.mvp-col-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}

.mvp-status {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.05em;
}

.mvp-status.in { color: var(--green); }
.mvp-status.out { color: var(--red); }

.mvp-list {
  list-style: none;
  padding: 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mvp-list li {
  font-size: 13.5px;
  color: var(--text-secondary);
  padding: 5px 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  display: flex;
  align-items: center;
  gap: 8px;
}

.mvp-in .mvp-list li::before { content: '✓'; color: var(--green); font-size: 12px; font-weight: 700; }
.mvp-out .mvp-list li::before { content: '×'; color: var(--red); font-size: 14px; font-weight: 700; }

/* ============= CALLOUTS ============= */
.callout {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  border-left: 3px solid;
  font-size: 14px;
  line-height: 1.65;
  margin: 24px 0;
}

.callout-amber {
  background: rgba(245,158,11,0.08);
  border-left-color: var(--amber);
  color: #d4aa60;
}

.callout-red {
  background: rgba(239,68,68,0.08);
  border-left-color: var(--red);
  color: #d48080;
}

.callout-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.callout strong { color: var(--text-primary); }

/* ============= FEATURE GRID ============= */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 8px;
}

.feature-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition: all 0.2s;
}

.feature-item:hover {
  border-color: var(--amber-border);
  background: var(--bg-hover);
}

.feature-icon { font-size: 22px; margin-bottom: 10px; }
.feature-item h4 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.feature-item p { font-size: 13px; color: var(--text-secondary); line-height: 1.65; }

/* ============= STATUS FLOW ============= */
.status-flow {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 20px 0;
  margin-bottom: 28px;
}

.status-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 20px;
  min-width: 120px;
}

.status-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
}

.status-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  color: var(--text-primary);
}

.status-desc { font-size: 11px; color: var(--text-muted); text-align: center; }

.status-node.pending .status-dot { background: #6b7280; }
.status-node.inprogress .status-dot { background: var(--amber); box-shadow: 0 0 6px var(--amber); }
.status-node.completed .status-dot { background: var(--green); box-shadow: 0 0 6px var(--green); }
.status-node.cancelled .status-dot { background: var(--red); }

.status-arrow {
  font-size: 18px;
  color: var(--text-muted);
}
.status-arrow.alt { margin-left: 8px; }

/* ============= PRIORITY ============= */
.priority-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 8px;
}

.priority-badge {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

/* ============= ENTITY TABLE ============= */
.entity-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin: 8px 0;
}

.entity-table {
  width: 100%;
  border-collapse: collapse;
}

.entity-table th {
  background: var(--bg-raised);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.entity-table td {
  padding: 12px 16px;
  font-size: 13.5px;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.entity-table tr:last-child td { border-bottom: none; }
.entity-table tr:hover td { background: var(--bg-raised); }
.entity-table code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--amber);
  background: var(--amber-glow);
  padding: 2px 6px;
  border-radius: 3px;
}

/* ============= FORMULA BLOCK ============= */
.formula-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 8px;
}

.formula-row {
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 13.5px;
}

.formula-row.highlight {
  background: var(--amber-glow);
  border: 1px solid var(--amber-border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-top: 4px;
}

.formula-label {
  min-width: 90px;
  color: var(--text-primary);
  font-weight: 500;
}

.formula-op { color: var(--text-muted); }
.formula-val { color: var(--text-secondary); }
.formula-row.highlight .formula-label { color: var(--amber); }
.formula-row.highlight .formula-val { color: var(--amber-dim); }

/* ============= INTEGRATION FLOW ============= */
.integration-flow {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin: 28px 0;
  overflow-x: auto;
  padding-bottom: 4px;
}

.flow-step {
  display: flex;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  min-width: 190px;
  flex: 1;
  align-items: flex-start;
  transition: all 0.2s;
}

.flow-step:hover {
  border-color: var(--amber-border);
  background: var(--bg-hover);
}

.flow-step-num {
  width: 28px; height: 28px;
  background: var(--amber-glow);
  border: 1px solid var(--amber-border);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--amber);
  flex-shrink: 0;
}

.flow-step-body h4 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13.5px;
  color: var(--text-primary);
  margin-bottom: 5px;
}

.flow-step-body p { font-size: 12.5px; color: var(--text-secondary); line-height: 1.6; }

.flow-connector {
  width: 28px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.flow-connector::after {
  content: '→';
  color: var(--amber-dim);
  font-size: 16px;
}

/* ============= DASHBOARD KPIS ============= */
.dashboard-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 8px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.2s;
}

.kpi-card:hover {
  border-color: var(--amber-border);
  background: var(--bg-hover);
}

.kpi-icon { font-size: 22px; }
.kpi-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--text-primary);
}
.kpi-desc { font-size: 12px; color: var(--text-muted); }

/* ============= REPORT LIST ============= */
.report-list { display: flex; flex-direction: column; gap: 12px; }

.report-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  transition: all 0.2s;
}

.report-item:hover { border-color: var(--border-strong); }

.report-icon { font-size: 22px; flex-shrink: 0; margin-top: 2px; }
.report-item strong { font-size: 14px; font-weight: 600; color: var(--text-primary); display: block; margin-bottom: 4px; }
.report-item p { font-size: 13px; color: var(--text-secondary); }

/* ============= ER GRID ============= */
.er-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.er-group {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  min-width: 180px;
  flex: 1;
}

.er-group.accent {
  border-color: var(--amber-border);
  background: rgba(245,158,11,0.05);
}

.er-group-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: var(--text-primary);
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.er-entity {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  padding: 5px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  display: flex;
  align-items: center;
  gap: 6px;
}

.er-entity::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--bg-raised);
  border: 1px solid var(--border-strong);
  border-radius: 1px;
  flex-shrink: 0;
}

.er-group.accent .er-entity::before { border-color: var(--amber-border); }

/* ============= WORKFLOWS ============= */
.workflow-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 18px;
}

.workflow-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.workflow-icon { font-size: 20px; }
.workflow-header h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: var(--text-primary);
}

.workflow-steps {
  list-style: none;
  counter-reset: step-counter;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.workflow-steps li {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 13.5px;
  color: var(--text-secondary);
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  counter-increment: step-counter;
  position: relative;
  padding-left: 32px;
}

.workflow-steps li::before {
  content: counter(step-counter);
  position: absolute;
  left: 0;
  width: 22px; height: 22px;
  background: var(--bg-raised);
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  top: 8px;
  flex-shrink: 0;
}

.step-actor {
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 3px;
  font-weight: 500;
  flex-shrink: 0;
}

.step-actor.manager {
  background: rgba(59,130,246,0.12);
  color: #60a5fa;
  border: 1px solid rgba(59,130,246,0.25);
}

.step-actor.worker {
  background: rgba(34,197,94,0.12);
  color: #4ade80;
  border: 1px solid rgba(34,197,94,0.25);
}

.step-actor.system {
  background: rgba(168,85,247,0.12);
  color: #c084fc;
  border: 1px solid rgba(168,85,247,0.25);
}

/* ============= ROLES ============= */
.roles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.role-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.2s;
}

.role-card:hover { transform: translateY(-3px); box-shadow: 0 12px 32px rgba(0,0,0,0.3); }

.role-card.admin { border-top: 2px solid var(--amber); }
.role-card.manager { border-top: 2px solid var(--blue); }
.role-card.worker { border-top: 2px solid var(--green); }

.role-header {
  padding: 20px 20px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
}

.role-icon { font-size: 22px; }
.role-header h3 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16px;
  color: var(--text-primary);
}

.role-perms {
  list-style: none;
  padding: 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.role-perms li {
  font-size: 12.5px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  display: flex;
  align-items: center;
  gap: 8px;
}

.role-perms li::before {
  font-size: 12px;
  flex-shrink: 0;
}

.role-perms li.allow { color: var(--text-secondary); }
.role-perms li.allow::before { content: '✓'; color: var(--green); font-weight: 700; }

.role-perms li.deny { color: var(--text-muted); }
.role-perms li.deny::before { content: '×'; color: var(--red); font-size: 14px; }

/* ============= PHASE 2 ============= */
.phase2-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.phase2-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.phase2-card:hover {
  border-color: var(--border-strong);
  background: var(--bg-hover);
}

.phase2-icon { font-size: 26px; }
.phase2-card h4 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--text-primary);
}
.phase2-card p { font-size: 13px; color: var(--text-secondary); line-height: 1.6; flex: 1; }

.phase2-complexity {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 3px;
  align-self: flex-start;
}

.phase2-complexity.medium { background: rgba(245,158,11,0.12); color: var(--amber); border: 1px solid var(--amber-border); }
.phase2-complexity.high { background: rgba(239,68,68,0.12); color: #ef4444; border: 1px solid rgba(239,68,68,0.3); }
.phase2-complexity.very-high { background: rgba(168,85,247,0.12); color: #a855f7; border: 1px solid rgba(168,85,247,0.3); }

/* ============= CHALLENGES ============= */
.challenge-list { display: flex; flex-direction: column; gap: 16px; }

.challenge-item {
  display: flex;
  gap: 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  transition: border-color 0.2s;
}

.challenge-item:hover { border-color: var(--border-strong); }

.challenge-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.challenge-icon.danger { background: rgba(239,68,68,0.1); }
.challenge-icon.warning { background: rgba(245,158,11,0.1); }
.challenge-icon.info { background: rgba(59,130,246,0.1); }

.challenge-body h4 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14.5px;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.challenge-body p { font-size: 13.5px; color: var(--text-secondary); line-height: 1.7; margin-bottom: 10px; }

.challenge-tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 3px;
}

/* ============= PRICING ============= */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 36px;
}

.pricing-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  position: relative;
  transition: all 0.2s;
}

.pricing-card:hover { transform: translateY(-3px); }

.pricing-card.featured {
  border-color: var(--amber-border);
  background: linear-gradient(135deg, rgba(245,158,11,0.06), var(--bg-card));
}

.pricing-badge {
  position: absolute;
  top: -10px; right: 18px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--amber);
  color: #000;
  padding: 3px 10px;
  border-radius: 4px;
  font-weight: 500;
}

.pricing-tier {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.pricing-price {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 20px;
  letter-spacing: 0.05em;
}

.pricing-features { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.pricing-features li {
  font-size: 13px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  display: flex;
  align-items: center;
  gap: 8px;
}
.pricing-features li.yes { color: var(--text-secondary); }
.pricing-features li.yes::before { content: '✓'; color: var(--green); font-weight: 700; font-size: 12px; }
.pricing-features li.no { color: var(--text-muted); }
.pricing-features li.no::before { content: '×'; color: var(--text-muted); font-size: 14px; }

/* ============= ADDONS ============= */
.addon-list { display: flex; flex-direction: column; gap: 12px; }

.addon-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.addon-item > span { font-size: 22px; }
.addon-item strong { font-size: 14px; font-weight: 600; color: var(--text-primary); display: block; margin-bottom: 4px; }
.addon-item p { font-size: 13px; color: var(--text-secondary); }

/* ============= FOOTER ============= */
.doc-footer {
  padding: 48px 64px;
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.doc-footer .logo-mark { justify-content: center; }
.footer-tagline { font-size: 14px; color: var(--text-secondary); }
.footer-meta { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }

.footer-links { display: flex; gap: 24px; margin-top: 6px; }
.footer-links a {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--amber); }

/* ============= RESPONSIVE ============= */
@media (max-width: 1200px) {
  .doc-section, .hero-section { padding: 52px 44px; }
  .section-divider { margin: 0 36px; }
  .hero-title { font-size: 48px; }
  .hero-sub { font-size: 36px; }
  .screenshot-card img { height: clamp(260px, 42vw, 520px); }
  .hero-screenshot img { height: clamp(300px, 46vw, 620px); }
}

@media (max-width: 900px) {
  :root { --sidebar-w: 0px; }

  .sidebar {
    transform: translateX(-270px);
    width: 270px;
    z-index: 200;
  }

  .sidebar.open { transform: translateX(0); }

  .content { margin-left: 0; }

  .menu-toggle { display: flex; }
  .doc-badge { display: none; }
  .topbar { padding: 0 16px; }
  .topbar-right { gap: 10px; }
  .version-tag { font-size: 10px; }

  .doc-section, .hero-section { padding: 40px 24px; }
  .section-divider { margin: 0 24px; }

  .arch-grid, .feature-grid, .roles-grid, .phase2-grid, .pricing-grid { grid-template-columns: 1fr; }
  .dashboard-kpis { grid-template-columns: repeat(2, 1fr); }
  .priority-grid { grid-template-columns: 1fr; }

  .hero-title { font-size: 36px; }
  .hero-sub { font-size: 28px; }
  .section-header { flex-wrap: wrap; }
  .section-title { font-size: 24px; }
  .section-intro { font-size: 14.5px; }
  .screenshot-card img { height: clamp(220px, 50vw, 420px); }
  .hero-screenshot img { height: clamp(260px, 54vw, 480px); }

  .integration-flow { flex-direction: column; }
  .flow-connector { width: 100%; height: 20px; justify-content: center; }
  .flow-connector::after { content: '↓'; }

  .status-flow { gap: 8px; }
  .status-node { min-width: calc(50% - 8px); flex: 1; }

  .formula-row {
    flex-wrap: wrap;
    gap: 6px 10px;
  }

  .report-item,
  .callout,
  .feature-item,
  .role-card,
  .kpi-card {
    min-width: 0;
  }

  .entity-table,
  .notif-table-wrap .entity-table {
    min-width: 640px;
  }

  .notif-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
  }
}

@media (max-width: 700px) {
  .topbar { height: 54px; }
  .logo-text { font-size: 15px; }
  .version-tag { display: none; }

  .hero-title {
    font-size: 30px;
    letter-spacing: -1px;
  }

  .hero-sub { font-size: 24px; }
  .hero-desc { font-size: 14px; margin-bottom: 28px; }

  .status-node { min-width: 100%; }
  .status-arrow, .status-arrow.alt { display: none; }

  .doc-footer { padding: 36px 22px; }
  .footer-links { flex-wrap: wrap; justify-content: center; }
}

@media (max-width: 480px) {
  .topbar { padding: 0 12px; }
  .logo-icon { font-size: 18px; }
  .logo-text { font-size: 14px; }

  .doc-section, .hero-section { padding: 30px 16px; }
  .section-divider { margin: 0 16px; }

  .dashboard-kpis { grid-template-columns: 1fr; }
  .hero-pillars { flex-direction: column; }
  .pillar-divider { display: none; }

  .pillar,
  .feature-item,
  .role-card,
  .kpi-card,
  .report-item {
    width: 100%;
  }

  .section-title { font-size: 21px; }
  .subsection-title { font-size: 15px; }

  .screenshot-card figcaption {
    padding: 14px 14px 16px;
    gap: 4px;
  }

  .screenshot-card img {
    height: clamp(180px, 54vw, 300px);
  }

  .hero-screenshot img {
    height: clamp(210px, 62vw, 340px);
  }

  .lightbox-close {
    top: -34px;
    width: 34px;
    height: 34px;
    font-size: 20px;
  }

  .lightbox-caption {
    font-size: 12px;
    padding: 0 8px;
  }
}

/* Sidebar overlay on mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 150;
}

.sidebar-overlay.visible { display: block; }

/* ============= LIGHTBOX MODAL ============= */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.95);
  z-index: 300;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease-out;
}

.lightbox.active {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.lightbox-image {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,0.8);
}

.lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.1);
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  color: #e8eaf0;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.lightbox-close:hover {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.5);
}

.lightbox-caption {
  color: #8b92a8;
  font-size: 14px;
  text-align: center;
  max-width: 600px;
  font-family: var(--font-mono);
}

.screenshot-card img {
  cursor: zoom-in;
  transition: opacity 0.2s, transform 0.2s;
}

.screenshot-card img:hover {
  opacity: 0.9;
  transform: scale(1.02);
}
