/* ============================================================
   Ayuda - Facturación Móvil
   AY-014
   ============================================================ */
*, *::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, #10b981 0%, #047857 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 2 columnas ---------- */
.ayuda-layout {
    display: flex; max-width: 1200px; margin: 0 auto;
    padding: 1.5rem; gap: 1.5rem;
}

/* ---------- Sidebar TOC ---------- */
.ayuda-toc {
    width: 260px; 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-grupo {
    font-size: 0.65rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.08em; color: #34d399; margin: 0.75rem 0 0.35rem;
    padding-left: 0.6rem;
}
.toc-grupo:first-child { margin-top: 0; }
.toc-list { list-style: none; }
.toc-list li { margin-bottom: 2px; }
.toc-list a {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.35rem 0.6rem; border-radius: 6px;
    font-size: 0.76rem; color: var(--fp-text-muted, #94a3b8);
    text-decoration: none; transition: all 0.15s;
}
.toc-list a:hover { background: rgba(16,185,129,0.1); color: #6ee7b7; }
.toc-list a.active { background: rgba(16,185,129,0.15); color: #34d399; font-weight: 600; }
.toc-list a i { font-size: 0.82rem; width: 18px; text-align: center; flex-shrink: 0; }
.toc-toggle { display: none; }

/* ---------- Contenido principal ---------- */
.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(16,185,129,0.2);
    display: flex; align-items: center; gap: 0.5rem;
}
.seccion h2 i { color: #34d399; }
.seccion h3 { font-size: 0.95rem; font-weight: 700; margin: 1.25rem 0 0.5rem; color: #6ee7b7; }
.seccion h4 { font-size: 0.85rem; font-weight: 600; margin: 1rem 0 0.4rem; color: #a7f3d0; }
.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); }

/* ---------- Callout boxes ---------- */
.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; }

/* ---------- Tabla ---------- */
.tabla-comp {
    width: 100%; border-collapse: collapse; margin: 0.75rem 0 1rem;
    font-size: 0.8rem;
}
.tabla-comp th {
    background: rgba(16,185,129,0.15); color: #6ee7b7;
    padding: 0.5rem 0.75rem; text-align: left; font-weight: 600;
    border-bottom: 1px solid rgba(16,185,129,0.2);
}
.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); }

/* ---------- Tecla (kbd) ---------- */
kbd {
    display: inline-block;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 4px;
    padding: 1px 6px;
    font-family: 'SFMono-Regular', Consolas, 'Courier New', monospace;
    font-size: 0.78rem;
    font-weight: 600;
    color: #e2e8f0;
    line-height: 1.6;
}

/* ---------- Steps ---------- */
.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(16,185,129,0.2); color: #34d399;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem; font-weight: 700;
}

/* ---------- Flujo visual ---------- */
.flujo { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.75rem 0 1rem; }
.flujo-paso {
    display: flex; align-items: center; gap: 0.4rem;
    background: var(--fp-bg-card, #2a2a2e);
    border: 1px solid var(--fp-border, rgba(255,255,255,0.08));
    border-radius: 8px; padding: 0.5rem 0.75rem;
    font-size: 0.78rem; color: var(--fp-text-secondary, #cbd5e1);
}
.flujo-paso i { color: #34d399; }
.flujo-flecha { display: flex; align-items: center; color: #4b5563; font-size: 0.9rem; }

/* ---------- Panel grid ---------- */
.panel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin: 0.75rem 0 1rem;
}
.panel-card {
    background: var(--fp-bg-card, #2a2a2e);
    border: 1px solid var(--fp-border, rgba(255,255,255,0.08));
    border-radius: 10px;
    padding: 1rem;
}
.panel-card h4 {
    font-size: 0.85rem; font-weight: 700; margin: 0 0 0.5rem;
    display: flex; align-items: center; gap: 0.4rem;
    color: #6ee7b7;
}
.panel-card h4 i { color: #34d399; }
.panel-card ul { padding-left: 1rem; margin: 0; }
.panel-card li { font-size: 0.8rem; margin-bottom: 0.2rem; }

/* ---------- 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: #34d399;
        font-size: 0.8rem; font-weight: 600; cursor: pointer;
        padding: 0.3rem 0; width: 100%;
    }
    .toc-list.collapsed { display: none; }
    .panel-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .ayuda-header { flex-wrap: wrap; }
    .btn-volver { order: -1; margin-left: 0; }
    .flujo { flex-direction: column; }
    .flujo-flecha { transform: rotate(90deg); justify-content: center; }
}
