/* User Manual page - standalone, matches the same visual language as
   buildone-install.css (Nunito font, --bo-* tokens, card-based layout)
   but built for a long, multi-section reference page rather than a
   single-screen flow. */

.bo-manual-body {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bo-bg);
    color: var(--bo-dark);
    margin: 0;
    line-height: 1.6;
}

/* ---------- Top bar ---------- */
.bo-manual-topbar {
    background: var(--bo-white);
    border-bottom: 1px solid var(--bo-border);
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 40;
}

.bo-manual-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 18px;
    color: var(--bo-dark);
    text-decoration: none;
}

.bo-manual-brand img { width: 32px; height: 32px; border-radius: var(--bo-radius-sm); }

.bo-manual-toc-toggle {
    display: none;
    background: var(--bo-bg);
    border: 1px solid var(--bo-border);
    border-radius: var(--bo-radius-sm);
    padding: 8px 12px;
    font-weight: 700;
    color: var(--bo-dark);
}

/* ---------- Hero ---------- */
.bo-manual-hero {
    background: linear-gradient(135deg, var(--bo-primary) 0%, var(--bo-accent) 100%);
    color: #fff;
    padding: 56px 24px;
    text-align: center;
}

.bo-manual-hero h1 { font-size: 32px; font-weight: 800; margin: 0 0 12px; }
.bo-manual-hero p { font-size: 16px; opacity: .92; max-width: 640px; margin: 0 auto; }

/* ---------- Layout: sticky TOC + content ---------- */
.bo-manual-layout {
    max-width: 1180px;
    margin: 0 auto;
    padding: 32px 24px 80px;
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 40px;
    align-items: start;
}

.bo-manual-toc {
    position: sticky;
    top: 74px;
    background: var(--bo-white);
    border: 1px solid var(--bo-border);
    border-radius: var(--bo-radius-lg);
    padding: 20px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.bo-manual-toc-title { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--bo-text-muted); margin-bottom: 12px; }

.bo-manual-toc a {
    display: block;
    padding: 7px 10px;
    border-radius: var(--bo-radius-sm);
    color: var(--bo-dark);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 600;
    margin-bottom: 2px;
}
.bo-manual-toc a:hover { background: rgba(var(--bo-primary-rgb), .12); color: var(--bo-primary); }
.bo-manual-toc a.active { background: rgba(var(--bo-primary-rgb), .1); color: var(--bo-primary); }

.bo-manual-content { min-width: 0; }

.bo-manual-section {
    background: var(--bo-white);
    border: 1px solid var(--bo-border);
    border-radius: var(--bo-radius-lg);
    padding: 32px;
    margin-bottom: 24px;
    scroll-margin-top: 84px;
}

