/* ── RESET & BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --brand-dark:    #0f172a;
  --brand-primary: #4f46e5;
  --brand-hover:   #4338ca;
  --brand-light:   #ede9fe;
  --accent-green:  #10b981;
  --text-primary:  #0f172a;
  --text-secondary:#475569;
  --text-muted:    #94a3b8;
  --border:        #e2e8f0;
  --surface:       #f8fafc;
  --white:         #ffffff;
  --sidebar-w:     260px;
  --header-h:      64px;
  --radius:        10px;
  --shadow-sm:     0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow:        0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -1px rgba(0,0,0,.05);
  --shadow-lg:     0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -2px rgba(0,0,0,.04);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--surface);
  min-height: 100vh;
}

/* ── TOP HEADER ── */
.top-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--brand-dark);
  z-index: 100;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 100%;
  padding: 0 20px;
}

/* Brand */
.brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

.brand-icon {
  width: 38px; height: 38px;
  background: var(--brand-primary);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  color: white;
  flex-shrink: 0;
}

.brand-title {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: white;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.brand-sub {
  display: block;
  font-size: 11px;
  color: #94a3b8;
  font-weight: 400;
}

/* Search */
.search-wrap {
  flex: 1;
  max-width: 560px;
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 12px;
  color: #94a3b8;
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 38px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: 0 40px 0 38px;
  color: white;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color .2s, background .2s;
}

.search-input::placeholder { color: #64748b; }

.search-input:focus {
  border-color: var(--brand-primary);
  background: rgba(255,255,255,0.12);
}

.search-kbd {
  position: absolute;
  right: 10px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 11px;
  color: #94a3b8;
  font-family: inherit;
}

.header-meta { margin-left: auto; flex-shrink: 0; }

.version-badge {
  font-size: 11px;
  color: #64748b;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 3px 10px;
  border-radius: 20px;
}

/* ── LAYOUT ── */
.layout {
  display: flex;
  margin-top: var(--header-h);
  min-height: calc(100vh - var(--header-h));
}

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  background: var(--white);
  border-right: 1px solid var(--border);
  padding: 20px 0 40px;
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: #e2e8f0 transparent;
}

.nav-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  padding: 0 18px 10px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  border-radius: 0;
  transition: background .15s, color .15s;
  border-left: 3px solid transparent;
  margin: 1px 0;
}

.nav-item:hover {
  background: var(--surface);
  color: var(--brand-primary);
}

.nav-item.active {
  background: var(--brand-light);
  color: var(--brand-primary);
  border-left-color: var(--brand-primary);
  font-weight: 600;
}

.nav-icon { font-size: 15px; flex-shrink: 0; }

.nav-count {
  margin-left: auto;
  font-size: 11px;
  background: #f1f5f9;
  color: var(--text-muted);
  border-radius: 10px;
  padding: 1px 7px;
  flex-shrink: 0;
}

.nav-item.active .nav-count {
  background: rgba(79,70,229,0.12);
  color: var(--brand-primary);
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px 18px 0;
  border-top: 1px solid var(--border);
}

.sidebar-footer p {
  font-size: 11px;
  color: var(--text-muted);
}

/* ── MAIN CONTENT ── */
.main-content {
  flex: 1;
  padding: 32px 40px 80px;
  max-width: 900px;
}

/* Search results bar */
.search-results-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 10px 16px;
  margin-bottom: 24px;
  font-size: 13px;
  color: #92400e;
}

.clear-search {
  margin-left: auto;
  background: none;
  border: 1px solid #f59e0b;
  border-radius: 5px;
  padding: 3px 10px;
  font-size: 12px;
  color: #92400e;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s;
}

.clear-search:hover { background: #fef3c7; }

/* No results */
.no-results-inner {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}

.no-results-inner h3 {
  font-size: 18px;
  color: var(--text-secondary);
  margin: 16px 0 8px;
}

.no-results-inner p { font-size: 14px; }

/* ── SECTIONS (tab mode: one visible at a time) ── */
.section {
  display: none;
  margin-bottom: 56px;
}
.section.active { display: block; }

/* While search is running, show all matching sections */
.main-content.search-mode .section         { display: block; }
.main-content.search-mode .section.all-hidden { display: none; }


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

.section-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.section-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.section-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ── CARDS ── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s;
}

.card:hover { box-shadow: var(--shadow); }

.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.card-body {
  font-size: 13.5px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.65;
}

