/* =========================================================
   Blog — Atende Cloud
   Complementa o design system (style.min.css / redesign.min.css).
   ========================================================= */

/* ---------- Cabeçalho da página ---------- */
.blog-hero {
    padding: 60px 0 40px;
    background: linear-gradient(135deg, #f0f4ff, #f8f9ff 60%, #eef2ff);
    position: relative;
    overflow: hidden;
}
.blog-hero .section-title { font-size: 2.6rem; }
.blog-search-form { max-width: 620px; margin: 28px auto 0; }
.blog-search-box {
    display: flex;
    background: #fff;
    border: 1px solid rgba(79, 70, 229, .18);
    border-radius: 999px;
    padding: 6px;
    box-shadow: 0 8px 30px rgba(79, 70, 229, .10);
}
.blog-search-box input {
    border: none;
    outline: none;
    flex: 1;
    padding: 10px 20px;
    font-size: .98rem;
    background: transparent;
    color: #111827;
}
.blog-search-box .btn-search {
    border: none;
    background: var(--primary);
    color: #fff;
    border-radius: 999px;
    padding: 10px 26px;
    font-weight: 700;
    font-size: .92rem;
    transition: background .3s ease;
}
.blog-search-box .btn-search:hover { background: var(--primary-dark); }

/* ---------- Filtros (categorias) ---------- */
.blog-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 22px;
}
.blog-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(79, 70, 229, .25);
    background: #fff;
    color: #111827;
    border-radius: 999px;
    padding: 7px 18px;
    font-size: .88rem;
    font-weight: 600;
    text-decoration: none;
    transition: all .25s ease;
}
.blog-filter-chip small {
    background: #4f46e51a;
    color: var(--primary);
    border-radius: 999px;
    padding: 1px 8px;
    font-size: .72rem;
    font-weight: 700;
}
.blog-filter-chip:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-2px); }
.blog-filter-chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.blog-filter-chip.active small { background: rgba(255,255,255,.2); color: #fff; }

/* ---------- Cards das matérias ---------- */
.post-card {
    background: #fff;
    border: 1px solid rgba(79, 70, 229, .08);
    border-radius: 20px;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .05);
}
.post-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 24px 50px rgba(79, 70, 229, .14);
    border-color: rgba(79, 70, 229, .25);
}
.post-card-media {
    position: relative;
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: linear-gradient(135deg, #6366f11f, #10b9811f);
}
.post-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .45s ease;
}
.post-card:hover .post-card-media img { transform: scale(1.05); }
.post-card-media .no-cover {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.4rem;
    color: rgba(79, 70, 229, .45);
}
.post-card-cat {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 2;
    background: rgba(255, 255, 255, .94);
    color: var(--primary);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .5px;
    text-transform: uppercase;
    padding: 5px 13px;
    border-radius: 999px;
    box-shadow: 0 4px 14px rgba(0,0,0,.12);
    text-decoration: none;
}
.post-card-body {
    padding: 22px 22px 18px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.post-card-body h3 {
    font-size: .98rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 6px;
}
.blog-latest-section .post-card-body h3 { font-size: .95rem; }
.post-card-body h3 a { color: var(--dark); transition: color .25s; }
.post-card-body h3 a:hover { color: var(--primary); }
.post-card-sub {
    color: var(--gray);
    font-size: .88rem;
    margin-bottom: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.post-card-meta {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 14px;
    color: #9ca3af;
    font-size: .78rem;
    font-weight: 500;
}
.post-card-meta i { color: var(--primary); }

/* ---------- Paginação ---------- */
.blog-pagination { display: flex; gap: 8px; justify-content: center; margin-top: 44px; flex-wrap: wrap; }
.blog-pagination a, .blog-pagination span {
    min-width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: 1px solid rgba(79, 70, 229, .2);
    color: #111827;
    font-weight: 600;
    font-size: .9rem;
    padding: 0 14px;
    text-decoration: none;
    transition: all .25s ease;
}
.blog-pagination a:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-2px); }
.blog-pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }
.blog-pagination .disabled { opacity: .45; pointer-events: none; }

/* ---------- Página da matéria ---------- */
.post-hero {
    padding: 60px 0 34px;
    background: linear-gradient(135deg, #f0f4ff, #f8f9ff 60%, #eef2ff);
}
.post-hero .post-cat-badge {
    display: inline-block;
    background: #4f46e51a;
    color: var(--primary);
    font-size: .75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 6px 16px;
    border-radius: 999px;
    margin-bottom: 16px;
    text-decoration: none;
}
.post-hero h1 { font-size: 2.5rem; font-weight: 800; color: var(--dark); line-height: 1.25; }
.post-hero .post-subtitle { font-size: 1.15rem; color: var(--gray); margin-top: 12px; }
.post-hero-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    margin-top: 18px;
    color: #6b7280;
    font-size: .86rem;
}
.post-hero-meta .post-cat-badge {
    margin-bottom: 0;
    font-size: .68rem;
    padding: 5px 14px;
}
.post-hero-meta i { color: var(--primary); }
.post-cover { border-radius: 24px; overflow: hidden; box-shadow: 0 24px 60px rgba(15,23,42,.14); margin: 34px 0; }
.post-cover img { width: 100%; display: block; }

