/* =============================================================
   AuditPro User Manual — bespoke theme over Bootstrap 5
   Navy (#0b3d5c) + Gold (#d4a437) palette · matches marketing site
   ============================================================= */

:root {
    --c-primary:        #0b3d5c;
    --c-primary-dark:   #06243a;
    --c-accent:         #d4a437;
    --c-accent-dark:    #b58724;
    --c-text:           #1a1f2b;
    --c-muted:          #5a6677;
    --c-bg:             #f7f9fb;
    --c-border:         #e3e8ee;
    --c-success:        #1d6b3a;
    --c-warning:        #b58724;
    --c-danger:         #8b1c1c;

    --shadow-sm: 0 1px 2px rgba(11,61,92,0.06);
    --shadow-md: 0 4px 16px rgba(11,61,92,0.08);
    --shadow-lg: 0 18px 48px rgba(11,61,92,0.14);

    --sidebar-w: 320px;
}

html, body { height: 100%; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
    color: var(--c-text);
    background: #ffffff;
    -webkit-font-smoothing: antialiased;
    line-height: 1.65;
    font-size: 16px;
}

a { color: var(--c-primary); text-decoration: none; transition: color .15s; }
a:hover { color: var(--c-accent-dark); }
img, svg { max-width: 100%; height: auto; }

/* ===== top nav ===== */
.man-nav {
    position: sticky; top: 0; z-index: 100;
    background: var(--c-primary);
    color: #ffffff;
    padding: 12px 24px;
    border-bottom: 3px solid var(--c-accent);
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px;
}
.man-nav-brand {
    display: flex; align-items: center; gap: 12px;
    color: #ffffff;
    font-weight: 700;
    font-size: 1.05rem;
}
.man-nav-brand .mark {
    width: 32px; height: 32px;
    background: linear-gradient(135deg, var(--c-accent), var(--c-accent-dark));
    border-radius: 7px;
    display: flex; align-items: center; justify-content: center;
    color: var(--c-primary-dark);
    font-weight: 800;
    font-size: 18px;
}
.man-nav-title {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.78);
    font-weight: 500;
}
.man-nav-progress {
    flex: 1;
    max-width: 320px;
    height: 6px;
    background: rgba(255,255,255,0.12);
    border-radius: 999px;
    overflow: hidden;
    margin: 0 18px;
}
.man-nav-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--c-accent), var(--c-accent-dark));
    border-radius: 999px;
    transition: width 0.5s;
}
.man-nav-meta {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.7);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 600;
}
.man-nav-burger {
    display: none;
    background: transparent;
    color: #ffffff;
    border: 1.5px solid rgba(255,255,255,0.35);
    border-radius: 6px;
    padding: 4px 12px;
    font-size: 18px;
    cursor: pointer;
}