.bo-manual-section h2 {
    font-size: 22px;
    font-weight: 800;
    margin: 0 0 6px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.bo-manual-section h2 .bo-manual-icon-badge {
    width: 38px; height: 38px; border-radius: var(--bo-radius);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 16px; flex-shrink: 0;
}
.bo-manual-section .bo-manual-subtitle { color: var(--bo-text-muted); font-size: 14.5px; margin: 0 0 22px; }
.bo-manual-section h3 { font-size: 16px; font-weight: 800; margin: 24px 0 10px; }
.bo-manual-section p { font-size: 14.5px; color: #334155; }
.bo-manual-section ul, .bo-manual-section ol { font-size: 14.5px; color: #334155; padding-left: 20px; }
.bo-manual-section li { margin-bottom: 6px; }

/* ---------- Role permission cards ---------- */
.bo-manual-role-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 8px;
}
.bo-manual-role-card {
    border: 1px solid var(--bo-border);
    border-radius: var(--bo-radius);
    padding: 18px;
    background: var(--bo-bg);
}
.bo-manual-role-card .bo-role-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.bo-manual-role-card .bo-role-icon {
    width: 34px; height: 34px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 14px; flex-shrink: 0;
}
.bo-manual-role-card h4 { font-size: 15px; font-weight: 800; margin: 0; }
.bo-manual-role-card .bo-role-tagline { font-size: 12.5px; color: var(--bo-text-muted); margin-bottom: 12px; }
.bo-manual-role-card ul { list-style: none; padding: 0; margin: 0; font-size: 13px; }
.bo-manual-role-card li { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 7px; }
.bo-manual-role-card li i { margin-top: 3px; flex-shrink: 0; font-size: 12px; }
.bo-manual-role-card li.bo-yes i { color: var(--bo-success); }
.bo-manual-role-card li.bo-no { color: #94A3B8; }
.bo-manual-role-card li.bo-no i { color: #CBD5E1; }

/* ---------- Flow diagram (Lead flow, Booking flow) ---------- */
.bo-manual-flow {
    display: flex;
    align-items: stretch;
    gap: 0;
    overflow-x: auto;
    padding: 8px 2px 16px;
    margin-top: 8px;
}
.bo-manual-flow-step {
    flex: 1 0 128px;
    min-width: 128px;
    text-align: center;
    position: relative;
    padding: 0 6px;
}
.bo-manual-flow-step .bo-flow-dot {
    width: 46px; height: 46px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 800; font-size: 15px;
    margin: 0 auto 10px;
    box-shadow: var(--bo-shadow-sm);
    position: relative;
    z-index: 2;
}
.bo-manual-flow-step .bo-flow-label { font-size: 12.5px; font-weight: 800; margin-bottom: 2px; }
.bo-manual-flow-step .bo-flow-desc { font-size: 11.5px; color: var(--bo-text-muted); line-height: 1.35; }
.bo-manual-flow-step:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 23px;
    left: calc(50% + 30px);
    right: calc(-50% + 30px);
    height: 2px;
    background: var(--bo-border);
    z-index: 1;
}
.bo-manual-flow-branch {
    font-size: 11px;
    color: var(--bo-text-muted);
    text-align: center;
    margin-top: 10px;
    font-style: italic;
}

/* Forces the vertical layout (same styles the mobile breakpoint below
   already uses) regardless of screen width - used for diagrams with
   enough steps that horizontal scrolling gets awkward even on desktop. */
.bo-manual-flow.bo-flow-vertical {
    flex-direction: column;
    overflow-x: visible;
}
.bo-manual-flow.bo-flow-vertical .bo-manual-flow-step {
    text-align: left;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 0 0 22px;
}
.bo-manual-flow.bo-flow-vertical .bo-manual-flow-step .bo-flow-dot { margin: 0; }
.bo-manual-flow.bo-flow-vertical .bo-manual-flow-step:not(:last-child)::after {
    top: 46px; left: 22px; right: auto; bottom: 0;
    width: 2px; height: auto;
}

/* ---------- Simple numbered step list (used for narrower workflows) ---------- */
.bo-manual-steps { list-style: none; padding: 0; margin: 8px 0 0; counter-reset: bo-step; }
.bo-manual-steps li {
    counter-increment: bo-step;
    display: flex; gap: 14px;
    padding: 12px 0;
    border-bottom: 1px dashed var(--bo-border);
}
.bo-manual-steps li:last-child { border-bottom: none; }
.bo-manual-steps li::before {
    content: counter(bo-step);
    flex-shrink: 0;
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--bo-primary);
    color: #fff; font-weight: 800; font-size: 13px;
    display: flex; align-items: center; justify-content: center;
}
.bo-manual-steps strong { display: block; font-size: 14px; margin-bottom: 2px; }
.bo-manual-steps span { font-size: 13.5px; color: #475569; }

/* ---------- Info / tip callouts ---------- */
.bo-manual-callout {
    border-left: 3px solid var(--bo-primary);
    background: rgba(var(--bo-primary-rgb), .06);
    border-radius: 0 var(--bo-radius-sm) var(--bo-radius-sm) 0;
    padding: 12px 16px;
    font-size: 13.5px;
    margin: 16px 0;
}
.bo-manual-callout.bo-warn { border-left-color: var(--bo-warning); background: rgba(245, 158, 11, .08); }
.bo-manual-callout strong { display: block; margin-bottom: 2px; }

/* ---------- Simple two-column table ---------- */
.bo-manual-table { width: 100%; border-collapse: collapse; font-size: 13.5px; margin-top: 8px; }
.bo-manual-table th {
    text-align: left; padding: 10px 12px; background: var(--bo-bg);
    font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--bo-text-muted);
    border-bottom: 2px solid var(--bo-border);
}
.bo-manual-table td { padding: 10px 12px; border-bottom: 1px solid var(--bo-border); vertical-align: top; }
.bo-manual-table tr:last-child td { border-bottom: none; }

/* ---------- Pipeline stage chips (reuses the app's own stage colors) ---------- */
.bo-manual-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px; border-radius: 999px;
    font-size: 12px; font-weight: 700; color: #fff;
}

/* ---------- Back to top ---------- */
.bo-manual-top-link { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--bo-primary); text-decoration: none; font-weight: 700; margin-top: 8px; }

/* ---------- Footer ---------- */
.bo-manual-footer { text-align: center; padding: 28px; color: var(--bo-text-muted); font-size: 13px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .bo-manual-layout { grid-template-columns: 1fr; }
    .bo-manual-toc {
        position: fixed;
        top: 58px; left: 0; right: 0; bottom: 0;
        border-radius: 0;
        max-height: none;
        z-index: 39;
        transform: translateY(-110%);
        transition: transform .2s ease;
    }
    .bo-manual-toc.bo-open { transform: translateY(0); }
    .bo-manual-toc-toggle { display: inline-flex; align-items: center; gap: 8px; }
    .bo-manual-role-grid { grid-template-columns: 1fr; }
    .bo-manual-hero h1 { font-size: 24px; }
    .bo-manual-section { padding: 22px 18px; }
    .bo-manual-flow { flex-direction: column; }
    .bo-manual-flow-step { text-align: left; display: flex; align-items: flex-start; gap: 14px; padding: 0 0 22px; }
    .bo-manual-flow-step .bo-flow-dot { margin: 0; }
    .bo-manual-flow-step:not(:last-child)::after {
        top: 46px; left: 22px; right: auto; bottom: 0;
        width: 2px; height: auto;
    }
}

/* ---------- Dark mode (matches _Layout's own theme toggle) ---------- */
@media (prefers-color-scheme: dark) {
    body.bo-manual-body:not([data-theme="light"]) { background: #0B1220; color: #E2E8F0; --bo-text-muted: #94A3B8; }
    body.bo-manual-body:not([data-theme="light"]) .bo-manual-topbar,
    body.bo-manual-body:not([data-theme="light"]) .bo-manual-section,
    body.bo-manual-body:not([data-theme="light"]) .bo-manual-toc { background: #111A2E; border-color: #1E293B; }
    body.bo-manual-body:not([data-theme="light"]) .bo-manual-role-card { background: #0B1220; border-color: #1E293B; }
    body.bo-manual-body:not([data-theme="light"]) .bo-manual-section p,
    body.bo-manual-body:not([data-theme="light"]) .bo-manual-section li,
    body.bo-manual-body:not([data-theme="light"]) .bo-manual-toc a { color: #CBD5E1; }
    body.bo-manual-body:not([data-theme="light"]) .bo-manual-steps span { color: #94A3B8; }
    body.bo-manual-body:not([data-theme="light"]) .bo-manual-table th { background: #0B1220; }
    body.bo-manual-body:not([data-theme="light"]) .bo-manual-table td { border-color: #1E293B; }
}