/* Tags */
.tag {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  border-radius: 4px;
  padding: 3px 8px;
  white-space: nowrap;
}

.tag-process   { background: #dbeafe; color: #1e40af; }
.tag-template  { background: #fce7f3; color: #9d174d; }
.tag-checklist { background: #dcfce7; color: #14532d; }
.tag-reference { background: #fef3c7; color: #78350f; }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
}

.badge-blue   { background: #dbeafe; color: #1e40af; }
.badge-green  { background: #dcfce7; color: #14532d; }
.badge-yellow { background: #fef9c3; color: #713f12; }
.badge-red    { background: #fee2e2; color: #991b1b; }

/* ── STEPS ── */
.steps { display: flex; flex-direction: column; gap: 12px; }

.step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.step-num {
  width: 26px; height: 26px;
  background: var(--brand-primary);
  color: white;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.step > div {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.step strong { color: var(--text-primary); }

/* ── CALLOUTS ── */
.callout {
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 13px;
  margin-top: 16px;
  line-height: 1.6;
}

.callout-tip     { background: #f0fdf4; border-left: 4px solid #10b981; color: #065f46; }
.callout-warning { background: #fffbeb; border-left: 4px solid #f59e0b; color: #78350f; }

.callout strong { font-weight: 600; }

/* ── TABLE ── */
.table-wrap { overflow-x: auto; }

.playbook-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.playbook-table th {
  text-align: left;
  padding: 10px 12px;
  background: #f8fafc;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

.playbook-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9;
  color: var(--text-secondary);
  vertical-align: top;
  line-height: 1.5;
}

.playbook-table tr:last-child td { border-bottom: none; }

.playbook-table tr:hover td { background: #f8fafc; }

/* ── CHECKLIST ── */
.checklist { display: flex; flex-direction: column; gap: 8px; }

.check-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.check-item input[type="checkbox"] {
  width: 16px; height: 16px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--brand-primary);
  cursor: pointer;
}

.check-item input:checked + span {
  text-decoration: line-through;
  color: var(--text-muted);
}

/* ── TEMPLATE CARDS ── */
.template-card .card-body { margin-bottom: 12px; }

.template-box {
  position: relative;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.template-box pre {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12.5px;
  line-height: 1.75;
  color: #334155;
  padding: 16px 52px 16px 18px;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}

.copy-btn {
  position: absolute;
  top: 10px; right: 10px;
  background: var(--brand-primary);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 11.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s, transform .1s;
  z-index: 2;
}

.copy-btn:hover { background: var(--brand-hover); }
.copy-btn:active { transform: scale(.96); }
.copy-btn.copied { background: #10b981; }

.text-muted { color: var(--text-muted); font-size: 12.5px; }

.template-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

/* ── METRICS GRID ── */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.metric-card {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
}

.metric-val {
  font-size: 24px;
  font-weight: 700;
  color: var(--brand-primary);
  letter-spacing: -0.02em;
}

.metric-label {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.4;
}

/* ── PIPELINE ── */
.pipeline {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  flex-wrap: wrap;
}

.pipeline-stage {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  flex: 1;
  min-width: 180px;
}

.pipeline-icon {
  width: 28px; height: 28px;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.pipeline-info strong {
  display: block;
  font-size: 13px;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.pipeline-info span {
  font-size: 11px;
  color: var(--text-muted);
}

.pipeline-info p {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 6px;
  line-height: 1.5;
}

.pipeline-arrow {
  font-size: 20px;
  color: var(--text-muted);
  align-self: center;
  padding-top: 0;
  flex-shrink: 0;
}

/* ── STAR GRID ── */
.star-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.star-item {
  display: flex;
  gap: 12px;
  background: #f8fafc;
  border-radius: 8px;
  border-left: 4px solid #e2e8f0;
  padding: 14px;
  align-items: flex-start;
}

.star-letter {
  width: 32px; height: 32px;
  background: var(--brand-light);
  color: var(--brand-primary);
  border-radius: 8px;
  font-size: 16px;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.star-s { border-left-color: #3b82f6; }
.star-t { border-left-color: #8b5cf6; }
.star-a { border-left-color: #10b981; }
.star-r { border-left-color: #f59e0b; }

.star-item strong { display: block; font-size: 13px; margin-bottom: 4px; }
.star-item p { font-size: 12.5px; color: var(--text-secondary); }

/* ── SCENARIO LIST ── */
.scenario-list { display: flex; flex-direction: column; gap: 14px; }

.scenario {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.scenario-label {
  background: #f8fafc;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 1px solid var(--border);
}

.scenario-response {
  padding: 12px 14px;
  font-size: 13px;
  color: #334155;
  line-height: 1.7;
  font-style: italic;
  background: var(--white);
}

/* ── TIMELINE ── */
.timeline { display: flex; flex-direction: column; gap: 0; }

.timeline-item {
  display: flex;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid #f1f5f9;
  align-items: flex-start;
}

.timeline-item:last-child { border-bottom: none; }

.time-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--brand-primary);
  min-width: 70px;
  padding-top: 2px;
  flex-shrink: 0;
}

.time-content {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.time-content strong { color: var(--text-primary); }

/* ── RAMP GRID ── */
.ramp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

.ramp-col {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.ramp-header {
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
}

.ramp-col ul {
  list-style: none;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ramp-col li {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  padding-left: 14px;
  position: relative;
}

.ramp-col li::before {
  content: '·';
  position: absolute;
  left: 0;
  color: var(--text-muted);
}

/* ── SURVEY BLOCK ── */
.survey-block {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
}

.survey-block strong {
  display: block;
  font-size: 13px;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.survey-block ol {
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.survey-block li {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ── TWO-COL CHECKS ── */
.two-col-checks { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.check-group-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

/* ── QUESTION LIST ── */
.question-list { display: flex; flex-direction: column; gap: 2px; }

.q-category {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--brand-primary);
  margin: 16px 0 8px;
}

.question-list ul {
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.question-list li {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ── OFFBOARDING TWO-COL ── */
.two-col-checks .checklist { margin-bottom: 0; }

/* ── HIGHLIGHT (search) ── */
mark.search-highlight {
  background: #fef08a;
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}

/* ── HIDDEN (search) ── */
.card.search-hidden { display: none; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

/* ── HAMBURGER & MOBILE NAV ── */
.hamburger {
  display: none;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  flex-shrink: 0;
  line-height: 0;
}
.hamburger:hover { background: rgba(255,255,255,0.1); }

.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  top: var(--header-h);
  background: rgba(0,0,0,0.45);
  z-index: 150;
}

.sidebar-close {
  display: none;
  justify-content: flex-end;
  padding: 10px 14px 0;
}
.sidebar-close-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 17px;
  line-height: 1;
  padding: 3px 10px;
  cursor: pointer;
  font-family: inherit;
}
.sidebar-close-btn:hover { background: var(--surface); color: var(--text-primary); }

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .main-content { padding: 24px 24px 60px; }
  .ramp-grid { grid-template-columns: 1fr; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .hamburger { display: flex; align-items: center; justify-content: center; }
  .sidebar {
    position: fixed;
    top: var(--header-h);
    left: 0;
    bottom: 0;
    width: var(--sidebar-w);
    height: auto;
    z-index: 200;
    transform: translateX(-100%);
    transition: transform .25s cubic-bezier(.4,0,.2,1);
  }
  .sidebar.open { transform: translateX(0); }
  .nav-overlay.active { display: block; }
  .sidebar-close { display: flex; }
  .layout { display: block; }
  .main-content { padding: 20px 16px 60px; max-width: 100%; }
  .star-grid { grid-template-columns: 1fr; }
  .two-col-checks { grid-template-columns: 1fr; }
  .pipeline { flex-direction: column; }
  .pipeline-arrow { display: none; }
  .header-inner { gap: 12px; }
  .brand-sub { display: none; }
  .search-kbd { display: none; }
  .metrics-grid { grid-template-columns: repeat(3, 1fr); }
  .header-meta { display: none; }
}

/* ── GO TO TOP ── */
.go-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  background: var(--brand-primary);
  color: white;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(79,70,229,.35);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .2s, transform .2s, background .15s;
  z-index: 300;
  pointer-events: none;
}
.go-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.go-top:hover { background: var(--brand-hover); }

/* ── AUTH ── */
.logout-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  color: #94a3b8;
  font-size: 12px;
  font-family: inherit;
  padding: 4px 12px;
  cursor: pointer;
  transition: background .15s, color .15s;
  margin-left: 8px;
}
.logout-btn:hover { background: rgba(255,255,255,0.14); color: white; }

/* ── PLACEHOLDER TAGS ── */
.placeholder { color: #dc2626; font-weight: 600; }
