/* ═══════════════════════════════════════════════════════════════════════════
   CENTRAL DE AJUDA, MANUAIS E TUTORIAIS — ATIVA ISP MANAGER
   ═══════════════════════════════════════════════════════════════════════════ */

.help-layout {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 20px;
    height: calc(100vh - 120px);
    min-height: 600px;
}

@media (max-width: 1024px) {
    .help-layout {
        grid-template-columns: 1fr;
        height: auto;
    }
}

/* ── Coluna Esquerda: Lista e Filtros ────────────────────────────────────── */
.help-sidebar-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.help-search-box {
    padding: 14px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
}

.help-search-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.help-search-input-wrap i {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    font-size: 13px;
}

.help-search-input-wrap input {
    width: 100%;
    padding: 8px 12px 8px 34px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s;
}

.help-search-input-wrap input:focus {
    border-color: var(--accent);
}

.help-categories-bar {
    display: flex;
    gap: 6px;
    padding: 10px 14px;
    overflow-x: auto;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
}

.help-cat-btn {
    padding: 5px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.help-cat-btn:hover {
    color: var(--text-primary);
    border-color: var(--accent);
}

.help-cat-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.help-docs-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.help-doc-item {
    padding: 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    cursor: pointer;
    transition: all 0.2s ease;
}

.help-doc-item:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.help-doc-item.active {
    border-color: var(--accent);
    background: rgba(6, 182, 212, 0.08);
    box-shadow: 0 0 0 1px var(--accent);
}

.help-doc-icon-wrap {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-size: 16px;
    flex-shrink: 0;
}

.help-doc-category {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent);
}

.help-doc-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    margin-bottom: 4px;
}

.help-doc-desc {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Coluna Direita: Leitor de Documentos ─────────────────────────────────── */
.help-reader-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    height: 100%;
}

.help-reader-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 30px 40px;
}

@media (max-width: 768px) {
    .help-reader-scroll {
        padding: 20px 16px;
    }
}

.help-reader-header {
    border-bottom: 1px solid var(--border);
    padding-bottom: 20px;
    margin-bottom: 24px;
}

.help-reader-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 8px 0 16px 0;
    line-height: 1.25;
}

.help-reader-actions {
    display: flex;
    gap: 8px;
}

/* ── Markdown Estilizado ─────────────────────────────────────────────────── */
.help-reader-body {
    color: var(--text-primary);
    line-height: 1.7;
    font-size: 14px;
}

.help-reader-body h1,
.help-reader-body .help-heading-1 {
    font-size: 22px;
    font-weight: 700;
    margin: 32px 0 14px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}

.help-reader-body h2,
.help-reader-body .help-heading-2 {
    font-size: 18px;
    font-weight: 700;
    margin: 28px 0 12px 0;
    color: var(--text-primary);
}

.help-reader-body h3,
.help-reader-body .help-heading-3 {
    font-size: 15px;
    font-weight: 600;
    margin: 20px 0 10px 0;
    color: var(--text-primary);
}

.help-p {
    margin-bottom: 14px;
}

.help-inline-code {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
    color: var(--accent);
}

.help-code-wrap {
    margin: 16px 0;
    border-radius: 8px;
    overflow: hidden;
    background: #0d1117;
    border: 1px solid var(--border);
}

.help-code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 14px;
    background: #161b22;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.help-code-lang {
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 700;
    color: #8b949e;
    letter-spacing: 0.05em;
}

.help-code-copy-btn {
    background: transparent;
    border: none;
    color: #8b949e;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.help-code-copy-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.help-code-wrap pre {
    margin: 0;
    padding: 16px;
    overflow-x: auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12.5px;
    line-height: 1.5;
    color: #e6edf3;
}

.help-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 8px;
    margin: 16px 0;
    font-size: 13.5px;
    line-height: 1.5;
}

.help-alert i {
    font-size: 18px;
    margin-top: 2px;
}

.help-alert-info {
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.3);
    color: #0891b2;
}

.help-alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #d97706;
}

.help-alert-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #16a34a;
}

.help-quote {
    border-left: 3px solid var(--accent);
    padding: 8px 16px;
    margin: 16px 0;
    color: var(--text-muted);
    background: var(--bg-secondary);
    border-radius: 0 6px 6px 0;
}

.help-list {
    padding-left: 24px;
    margin-bottom: 14px;
}

