/* Painel do PostOne. Mesma identidade do site: papel bege, tinta quase preta, verde de ação, cantos de 2 px, superfícies lisas e sem movimento. */
@font-face { font-family: "Atkinson Hyperlegible Next"; font-weight: 400; font-display: swap; src: url("fonts/atkinson-hyperlegible-next-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible Next"; font-weight: 500; font-display: swap; src: url("fonts/atkinson-hyperlegible-next-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible Next"; font-weight: 700; font-display: swap; src: url("fonts/atkinson-hyperlegible-next-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: Literata; font-weight: 400 700; font-display: swap; src: url("fonts/literata-latin-wght-normal.woff2") format("woff2"); }

:root {
  --bg: #f2f0eb; --paper: #fcfbf8; --ink: #1d1b17; --muted: #5c574e; --line: #d3cec4; --accent: #13704a; --accent-ink: #ffffff; --code: #ebe8e0; --perigo: #9a2b1f;
  --serif: Literata, "Iowan Old Style", Georgia, serif;
  --sans: "Atkinson Hyperlegible Next", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #161719; --paper: #1f2124; --ink: #eceae5; --muted: #a6a39c; --line: #3a3d42; --accent: #f0a040; --accent-ink: #1a1206; --code: #26292d; --perigo: #ff8f80; color-scheme: dark; }
}

/* Tema escolhido na tela Configurações (tema.js grava data-tema no <html>); sem escolha, vale o do sistema acima. */
:root[data-tema="claro"] { --bg: #f2f0eb; --paper: #fcfbf8; --ink: #1d1b17; --muted: #5c574e; --line: #d3cec4; --accent: #13704a; --accent-ink: #ffffff; --code: #ebe8e0; --perigo: #9a2b1f; color-scheme: light; }
:root[data-tema="escuro"] { --bg: #161719; --paper: #1f2124; --ink: #eceae5; --muted: #a6a39c; --line: #3a3d42; --accent: #f0a040; --accent-ink: #1a1206; --code: #26292d; --perigo: #ff8f80; color-scheme: dark; }

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.6; overflow-wrap: anywhere; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

.pagina { width: min(1100px, 100%); margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 0 56px; }
.topo { border-bottom: 2px solid var(--ink); }
.topo .pagina { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 20px; padding-block: 18px 12px; }
.marca { font-family: var(--serif); font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin-right: auto; }
.menu { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: baseline; }
.menu a { color: var(--ink); }
.menu a[aria-current="page"] { font-weight: 700; text-decoration-thickness: 2px; }
.quem { color: var(--muted); font-size: 14px; }

/* Menu lateral: colado à esquerda no computador (recolhe só em ícones); no celular vira uma barra no topo, com o menu escondido atrás do hambúrguer. */
.layout { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.layout.recolhido { grid-template-columns: 68px minmax(0, 1fr); }
.lateral { position: sticky; top: 0; align-self: start; height: 100vh; display: flex; flex-direction: column; gap: 14px; padding: 16px 12px; background: var(--paper); border-right: 1px solid var(--line); overflow-x: hidden; }
.lateral .cab { display: flex; align-items: center; gap: 8px; }
.lateral .marca { margin-right: 0; font-size: 24px; }
.lateral .menu { flex-direction: column; flex-wrap: nowrap; gap: 4px; align-items: stretch; }
.lateral .menu a { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 8px 12px; border-radius: 10px; color: var(--muted); font-weight: 500; text-decoration: none; }
.lateral .menu a:hover { background: var(--bg); background: color-mix(in srgb, var(--ink) 7%, transparent); color: var(--ink); }
.lateral .menu a[aria-current="page"] { background: var(--bg); background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--ink); font-weight: 700; }
.lateral .menu a[aria-current="page"] .ico { color: var(--accent); }
.ico { flex: 0 0 auto; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.lateral .ham, .lateral .sair { display: flex; align-items: center; gap: 12px; min-height: 44px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 500; cursor: pointer; }
.lateral .ham { justify-content: center; width: 44px; min-width: 44px; padding: 0; color: var(--ink); }
.lateral .sair { padding: 8px 12px; justify-content: flex-start; }
.lateral .ham:hover, .lateral .sair:hover { background: var(--bg); background: color-mix(in srgb, var(--ink) 7%, transparent); color: var(--ink); }
.lateral .usuario { margin-top: auto; display: grid; gap: 8px; }
.lateral .quem { padding: 0 12px; }
.contador-menu { margin-left: auto; min-width: 22px; padding: 0 6px; text-align: center; font-size: 12px; font-weight: 700; color: var(--accent-ink); background: var(--accent); border-radius: 999px; }
.selo-seco { align-self: start; padding: 2px 10px; font-size: 13px; font-weight: 700; color: var(--ink); background: var(--bg); border: 1px dashed var(--ink); border-radius: 999px; }
.selo-mini { display: none; align-self: center; width: 32px; height: 32px; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; background: var(--bg); border: 1px dashed var(--ink); border-radius: 999px; }
.layout.recolhido .marca, .layout.recolhido .rot, .layout.recolhido .selo-seco, .layout.recolhido .quem { display: none; }
.layout.recolhido .selo-mini:not([hidden]) { display: flex; }
.layout.recolhido .lateral .menu a, .layout.recolhido .lateral .sair { justify-content: center; padding: 8px; position: relative; }
.layout.recolhido .contador-menu { position: absolute; top: 2px; right: 2px; min-width: 18px; padding: 0 4px; font-size: 11px; margin: 0; }
.conteudo { min-width: 0; }
@media (max-width: 760px) {
  .layout, .layout.recolhido { grid-template-columns: 1fr; }
  .lateral { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .lateral .menu { flex-direction: row; flex-wrap: wrap; flex: 1 1 100%; order: 3; }
  .lateral .usuario { margin-top: 0; display: flex; align-items: center; gap: 10px; margin-left: auto; }
  .layout.recolhido .lateral .menu { display: none; }
  .layout.recolhido .marca, .layout.recolhido .quem { display: initial; }
  .layout.recolhido .selo-mini:not([hidden]) { display: none; }
  .layout.recolhido .selo-seco:not([hidden]) { display: inline-block; }
}

h1, h2, h3 { font-family: var(--serif); letter-spacing: -.02em; line-height: 1.2; text-wrap: balance; }
h1 { font-size: clamp(26px, 4vw, 34px); font-weight: 600; margin: 28px 0 12px; }
h2 { font-size: 21px; font-weight: 600; margin: 28px 0 10px; padding-top: 14px; border-top: 2px solid var(--ink); }
h3 { font-size: 17px; font-weight: 700; margin: 18px 0 6px; }
p { margin: 0 0 .9em; }
.meta { color: var(--muted); font-size: 14px; }

.aviso { background: var(--paper); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 2px; padding: 10px 14px; margin: 0 0 1em; }
.aviso.erro { border-left-color: var(--perigo); color: var(--perigo); }
.pagina-texto { width: min(720px, 100%); margin: 0 auto; padding: 24px max(16px, env(safe-area-inset-right, 0px)) 56px max(16px, env(safe-area-inset-left, 0px)); }
.pagina-texto ul { padding-left: 22px; }

.lista { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.item { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 2px; padding: 10px 12px; }
.item .titulo { flex: 1 1 220px; min-width: 0; font-weight: 500; }
.item .detalhe { flex: 1 1 100%; color: var(--muted); font-size: 14px; }
.vazio { color: var(--muted); }

.cartao { background: var(--paper); border: 1px solid var(--line); border-radius: 2px; padding: 14px 16px; margin: 0 0 12px; }
.cartao h3:first-child { margin-top: 0; }
.texto-rede { white-space: pre-wrap; background: var(--bg); border: 1px solid var(--line); border-radius: 2px; padding: 10px 12px; margin: 6px 0; }
.contador { font-size: 14px; color: var(--muted); }
.contador.estourou { color: var(--perigo); font-weight: 700; }
.previas { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.previas img, .midia img { display: block; max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 2px; background: var(--paper); }
.previas img { max-height: 160px; width: auto; }
.midia { display: grid; gap: 4px; margin: 0 0 12px; }
.etiqueta { display: inline-block; border: 1px solid var(--line); border-radius: 2px; padding: 0 6px; font-size: 13px; background: var(--bg); }
.etiqueta.ia { border-color: var(--accent); }

form { display: grid; gap: 12px; max-width: 520px; margin: 0 0 16px; }
label { display: grid; gap: 4px; font-weight: 500; }
.opcao { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.opcao input { margin-top: 5px; }
input[type="text"], input[type="email"], input[type="password"], input[type="url"], input[type="datetime-local"], textarea {
  font: inherit; color: var(--ink); background: var(--paper); border: 1px solid var(--ink); border-radius: 2px; padding: 8px 10px; width: 100%; min-height: 44px;
}
textarea { min-height: 88px; resize: vertical; }

button, .botao { font: inherit; font-weight: 500; color: var(--ink); background: var(--paper); border: 1px solid var(--ink); border-radius: 2px; padding: 8px 14px; min-height: 44px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
button:hover, .botao:hover { background: var(--bg); }
button.primario { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
button.primario:hover { background: var(--accent); filter: none; text-decoration: underline; }
button.perigo { border-color: var(--perigo); color: var(--perigo); }
button:disabled { opacity: .55; cursor: not-allowed; }
button.icone { min-width: 44px; padding: 8px; }
button.icone svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: square; stroke-linejoin: miter; }
.acoes { display: flex; flex-wrap: wrap; gap: 8px; }

@media (max-width: 480px) {
  .topo .pagina { padding-block: 12px 8px; }
  .acoes button { flex: 1 1 100%; }
}

/* Configurações */
.temas { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-top: 10px; }
.tema { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); cursor: pointer; font-weight: 400; }
.tema:has(input:checked) { border-color: var(--accent); outline: 2px solid var(--accent); }
.amostra { display: flex; gap: 4px; height: 30px; }
.amostra i { flex: 1; border: 1px solid var(--line); border: 1px solid color-mix(in srgb, var(--ink) 25%, transparent); border-radius: 4px; }
.amostra.claro i:nth-child(1) { background: #f2f0eb; } .amostra.claro i:nth-child(2) { background: #fcfbf8; } .amostra.claro i:nth-child(3) { background: #1d1b17; } .amostra.claro i:nth-child(4) { background: #13704a; }
.amostra.escuro i:nth-child(1) { background: #161719; } .amostra.escuro i:nth-child(2) { background: #1f2124; } .amostra.escuro i:nth-child(3) { background: #eceae5; } .amostra.escuro i:nth-child(4) { background: #f0a040; }
.amostra.padrao i:nth-child(1) { background: #f2f0eb; } .amostra.padrao i:nth-child(2) { background: #161719; } .amostra.padrao i:nth-child(3) { background: #13704a; } .amostra.padrao i:nth-child(4) { background: #f0a040; }
.cartao h2 { border-top: 0; padding-top: 0; margin-top: 0; }
.novo-usuario { margin-top: 14px; } .novo-usuario summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 500; }
.ambiente { display: grid; grid-template-columns: minmax(140px, 220px) 1fr; gap: 8px 16px; margin: 10px 0 0; } .ambiente dt { color: var(--muted); } .ambiente dd { margin: 0; }
.item select { font: inherit; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; min-height: 44px; }

/* Auditoria */
.filtros { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: end; max-width: none; margin: 14px 0 18px; }
.filtros label { min-width: 150px; }
.filtros select, input[type="date"] { font: inherit; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; min-height: 44px; width: 100%; }
.tabela { background: var(--paper); border: 1px solid var(--line); border-radius: 6px; overflow-x: auto; }
.tabela table { width: 100%; border-collapse: collapse; min-width: 720px; }
.tabela th { text-align: left; font-size: 13px; font-weight: 700; color: var(--muted); padding: 10px 12px; border-bottom: 2px solid var(--ink); }
.tabela td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tabela tr:last-child td { border-bottom: 0; }
.tabela td:first-child { min-width: 120px; }
.tabela td:nth-child(1) { white-space: normal; }
.tabela code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
.tabela details summary { cursor: pointer; color: var(--accent); }
.tabela pre { margin: 6px 0 0; padding: 8px 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; font-size: 12px; white-space: pre-wrap; color: var(--muted); }
#mais { margin-top: 14px; }

/* Posts: lista e calendário */
.cabecalho-pagina { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.vistas { display: flex; }
.vistas button { border-radius: 0; margin-left: -1px; }
.vistas button:first-child { border-radius: 6px 0 0 6px; margin-left: 0; }
.vistas button:last-child { border-radius: 0 6px 6px 0; }
.vistas button[aria-pressed="true"] { background: var(--ink); color: var(--paper); font-weight: 700; }
.filtros .busca { flex: 1 1 260px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.chips button[aria-pressed="true"] { background: var(--ink); color: var(--paper); font-weight: 700; }
.etiqueta.rev { border-color: var(--accent); color: var(--accent); font-weight: 700; }
.etiqueta.agd { background: var(--ink); color: var(--paper); }
.etiqueta.pub { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.etiqueta.fal { border-color: var(--perigo); color: var(--perigo); font-weight: 700; }
.etiqueta.ver { border-style: dashed; }
.etiqueta.ras { color: var(--muted); }
.tabela td a { font-weight: 500; }
.cal-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 0 12px; }
.cal-nav h2 { border-top: 0; padding-top: 0; margin: 0 8px; min-width: 190px; text-align: center; }
.calendario { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; margin-bottom: 12px; }
.calendario .cab-dia { background: var(--bg); padding: 6px 8px; font-size: 13px; font-weight: 700; color: var(--muted); }
.calendario .dia { min-height: 104px; padding: 6px; background: var(--paper); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.calendario .dia.fora { background: var(--bg); }
.calendario .dia .n { font-size: 13px; font-weight: 700; }
.calendario .dia.hoje .n { align-self: flex-start; padding: 0 6px; background: var(--ink); color: var(--paper); border-radius: 4px; }
.calendario .it { display: block; padding: 2px 6px; font-size: 12px; line-height: 18px; border: 1px solid var(--ink); border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); text-decoration: none; }
.calendario .it.agd { background: var(--ink); color: var(--paper); }
.calendario .it.pub { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.calendario .it.fal { border-color: var(--perigo); color: var(--perigo); font-weight: 700; }
.calendario .it.man { border-style: dashed; }
@media (max-width: 760px) { .calendario .dia { min-height: 72px; padding: 4px; } .calendario .it { font-size: 11px; } }

/* Sistemas */
.escopos { border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); column-gap: 20px; }
.escopos legend { font-weight: 500; padding: 0 6px; }
.escopos label { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; padding: 4px 0; }
.escopos input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--accent); }
.escopos .meta { display: block; }
#chave-valor { flex: 1 1 280px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 14px; }
#chave-nova .acoes { margin-top: 8px; }

/* Contas em cartões */
.cartoes { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; margin-bottom: 24px; }
.cartao.rede { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.cartao.rede h3 { margin: 0; font-size: 19px; }
.rede-cab { display: flex; gap: 12px; align-items: center; }
.rede-icone { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-weight: 700; font-size: 18px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; }
.cartao.rede.em-breve { opacity: .75; }
.cartao.rede .etiquetas { display: flex; flex-wrap: wrap; gap: 6px; }
.cartao.rede details summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--accent); font-weight: 500; }
.cartao.rede form { max-width: none; }
.etiqueta.ok { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.cartao.rede .acoes { margin-top: auto; }

#auditoria-linhas td:first-child { white-space: nowrap; }
