/* ============================================================
   Ayuda - Usuarios y Licencias
   AY-014
   Paleta: negros, turquesas oscuros, azules y blanco
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --ay-bg:        #000000;
    --ay-card:      #0a0e14;
    --ay-card-2:    #0f1621;
    --ay-border:    rgba(13, 148, 172, 0.25);
    --ay-text:      #ffffff;
    --ay-text-soft: #e0f2fe;
    --ay-blue:      #3b82f6;
    --ay-blue-dk:   #1d4ed8;
    --ay-blue-lt:   #60a5fa;
    --ay-teal:      #0d9488;
    --ay-teal-dk:   #0f766e;
    --ay-teal-lt:   #2dd4bf;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--ay-bg);
    color: var(--ay-text);
    min-height: 100vh;
    font-size: 16px;
}

.ayuda-header {
    background: linear-gradient(135deg, #000000 0%, #0f766e 50%, #1d4ed8 100%);
    padding: 2rem 1.5rem 1.5rem;
    display: flex; align-items: center; gap: 1rem;
    border-bottom: 1px solid var(--ay-border);
}
.ayuda-header-icon { font-size: 2.5rem; color: #fff; opacity: 0.95; }
.ayuda-header-text h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.25rem; color: #fff; }
.ayuda-header-text p  { font-size: 0.9rem; color: #e0f2fe; opacity: 0.9; }
.btn-volver {
    margin-left: auto;
    display: flex; align-items: center; gap: 0.4rem;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.35);
    color: #fff; padding: 0.5rem 1rem;
    border-radius: 8px; font-size: 0.9rem; font-weight: 600;
    cursor: pointer; text-decoration: none;
    transition: background 0.2s; white-space: nowrap;
}
.btn-volver:hover { background: rgba(255,255,255,0.22); color: #fff; }

.ayuda-layout {
    display: flex; max-width: 1100px; margin: 0 auto;
    padding: 1.5rem; gap: 1.5rem;
}

.ayuda-toc {
    width: 240px; flex-shrink: 0;
    position: sticky; top: 1rem; align-self: flex-start;
    background: var(--ay-card);
    border: 1px solid var(--ay-border);
    border-radius: 12px; padding: 1rem;
    max-height: calc(100vh - 2rem); overflow-y: auto;
}
.toc-list { list-style: none; }
.toc-list li { margin-bottom: 2px; }
.toc-list a {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.5rem 0.7rem; border-radius: 6px;
    font-size: 0.9rem; color: #ffffff;
    text-decoration: none; transition: all 0.15s;
    font-weight: 500;
}
.toc-list a:hover {
    background: rgba(59, 130, 246, 0.18);
    color: #60a5fa;
}
.toc-list a.active {
    background: linear-gradient(90deg, rgba(13,148,136,0.25), rgba(59,130,246,0.25));
    color: #2dd4bf; font-weight: 700;
    border-left: 3px solid #2dd4bf;
    padding-left: calc(0.7rem - 3px);
}
.toc-list a i { font-size: 0.9rem; width: 18px; text-align: center; flex-shrink: 0; color: var(--ay-teal-lt); }
.toc-toggle { display: none; }

.ayuda-content { flex: 1; min-width: 0; }

.seccion { margin-bottom: 2.5rem; scroll-margin-top: 1rem; }
.seccion h2 {
    font-size: 1.2rem; font-weight: 700; margin-bottom: 1rem;
    padding-bottom: 0.6rem;
    border-bottom: 2px solid var(--ay-teal);
    display: flex; align-items: center; gap: 0.6rem;
    color: #ffffff;
}
.seccion h2 i { color: var(--ay-teal-lt); }
.seccion h3 {
    font-size: 1rem; font-weight: 700; margin: 1.25rem 0 0.6rem;
    color: var(--ay-blue-lt);
}
.seccion p  {
    font-size: 0.9rem; line-height: 1.7; margin-bottom: 0.75rem;
    color: #ffffff;
}
.seccion ul, .seccion ol { padding-left: 1.25rem; margin-bottom: 0.75rem; }
.seccion li {
    font-size: 0.9rem; line-height: 1.7; margin-bottom: 0.35rem;
    color: #ffffff;
}
.seccion li::marker { color: var(--ay-teal-lt); }
.seccion strong { color: #2dd4bf; font-weight: 700; }
.seccion code {
    background: rgba(13,148,136,0.18);
    color: #2dd4bf;
    padding: 1px 6px; border-radius: 4px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.9rem;
    border: 1px solid rgba(13,148,136,0.35);
}

.box {
    padding: 0.9rem 1rem; border-radius: 8px;
    margin-bottom: 1rem; font-size: 0.9rem; line-height: 1.6;
    border-left: 3px solid;
    background: var(--ay-card-2);
}
.box strong { display: block; margin-bottom: 0.3rem; color: #ffffff; }
.box-info   { border-color: var(--ay-blue);    color: #dbeafe; }
.box-info strong { color: var(--ay-blue-lt); }
.box-tip    { border-color: var(--ay-teal);    color: #ccfbf1; }
.box-tip strong { color: var(--ay-teal-lt); }
.box-warn   { border-color: #3b82f6;           color: #e0f2fe; background: #0b1a2d; }
.box-warn strong { color: #93c5fd; }
.box-danger { border-color: #0f766e;           color: #ccfbf1; background: #041a18; }
.box-danger strong { color: #5eead4; }

.tabla-comp {
    width: 100%; border-collapse: collapse; margin: 0.75rem 0 1rem;
    font-size: 0.9rem;
    background: var(--ay-card);
    border: 1px solid var(--ay-border);
    border-radius: 8px;
    overflow: hidden;
}
.tabla-comp th {
    background: linear-gradient(135deg, #0f766e, #1d4ed8);
    color: #ffffff;
    padding: 0.65rem 0.85rem; text-align: left; font-weight: 700;
    border-bottom: 2px solid var(--ay-teal);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.tabla-comp td {
    padding: 0.6rem 0.85rem;
    border-bottom: 1px solid rgba(13,148,136,0.15);
    color: #ffffff;
}
.tabla-comp tr:last-child td { border-bottom: none; }
.tabla-comp tr:hover td { background: rgba(13,148,136,0.08); }

.diagrama {
    background: var(--ay-card);
    border: 1px solid var(--ay-border);
    border-radius: 10px;
    padding: 1.25rem;
    margin: 1rem 0;
}
.diagrama-licencia {
    background: linear-gradient(135deg, rgba(13,148,136,0.15), rgba(29,78,216,0.15));
    border: 1px solid var(--ay-teal);
    border-radius: 8px;
    padding: 0.85rem 1rem;
    margin-bottom: 0.85rem;
}
.diagrama-licencia:last-child { margin-bottom: 0; }
.diagrama-licencia-titulo {
    font-size: 0.9rem; font-weight: 700;
    color: #2dd4bf;
    display: flex; align-items: center; gap: 0.4rem;
    margin-bottom: 0.6rem;
}
.diagrama-usuarios {
    display: flex; flex-wrap: wrap; gap: 0.4rem;
    padding-left: 1.3rem;
}
.diagrama-usuario {
    background: rgba(59,130,246,0.18);
    border: 1px solid var(--ay-blue);
    color: #ffffff;
    padding: 0.3rem 0.7rem;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex; align-items: center; gap: 0.35rem;
}
.diagrama-usuario i { color: var(--ay-blue-lt); }
.diagrama p {
    color: #e0f2fe !important;
    font-size: 0.9rem !important;
    margin-top: 0.85rem !important;
    margin-bottom: 0 !important;
}

.pasos { counter-reset: paso; list-style: none; padding-left: 0; }
.pasos li {
    counter-increment: paso;
    position: relative; padding-left: 2.75rem;
    margin-bottom: 1rem; font-size: 0.9rem; line-height: 1.7;
    color: #ffffff;
}
.pasos li::before {
    content: counter(paso);
    position: absolute; left: 0; top: 0;
    width: 2rem; height: 2rem; border-radius: 50%;
    background: linear-gradient(135deg, #0f766e, #1d4ed8);
    color: #ffffff;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.9rem; font-weight: 700;
    border: 1px solid var(--ay-teal-lt);
}

@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: var(--ay-teal-lt);
        font-size: 0.9rem; font-weight: 700; 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; }
}