.help-list li {
    margin-bottom: 6px;
}

.help-table {
    width: 100%;
    margin: 16px 0;
    font-size: 13px;
}

.help-hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 24px 0;
}

.help-link {
    color: var(--accent);
    text-decoration: underline;
    font-weight: 500;
}

/* ilustrações dos tutoriais (14/11/2026) */
.help-img {
    display: block;
    max-width: min(100%, 760px);
    height: auto;
    margin: 10px 0 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
}


/* ── Busca no conteúdo, índice da página e registro de mudanças (28/11/2026) ── */
.help-busca-conteudo { border-bottom: 1px solid var(--border); max-height: 45vh; overflow-y: auto; padding: 6px 10px 10px; display: grid; gap: 4px; }
.help-busca-tit { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); padding: 6px 2px 2px; }
.help-busca-item { all: unset; cursor: pointer; display: grid; gap: 2px; padding: 7px 9px; border-radius: 8px; border: 1px solid transparent; }
.help-busca-item:hover, .help-busca-item:focus-visible { background: var(--bg-hover); border-color: var(--border); }
.help-busca-item:focus-visible { outline: 2px solid var(--accent); }
.help-busca-doc { font-size: 11.5px; color: var(--accent); font-weight: 600; }
.help-busca-sec { font-size: 12.5px; font-weight: 600; color: var(--text-primary); }
.help-busca-trecho { font-size: 12px; color: var(--text-secondary); line-height: 1.4; }
.help-busca-hist { border-top: 1px dashed var(--border); border-radius: 0; margin-top: 4px; }
.help-busca-vazio { font-size: 12px; color: var(--text-muted); padding: 4px 2px; }
.help-reader-body mark, .help-busca-conteudo mark, #cl-lista mark { background: rgba(250, 204, 21, .35); color: inherit; border-radius: 2px; padding: 0 1px; }
.help-indice { margin: -10px 0 18px; }
.help-indice details { background: var(--bg-elevated, var(--bg-hover)); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; }
.help-indice summary { cursor: pointer; font-weight: 600; font-size: 13px; }
.help-indice ol { margin: 8px 0 2px; padding-left: 20px; columns: 2 260px; font-size: 13px; }
.help-indice li { margin: 2px 0; break-inside: avoid; } .help-indice .help-indice-sub { margin-left: 14px; font-size: 12.5px; }
.help-indice a { color: var(--accent); text-decoration: none; } .help-indice a:hover { text-decoration: underline; }
.cl-filtros { position: sticky; top: -30px; z-index: 2; background: var(--bg-card); padding: 10px 0; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.cl-busca { flex: 1 1 260px; min-width: 0; }
.cl-tipos { display: flex; gap: 4px; flex-wrap: wrap; }
.cl-filtros select { max-width: 100%; }
.cl-cont { font-size: 12.5px; color: var(--text-muted); margin: 4px 0 6px; }
.cl-dia { font-size: 14px; margin: 18px 0 6px; display: flex; gap: 8px; align-items: baseline; }
.cl-dia span { font-size: 12px; font-weight: 400; color: var(--text-muted); text-transform: none; }
.cl-item { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; background: var(--bg-card); }
.cl-item > summary { cursor: pointer; padding: 9px 12px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; list-style-position: inside; }
.cl-item > summary:focus-visible { outline: 2px solid var(--accent); border-radius: 10px; }
.cl-tit { font-weight: 600; font-size: 13.5px; flex: 1 1 280px; min-width: 0; }
.cl-tag { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 2px 7px; border-radius: 4px; background: var(--bg-hover); }
.cl-novo { color: #16a34a; background: rgba(22, 163, 74, .13); } .cl-melhoria { color: #2563eb; background: rgba(37, 99, 235, .13); }
.cl-correcao { color: #d97706; background: rgba(217, 119, 6, .14); } .cl-seguranca { color: #dc2626; background: rgba(220, 38, 38, .12); }
[data-theme="dark"] .cl-novo, :root:not([data-theme="light"]) .cl-novo { color: #4ade80; }
.cl-mod { font-size: 11.5px; color: var(--text-secondary); border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; }
.cl-corpo { padding: 0 14px 4px; font-size: 13px; }
.cl-docs { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 12px 10px; }
@media (max-width: 640px) { .cl-filtros { position: static; } .help-indice ol { columns: 1; } }
