/* ============================================================
   Ayuda - Contabilidad
   AY-015 | CT-013 / CT-016 / CT-017 / CT-018 / CT-019
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--fp-bg-body, #1e1e23);
    color: var(--fp-text-primary, #f1f5f9);
    min-height: 100vh;
}

/* ── Header ──────────────────────────────────────────────── */
.ayuda-header {
    background: linear-gradient(135deg, #1d4ed8 0%, #7c3aed 100%);
    padding: 2rem 1.5rem 1.5rem;
    display: flex; align-items: center; gap: 1rem;
}
.ayuda-header-icon { font-size: 2.5rem; opacity: 0.95; }
.ayuda-header-text h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.25rem; }
.ayuda-header-text p  { font-size: 0.9rem; opacity: 0.85; }
.btn-volver {
    margin-left: auto;
    display: flex; align-items: center; gap: 0.4rem;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff; padding: 0.45rem 0.9rem;
    border-radius: 8px; font-size: 0.85rem; font-weight: 600;
    cursor: pointer; text-decoration: none;
    transition: background 0.2s; white-space: nowrap;
}
.btn-volver:hover { background: rgba(255,255,255,0.3); color: #fff; }

/* ── Layout con menú lateral ─────────────────────────────── */
.ayuda-layout-con-menu {
    display: flex; gap: 0; max-width: 100%;
}
.ayuda-layout {
    display: flex; max-width: 1100px; margin: 0 auto;
    padding: 1.5rem; gap: 1.5rem; flex: 1; min-width: 0;
}

/* ── TOC ─────────────────────────────────────────────────── */
.ayuda-toc {
    width: 240px; flex-shrink: 0;
    position: sticky; top: 1rem; align-self: flex-start;
    background: var(--fp-bg-card, #2a2a2e);
    border: 1px solid var(--fp-border, rgba(255,255,255,0.08));
    border-radius: 12px; padding: 1rem;
    max-height: calc(100vh - 2rem); overflow-y: auto;
}
.toc-toggle { display: none; }
.toc-list { list-style: none; }
.toc-list li { margin-bottom: 2px; }
.toc-list a {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.4rem 0.6rem; border-radius: 6px;
    font-size: 0.78rem; color: var(--fp-text-muted, #94a3b8);
    text-decoration: none; transition: all 0.15s;
}
.toc-list a:hover { background: rgba(124,58,237,0.12); color: #c4b5fd; }
.toc-list a.active { background: rgba(124,58,237,0.18); color: #a78bfa; font-weight: 600; }
.toc-list a i { font-size: 0.85rem; width: 18px; text-align: center; flex-shrink: 0; }

/* ── Contenido ───────────────────────────────────────────── */
.ayuda-content { flex: 1; min-width: 0; }

.seccion { margin-bottom: 2.5rem; scroll-margin-top: 1rem; }
.seccion h2 {
    font-size: 1.15rem; font-weight: 700; margin-bottom: 1rem;
    padding-bottom: 0.5rem; border-bottom: 1px solid rgba(124,58,237,0.25);
    display: flex; align-items: center; gap: 0.5rem;
}
.seccion h2 i { color: #a78bfa; }
.seccion h3 { font-size: 0.95rem; font-weight: 700; margin: 1.25rem 0 0.5rem; color: #c4b5fd; }
.seccion p  { font-size: 0.85rem; line-height: 1.6; margin-bottom: 0.75rem; color: var(--fp-text-secondary, #cbd5e1); }
.seccion ul, .seccion ol { padding-left: 1.25rem; margin-bottom: 0.75rem; }
.seccion li { font-size: 0.85rem; line-height: 1.6; margin-bottom: 0.3rem; color: var(--fp-text-secondary, #cbd5e1); }

/* ── Cajas de aviso ──────────────────────────────────────── */
.box {
    padding: 0.85rem 1rem; border-radius: 8px;
    margin-bottom: 1rem; font-size: 0.82rem; line-height: 1.5;
    border-left: 3px solid;
}
.box-info   { background: rgba(59,130,246,0.1);  border-color: #3b82f6; color: #93c5fd; }
.box-tip    { background: rgba(16,185,129,0.1);  border-color: #10b981; color: #6ee7b7; }
.box-warn   { background: rgba(245,158,11,0.1);  border-color: #f59e0b; color: #fcd34d; }
.box-danger { background: rgba(239,68,68,0.1);   border-color: #ef4444; color: #fca5a5; }
.box strong { display: block; margin-bottom: 0.25rem; }

/* ── Tablas ──────────────────────────────────────────────── */
.tabla-comp {
    width: 100%; border-collapse: collapse; margin: 0.75rem 0 1rem;
    font-size: 0.8rem;
}
.tabla-comp th {
    background: rgba(124,58,237,0.15); color: #c4b5fd;
    padding: 0.5rem 0.75rem; text-align: left; font-weight: 600;
    border-bottom: 1px solid rgba(124,58,237,0.25);
}
.tabla-comp td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--fp-border, rgba(255,255,255,0.06));
    color: var(--fp-text-secondary, #cbd5e1);
}
.tabla-comp tr:hover td { background: rgba(255,255,255,0.02); }

/* ── Pasos numerados ─────────────────────────────────────── */
.pasos { counter-reset: paso; list-style: none; padding-left: 0; }
.pasos li {
    counter-increment: paso;
    position: relative; padding-left: 2.5rem;
    margin-bottom: 1rem; font-size: 0.85rem; line-height: 1.6;
    color: var(--fp-text-secondary, #cbd5e1);
}
.pasos li::before {
    content: counter(paso);
    position: absolute; left: 0; top: 0;
    width: 1.8rem; height: 1.8rem; border-radius: 50%;
    background: rgba(124,58,237,0.2); color: #a78bfa;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem; font-weight: 700;
}

/* ── Badges módulo ───────────────────────────────────────── */
.modulo-codigo {
    font-size: 0.65rem; font-weight: 400;
    background: rgba(255,255,255,0.18);
    padding: 2px 7px; border-radius: 4px;
    vertical-align: middle; margin-left: 6px; opacity: 0.8;
}
code {
    background: rgba(124,58,237,0.15);
    color: #c4b5fd; padding: 0 4px; border-radius: 4px;
    font-size: 0.78rem; font-family: 'Courier New', monospace;
}

/* ── Bloque de código ────────────────────────────────────── */
pre {
    background: rgba(0,0,0,0.35); border: 1px solid rgba(124,58,237,0.2);
    border-radius: 8px; padding: 0.85rem 1rem;
    font-size: 0.75rem; overflow-x: auto;
    margin: 0.75rem 0 1rem; line-height: 1.5;
    color: #c4b5fd;
}
pre code { background: none; padding: 0; color: inherit; font-size: inherit; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 820px) {
    .ayuda-layout { flex-direction: column; }
    .ayuda-toc { position: relative; top: 0; width: 100%; max-height: none; }
    .toc-toggle {
        display: flex; align-items: center; gap: 0.4rem;
        background: none; border: none; color: #a78bfa;
        font-size: 0.8rem; font-weight: 600; cursor: pointer;
        padding: 0.3rem 0; width: 100%;
    }
    .toc-list.collapsed { display: none; }
}
@media (max-width: 600px) {
    .ayuda-header { flex-wrap: wrap; }
    .btn-volver { order: -1; margin-left: 0; }
}