/* ===== layout: sidebar + content ===== */
.man-layout {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    min-height: calc(100vh - 64px);
}
.man-sidebar {
    background: var(--c-bg);
    border-right: 1px solid var(--c-border);
    padding: 24px 0;
    position: sticky;
    top: 64px;
    height: calc(100vh - 64px);
    overflow-y: auto;
    z-index: 50;
}
.man-sidebar-section {
    padding: 0 20px 8px;
    font-size: 11px;
    font-weight: 700;
    color: var(--c-muted);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    margin-top: 18px;
}
.man-sidebar-section:first-child { margin-top: 0; }
.man-sidebar-list { list-style: none; padding: 0; margin: 0; }
.man-sidebar-list li { display: block; }
.man-sidebar-link {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 9px 20px 9px 22px;
    color: var(--c-text);
    border-left: 3px solid transparent;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    font-size: 0.92rem;
    line-height: 1.4;
}
.man-sidebar-link:hover {
    background: #ffffff;
    color: var(--c-primary);
    border-left-color: var(--c-accent);
}
.man-sidebar-link.is-active {
    background: #ffffff;
    color: var(--c-primary);
    border-left-color: var(--c-accent);
    font-weight: 600;
}
.man-sidebar-link .step-pill {
    flex-shrink: 0;
    width: 26px; height: 26px;
    border-radius: 50%;
    background: rgba(11,61,92,0.08);
    color: var(--c-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 11px;
}
.man-sidebar-link.is-active .step-pill {
    background: linear-gradient(135deg, var(--c-accent), var(--c-accent-dark));
    color: var(--c-primary-dark);
}
.man-sidebar-link.is-done .step-pill {
    background: rgba(40,167,69,0.16);
    color: var(--c-success);
}
.man-sidebar-link.is-done .step-pill::before { content: '✓ '; }
.man-sidebar-link.is-done .step-pill { font-size: 0; line-height: 26px; }
.man-sidebar-link.is-done .step-pill::before { font-size: 14px; }

/* ===== content area ===== */
.man-content {
    padding: 36px 56px 80px;
    max-width: 980px;
    margin: 0 auto;
    width: 100%;
}
.man-breadcrumb {
    font-size: 0.82rem;
    color: var(--c-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}
.man-breadcrumb .sep { opacity: 0.4; margin: 0 8px; }

.page-header {
    border-bottom: 2px solid var(--c-accent);
    padding-bottom: 24px;
    margin-bottom: 32px;
}
.page-header h1 {
    font-size: 2.4rem;
    color: var(--c-primary);
    margin: 0 0 12px;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.15;
}
.page-header .lede {
    font-size: 1.15rem;
    color: var(--c-muted);
    line-height: 1.5;
    max-width: 720px;
    margin: 0;
}

.page-stepnum {
    display: inline-block;
    padding: 4px 14px;
    background: linear-gradient(135deg, var(--c-accent), var(--c-accent-dark));
    color: var(--c-primary-dark);
    font-size: 12px;
    font-weight: 800;
    border-radius: 999px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 10px;
}

/* ===== content typography ===== */
.man-content h2 {
    font-size: 1.65rem;
    color: var(--c-primary);
    font-weight: 700;
    margin-top: 48px;
    margin-bottom: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--c-border);
    line-height: 1.2;
}
.man-content h2:first-child,
.man-content section > h2:first-child {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
}
.man-content h3 {
    font-size: 1.25rem;
    color: var(--c-primary);
    font-weight: 700;
    margin-top: 28px;
    margin-bottom: 10px;
}
.man-content h4 {
    font-size: 1.05rem;
    color: var(--c-primary);
    font-weight: 700;
    margin-top: 20px;
    margin-bottom: 6px;
}
.man-content p { margin: 10px 0 14px; }
.man-content ul, .man-content ol { margin: 10px 0 14px; padding-left: 22px; }
.man-content li { margin-bottom: 5px; }
.man-content code {
    background: rgba(11,61,92,0.06);
    color: var(--c-primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.88em;
    font-family: "Menlo", "Consolas", monospace;
}
.man-content strong { color: var(--c-primary); }

/* ===== call-out boxes ===== */
.callout {
    margin: 18px 0;
    padding: 16px 20px 16px 56px;
    border-radius: 10px;
    position: relative;
    border-left: 4px solid;
    background: var(--c-bg);
}
.callout::before {
    position: absolute;
    left: 18px;
    top: 16px;
    font-size: 24px;
    line-height: 1;
}
.callout.try-this {
    background: rgba(40,167,69,0.08);
    border-left-color: var(--c-success);
}
.callout.try-this::before { content: '✓'; color: var(--c-success); font-weight: 800; }
.callout.try-this .title {
    color: var(--c-success);
}
.callout.watch-out {
    background: rgba(220,53,69,0.06);
    border-left-color: var(--c-danger);
}
.callout.watch-out::before { content: '⚠'; color: var(--c-danger); }
.callout.watch-out .title {
    color: var(--c-danger);
}
.callout.tip {
    background: rgba(212,164,55,0.10);
    border-left-color: var(--c-accent-dark);
}
.callout.tip::before { content: '💡'; }
.callout.tip .title {
    color: var(--c-accent-dark);
}
.callout.note {
    background: rgba(11,61,92,0.05);
    border-left-color: var(--c-primary);
}
.callout.note::before { content: 'ℹ'; color: var(--c-primary); font-weight: 700; }
.callout.note .title { color: var(--c-primary); }
.callout .title {
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
    display: block;
}
.callout p:first-of-type { margin-top: 0; }
.callout p:last-of-type { margin-bottom: 0; }

/* ===== screen mock-ups ===== */
.screen-mock {
    background: #ffffff;
    border: 1px solid var(--c-border);
    border-radius: 12px;
    padding: 14px;
    box-shadow: var(--shadow-md);
    margin: 24px 0;
}
.screen-mock .label {
    font-size: 11px;
    color: var(--c-muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 8px;
}
.screen-mock svg, .screen-mock img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

/* ===== field-callout cards ===== */
.fields-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
    margin: 20px 0;
}
.field-card {
    background: #ffffff;
    border: 1px solid var(--c-border);
    border-radius: 10px;
    padding: 14px 16px;
    border-left: 3px solid var(--c-accent);
}
.field-card .num {
    display: inline-block;
    width: 24px; height: 24px;
    background: linear-gradient(135deg, var(--c-accent), var(--c-accent-dark));
    color: var(--c-primary-dark);
    border-radius: 50%;
    text-align: center;
    line-height: 24px;
    font-weight: 800;
    font-size: 12px;
    margin-right: 8px;
}
.field-card .name {
    color: var(--c-primary);
    font-weight: 700;
    font-size: 0.95rem;
}
.field-card .meta {
    margin-top: 4px;
    font-size: 0.78rem;
    color: var(--c-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.field-card p {
    margin: 8px 0 0;
    font-size: 0.92rem;
    color: var(--c-text);
}

/* ===== ISA reference badge ===== */
.std-badge {
    display: inline-block;
    padding: 3px 10px;
    background: rgba(212,164,55,0.16);
    color: var(--c-accent-dark);
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    margin-right: 4px;
    margin-bottom: 4px;
}
.std-badges {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px dashed var(--c-border);
}
.std-badges .std-label {
    display: block;
    font-size: 11px;
    color: var(--c-muted);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 6px;
}

/* ===== numbered step block ===== */
.steplist {
    list-style: none;
    counter-reset: step;
    padding: 0;
    margin: 22px 0;
}
.steplist li {
    counter-increment: step;
    position: relative;
    padding: 14px 14px 14px 64px;
    background: #ffffff;
    border: 1px solid var(--c-border);
    border-radius: 10px;
    margin-bottom: 10px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s, box-shadow 0.15s;
}
.steplist li:hover {
    transform: translateX(2px);
    box-shadow: var(--shadow-md);
}
.steplist li::before {
    content: counter(step);
    position: absolute;
    left: 16px; top: 50%;
    transform: translateY(-50%);
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--c-primary), var(--c-primary-dark));
    color: var(--c-accent);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800;
    font-size: 14px;
}

/* ===== inter-page nav ===== */
.page-nav {
    margin-top: 64px;
    padding-top: 28px;
    border-top: 1px solid var(--c-border);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.page-nav-link {
    display: block;
    padding: 18px 22px;
    background: var(--c-bg);
    border: 1px solid var(--c-border);
    border-radius: 12px;
    color: var(--c-text);
    transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.page-nav-link:hover {
    transform: translateY(-2px);
    border-color: var(--c-accent);
    box-shadow: var(--shadow-md);
    color: var(--c-text);
}
.page-nav-link .dir {
    font-size: 0.72rem;
    color: var(--c-muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 700;
    margin-bottom: 4px;
    display: block;
}
.page-nav-link .label {
    color: var(--c-primary);
    font-weight: 700;
    font-size: 1.05rem;
}
.page-nav-link.next { text-align: right; }
.page-nav-link.disabled { opacity: 0.4; pointer-events: none; }

/* ===== ISA / regulatory badges ===== */
.isa-badge {
    display: inline-block;
    padding: 4px 12px;
    margin: 0 6px 8px 0;
    border-radius: 14px;
    background: linear-gradient(135deg, #fff7e6, #ffe7b5);
    border: 1px solid #d4a437;
    color: #6b4d10;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* ===== Risk pills ===== */
.risk-pill {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.risk-pill.high { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.risk-pill.medium { background: #fef3c7; color: #854d0e; border: 1px solid #fcd34d; }
.risk-pill.low { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }

/* ===== Role / general reference table ===== */
.role-table {
    width: 100%;
    border-collapse: collapse;
    margin: 18px 0;
    font-size: 13px;
    background: #ffffff;
    border: 1px solid var(--c-border);
    border-radius: 8px;
    overflow: hidden;
}
.role-table thead {
    background: var(--c-primary);
    color: #ffffff;
}
.role-table th {
    padding: 10px 14px;
    text-align: left;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.role-table td {
    padding: 9px 14px;
    border-top: 1px solid #eef2f5;
    color: var(--c-text);
    vertical-align: top;
}
.role-table tbody tr:hover { background: #f9fbfd; }

/* ===== Definition list (glossary) ===== */
dl dt {
    margin-top: 14px;
    color: var(--c-primary);
    font-weight: 700;
}
dl dd {
    margin-left: 0;
    margin-bottom: 8px;
    color: var(--c-text);
    line-height: 1.6;
}

/* ===== TOC roadmap on landing page ===== */
.roadmap {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
    margin: 32px 0;
}
.roadmap-card {
    background: #ffffff;
    border: 1px solid var(--c-border);
    border-radius: 14px;
    padding: 20px 22px;
    transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
    border-top: 4px solid var(--c-accent);
    position: relative;
    color: var(--c-text);
}
.roadmap-card:hover {
    transform: translateY(-3px);
    border-color: var(--c-accent);
    box-shadow: var(--shadow-lg);
    color: var(--c-text);
}
.roadmap-card .roadmap-step {
    font-size: 11px;
    color: var(--c-accent-dark);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-weight: 800;
    margin-bottom: 8px;
}
.roadmap-card h3 {
    font-size: 1.15rem;
    color: var(--c-primary);
    margin: 0 0 8px;
    font-weight: 700;
}
.roadmap-card p {
    color: var(--c-muted);
    font-size: 0.92rem;
    margin: 0;
    line-height: 1.5;
}
.roadmap-card .roadmap-meta {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed var(--c-border);
    font-size: 0.75rem;
    color: var(--c-accent-dark);
    font-weight: 700;
    letter-spacing: 0.06em;
}

/* ===== hero block on landing ===== */
.hero-block {
    background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-primary-dark) 100%);
    color: #ffffff;
    border-radius: 18px;
    padding: 48px;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
}
.hero-block::before {
    content: ''; position: absolute; inset: 0;
    background:
        radial-gradient(circle at 80% 20%, rgba(212,164,55,0.18) 0%, transparent 45%),
        radial-gradient(circle at 10% 90%, rgba(212,164,55,0.10) 0%, transparent 40%);
    pointer-events: none;
}
.hero-block > * { position: relative; z-index: 1; }
.hero-block h1 {
    color: #ffffff;
    font-size: 2.5rem;
    margin: 0 0 16px;
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: -0.02em;
}
.hero-block .lede {
    color: rgba(255,255,255,0.86);
    font-size: 1.15rem;
    max-width: 60ch;
    margin: 0 0 20px;
}
.hero-block .meta-pill {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(212,164,55,0.18);
    color: var(--c-accent);
    border: 1px solid rgba(212,164,55,0.4);
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* ===== keyboard kbd-style chip ===== */
kbd, .kbd {
    background: linear-gradient(180deg, #ffffff 0%, #eff2f6 100%);
    border: 1px solid #c9d1da;
    border-bottom-width: 2px;
    border-radius: 5px;
    padding: 1px 8px;
    font-family: "Menlo", "Consolas", monospace;
    font-size: 0.85em;
    color: var(--c-text);
    box-shadow: 0 1px 0 rgba(0,0,0,0.04);
}

/* ===== responsive ===== */
@media (max-width: 1024px) {
    .man-content { padding: 28px 32px 64px; }
}
@media (max-width: 860px) {
    :root { --sidebar-w: 0px; }
    .man-layout { grid-template-columns: 1fr; }
    .man-sidebar {
        position: fixed;
        top: 64px; left: 0;
        width: 320px;
        max-width: 86vw;
        height: calc(100vh - 64px);
        transform: translateX(-100%);
        transition: transform 0.3s;
        box-shadow: var(--shadow-lg);
    }
    .man-sidebar.is-open { transform: translateX(0); }
    .man-nav-burger { display: inline-block; }
    .man-nav-progress { display: none; }
    .man-content { padding: 24px 20px 60px; }
    .page-header h1 { font-size: 1.85rem; }
    .hero-block { padding: 32px 26px; }
    .hero-block h1 { font-size: 2rem; }
    .page-nav { grid-template-columns: 1fr; }
}

/* ===== print ===== */
@media print {
    .man-nav, .man-sidebar, .page-nav { display: none !important; }
    .man-layout { display: block; }
    .man-content { padding: 0; max-width: 100%; }
    body { font-size: 11pt; }
    .roadmap-card, .field-card, .callout, .steplist li { page-break-inside: avoid; }
    .hero-block { background: var(--c-primary) !important; color: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .screen-mock { page-break-inside: avoid; }
}
