/* Painel administrativo */
:root { --p: #1e7b3f; --p-dark: #135a2d; --acc: #f6c611; --bg: #f3f5f2; --line: #e1e6df; --text: #1c2420; --muted: #6b766e; --danger: #c62828; }
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 14.5px; color: var(--text); background: var(--bg); }
a { color: var(--p); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.inline { display: inline; }
.admin { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.a-side { background: #14201a; color: #cfd8d1; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.a-brand { color: #fff; font-weight: 800; font-size: 1.1rem; padding: 20px 18px; display: flex; flex-direction: column; border-bottom: 1px solid rgba(255,255,255,.08); }
.a-brand small { font-weight: 400; font-size: .72rem; color: var(--acc); text-transform: uppercase; letter-spacing: .12em; }
.a-side nav { display: flex; flex-direction: column; padding: 10px; gap: 2px; }
.a-side nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; color: inherit; font-weight: 500; }
.a-side nav a:hover { background: rgba(255,255,255,.06); text-decoration: none; }
.a-side nav a.on { background: var(--p); color: #fff; }
.a-side-foot { margin-top: auto; padding: 14px 18px; border-top: 1px solid rgba(255,255,255,.08); display: flex; justify-content: space-between; font-size: .85rem; }
.a-side-foot a { color: #fff; }
.a-side-foot .link { background: none; border: 0; color: #f8b4b4; cursor: pointer; font: inherit; padding: 0; }
.a-main { padding: 22px 28px 60px; min-width: 0; }
.a-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.a-top h1 { font-size: 1.45rem; font-weight: 800; }
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-weight: 500; }
.flash-ok { background: #e3f6e8; color: #145a2c; border: 1px solid #b9e4c5; }
.flash-err { background: #fdecea; color: #8a1c1c; border: 1px solid #f5c2c0; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; margin-bottom: 18px; }
.panel h2 { font-size: 1rem; font-weight: 700; margin-bottom: 14px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.panel h2 + h2, .panel .grid-2 + h2, .panel label + h2 { margin-top: 18px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; color: inherit; }
.stat:hover { text-decoration: none; border-color: var(--p); }
.stat b { font-size: 1.7rem; font-weight: 800; color: var(--p); }
.stat span { font-size: .8rem; color: var(--muted); }
.a-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.filters { display: flex; gap: 6px; margin-left: auto; }
.cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; align-items: start; }
.cols-form { grid-template-columns: 420px 1fr; }
.cols-editor { grid-template-columns: minmax(0, 1fr) 330px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 8px 8px; border-bottom: 2px solid var(--line); }
td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr.inactive td { opacity: .55; }
td.actions { white-space: nowrap; text-align: right; }
td.actions form { display: inline; }
.thumb { width: 72px; border-radius: 6px; display: block; }
.thumb-wide { max-width: 200px; max-height: 70px; border-radius: 6px; display: block; margin-bottom: 8px; }
.cover-preview { width: 100%; border-radius: 8px; margin-bottom: 10px; }
.tag { display: inline-block; font-size: .7rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: #eceeeb; color: #555; margin-left: 4px; }
.tag-published { background: #e3f6e8; color: #145a2c; }
.tag-draft { background: #fff3d6; color: #7a5200; }
.tag-feat { background: #fff1b8; color: #6b5200; }
.tag-oficial { background: #e3f6e8; color: #145a2c; }
.tag-veiculo { background: #fde9d6; color: #8a4b12; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; }
.simple-list { padding-left: 20px; margin: 0; }
.simple-list li { margin-bottom: 8px; }
label { display: block; font-weight: 600; font-size: .85rem; margin-bottom: 12px; }
label small { font-weight: 400; }
input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="number"], input[type="url"], input[type="date"], input[type="datetime-local"], input:not([type]), select, textarea {
  display: block; width: 100%; margin-top: 5px; padding: 9px 11px; border: 1px solid #cfd6cc; border-radius: 8px; font: inherit; background: #fff; color: var(--text);
}
input[type="file"] { margin-top: 5px; font-size: .85rem; }
input[type="color"] { margin-top: 5px; height: 40px; width: 100%; border: 1px solid #cfd6cc; border-radius: 8px; background: #fff; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--p); outline-offset: 0; border-color: var(--p); }
input.big { font-size: 1.25rem; font-weight: 700; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.check input { width: auto; margin: 0; }
.field { margin-bottom: 12px; }
.field .label { display: block; font-weight: 600; font-size: .85rem; margin-bottom: 5px; }
.btn { display: inline-block; padding: 9px 16px; border-radius: 8px; border: 1px solid #cfd6cc; background: #fff; color: var(--text); font: inherit; font-weight: 600; cursor: pointer; font-size: .88rem; }
.btn:hover { text-decoration: none; background: #f3f5f2; }
.btn-primary { background: var(--p); border-color: var(--p); color: #fff; }
.btn-primary:hover { background: var(--p-dark); }
.btn-danger { color: var(--danger); border-color: #f0c4c4; }
.btn-danger:hover { background: #fdecea; }
.btn-danger.confirming { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 5px 10px; font-size: .78rem; margin-left: 4px; }
.btn-block { width: 100%; text-align: center; }
.btn-row { display: flex; gap: 8px; margin-top: 8px; }
.side-panel .panel { padding: 14px 16px; }
.side-panel .panel h2 { font-size: .9rem; }

/* Editor */
.editor { border: 1px solid #cfd6cc; border-radius: 8px; background: #fff; overflow: hidden; }
.ed-toolbar { display: flex; flex-wrap: wrap; gap: 3px; padding: 6px; background: #f5f7f4; border-bottom: 1px solid var(--line); }
.ed-toolbar button { border: 1px solid transparent; background: transparent; padding: 5px 8px; border-radius: 6px; font: inherit; font-size: .82rem; cursor: pointer; }
.ed-toolbar button:hover { background: #fff; border-color: #cfd6cc; }
.ed-toolbar .sep { width: 1px; background: #d5dbd2; margin: 4px 4px; }
.ed-inline { display: flex; gap: 6px; padding: 8px; background: #fff8dc; border-bottom: 1px solid #f0dc8a; align-items: center; }
.ed-inline input[type="text"] { margin: 0; flex: 1; }
.ed-area { min-height: 380px; padding: 16px 18px; font-size: 1.05rem; line-height: 1.65; outline: none; }
.ed-area:empty::before { content: attr(data-placeholder); color: #aab; }
.ed-area img { max-width: 100%; height: auto; border-radius: 6px; }
.ed-area blockquote { border-left: 4px solid var(--acc); margin: 1em 0; padding: 6px 14px; background: #fafaf5; }
.ed-area .video-embed { position: relative; aspect-ratio: 16/9; background: #000; margin: 1em 0; border-radius: 6px; overflow: hidden; }
.ed-area .video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; pointer-events: none; }
.ed-area a { color: var(--p); text-decoration: underline; }
.ed-source { width: 100%; border: 0; padding: 14px; font: 13px/1.5 ui-monospace, Menlo, Consolas, monospace; min-height: 380px; resize: vertical; }

/* Login */
.login-body { display: grid; place-items: center; min-height: 100vh; background: linear-gradient(135deg, #135a2d, #1e7b3f 60%, #f6c611); padding: 20px; }
.login-box { background: #fff; padding: 34px 32px; border-radius: 16px; width: 100%; max-width: 380px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.login-box h1 { font-size: 1.4rem; font-weight: 800; }
.login-box .muted { margin: 4px 0 18px; }

@media (max-width: 900px) {
  .admin { grid-template-columns: 1fr; }
  .a-side { position: static; height: auto; }
  .a-side nav { flex-direction: row; flex-wrap: wrap; }
  .a-main { padding: 16px; }
  .cols, .cols-form, .cols-editor { grid-template-columns: 1fr; }
  .filters { margin-left: 0; }
}

/* Painel de Analytics */
.ga-agora { font-size: .95rem; }
.stat span em { font-style: normal; font-weight: 600; font-size: .78rem; margin-left: 4px; }
.stat span em.up { color: #145a2c; }
.stat span em.down { color: #b3261e; }
.ga-chart { display: flex; align-items: flex-end; gap: 3px; height: 130px; padding-top: 6px; }
.ga-bar { flex: 1; background: linear-gradient(180deg, #1e7b3f, #6bbf87); border-radius: 3px 3px 0 0; min-width: 4px; }
.ga-bar:hover { background: #135a2d; }
.ga-chart-eixo { display: flex; justify-content: space-between; font-size: .72rem; color: var(--muted); margin-top: 6px; }
.ga-track { background: #eceeeb; border-radius: 999px; height: 10px; overflow: hidden; }
.ga-fill { background: #1e7b3f; height: 100%; border-radius: 999px; }

/* Colunistas / fluxo editorial */
.nav-badge { background: #ffb020; color: #4a2f00; font-size: .7rem; font-weight: 700; border-radius: 999px; padding: 1px 7px; margin-left: auto; }
.a-side nav a { position: relative; }
.tag-pending { background: #ffe8c2; color: #8a5200; }
.perfil-foto { width: 96px; height: 96px; object-fit: cover; border-radius: 50%; border: 2px solid var(--line); }
.pend-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.pend-item:last-child { border-bottom: 0; }
.pend-item .who { font-size: .8rem; color: var(--muted); }

/* Página de Ajuda */
.ajuda { max-width: 820px; line-height: 1.65; }
.ajuda h2 { font-size: 1.4rem; border-bottom: 2px solid var(--line); padding-bottom: 6px; margin: 1.6em 0 .6em; }
.ajuda h3 { font-size: 1.1rem; margin: 1.3em 0 .4em; }
.ajuda h4 { font-size: 1rem; margin: 1.1em 0 .3em; color: var(--muted); }
.ajuda p { margin: 0 0 1em; }
.ajuda ul, .ajuda ol { margin: 0 0 1em; padding-left: 1.4em; }
.ajuda li { margin-bottom: .35em; }
.ajuda code { background: #eef1ee; padding: 1px 6px; border-radius: 5px; font-size: .9em; }
.ajuda pre { background: #14201a; color: #e6ede4; padding: 12px 14px; border-radius: 8px; overflow-x: auto; }
.ajuda pre code { background: none; color: inherit; padding: 0; }
.ajuda blockquote { border-left: 4px solid var(--acc); background: #fffdf5; margin: 1em 0; padding: 8px 16px; color: #5a4a1a; }
.ajuda hr { border: 0; border-top: 1px solid var(--line); margin: 1.8em 0; }
.ajuda .ajuda-linha { padding: 4px 0; border-bottom: 1px dashed var(--line); font-size: .92rem; }
.ajuda a { text-decoration: underline; }

/* ---- Módulo comercial (CRM + financeiro) ---- */
.tag-danger { background: #fbe0e0; color: #8a1f2d; }
/* Sub-navegação como controle segmentado (abas em forma de botão) */
.subnav { display: inline-flex; flex-wrap: wrap; gap: 2px; margin: 0 0 20px; padding: 4px; background: #eef0ed; border: 1px solid var(--line); border-radius: 12px; }
.subnav a { padding: 8px 16px; font-size: .9rem; font-weight: 600; color: #555; border-radius: 8px; text-decoration: none; transition: background .12s, color .12s; }
.subnav a:hover { color: var(--p); background: #fff; }
.subnav a.on { color: #fff; background: var(--p); }
.stat.neg b { color: #8a1f2d; }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
/* Filtros como pílulas-botão */
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.filters a { font-size: .85rem; font-weight: 600; padding: 6px 14px; border-radius: 999px; background: #eef0ed; border: 1px solid var(--line); color: #555; text-decoration: none; }
.filters a:hover { border-color: var(--p); color: var(--p); }
.filters a.on { background: var(--p); border-color: var(--p); color: #fff; }
.filters .sep { flex: 1; }
/* Botões de ação um pouco mais respiráveis no módulo */
.btn-row .btn { margin-bottom: 4px; }
