:root {
  --fundo: #0b0b0c;
  --painel: #141416;
  --painel-2: #1b1b1e;
  --borda: #2a2a2e;
  --texto: #f2f0ea;
  --suave: #a3a09a;
  --ouro: #e7c04e;
  --ouro-2: #f3d77a;
  --vermelho: #e63148;
  --verde: #3ccf7a;
  --azul: #5aa9ff;
  --raio: 12px;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--fundo); color: var(--texto); font-size: 15px; line-height: 1.45; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--ouro-2); }
h1, h2, h3 { margin: 0; line-height: 1.2; }

/* ---------- Botões ---------- */
.bt { border: 1px solid var(--borda); background: var(--painel-2); padding: 9px 14px; border-radius: 10px; cursor: pointer; font-weight: 600; display: inline-flex; gap: 8px; align-items: center; white-space: nowrap; }
.bt:hover { border-color: #444; }
.bt:disabled { opacity: .5; cursor: not-allowed; }
.bt.ouro { background: linear-gradient(180deg, var(--ouro-2), var(--ouro)); color: #141006; border-color: transparent; }
.bt.perigo { color: #ff8a98; }
.bt.fantasma { background: transparent; }
.bt.peq { padding: 6px 10px; font-size: 13px; }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 50% 0%, #2a210a 0, var(--fundo) 60%); }
.login form { width: min(380px, 100%); background: var(--painel); border: 1px solid var(--borda); border-radius: 18px; padding: 32px; display: grid; gap: 16px; text-align: center; }
.login img { width: 84px; height: 84px; border-radius: 50%; margin: 0 auto; }
.login input { width: 100%; }

/* ---------- Topo ---------- */
.topo { position: sticky; top: 0; z-index: 5; background: rgba(11,11,12,.9); backdrop-filter: blur(8px); border-bottom: 1px solid var(--borda); }
.topo .in { max-width: 1280px; margin: 0 auto; padding: 12px 20px; display: flex; gap: 16px; align-items: center; }
.marca { display: flex; gap: 10px; align-items: center; font-weight: 800; font-size: 18px; }
.marca img { width: 34px; height: 34px; border-radius: 50%; }
.marca span { color: var(--ouro); }
.abas { display: flex; gap: 4px; margin-left: 12px; }
.abas button { background: none; border: 0; padding: 8px 12px; border-radius: 8px; color: var(--suave); cursor: pointer; font-weight: 600; }
.abas button.ativa { background: var(--painel-2); color: var(--texto); }
.espaco { flex: 1; }
.selo-teste { background: #3a2a05; color: var(--ouro-2); border: 1px solid #6b5212; border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 700; }

main { max-width: 1280px; margin: 0 auto; padding: 20px; }

/* ---------- Calendário ---------- */
.cal-topo { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.cal-topo h2 { font-size: 22px; min-width: 220px; }
.legenda-status { display: flex; gap: 14px; margin-left: auto; color: var(--suave); font-size: 13px; flex-wrap: wrap; }
.legenda-status i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal .dsem { color: var(--suave); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; padding: 4px 6px; }
.dia { background: var(--painel); border: 1px solid var(--borda); border-radius: 10px; min-height: 128px; padding: 6px; display: flex; flex-direction: column; gap: 5px; cursor: pointer; }
.dia:hover { border-color: #3a3a40; }
.dia.fora { opacity: .35; }
.dia.hoje { border-color: var(--ouro); }
.dia .num { font-size: 12px; color: var(--suave); font-weight: 700; display: flex; justify-content: space-between; }
.dia .num .mais { opacity: 0; font-size: 16px; line-height: 1; color: var(--ouro); }
.dia:hover .num .mais { opacity: 1; }
.chip { display: flex; gap: 6px; align-items: center; background: var(--painel-2); border-radius: 8px; padding: 4px; border-left: 3px solid var(--suave); font-size: 12px; cursor: pointer; }
.chip img, .chip .sem { width: 30px; height: 30px; border-radius: 5px; object-fit: cover; background: #222; flex: none; }
.chip .tx { overflow: hidden; min-width: 0; }
.chip .tx b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip .tx small { color: var(--suave); }

.st-rascunho { border-left-color: #777 !important; } .bola-rascunho { background: #777; }
.st-agendado { border-left-color: var(--azul) !important; } .bola-agendado { background: var(--azul); }
.st-publicando { border-left-color: var(--ouro) !important; } .bola-publicando { background: var(--ouro); }
.st-publicado { border-left-color: var(--verde) !important; } .bola-publicado { background: var(--verde); }
.st-erro { border-left-color: var(--vermelho) !important; } .bola-erro { background: var(--vermelho); }
.etq { display: inline-block; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 2px 8px; background: #2a2a2e; }
.etq.agendado { background: #12304f; color: #9cccff; } .etq.publicado { background: #0f3a22; color: #8ff0b6; }
.etq.erro { background: #451219; color: #ff9aa7; } .etq.publicando { background: #3a2a05; color: var(--ouro-2); }

/* ---------- Lista ---------- */
.grupo { margin-bottom: 26px; }
.grupo h3 { font-size: 14px; text-transform: uppercase; letter-spacing: .08em; color: var(--suave); margin-bottom: 10px; }
.linhas { display: grid; gap: 8px; }
.linha { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center; background: var(--painel); border: 1px solid var(--borda); border-left-width: 4px; border-radius: 12px; padding: 8px 12px 8px 8px; cursor: pointer; }
.linha img, .linha .sem { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; background: #222; }
.linha .tx b { display: block; }
.linha .tx small { color: var(--suave); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 70ch; }
.vazio { color: var(--suave); padding: 16px; border: 1px dashed var(--borda); border-radius: 12px; }

/* ---------- Editor ---------- */
.fundo-modal { position: fixed; inset: 0; background: rgba(0,0,0,.65); z-index: 20; display: flex; justify-content: flex-end; }
.editor { width: min(1100px, 100%); height: 100%; background: var(--fundo); border-left: 1px solid var(--borda); overflow: auto; display: flex; flex-direction: column; }
.editor .cab { display: flex; gap: 10px; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--borda); position: sticky; top: 0; background: var(--fundo); z-index: 2; }
.editor .corpo { display: grid; grid-template-columns: 1fr 360px; gap: 24px; padding: 20px; }
.editor .rodape { display: flex; gap: 8px; flex-wrap: wrap; padding: 14px 20px; border-top: 1px solid var(--borda); position: sticky; bottom: 0; background: var(--fundo); margin-top: auto; }
.campo { display: grid; gap: 6px; margin-bottom: 16px; }
.campo > span { font-size: 13px; color: var(--suave); font-weight: 600; }
input[type=text], input[type=password], input[type=datetime-local], textarea {
  background: var(--painel); border: 1px solid var(--borda); border-radius: 10px; padding: 10px 12px; outline: none; width: 100%;
}
input:focus, textarea:focus { border-color: var(--ouro); }
textarea { min-height: 220px; resize: vertical; }
.contador { font-size: 12px; color: var(--suave); text-align: right; }
.contador .ruim { color: var(--vermelho); font-weight: 700; }
.segmento { display: flex; background: var(--painel); border: 1px solid var(--borda); border-radius: 10px; padding: 3px; gap: 3px; }
.segmento button { flex: 1; border: 0; background: none; padding: 8px; border-radius: 8px; cursor: pointer; color: var(--suave); font-weight: 600; }
.segmento button.ativa { background: var(--painel-2); color: var(--ouro-2); }
.soltar { border: 2px dashed var(--borda); border-radius: 12px; padding: 18px; text-align: center; color: var(--suave); cursor: pointer; }
.soltar.sobre { border-color: var(--ouro); color: var(--ouro-2); }
.midias { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.midia { position: relative; width: 96px; }
.midia img, .midia .video { width: 96px; height: 120px; object-fit: cover; border-radius: 8px; background: #222; display: grid; place-items: center; font-size: 12px; color: var(--suave); }
.midia .acoes { display: flex; justify-content: space-between; margin-top: 4px; }
.midia .acoes button { background: var(--painel-2); border: 1px solid var(--borda); border-radius: 6px; cursor: pointer; padding: 2px 7px; font-size: 12px; }
.problemas { background: #2b0f14; border: 1px solid #5c1d27; color: #ffb3bd; border-radius: 10px; padding: 10px 14px; margin-bottom: 16px; font-size: 14px; }
.problemas ul { margin: 4px 0 0; padding-left: 18px; }
.info { background: #11233a; border: 1px solid #1f4470; color: #bcdcff; border-radius: 10px; padding: 10px 14px; margin-bottom: 16px; font-size: 14px; }
.historico { font-size: 13px; color: var(--suave); display: grid; gap: 4px; margin-top: 14px; }
.historico time { color: #77736c; margin-right: 6px; }

/* Prévia no estilo Instagram */
.previa { position: sticky; top: 80px; align-self: start; }
.celular { background: #000; border: 1px solid var(--borda); border-radius: 22px; overflow: hidden; }
.celular .perfil { display: flex; gap: 8px; align-items: center; padding: 10px 12px; font-weight: 700; font-size: 13px; }
.celular .perfil img { width: 30px; height: 30px; border-radius: 50%; }
.celular .foto { width: 100%; aspect-ratio: 4/5; background: #1a1a1a; display: grid; place-items: center; color: #666; overflow: hidden; position: relative; }
.celular .foto img { width: 100%; height: 100%; object-fit: cover; }
.celular.story .foto { aspect-ratio: 9/16; }
.celular .pontos { position: absolute; bottom: 8px; left: 0; right: 0; display: flex; justify-content: center; gap: 4px; }
.celular .pontos i { width: 6px; height: 6px; border-radius: 50%; background: #fff7; }
.celular .pontos i.on { background: var(--azul); }
.celular .leg { padding: 10px 12px 14px; font-size: 13px; white-space: pre-wrap; max-height: 240px; overflow: auto; }
.celular .leg b { margin-right: 6px; }

/* ---------- Conta ---------- */
.cartoes { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.cartao { background: var(--painel); border: 1px solid var(--borda); border-radius: 14px; padding: 18px; }
.cartao h3 { font-size: 15px; margin-bottom: 10px; color: var(--ouro-2); }
.cartao .grande { font-size: 30px; font-weight: 800; }
.cartao ol { padding-left: 18px; margin: 6px 0 0; }
.cartao li { margin-bottom: 6px; }
.cartao code { background: #000; padding: 1px 6px; border-radius: 5px; color: var(--ouro-2); }

#aviso { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(30px); opacity: 0; background: var(--painel-2); border: 1px solid var(--borda); padding: 12px 18px; border-radius: 12px; transition: .25s; z-index: 50; max-width: 90vw; }
#aviso.on { opacity: 1; transform: translateX(-50%); }
#aviso.erro { border-color: var(--vermelho); }

@media (max-width: 900px) {
  .editor .corpo { grid-template-columns: 1fr; }
  .previa { position: static; }
  .abas { margin-left: 0; }
  .topo .in { flex-wrap: wrap; }
  .cal { grid-template-columns: 1fr; }
  .cal .dsem, .dia.vazio-mob, .legenda-status { display: none; }
  .cal-topo h2 { min-width: 0; font-size: 18px; }
  .dia { min-height: auto; }
}
