/* ===== Painel administrativo ===== */
:root {
    --a-accent: #bf1eb4;
    --a-accent-dark: #961c96;
    --a-ink: #222;
    --a-muted: #6b6b6b;
    --a-line: #e6e6e6;
    --a-bg: #f4f4f6;
    --a-side: #211b24;
    --a-ok: #2e7d32;
    --a-warn: #ed9b14;
    --a-bad: #c62828;
}

.admin-shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; background: var(--a-bg); transition: grid-template-columns .2s ease; }

/* Recolher menu (CSS puro, sem JS) — dois gatilhos pro mesmo checkbox */
.side-toggle { position: absolute; opacity: 0; pointer-events: none; }

/* "‹" dentro da sidebar, recolhe */
.side-close { position: absolute; top: 10px; right: 10px; z-index: 5; display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; color: #cfc6d2; font-size: 1.4rem; line-height: 1; border-radius: 6px; cursor: pointer; }
.side-close:hover { background: rgba(255,255,255,.08); color: #fff; }

/* "☰" flutuante, só aparece quando recolhido */
.side-open { position: fixed; top: 14px; left: 14px; z-index: 30; display: none; align-items: center; justify-content: center; width: 40px; height: 40px; background: var(--a-side); color: #fff; font-size: 1.2rem; border-radius: 8px; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.18); }
.side-open:hover { background: var(--a-accent); }

/* Estado recolhido: esconde a sidebar, usa a largura toda e mostra o "☰" */
.side-toggle:checked ~ .admin-shell { grid-template-columns: 1fr; }
.side-toggle:checked ~ .admin-shell .admin-side { display: none; }
.side-toggle:checked ~ .admin-shell .side-open { display: flex; }
.side-toggle:checked ~ .admin-shell .admin-main { padding-left: 64px; max-width: none; }

/* Sidebar */
.admin-side { background: var(--a-side); color: #ddd; display: flex; flex-direction: column; padding: 20px 0; position: sticky; top: 0; height: 100vh; }
.admin-brand { display: flex; align-items: center; gap: 10px; padding: 0 20px 18px; color: #fff; }
.admin-brand img { height: 42px; width: auto; background: #fff; border-radius: 50%; padding: 2px; }
.admin-brand span { font-weight: 700; letter-spacing: .5px; text-transform: uppercase; font-size: .85rem; }
.admin-nav { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; flex: 1; }
.admin-nav a { color: #cfc6d2; padding: 11px 22px; font-size: .92rem; text-decoration: none; border-left: 3px solid transparent; }
.admin-nav a:hover { background: rgba(255,255,255,.06); color: #fff; border-left-color: var(--a-accent); }
.admin-logout { padding: 12px 20px 0; border-top: 1px solid #3a3140; }
.admin-logout button { width: 100%; background: transparent; color: #cfc6d2; border: 1px solid #4a414f; border-radius: 6px; padding: 9px; cursor: pointer; }
.admin-logout button:hover { background: var(--a-accent); border-color: var(--a-accent); color: #fff; }

/* Main */
.admin-main { padding: 28px 32px 60px; max-width: 1200px; }
.admin-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.admin-head h1 { font-size: 1.6rem; margin: 0; color: var(--a-ink); }
.admin-head-actions { display: flex; gap: 10px; }

.admin-btn { display: inline-block; background: var(--a-accent); color: #fff; border: 0; border-radius: 6px; padding: 9px 18px; font-size: .92rem; font-weight: 600; cursor: pointer; text-decoration: none; }
.admin-btn:hover { background: var(--a-accent-dark); color: #fff; }
.admin-btn.ghost, .admin-btn.block { }
.admin-btn.ghost { background: #fff; color: var(--a-ink); border: 1px solid var(--a-line); }
.admin-btn.ghost:hover { border-color: var(--a-accent); color: var(--a-accent); background: #fff; }
.admin-btn.block { width: 100%; }

.admin-hint { color: var(--a-muted); }
.admin-error { background: #fdecea; border: 1px solid #f5c6c0; color: var(--a-bad); padding: 10px 14px; border-radius: 6px; margin: 10px 0; }
.alert-success { background: #e8f5e9; border: 1px solid #c0e4c2; color: var(--a-ok); padding: 10px 14px; border-radius: 6px; margin: 10px 0; }

/* Dashboard */
.admin-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 18px; margin-bottom: 24px; }
.admin-card { background: #fff; border: 1px solid var(--a-line); border-radius: 10px; padding: 22px; display: flex; flex-direction: column; gap: 6px; }
.admin-card .num { font-size: 2.2rem; font-weight: 800; color: var(--a-accent); line-height: 1; }
.admin-card .lbl { color: var(--a-muted); font-size: .9rem; }

/* Tabela */
.admin-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--a-line); border-radius: 10px; overflow: hidden; }
.admin-table th, .admin-table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--a-line); font-size: .92rem; }
.admin-table th { background: #faf9fb; color: var(--a-muted); text-transform: uppercase; font-size: .74rem; letter-spacing: .5px; }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table .actions { display: flex; gap: 12px; }
.admin-table .link { background: none; border: 0; color: var(--a-accent); cursor: pointer; padding: 0; font-size: .9rem; text-decoration: none; }
.admin-table .link:hover { text-decoration: underline; }
.admin-table .link.danger { color: var(--a-bad); }
.badge { font-size: .74rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.badge.ok { background: #e8f5e9; color: var(--a-ok); }
.badge.draft { background: #fff3e0; color: var(--a-warn); }

/* Editor */
.editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) 34px 320px; gap: 18px; align-items: start; }
.editor-grid.side-collapsed { grid-template-columns: minmax(0, 1fr) 34px; }
.editor-main { display: flex; flex-direction: column; }
.editor-main > label, .editor-box label, .editor-seo label { font-weight: 600; font-size: .85rem; margin: 14px 0 6px; color: var(--a-ink); }
.editor-main > label small, .editor-seo label small { font-weight: 400; color: var(--a-muted); }
.editor-grid input, .editor-grid textarea, .editor-grid select { width: 100%; padding: 9px 11px; border: 1px solid var(--a-line); border-radius: 6px; font-family: inherit; font-size: .95rem; background: #fff; }
.editor-title { font-size: 1.15rem !important; font-weight: 600; }
.editor-seo { border: 1px solid var(--a-line); border-radius: 8px; padding: 6px 16px 16px; margin-top: 18px; background: #fff; }
.editor-seo legend { font-weight: 700; color: var(--a-accent); padding: 0 6px; }
.rte-textarea { width: 100%; min-height: 200px; }

.editor-side-toggle { position: sticky; top: 24px; display: flex; align-items: center; justify-content: center; width: 34px; height: 52px; margin-top: 48px; background: #fff; color: var(--a-accent); border: 1px solid var(--a-line); border-radius: 8px; font-size: 1.25rem; font-weight: 800; line-height: 1; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.04); }
.editor-side-toggle:hover { background: var(--a-accent); border-color: var(--a-accent); color: #fff; }
.editor-side { display: flex; flex-direction: column; gap: 18px; }
.editor-grid.side-collapsed .editor-side { display: none; }
.editor-box { background: #fff; border: 1px solid var(--a-line); border-radius: 8px; padding: 14px 16px 18px; }
.editor-box h3 { margin: 0 0 6px; font-size: .95rem; }
.featured-preview { width: 100%; border-radius: 6px; margin-bottom: 8px; display: block; }
.cat-checks { display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow-y: auto; }
.cat-check { display: flex; align-items: center; gap: 8px; font-weight: 400 !important; font-size: .9rem; margin: 0 !important; }
.cat-check input { width: auto !important; }

/* Painel SEO */
.seo-panel { background: #fff; border: 1px solid var(--a-line); border-radius: 8px; padding: 14px 16px 18px; }
.seo-panel h3 { margin: 0 0 10px; font-size: .95rem; display: flex; align-items: center; justify-content: space-between; }
.seo-preview { border: 1px solid var(--a-line); border-radius: 6px; padding: 12px; margin-bottom: 16px; }
.seo-url { color: #006621; font-size: .78rem; }
.seo-title { color: #1a0dab; font-size: 1.05rem; line-height: 1.3; margin: 2px 0; }
.seo-desc { color: #4d5156; font-size: .82rem; }
.seo-score { font-size: .78rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; color: #fff; }
.seo-score.ok { background: var(--a-ok); }
.seo-score.warn { background: var(--a-warn); }
.seo-score.bad { background: var(--a-bad); }
.seo-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.seo-checks li { display: flex; align-items: flex-start; gap: 8px; font-size: .85rem; color: var(--a-ink); }
.seo-checks .dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 4px; flex: none; }
.seo-checks li.ok .dot { background: var(--a-ok); }
.seo-checks li.warn .dot { background: var(--a-warn); }
.seo-checks li.bad .dot { background: var(--a-bad); }

/* Login */
.admin-auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--a-bg); padding: 20px; }
.admin-auth-card { background: #fff; border: 1px solid var(--a-line); border-radius: 12px; padding: 36px; width: 100%; max-width: 380px; text-align: center; box-shadow: 0 14px 40px rgba(0,0,0,.08); }
.admin-auth-logo { height: 90px; margin-bottom: 8px; }
.admin-auth-card h1 { font-size: 1.25rem; margin: 0 0 18px; }

/* Nav badge (mensagens não lidas) */
.admin-nav a { display: flex; align-items: center; gap: 8px; }
.nav-badge { background: var(--a-accent); color: #fff; font-size: .72rem; font-weight: 700; line-height: 1; padding: 3px 7px; border-radius: 10px; margin-left: auto; }

/* Caixa de mensagens */
.inbox { display: grid; grid-template-columns: 320px 1fr; gap: 18px; align-items: start; }
.inbox-list { list-style: none; margin: 0; padding: 0; background: #fff; border: 1px solid var(--a-line); border-radius: 10px; overflow: hidden; }
.inbox-list li { border-bottom: 1px solid var(--a-line); }
.inbox-list li:last-child { border-bottom: 0; }
.inbox-list li button { display: grid; gap: 3px; width: 100%; text-align: left; background: none; border: 0; padding: 12px 14px; cursor: pointer; }
.inbox-list li button:hover { background: #faf6fb; }
.inbox-list li.active button { background: #f3e7f5; border-left: 3px solid var(--a-accent); }
.inbox-list li.unread .inbox-from { font-weight: 700; }
.inbox-list li.unread .inbox-from::before { content: "●"; color: var(--a-accent); font-size: .7rem; margin-right: 6px; vertical-align: middle; }
.inbox-from { font-size: .92rem; color: var(--a-ink); }
.inbox-subject { font-size: .85rem; color: var(--a-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-date { font-size: .74rem; color: #9a9a9a; }

.inbox-detail { background: #fff; border: 1px solid var(--a-line); border-radius: 10px; padding: 22px 24px; min-height: 240px; }
.inbox-detail-head h2 { margin: 0 0 8px; font-size: 1.25rem; color: var(--a-ink); }
.inbox-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; font-size: .88rem; color: var(--a-muted); margin-bottom: 14px; }
.inbox-meta a { color: var(--a-accent); text-decoration: none; }
.inbox-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--a-line); }
.inbox-body { white-space: pre-wrap; line-height: 1.6; color: #333; }

@media (max-width: 760px) {
    .inbox { grid-template-columns: 1fr; }
}

/* Categorias / Tags */
.tax-grid { display: grid; grid-template-columns: 1fr 340px; gap: 18px; align-items: start; }
.tax-list { background: #fff; border: 1px solid var(--a-line); border-radius: 10px; overflow: hidden; }
.tax-list .admin-table { margin: 0; }
.tax-list tr.active { background: #f3e7f5; }
.tax-twig { color: #bbb; margin-right: 4px; }
.tax-form { background: #fff; border: 1px solid var(--a-line); border-radius: 10px; padding: 18px 20px; position: sticky; top: 20px; }
.tax-form h3 { margin: 0 0 12px; font-size: 1.05rem; color: var(--a-ink); }
.tax-form label { display: block; font-size: .82rem; font-weight: 600; color: var(--a-muted); margin: 10px 0 4px; }
.tax-form label small { font-weight: 400; }
.tax-form input, .tax-form select, .tax-form textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--a-line); border-radius: 6px; font: inherit; box-sizing: border-box; }
.tax-form-actions { display: flex; gap: 10px; margin-top: 16px; }
.tag-edit { padding: 5px 8px; border: 1px solid var(--a-accent); border-radius: 5px; font: inherit; }
.field-hint { display: block; color: var(--a-muted); font-size: .76rem; margin-top: 3px; }

@media (max-width: 760px) {
    .tax-grid { grid-template-columns: 1fr; }
    .tax-form { position: static; }
}

/* Biblioteca de mídia */
.upload-btn { cursor: pointer; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.media-card { background: #fff; border: 1px solid var(--a-line); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; }
.media-thumb { height: 140px; background-size: cover; background-position: center; background-color: #f0eef2; }
.media-info { padding: 10px 12px; display: flex; flex-direction: column; gap: 7px; }
.media-name { font-size: .8rem; color: var(--a-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-alt { width: 100%; padding: 6px 8px; border: 1px solid var(--a-line); border-radius: 6px; font: inherit; font-size: .82rem; box-sizing: border-box; }
.media-actions { display: flex; justify-content: space-between; }
.admin-auth-card label { display: block; text-align: left; font-weight: 600; font-size: .85rem; margin: 12px 0 6px; }
.admin-auth-card input { width: 100%; padding: 10px 12px; border: 1px solid var(--a-line); border-radius: 6px; font-size: 1rem; }
.admin-auth-card .admin-btn { margin-top: 20px; }
.validation-message, .text-danger { color: var(--a-bad); font-size: .82rem; }

@media (max-width: 820px) {
    .admin-shell { grid-template-columns: 1fr; }
    .admin-side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
    .admin-nav { flex-direction: row; flex-wrap: wrap; flex: 1; }
    .admin-logout { border: 0; padding: 0 20px; }
    .editor-grid,
    .editor-grid.side-collapsed { grid-template-columns: 1fr; }
    .editor-side-toggle { display: none; }
    .editor-grid.side-collapsed .editor-side { display: flex; }
}

/* ===== Comentários (admin) ===== */
.admin-tabs { display: flex; gap: 6px; margin-bottom: 20px; }
.admin-tab { background: #fff; border: 1px solid var(--a-line); color: var(--a-ink); padding: 7px 16px; border-radius: 20px; font-size: .85rem; cursor: pointer; font-family: inherit; }
.admin-tab.active { background: var(--a-accent); color: #fff; border-color: var(--a-accent); font-weight: 700; }
.admin-tab:hover:not(.active) { border-color: var(--a-accent); color: var(--a-accent); }
.admin-comment-list { display: flex; flex-direction: column; gap: 14px; }
.admin-comment { background: #fff; border: 1px solid var(--a-line); border-radius: 10px; padding: 16px 18px; }
.admin-comment.pending { border-left: 4px solid var(--a-warn); }
.admin-comment-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; margin-bottom: 8px; font-size: .85rem; }
.admin-comment-meta a { color: var(--a-accent); }
.muted { color: var(--a-muted); }
.badge-pending { background: #fff3cd; color: #856404; border: 1px solid #ffc107; border-radius: 10px; padding: 1px 8px; font-size: .75rem; font-weight: 700; }
.admin-comment-content { margin: 0 0 12px; font-size: .92rem; color: var(--a-ink); white-space: pre-wrap; }
.admin-comment-actions { display: flex; gap: 8px; }
.admin-btn.danger { background: var(--a-bad); }
.admin-btn.danger:hover { background: #a01f1f; }
.admin-empty { color: var(--a-muted); font-size: .95rem; padding: 20px 0; }

/* Destaque no carrossel */
.featured-cell { text-align: center; width: 80px; }
.feat-star { background: none; border: none; font-size: 1.2rem; cursor: pointer; padding: 2px 6px; border-radius: 6px; line-height: 1; }
.feat-star:hover { background: #fff8e1; }
.feat-star.on { filter: drop-shadow(0 0 2px #f0a22f); }
.feat-check-label { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: .88rem; cursor: pointer; }
.feat-check-label input { width: auto; cursor: pointer; }

/* === Anúncios === */
.promo-form { max-width: 560px; margin-bottom: 20px; }
.promo-form input[type="text"], .promo-form input:not([type]), .promo-form input[type="number"], .promo-form select { width: 100%; }
.promo-preview { display: block; max-width: 100%; max-height: 160px; margin: 8px 0; border: 1px solid var(--a-line); border-radius: 8px; }
.promo-thumb { width: 120px; height: 60px; object-fit: cover; border: 1px solid var(--a-line); border-radius: 6px; }
.admin-table tr.row-inactive { opacity: .55; }
.admin-row-actions { display: flex; gap: 8px; justify-content: flex-end; white-space: nowrap; }

/* === Alerta de novidades no dashboard === */
.admin-alert { display: flex; gap: 14px; align-items: flex-start; background: #fff8e1; border: 1px solid #ffe082; border-left: 4px solid #f6a609; border-radius: 8px; padding: 14px 18px; margin-bottom: 22px; }
.admin-alert-icon { font-size: 1.4rem; line-height: 1.2; }
.admin-alert-body strong { display: block; margin-bottom: 6px; color: var(--a-ink); }
.admin-alert-body ul { margin: 0; padding-left: 18px; }
.admin-alert-body li { margin: 2px 0; }
.admin-alert-body a { color: var(--a-accent); font-weight: 600; }
/* Card clicável que vira link; destaque quando tem pendência */
a.admin-card { text-decoration: none; transition: border-color .15s, box-shadow .15s; }
a.admin-card:hover { border-color: var(--a-accent); box-shadow: 0 2px 10px rgba(191,30,180,.08); }
.admin-card.card-alert { border-color: #f6a609; background: #fffdf6; }
.admin-card.card-alert .num { color: #d98400; }

.admin-editor-scroll-top { position: fixed; right: 28px; bottom: 88px; z-index: 8900; width: 46px; height: 46px; border: 0; border-radius: 50%; background: var(--a-accent); color: #fff; box-shadow: 0 10px 24px rgba(0,0,0,.18); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .15s, transform .15s; }
.admin-editor-scroll-top:hover { background: var(--a-accent-dark); transform: translateY(-1px); }
.admin-editor-scroll-top svg { fill: currentColor; display: block; }

/* ===== Tour guiado (admin-tour.js) ===== */
.pt-help-btn { position: fixed; bottom: 28px; right: 28px; z-index: 9000; width: 46px; height: 46px; border-radius: 50%; background: var(--a-accent); color: #fff; border: 0; font-size: 1.3rem; font-weight: 800; cursor: pointer; box-shadow: 0 4px 16px rgba(0,0,0,.22); transition: transform .15s, box-shadow .15s; line-height: 1; }
.pt-help-btn:hover { transform: scale(1.12); box-shadow: 0 6px 22px rgba(0,0,0,.28); }
.pt-help-btn.pt-unseen::after { content: ''; position: absolute; top: 2px; right: 2px; width: 11px; height: 11px; background: #e53935; border-radius: 50%; border: 2px solid #fff; }
.pt-overlay { position: fixed; inset: 0; z-index: 10000; background: transparent; cursor: default; }
.pt-highlight { position: fixed; z-index: 10001; border-radius: 8px; pointer-events: none; box-shadow: 0 0 0 4px var(--a-accent), 0 0 0 9999px rgba(0,0,0,.48); transition: top .25s ease, left .25s ease, width .25s ease, height .25s ease; }
.pt-tooltip { position: fixed; z-index: 10002; background: #fff; border-radius: 12px; padding: 18px 20px 16px; width: min(320px, calc(100vw - 24px)); overflow: auto; box-shadow: 0 8px 32px rgba(0,0,0,.18); transition: visibility .1s; }
.pt-progress { height: 3px; background: #eee; border-radius: 99px; margin-bottom: 14px; overflow: hidden; }
.pt-bar { height: 100%; background: var(--a-accent); border-radius: 99px; transition: width .3s ease; }
.pt-step { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--a-accent); margin: 0 0 6px; }
.pt-title { font-size: .98rem; font-weight: 700; color: var(--a-ink); margin: 0 0 8px; }
.pt-body { font-size: .88rem; color: #555; line-height: 1.6; margin: 0 0 18px; }
.pt-actions { display: flex; justify-content: space-between; gap: 8px; position: sticky; bottom: -16px; margin: 0 -20px -16px; padding: 10px 20px 16px; background: #fff; }
.pt-btn { padding: 8px 18px; border-radius: 8px; border: 0; font-size: .85rem; font-weight: 700; cursor: pointer; font-family: inherit; transition: filter .1s; }
.pt-btn:hover { filter: brightness(1.1); }
.pt-prev { background: #f0f0f0; color: #444; }
.pt-next { background: var(--a-accent); color: #fff; }
.pt-finish { background: #2e7d32; color: #fff; }
