/* Plataforma Mederos: mesmo padrão visual do Movik (preto, Inter, menu em pílula, azul só no botão principal). */
@font-face { font-family: "Inter"; src: url("/a/fontes/inter-latin.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #000; --sidebar: #0b0b0b; --surface: #151515; --surface-2: #1f1f1f; --surface-3: #2a2a2a;
  --label: #f5f5f5; --label-2: #b4b4b4; --label-3: #8f8f8f;
  --separator: rgba(255, 255, 255, .12); --separator-2: rgba(255, 255, 255, .2);
  --accent: #0A6CFF; --perigo: #ff8f8f;
  --raio: 16px; --raio-campo: 12px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --saida: cubic-bezier(.22, 1, .36, 1);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--label); font: 400 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--label); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- casca ---------- */
.app { display: flex; flex-wrap: wrap; min-height: 100vh; }
.sidebar { flex: 1 1 240px; max-width: 100%; background: var(--sidebar); border-right: 1px solid var(--separator); padding: 24px 16px; display: flex; flex-direction: column; gap: 4px; }
@media (min-width: 900px) { .sidebar { flex: 0 0 240px; position: sticky; top: 0; height: 100vh; } }
.marca { display: flex; align-items: center; gap: 10px; padding: 4px 12px 24px; font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.marca i { width: 28px; height: 28px; border-radius: 8px; background: var(--label); color: var(--bg); display: grid; place-items: center; font-style: normal; font-size: 15px; }
.nav-item { display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 14px; border-radius: 999px; color: var(--label-2); text-decoration: none; font-weight: 500; transition: background .2s ease, color .2s ease; }
.nav-item:hover { background: var(--surface); color: var(--label); }
.nav-item[aria-current="page"] { background: var(--surface-2); color: var(--label); font-weight: 600; }
.nav-sep { margin: 18px 14px 6px; font-size: 12px; color: var(--label-3); }
.nav-item.em-breve { color: var(--label-3); pointer-events: none; }
.nav-item.em-breve small { margin-left: auto; font-size: 11px; }
.sidebar-fim { margin-top: auto; padding: 12px; border-top: 1px solid var(--separator); font-size: 12px; color: var(--label-3); }
.conteudo { flex: 999 1 560px; min-width: 0; padding: 40px 48px 64px; }
@media (max-width: 700px) { .conteudo { padding: 24px 16px 48px; } }

.cabeca { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.cabeca small { display: block; color: var(--label-3); font-size: 13px; margin-bottom: 6px; }
.title { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.acoes { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ---------- botões e campos ---------- */
.botao { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--separator-2); background: transparent; font-weight: 500; cursor: pointer; text-decoration: none; transition: background .2s ease, transform .15s ease, opacity .2s ease; white-space: nowrap; }
.botao:hover { background: var(--surface); }
.botao:active { transform: scale(.98); }
.botao:disabled { opacity: .45; cursor: default; }
.botao.claro { background: var(--label); color: var(--bg); border-color: transparent; font-weight: 600; }
.botao.claro:hover { background: #fff; }
.botao.principal { background: var(--accent); color: #fff; border-color: transparent; font-weight: 600; }
.botao.principal:hover { background: #2a7fff; }
.botao.pequeno { height: 36px; padding: 0 14px; font-size: 13px; }
.botao.icone { width: 36px; padding: 0; height: 36px; }
select.botao { appearance: none; padding-right: 34px; background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23b4b4b4' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center; }
select.botao option { background: var(--surface); color: var(--label); }

.campo { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--label-3); min-width: 0; }
.campo input, .campo select, .campo textarea { width: 100%; min-height: 44px; border-radius: var(--raio-campo); border: 1px solid var(--separator); background: var(--surface-2); padding: 10px 12px; font-size: 14px; color: var(--label); transition: border-color .2s ease; }
.campo textarea { resize: vertical; min-height: 88px; line-height: 1.5; }
.campo input:focus, .campo select:focus, .campo textarea:focus { outline: none; border-color: var(--label-2); }
.campo .ajuda { font-size: 12px; color: var(--label-3); }
.grade-campos { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.grade-campos .largo { grid-column: 1 / -1; }

.pilulas { display: flex; flex-wrap: wrap; gap: 8px; }
.pilula { height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--separator-2); background: transparent; color: var(--label-2); font-size: 13px; font-weight: 500; cursor: pointer; }
.pilula[aria-pressed="true"] { background: var(--label); border-color: transparent; color: var(--bg); }

.selo { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; background: var(--surface-2); font-size: 12px; color: var(--label-2); white-space: nowrap; }
.selo.publicada { color: var(--label); }
.selo.aceita { background: var(--label); color: var(--bg); font-weight: 600; }

.cartao { background: var(--surface); border-radius: var(--raio); padding: 22px; }
.cartao + .cartao { margin-top: 16px; }
.cartao h2 { margin: 0 0 16px; font-size: 16px; font-weight: 600; }
.vazio { color: var(--label-3); padding: 24px 0; text-align: center; }

/* ---------- painel ---------- */
.resumo-grade { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.kpi { background: var(--surface); border-radius: var(--raio); padding: 20px; display: flex; flex-direction: column; gap: 8px; }
.kpi span { font-size: 13px; color: var(--label-3); }
.kpi strong { font-size: 28px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tabela-caixa { overflow-x: auto; }
table { width: 100%; min-width: 520px; border-collapse: collapse; }
th { text-align: left; font-size: 12px; font-weight: 500; color: var(--label-3); padding: 8px 0; }
td { padding: 13px 12px 13px 0; border-top: 1px solid var(--separator); font-variant-numeric: tabular-nums; }
td a { text-decoration: none; font-weight: 500; }
td a:hover { text-decoration: underline; }

/* ---------- propostas ---------- */
.propostas { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 1100px) { .propostas { grid-template-columns: 1fr; } }
.lista { display: flex; flex-direction: column; gap: 6px; }
.lista-topo { display: flex; flex-direction: column; gap: 12px; margin-bottom: 8px; }
.item { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; width: 100%; padding: 14px 16px; border-radius: 12px; border: 0; background: #0f0f0f; text-align: left; cursor: pointer; transition: background .2s ease; }
.item:hover { background: var(--surface); }
.item[aria-current="true"] { background: var(--surface-2); }
.item b { font-size: 14px; font-weight: 600; }
.item span { font-size: 12px; color: var(--label-3); }
.item .linha { display: flex; gap: 8px; align-items: center; width: 100%; justify-content: space-between; }

.editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 1400px) { .editor { grid-template-columns: 1fr; } }
.editor-cabeca { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 14px; margin-bottom: 18px; }
.editor-cabeca h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.editor-cabeca .meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; font-size: 13px; color: var(--label-3); }
.salvo { font-size: 12px; color: var(--label-3); min-width: 70px; }
.erros { margin: 0 0 16px; padding: 12px 14px; border-radius: 12px; background: rgba(255, 143, 143, .08); color: var(--perigo); font-size: 13px; }
.erros:empty { display: none; }

.totais { display: flex; flex-wrap: wrap; gap: 24px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--separator); }
.totais div { display: flex; flex-direction: column; gap: 2px; }
.totais span { font-size: 12px; color: var(--label-3); }
.totais strong { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }

details.secao { background: var(--surface); border-radius: var(--raio); }
details.secao + details.secao { margin-top: 12px; }
details.secao > summary { list-style: none; display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 0 22px; font-weight: 600; cursor: pointer; }
details.secao > summary::-webkit-details-marker { display: none; }
details.secao > summary .ic { color: var(--label-3); transition: transform .3s var(--saida); }
details.secao[open] > summary .ic { transform: rotate(90deg); }
details.secao > summary small { margin-left: auto; font-weight: 400; color: var(--label-3); font-size: 12px; }
.secao-corpo { padding: 0 22px 22px; }

.bloco { border-radius: 12px; background: var(--surface-2); }
.bloco + .bloco { margin-top: 8px; }
.bloco-linha { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 8px 0 14px; }
.bloco-linha .nome { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bloco-linha .nome b { font-weight: 500; }
.bloco-linha .nome span { font-size: 12px; color: var(--label-3); }
.bloco.desligado .nome b { color: var(--label-3); }
.bloco-corpo { padding: 4px 14px 16px; display: grid; gap: 12px; }
.chave { position: relative; width: 44px; height: 26px; flex: none; border-radius: 999px; border: 0; background: var(--surface-3); cursor: pointer; transition: background .25s ease; }
.chave::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--label-3); transition: transform .3s var(--saida), background .25s ease; }
.chave[aria-checked="true"] { background: var(--label); }
.chave[aria-checked="true"]::after { transform: translateX(18px); background: var(--bg); }
.chave:disabled { opacity: .4; cursor: not-allowed; }

.previa { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 12px; }
.previa-barra { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.previa-moldura { background: var(--surface); border-radius: var(--raio); padding: 12px; display: grid; place-items: center; }
.previa-moldura iframe { width: 100%; height: calc(100vh - 160px); min-height: 520px; border: 0; border-radius: 10px; background: #000; }
.previa-moldura.celular iframe { width: 390px; max-width: 100%; height: min(844px, calc(100vh - 160px)); }

.aviso { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 16px); opacity: 0; padding: 12px 18px; border-radius: 999px; background: var(--label); color: var(--bg); font-weight: 500; transition: opacity .3s ease, transform .3s var(--saida); pointer-events: none; z-index: 10; }
.aviso.visivel { opacity: 1; transform: translate(-50%, 0); }

dialog { border: 0; border-radius: 20px; background: var(--surface); color: var(--label); padding: 24px; width: min(440px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(0, 0, 0, .7); }
dialog h2 { margin: 0 0 18px; font-size: 18px; }
dialog form { display: grid; gap: 14px; }
dialog .acoes { justify-content: flex-end; margin-top: 6px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