.post-content {
    font-size: 1.05rem;
    line-height: 1.85;
    color: #374151;
    max-width: 820px;
    margin: 0 auto;
}
.post-content h2 { font-size: 1.65rem; margin: 1.6em 0 .6em; color: var(--dark); }
.post-content h3 { font-size: 1.3rem; margin: 1.4em 0 .5em; color: var(--dark); }
.post-content h4 { font-size: 1.12rem; margin: 1.2em 0 .4em; color: var(--dark); }
.post-content p { margin-bottom: 1.15em; }
.post-content a { color: var(--primary); text-decoration: underline; }
.post-content img { max-width: 100%; height: auto; border-radius: 14px; margin: 1.2em 0; }
.post-content ul, .post-content ol { padding-left: 1.5em; margin-bottom: 1.15em; }
.post-content li { margin-bottom: .4em; }
.post-content blockquote {
    border-left: 4px solid var(--primary);
    background: #f8f9ff;
    padding: 16px 22px;
    border-radius: 0 14px 14px 0;
    margin: 1.4em 0;
    font-style: italic;
    color: #4b5563;
}
.post-content pre {
    background: #0f172a;
    color: #e2e8f0;
    padding: 18px 22px;
    border-radius: 14px;
    overflow-x: auto;
    font-size: .9rem;
}
.post-content code { background: #4f46e514; padding: 2px 7px; border-radius: 6px; font-size: .88em; }
.post-content pre code { background: transparent; padding: 0; }
.post-content table { width: 100%; border-collapse: collapse; margin: 1.4em 0; }
.post-content th, .post-content td { border: 1px solid #e5e7eb; padding: 10px 14px; text-align: left; }
.post-content th { background: #f8f9ff; color: var(--dark); }
.post-content .video-embed { position: relative; padding-bottom: 56.25%; height: 0; margin: 1.4em 0; border-radius: 14px; overflow: hidden; }
.post-content .video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.post-content mark { background: #fde68a80; padding: 0 4px; border-radius: 4px; }

/* ---------- Artigos relacionados / CTA ---------- */
.related-card {
    display: flex;
    gap: 14px;
    background: #fff;
    border: 1px solid rgba(79,70,229,.1);
    border-radius: 16px;
    padding: 12px;
    text-decoration: none;
    transition: all .3s ease;
    height: 100%;
}
.related-card:hover { transform: translateY(-4px); box-shadow: 0 16px 34px rgba(79,70,229,.14); }
.related-thumb {
    width: 84px;
    height: 84px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
    background: #4f46e514;
}
.related-body h3 { font-size: .92rem; font-weight: 700; color: var(--dark); margin-bottom: 2px; }
.related-body span { font-size: .76rem; color: #9ca3af; }

/* ---------- Autor + leitura (rodapé discreto da matéria) ---------- */
.post-byline {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 26px;
    padding-top: 14px;
    border-top: 1px solid #eef0f6;
    font-size: .8rem;
    color: #9ca3af;
}
.post-byline i { font-size: .74rem; opacity: .75; margin-right: 2px; }
.byline-author { font-weight: 600; color: #6b7280; }
.byline-sep { opacity: .5; }

body.dark-mode .post-byline { border-top-color: #1e293b; }
body.dark-mode .post-byline { color: #64748b; }
body.dark-mode .byline-author { color: #94a3b8; }

/* ---------- Compartilhar (final da matéria) ---------- */
.share-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 34px 0 8px;
    padding: 14px 0;
    border-top: 1px solid #eef0f6;
}
.share-label {
    font-size: .86rem;
    font-weight: 700;
    color: #6b7280;
    margin-right: 4px;
}
.share-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    position: relative;
    transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}
.share-btn:hover { transform: translateY(-2px) scale(1.08); }
.share-btn.whatsapp { background: #25d3661a; color: #128c7e; }
.share-btn.whatsapp:hover { background: #25d366; color: #fff; box-shadow: 0 6px 16px rgba(37,211,102,.35); }
.share-btn.facebook { background: #1877f21a; color: #1877f2; }
.share-btn.facebook:hover { background: #1877f2; color: #fff; box-shadow: 0 6px 16px rgba(24,119,242,.35); }
.share-btn.copy { background: #4f46e51a; color: #4f46e5; }
.share-btn.copy:hover { background: #4f46e5; color: #fff; box-shadow: 0 6px 16px rgba(79,70,229,.35); }

/* Tooltip dos botões de compartilhar (abaixo, como os do painel) */
.share-btn::after {
    content: attr(data-tip);
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    background: #111827;
    color: #fff;
    font-size: .72rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    padding: 6px 11px;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
    z-index: 30;
}
.share-btn:hover::after { opacity: 1; transform: translateX(-50%) translateY(0); }
.share-btn.copied::after {
    content: 'Link copiado! ✓';
    background: #059669;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

body.dark-mode .share-row { border-top-color: #1e293b; }
body.dark-mode .share-label { color: #94a3b8; }
body.dark-mode .share-btn.whatsapp { background: #25d36626; color: #4ade80; }
body.dark-mode .share-btn.facebook { background: #1877f226; color: #60a5fa; }
body.dark-mode .share-btn.copy { background: #4f46e526; color: #a5b4fc; }

/* ---------- CTA ChatCloud (final da matéria) ---------- */
.post-cta {
    margin-top: 46px;
    padding: 38px 34px;
    border-radius: 22px;
    text-align: center;
    background:
        radial-gradient(ellipse at top left, rgba(37, 211, 102, .14), transparent 55%),
        radial-gradient(ellipse at bottom right, rgba(79, 70, 229, .12), transparent 55%),
        #f8faff;
    border: 1.5px solid #dbe4f5;
}
.post-cta-icon {
    width: 62px;
    height: 62px;
    margin: 0 auto 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #25d366, #128c7e);
    color: #fff;
    font-size: 1.9rem;
    box-shadow: 0 10px 26px rgba(18, 140, 126, .35);
}
.post-cta h3 {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--dark);
    margin: 0 0 10px;
}
.post-cta p {
    max-width: 560px;
    margin: 0 auto 22px;
    color: #4b5563;
    font-size: .95rem;
    line-height: 1.65;
}
.post-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #25d366, #128c7e);
    color: #fff;
    font-weight: 700;
    font-size: .98rem;
    padding: 14px 30px;
    border-radius: 999px;
    text-decoration: none;
    transition: transform .25s ease, box-shadow .25s ease;
    box-shadow: 0 8px 22px rgba(18, 140, 126, .32);
}
.post-cta-btn:hover {
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 14px 30px rgba(18, 140, 126, .45);
}
.post-cta-btn i { font-size: 1.2rem; }
.post-cta-note {
    display: block;
    margin-top: 12px;
    font-size: .78rem;
    color: #9ca3af;
}
body.dark-mode .post-cta {
    background:
        radial-gradient(ellipse at top left, rgba(37, 211, 102, .1), transparent 55%),
        radial-gradient(ellipse at bottom right, rgba(79, 70, 229, .12), transparent 55%),
        #111a2e;
    border-color: #1e293b;
}
body.dark-mode .post-cta h3 { color: #e5e7eb; }
body.dark-mode .post-cta p { color: #94a3b8; }

/* ---------- Painel admin ---------- */
.admin-body { background: #f4f5fb; min-height: 100vh; }
.admin-topbar {
    background: #fff;
    border-bottom: 1px solid #e9eaf2;
    padding: 14px 0;
    position: sticky;
    top: 0;
    z-index: 50;
}
.admin-topbar .brand { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--dark); text-decoration: none; }
.admin-topbar .brand img { height: 34px; width: auto; }
.admin-shell { max-width: 1200px; margin: 0 auto; padding: 30px 20px 60px; }
.admin-card {
    background: #fff;
    border: 1px solid #e9eaf2;
    border-radius: 18px;
    padding: 26px;
    box-shadow: 0 6px 24px rgba(15,23,42,.05);
}
/* Scroll da tabela colado no card (o card não tem padding na área da tabela).
   Sem arredondamentos: o card que contém a tabela também fica quadrado. */
.admin-card.table-card { border-radius: 0; }
.admin-table-wrap {
    overflow-x: auto;
    max-height: 560px; /* área de rolagem com altura generosa */
    overflow-y: auto;
    margin: -26px -26px -26px; /* anula o padding do .admin-card nas laterais e embaixo */
}
.admin-table-wrap::-webkit-scrollbar { height: 10px; }
.admin-table-wrap::-webkit-scrollbar-track { background: #f1f2f8; }
.admin-table-wrap::-webkit-scrollbar-thumb { background: #c7d2fe; border-radius: 999px; border: 2px solid #f1f2f8; }
.admin-table-wrap::-webkit-scrollbar-thumb:hover { background: #a5b4fc; }
.admin-table-wrap { scrollbar-color: #c7d2fe #f1f2f8; scrollbar-width: thin; } /* Firefox */
.table-posts { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table-posts th {
    text-align: left;
    font-size: .74rem;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: #9ca3af;
    padding: 14px 26px; /* lateral maior: a tabela agora encosta nas bordas do card */
    border-bottom: 2px solid #eef0f6;
    white-space: nowrap;
    background: #fbfbfe;
    position: sticky; /* header não sobe junto com a rolagem */
    top: 0;
    z-index: 2;
}
.table-posts td { padding: 14px 26px; border-bottom: 1px solid #f1f2f8; vertical-align: middle; }
.table-posts tr:last-child td { border-bottom: none; }
.table-posts tr:hover td { background: #fafbff; }
.status-pill { font-size: .72rem; font-weight: 800; padding: 4px 12px; border-radius: 999px; text-transform: uppercase; letter-spacing: .5px; }
.status-published { background: #10b9811a; color: #059669; }
.status-scheduled { background: #6366f11a; color: #4f46e5; }
.status-draft { background: #f59e0b1a; color: #b45309; }
.admin-title { font-size: 1.5rem; font-weight: 800; color: var(--dark); margin: 0; }
.admin-thumb { width: 74px; height: 48px; object-fit: cover; border-radius: 10px; background: #4f46e514; }

.btn-ac {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 11px 24px;
    font-weight: 700;
    font-size: .9rem;
    text-decoration: none;
    transition: all .3s ease;
    cursor: pointer;
}
.btn-ac:hover { background: var(--primary-dark); color: #fff; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(79,70,229,.3); }
.btn-ac-outline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    color: var(--primary);
    border: 1.5px solid rgba(79,70,229,.35);
    border-radius: 999px;
    padding: 10px 22px;
    font-weight: 700;
    font-size: .9rem;
    text-decoration: none;
    cursor: pointer;
    transition: all .3s ease;
}
.btn-ac-outline:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-2px); }
.btn-ac-danger { background: #ef4444; }
.btn-ac-danger:hover { background: #dc2626; color: #fff; }
.btn-ac-sm { padding: 7px 16px; font-size: .82rem; }

/* ---------- Botões redondos de ação (com tooltip) ---------- */
.act-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    font-size: .88rem;
    text-decoration: none;
    position: relative;
    transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}
.act-btn:hover { transform: translateY(-2px) scale(1.06); filter: saturate(1.15); z-index: 5; }
.act-btn:active { transform: translateY(0) scale(.96); }
.act-btn.view   { background: #eef2ff; color: #4f46e5; }
.act-btn.view:hover { box-shadow: 0 6px 16px rgba(79,70,229,.28); }
.act-btn.edit   { background: #ecfdf5; color: #059669; }
.act-btn.edit:hover { box-shadow: 0 6px 16px rgba(5,150,105,.28); }
.act-btn.toggle { background: #fff7ed; color: #ea580c; }
.act-btn.toggle:hover { box-shadow: 0 6px 16px rgba(234,88,12,.28); }
.act-btn.delete { background: #fef2f2; color: #dc2626; }
.act-btn.delete:hover { box-shadow: 0 6px 16px rgba(220,38,38,.3); }
.act-btn.key    { background: #fdf4ff; color: #a21caf; }
.act-btn.key:hover { box-shadow: 0 6px 16px rgba(162,28,175,.26); }
.act-btn.logout { background: #f1f5f9; color: #475569; }
.act-btn.logout:hover { box-shadow: 0 6px 16px rgba(71,85,105,.26); }
/* Cores próprias por ação da topbar — nenhuma se repete na mesma página */
.act-btn.tags   { background: #eff6ff; color: #2563eb; } /* Categorias */
.act-btn.tags:hover { box-shadow: 0 6px 16px rgba(37,99,235,.28); }
.act-btn.seo    { background: #fffbeb; color: #b45309; } /* Auditoria SEO */
.act-btn.seo:hover { box-shadow: 0 6px 16px rgba(180,83,9,.28); }
.act-btn.theme  { background: #f0fdfa; color: #0d9488; } /* Alternar tema */
.act-btn.theme:hover { box-shadow: 0 6px 16px rgba(13,148,136,.28); }
.act-btn.posts  { background: #e2e8f0; color: #334155; } /* Voltar p/ matérias */
.act-btn.posts:hover { box-shadow: 0 6px 16px rgba(71,85,105,.26); }

/* Tooltip personalizado (puro CSS) — aparece ABAIXO do botão,
   pois os botões do topbar ficam no topo da página. */
.act-btn::after {
    content: attr(data-tip);
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    background: #111827;
    color: #fff;
    font-size: .72rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    padding: 6px 11px;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
    box-shadow: 0 8px 20px rgba(15,23,42,.25);
    z-index: 60;
}
.act-btn::before {
    content: '';
    position: absolute;
    top: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    border: 5px solid transparent;
    border-bottom-color: #111827;
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
}
.act-btn:hover::after { opacity: 1; transform: translateX(-50%) translateY(0); }
.act-btn:hover::before { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Última linha da tabela: tooltip vira para CIMA — apontando para baixo.
   Sem isso o tooltip vaza para fora do .admin-table-wrap e cria um
   scrollbar vertical fantasma (o conteúdo em si já cabe no wrap). */
.admin-table-wrap tbody tr:last-child .act-btn::after {
    top: auto;
    bottom: calc(100% + 10px);
    transform: translateX(-50%) translateY(4px);
}
.admin-table-wrap tbody tr:last-child .act-btn::before {
    top: auto;
    bottom: calc(100% + 4px);
    border-bottom-color: transparent;
    border-top-color: #111827;
    transform: translateX(-50%) translateY(4px);
}
.admin-table-wrap tbody tr:last-child .act-btn:hover::after,
.admin-table-wrap tbody tr:last-child .act-btn:hover::before {
    transform: translateX(-50%) translateY(0);
}

/* ---------- Auditoria SEO (painel) ---------- */
.seo-card { border-left: 5px solid #e9eaf2; }
.seo-card.seo-ok { border-left-color: #10b981; }
.seo-card.seo-warn { border-left-color: #f59e0b; }
.seo-card.seo-bad { border-left-color: #ef4444; }
.seo-title {
    font-size: 1.02rem;
    font-weight: 800;
    color: var(--dark);
    margin: 0 0 4px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.seo-ico { font-size: .95rem; }
.seo-ico.ok { color: #10b981; }
.seo-ico.warn { color: #f59e0b; }
.seo-ico.bad { color: #ef4444; }
.seo-title .status-pill { font-size: .62rem; padding: 2px 8px; }
.seo-issues {
    list-style: none;
    margin: 14px 0 0;
    padding: 12px 16px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 12px;
    font-size: .86rem;
    color: #b91c1c;
}
.seo-issues li { padding: 3px 0; }
.seo-issues i { font-size: .7rem; margin-right: 8px; opacity: .7; }
.seo-okmsg {
    margin: 14px 0 0;
    padding: 10px 16px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 12px;
    font-size: .86rem;
    color: #047857;
    font-weight: 600;
}
.seo-okmsg i { margin-right: 8px; }
details.seo-headings {
    margin-top: 12px;
    font-size: .84rem;
    color: #6b7280;
}
details.seo-headings summary {
    cursor: pointer;
    font-weight: 600;
    color: #4f46e5;
    user-select: none;
}
details.seo-headings ul {
    margin: 10px 0 0;
    padding-left: 20px;
}
details.seo-headings li { padding: 2px 0; }
.act-btn.active { outline: 2px solid var(--primary); outline-offset: 2px; }

body.dark-mode .seo-card.seo-ok { border-left-color: #10b981; }
body.dark-mode .seo-card.seo-warn { border-left-color: #f59e0b; }
body.dark-mode .seo-card.seo-bad { border-left-color: #ef4444; }
body.dark-mode .seo-issues { background: #7f1d1d33; border-color: #7f1d1d; color: #fca5a5; }
body.dark-mode .seo-okmsg { background: #064e3b33; border-color: #065f46; color: #6ee7b7; }
body.dark-mode .seo-title { color: #e5e7eb; }
body.dark-mode details.seo-headings summary { color: #a5b4fc; }
body.dark-mode details.seo-headings { color: #94a3b8; }

/* ---------- Modal de confirmação (excluir) ---------- */
.ac-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .55);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    transition: opacity .2s ease;
}
.ac-modal-overlay.show { opacity: 1; }
.ac-modal {
    background: #fff;
    border-radius: 20px;
    max-width: 440px;
    width: calc(100% - 40px);
    padding: 30px 28px 24px;
    text-align: center;
    box-shadow: 0 30px 80px rgba(15,23,42,.35);
    transform: scale(.92) translateY(10px);
    transition: transform .22s ease;
}
.ac-modal-overlay.show .ac-modal { transform: scale(1) translateY(0); }
.ac-modal-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fef2f2;
    color: #dc2626;
    font-size: 1.5rem;
}
.ac-modal h3 {
    font-size: 1.1rem;
    font-weight: 800;
    color: #111827;
    margin: 0 0 8px;
}
.ac-modal p {
    font-size: .88rem;
    color: #6b7280;
    line-height: 1.6;
    margin: 0 0 22px;
}
.ac-modal-actions { display: flex; gap: 10px; justify-content: center; }
.ac-modal-btn {
    border: none;
    border-radius: 999px;
    padding: 11px 24px;
    font-weight: 700;
    font-size: .88rem;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
    min-width: 110px;
}
.ac-modal-btn:hover { transform: translateY(-2px); }
.ac-modal-btn.cancel { background: #f1f5f9; color: #475569; }
.ac-modal-btn.confirm { background: #dc2626; color: #fff; box-shadow: 0 6px 16px rgba(220,38,38,.3); }
.ac-modal-btn.confirm:hover { box-shadow: 0 10px 22px rgba(220,38,38,.4); }

body.dark-mode .ac-modal { background: #111a2e; }
body.dark-mode .ac-modal h3 { color: #e5e7eb; }
body.dark-mode .ac-modal p { color: #94a3b8; }
body.dark-mode .ac-modal-icon { background: #7f1d1d40; color: #fca5a5; }
body.dark-mode .ac-modal-btn.cancel { background: #1e293b; color: #cbd5e1; }

/* ---------- Dark mode: admin geral ---------- */
body.dark-mode .admin-alert.success { background: #064e3b40; color: #6ee7b7; border-color: #065f46; }
body.dark-mode .admin-alert.error { background: #7f1d1d40; color: #fca5a5; border-color: #7f1d1d; }
body.dark-mode .status-published { background: #064e3b40; color: #6ee7b7; }
body.dark-mode .status-scheduled { background: #3730a340; color: #a5b4fc; }
body.dark-mode .status-draft { background: #7c2d1240; color: #fdba74; }
body.dark-mode .admin-title,
body.dark-mode .admin-card h3,
body.dark-mode .table-posts a { color: #e5e7eb !important; }
body.dark-mode .table-posts th { color: #64748b; background: #0f1a30; } /* fundo sólido p/ sticky */
.cat-view { font-weight: 700; color: #111827; }
body.dark-mode .cat-view { color: #e5e7eb; }
body.dark-mode .brand { color: #e5e7eb; }
body.dark-mode .act-btn::after { background: #334155; color: #f1f5f9; }
body.dark-mode .act-btn::before { border-bottom-color: #334155; }
body.dark-mode .filter-add::after,
body.dark-mode .filter-clear::after { background: #334155; color: #f1f5f9; }

/* Login em dark */
body.dark-mode .login-wrap { background: linear-gradient(135deg, #0b1220, #0f1a30 60%, #111a2e); }
body.dark-mode .login-card { background: #111a2e; box-shadow: 0 30px 70px rgba(0,0,0,.5); }
body.dark-mode .login-card h1 { color: #e5e7eb !important; }
body.dark-mode #captchaBox { background: #fff !important; } /* captcha sempre claro (legibilidade) */

/* Quill (editor) em dark */
body.dark-mode .ql-toolbar.ql-snow { background: #0f1a30 !important; border-color: #2c3a5c !important; }
body.dark-mode .ql-toolbar .ql-stroke { stroke: #cbd5e1; }
body.dark-mode .ql-toolbar .ql-fill { fill: #cbd5e1; }
body.dark-mode .ql-toolbar .ql-picker-label { color: #cbd5e1 !important; }
body.dark-mode .ql-toolbar .ql-picker-options { background: #111a2e !important; border-color: #2c3a5c !important; }
body.dark-mode .ql-container.ql-snow { border-color: #2c3a5c !important; background: #0f1a30; color: #e5e7eb; }
body.dark-mode .ql-editor { color: #e5e7eb; }
body.dark-mode .ql-snow .ql-picker { color: #cbd5e1; }
body.dark-mode .input-group .input-group-text { background: #0f1a30; border-color: #2c3a5c; color: #64748b; }

/* Topbar com botões redondos */
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.act-btn.new-post {
    width: auto;
    border-radius: 999px;
    padding: 0 18px;
    height: 38px;
    gap: 8px;
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: #fff;
    font-weight: 700;
    font-size: .84rem;
}
.act-btn.new-post:hover { box-shadow: 0 6px 18px rgba(79,70,229,.4); }

/* ---------- Cards de estatísticas ---------- */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 16px;
    margin-bottom: 26px;
}
.stat-card {
    background: #fff;
    border: 1.5px solid #e9eaf2;
    border-radius: 18px;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
    cursor: pointer;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(15,23,42,.09); border-color: #c7d2fe; }
.stat-card.active { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.12); }
.stat-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.stat-icon.all       { background: #eef2ff; color: #4f46e5; }
.stat-icon.published { background: #ecfdf5; color: #059669; }
.stat-icon.scheduled { background: #fef9c3; color: #ca8a04; }
.stat-icon.draft     { background: #fff7ed; color: #ea580c; }
.stat-icon.views     { background: #f0f9ff; color: #0284c7; }
.stat-num { font-size: 1.45rem; font-weight: 800; color: var(--dark); line-height: 1.1; }
.stat-label { font-size: .76rem; font-weight: 600; color: #9ca3af; text-transform: uppercase; letter-spacing: .6px; }

/* ---------- Busca com auto-filtro ---------- */
.filter-bar {
    background: #fff;
    border: 1.5px solid #e9eaf2;
    border-radius: 999px;
    padding: 8px 10px 8px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 14px rgba(15,23,42,.05);
}
.filter-bar .search-ico { color: #9ca3af; font-size: .9rem; }
.filter-bar input {
    border: none;
    outline: none;
    background: transparent;
    font-family: 'Poppins', sans-serif;
    font-size: .92rem;
    color: #111827;
    min-width: 210px;
    flex: 1;
}
.filter-bar input::placeholder { color: #b6bcc9; }
.filter-bar select {
    border: 1.5px solid #e9eaf2;
    border-radius: 999px;
    background: #f8f9ff;
    padding: 8px 14px;
    font-family: 'Poppins', sans-serif;
    font-size: .84rem;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    outline: none;
}
.filter-bar select:focus { border-color: var(--primary); }
.filter-clear {
    background: #fef2f2;
    color: #dc2626;
    border: none;
    border-radius: 999px;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform .2s ease, background .2s ease;
}
/* Girar o ÍCONE no hover (não o botão inteiro — girar o botão
   arrastaria o tooltip junto, pois o ::after acompanha o transform do pai) */
.filter-clear i { display: inline-block; transition: transform .25s ease; }
.filter-clear:hover { background: #fee2e2; }
.filter-clear:hover i { transform: rotate(90deg); }
.filter-clear::after {
    content: attr(data-tip-filter);
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    background: #111827;
    color: #fff;
    font-size: .72rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    padding: 6px 11px;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
    z-index: 30;
}
.filter-clear { position: relative; }
.filter-clear:hover::after { opacity: 1; transform: translateX(-50%) translateY(0); }
.filter-add {
    background: #eef2ff;
    color: #4f46e5;
    border: none;
    border-radius: 999px;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: transform .2s ease, background .2s ease;
    flex-shrink: 0;
}
.filter-add { position: relative; }
.filter-add:hover { transform: scale(1.1); background: #e0e7ff; box-shadow: 0 6px 16px rgba(79,70,229,.28); }
/* Ancorado pela DIREITA: o botão fica no fim da linha (junto à viewport),
   centralizar faria o tooltip cortar na borda da tela */
.filter-add::after {
    content: attr(data-tip);
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    transform: translateY(-4px);
    background: #111827;
    color: #fff;
    font-size: .72rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    padding: 6px 11px;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
    z-index: 30;
}
.filter-add:hover::after { opacity: 1; transform: translateY(0); }
.form-control-sm-ac { padding: 7px 12px; font-size: .88rem; }

/* ---------- Formulário do editor ---------- */
.editor-cover-preview {
    width: 100%;
    max-height: 260px;
    object-fit: cover;
    border-radius: 14px;
    margin-top: 12px;
    display: none;
}
.form-label-ac { font-weight: 700; color: var(--dark); font-size: .9rem; margin-bottom: 6px; display: block; }
.form-control-ac {
    width: 100%;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    padding: 11px 16px;
    font-size: .95rem;
    color: #111827;
    background: #fff;
    transition: border-color .25s ease, box-shadow .25s ease;
}
.form-control-ac:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(79,70,229,.12); }
textarea.form-control-ac { min-height: 90px; resize: vertical; }

/* Slug: prefixo + input na mesma linha (corrige quebra do input-group) */
.input-group { flex-wrap: nowrap; }
.input-group .input-group-text {
    background: #f8f9ff;
    border: 1.5px solid #e5e7eb;
    border-right: none;
    border-radius: 12px 0 0 12px;
    padding: 11px 16px;
    font-family: 'Poppins', sans-serif;
    font-size: .95rem;
    font-weight: 600;
    color: #9ca3af;
}
.input-group .form-control-ac {
    flex: 1 1 auto;
    width: 1%;
    min-width: 0;
    border-radius: 0 12px 12px 0;
    border-left: none;
}

#quillEditor { height: 420px; background: #fff; }
#quillEditor img { max-width: 100%; }
body.dark-mode #quillEditor { background: #0f1a30; }
body.dark-mode .ql-editor.ql-blank::before { color: #64748b; } /* placeholder */
.ql-toolbar { border-radius: 14px 14px 0 0 !important; border: 1.5px solid #e5e7eb !important; border-bottom: none !important; background: #f8f9ff; }
.ql-container { border-radius: 0 0 14px 14px !important; border: 1.5px solid #e5e7eb !important; font-size: 1rem !important; font-family: 'Poppins', sans-serif !important; }

.admin-alert { border-radius: 14px; padding: 14px 18px; font-size: .9rem; font-weight: 600; border: 1px solid transparent; margin-bottom: 18px; }
.admin-alert.success { background: #10b98114; color: #047857; border-color: #10b98133; }
.admin-alert.error { background: #ef444414; color: #b91c1c; border-color: #ef444433; }

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #f0f4ff, #eef2ff 60%, #e0e7ff); padding: 20px; }
.login-card { background: #fff; border-radius: 24px; padding: 40px 36px; width: 100%; max-width: 430px; box-shadow: 0 30px 70px rgba(79,70,229,.16); }
.login-logo { display: flex; justify-content: center; margin-bottom: 18px; }
.login-logo img { height: 54px; width: auto; }

/* ---------- Últimas do blog (seção em páginas do site) ---------- */
.blog-latest-section { background: #f8fafc; }
.blog-latest-section .post-card-body h3 { font-size: 1rem; }

/* ---------- Dark mode (compatível com o tema do site) ---------- */
body.dark-mode .blog-hero,
body.dark-mode .post-hero { background: linear-gradient(135deg, #0b1220, #101a30 60%, #131f38); }
body.dark-mode .blog-search-box { background: #111a2e; border-color: #2c3a5c; }
body.dark-mode .blog-search-box input { color: #e5e7eb; }
body.dark-mode .blog-filter-chip { background: #111a2e; border-color: #2c3a5c; color: #e5e7eb; }
body.dark-mode .post-card,
body.dark-mode .related-card { background: #111a2e; border-color: #2c3a5c; }
body.dark-mode .post-card-body h3 a,
body.dark-mode .related-body h3 { color: #e5e7eb; }
body.dark-mode .post-card-cat { background: rgba(17,26,46,.94); color: #a5b4fc; }
body.dark-mode .post-content { color: #cbd5e1; }
body.dark-mode .post-content h2, body.dark-mode .post-content h3,
body.dark-mode .post-content h4 { color: #e5e7eb; }
body.dark-mode .post-content blockquote { background: #111a2e; color: #94a3b8; }
body.dark-mode .post-content th { background: #111a2e; color: #e5e7eb; }
body.dark-mode .post-content th, body.dark-mode .post-content td { border-color: #2c3a5c; }
body.dark-mode .post-content code { background: #1e293b; }
body.dark-mode .blog-latest-section { background: #0d1526; }
body.dark-mode .admin-topbar { background: #0b1220; border-color: #1e293b; }
body.dark-mode .admin-card { background: #111a2e; border-color: #1e293b; }
/* .admin-body É o próprio <body> — não é descendente dele mesmo,
   por isso o seletor precisa casar o body diretamente */
body.admin-body.dark-mode { background: #0b1220; }
body.dark-mode .table-posts tr:hover td { background: #16223c; }
body.dark-mode .form-control-ac { background: #0f1a30; border-color: #2c3a5c; color: #e5e7eb; }
body.dark-mode .login-card { background: #111a2e; }
body.dark-mode .btn-ac-outline { background: transparent; }
body.dark-mode .table-posts td { border-color: #1e293b; }
body.dark-mode .table-posts th { background: #0f1a30; border-bottom-color: #1e293b; }
body.dark-mode .admin-table-wrap::-webkit-scrollbar-track { background: #0f1a30; }
body.dark-mode .admin-table-wrap::-webkit-scrollbar-thumb { background: #312e81; border-color: #0f1a30; }
body.dark-mode .admin-table-wrap { scrollbar-color: #312e81 #0f1a30; }
body.dark-mode .admin-card.table-card { border-radius: 0; }
body.dark-mode .act-btn.view   { background: #312e81; color: #a5b4fc; }
body.dark-mode .act-btn.edit   { background: #064e3b; color: #6ee7b7; }
body.dark-mode .act-btn.toggle { background: #7c2d12; color: #fdba74; }
body.dark-mode .act-btn.delete { background: #7f1d1d; color: #fca5a5; }
body.dark-mode .act-btn.key    { background: #701a75; color: #f0abfc; }
body.dark-mode .act-btn.logout { background: #1e293b; color: #94a3b8; }
body.dark-mode .act-btn.tags   { background: #1e3a8a; color: #93c5fd; }
body.dark-mode .act-btn.seo    { background: #713f12; color: #fcd34d; }
body.dark-mode .act-btn.theme  { background: #134e4a; color: #5eead4; }
body.dark-mode .act-btn.posts  { background: #475569; color: #f1f5f9; }
body.dark-mode .stat-card { background: #111a2e; border-color: #1e293b; }
body.dark-mode .stat-card:hover { border-color: #4f46e5; box-shadow: 0 12px 28px rgba(0,0,0,.4); }
body.dark-mode .stat-num { color: #e5e7eb; }
body.dark-mode .filter-bar { background: #111a2e; border-color: #1e293b; box-shadow: none; }
body.dark-mode .filter-bar input { color: #e5e7eb; }
body.dark-mode .filter-bar input::placeholder { color: #64748b; }
body.dark-mode .filter-bar select { background: #0f1a30; border-color: #2c3a5c; color: #cbd5e1; }
body.dark-mode .filter-clear { background: #7f1d1d; color: #fca5a5; }
body.dark-mode .input-group .input-group-text { background: #0f1a30; border-color: #2c3a5c; color: #64748b; }
body.dark-mode .filter-add { background: #312e81; color: #a5b4fc; }
body.dark-mode .filter-add:hover { background: #3730a3; }
body.dark-mode .act-btn::after { background: #334155; }
body.dark-mode .act-btn::before { border-top-color: #334155; }
body.dark-mode .admin-table-wrap tbody tr:last-child .act-btn::before { border-top-color: #334155; }

/* ---------- Responsivo ---------- */
@media (max-width: 767.98px) {
    .blog-hero .section-title, .post-hero h1 { font-size: 1.9rem; }
    .blog-search-box { flex-direction: column; border-radius: 20px; gap: 8px; padding: 10px; }
    .blog-search-box input { padding: 12px 16px; border-radius: 12px; background: #f8f9ff; }
    .blog-search-box .btn-search { width: 100%; }
    .post-hero h1 { font-size: 1.7rem; }
    #quillEditor { height: 340px; }
}
