/* Livendix - Manual de usuario */

.manual-page {
    background: var(--bg, #f5f7fa);
    color: var(--text, #1a1a2e);
    min-height: 100vh;
}

.manual-topbar {
    background: linear-gradient(135deg, #004E89 0%, #0066b3 100%);
    color: #fff;
    padding: 16px 20px;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.manual-topbar-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.manual-topbar-search {
    flex: 1 1 280px;
    max-width: 420px;
    min-width: 0;
    position: relative;
}

.manual-search-field {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border-radius: 10px;
    padding: 0 10px 0 12px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.manual-search-icon {
    color: #666;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.manual-search-input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    padding: 10px 0;
    font-size: 0.95rem;
    color: #1a1a2e;
    outline: none;
}

.manual-search-input::placeholder {
    color: #888;
}

.manual-search-input::-webkit-search-cancel-button {
    display: none;
}

.manual-search-clear {
    flex-shrink: 0;
    border: none;
    background: transparent;
    color: #666;
    padding: 6px;
    cursor: pointer;
    border-radius: 6px;
    line-height: 1;
}

.manual-search-clear:hover {
    background: #f0f2f5;
    color: #333;
}

.manual-search-clear.hidden {
    display: none;
}

.manual-search-results {
    list-style: none;
    margin: 6px 0 0;
    padding: 6px;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    max-height: min(60vh, 360px);
    overflow-y: auto;
    z-index: 60;
}

.manual-search-results[hidden] {
    display: none;
}

.manual-search-hit {
    display: block;
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    font: inherit;
    color: inherit;
}

.manual-search-hit:hover,
.manual-search-hit:focus {
    background: #e8f0fe;
    outline: none;
}

.manual-search-hit-title {
    display: block;
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--primary, #004E89);
    margin-bottom: 4px;
    line-height: 1.3;
}

.manual-search-hit-snippet {
    display: block;
    font-size: 0.82rem;
    color: #555;
    line-height: 1.4;
}

.manual-search-hit mark {
    background: #fff3cd;
    color: inherit;
    padding: 0 1px;
    border-radius: 2px;
}

.manual-search-empty {
    padding: 12px 14px;
    font-size: 0.88rem;
    color: #666;
}

.manual-content section.manual-search-flash {
    animation: manualSearchFlash 2.2s ease-out;
}

@keyframes manualSearchFlash {
    0%, 15% { background-color: rgba(255, 107, 53, 0.12); }
    100% { background-color: transparent; }
}

.manual-topbar-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.manual-back-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    text-decoration: none;
    padding: 6px 12px 6px 8px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    transition: background 0.2s;
    max-width: 100%;
}

.manual-back-link:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.manual-back-logo {
    height: 28px;
    width: auto;
    filter: brightness(0) invert(1);
    flex-shrink: 0;
}

.manual-back-text {
    font-size: 0.88rem;
    font-weight: 600;
    white-space: nowrap;
}

.manual-back-text i {
    margin-right: 4px;
    font-size: 0.8rem;
}

.manual-topbar-actions a {
    color: #fff;
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.35);
    transition: background 0.2s;
}

.manual-topbar-actions a:hover {
    background: rgba(255, 255, 255, 0.15);
}

.manual-topbar-actions a.btn-primary-manual {
    background: var(--accent, #FF6B35);
    border-color: var(--accent, #FF6B35);
}

.manual-layout {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 20px 60px;
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 32px;
    align-items: start;
}

.manual-toc {
    position: sticky;
    top: 80px;
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--border, #e0e6ed);
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.manual-toc h2 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted, #666);
    margin: 0 0 12px;
}

.manual-toc ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.manual-toc li {
    margin-bottom: 4px;
}

.manual-toc a {
    display: block;
    padding: 6px 10px;
    color: var(--text, #1a1a2e);
    text-decoration: none;
    font-size: 0.88rem;
    border-radius: 6px;
    line-height: 1.35;
    transition: background 0.15s, color 0.15s;
}

.manual-toc a:hover,
.manual-toc a.active {
    background: #e8f0fe;
    color: var(--primary, #004E89);
}

.manual-toc-mobile {
    display: none;
    margin-bottom: 20px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.manual-toc-mobile select {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    border: 2px solid var(--border, #e0e6ed);
    border-radius: 10px;
    background: #fff;
}

.manual-content {
    background: #fff;
    border-radius: 16px;
    padding: 36px 40px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--border, #e0e6ed);
}

.manual-content h1 {
    font-size: 1.75rem;
    color: var(--primary, #004E89);
    margin: 0 0 8px;
    line-height: 1.25;
}

.manual-intro {
    font-size: 1.05rem;
    color: var(--text-muted, #666);
    margin-bottom: 28px;
    line-height: 1.6;
}

.manual-content section {
    margin-bottom: 40px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border, #e0e6ed);
}

.manual-content section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.manual-content h2 {
    font-size: 1.35rem;
    color: var(--primary, #004E89);
    margin: 0 0 16px;
    scroll-margin-top: 90px;
}

.manual-content h3 {
    font-size: 1.05rem;
    margin: 20px 0 10px;
    color: var(--text, #1a1a2e);
}

.manual-content p,
.manual-content li {
    line-height: 1.65;
    color: var(--text-muted, #555);
    margin-bottom: 10px;
}

.manual-content ul,
.manual-content ol {
    margin: 0 0 14px 1.25rem;
    padding: 0;
}

.manual-content li {
    margin-bottom: 6px;
}

.manual-content kbd {
    background: #f0f2f5;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.85em;
}

.manual-box {
    border-radius: 10px;
    padding: 14px 16px;
    margin: 16px 0;
    font-size: 0.95rem;
}

.manual-box.tip {
    background: #e8f5e9;
    border-left: 4px solid #2e7d32;
    color: #1b5e20;
}

.manual-box.warning {
    background: #fff3e0;
    border-left: 4px solid #ef6c00;
    color: #e65100;
}

.manual-box.info {
    background: #e3f2fd;
    border-left: 4px solid #1565c0;
    color: #0d47a1;
}

.manual-table-wrap {
    overflow-x: auto;
    margin: 16px 0;
}

.manual-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.manual-table th,
.manual-table td {
    border: 1px solid var(--border, #e0e6ed);
    padding: 10px 12px;
    text-align: left;
}

.manual-table th {
    background: var(--primary, #004E89);
    color: #fff;
    font-weight: 600;
}

.manual-table tr:nth-child(even) {
    background: #f8f9ff;
}

.manual-steps {
    counter-reset: step;
    list-style: none;
    margin: 0;
    padding: 0;
}

.manual-steps li {
    position: relative;
    padding-left: 48px;
    margin-bottom: 18px;
    min-height: 36px;
}

.manual-steps li::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0;
    width: 32px;
    height: 32px;
    background: var(--primary, #004E89);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}

.manual-glossary dt {
    font-weight: 700;
    color: var(--text, #1a1a2e);
    margin-top: 12px;
}

.manual-glossary dd {
    margin: 4px 0 0 0;
    color: var(--text-muted, #666);
}

.manual-footer {
    text-align: center;
    padding: 24px 20px;
    font-size: 0.85rem;
    color: var(--text-muted, #888);
}

.manual-footer a {
    color: var(--primary, #004E89);
}

@media (max-width: 900px) {
    .manual-topbar-inner {
        flex-direction: column;
        align-items: stretch;
    }

    .manual-topbar-search {
        max-width: none;
        order: 2;
    }

    .manual-topbar-actions {
        order: 3;
        justify-content: stretch;
    }

    .manual-back-link {
        flex: 1;
        justify-content: center;
    }

    .manual-back-logo {
        display: none;
    }

    .manual-layout {
        grid-template-columns: 1fr;
    }

    .manual-toc {
        display: none;
    }

    .manual-toc-mobile {
        display: block;
    }

    .manual-content {
        padding: 24px 20px;
    }
}

@media print {
    .manual-topbar,
    .manual-toc,
    .manual-toc-mobile,
    .manual-topbar-actions,
    .manual-topbar-search {
        display: none !important;
    }

    .manual-layout {
        display: block;
        padding: 0;
    }

    .manual-content {
        box-shadow: none;
        border: none;
    }
}
