:root {
  --bg: #f4f5f7; --card: #fff; --text: #1d2129; --muted: #6b7280; --line: #e3e5e8;
  --pri: #d62976; --pri-dark: #b01f61; --ok: #15803d; --ok-bg: #e7f6ec; --live: #dc2626; --live-bg: #fde8e8;
  --warn: #a16207; --warn-bg: #fdf4dc; --info-bg: #eef2ff; --radius: 12px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.45; }
h1, h2, h3 { margin: 0 0 .25rem; line-height: 1.2; }
h2 { font-size: 1.35rem; } h3 { font-size: 1.05rem; }
a { color: var(--pri); }
.muted { color: var(--muted); margin: .2rem 0; }
.erro { color: var(--live); background: var(--live-bg); padding: .5rem .7rem; border-radius: 8px; margin: .5rem 0; }
[hidden] { display: none !important; }

/* botões e campos */
.btn { border: 1px solid var(--line); background: #fff; color: var(--text); padding: .55rem .95rem; border-radius: 8px;
  font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover { background: #f3f4f6; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primario { background: var(--pri); border-color: var(--pri); color: #fff; }
.btn.primario:hover:not(:disabled) { background: var(--pri-dark); }
.btn.perigo { color: var(--live); border-color: #f3c3c3; }
.btn.perigo:hover { background: var(--live-bg); }
.btn.leve { background: transparent; }
.btn.pequeno { padding: .3rem .6rem; font-size: .85rem; }
.btn.parar { background: var(--live); border-color: var(--live); color: #fff; }
label { display: flex; flex-direction: column; gap: .25rem; font-size: .85rem; font-weight: 600; color: #374151; }
input, select { font: inherit; font-weight: 400; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: var(--text); min-width: 0; }
input:focus, select:focus { outline: 2px solid #f5b5d0; border-color: var(--pri); }
.link { color: var(--pri); cursor: pointer; text-decoration: underline; display: inline; font-size: inherit; font-weight: 600; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.login-box { background: var(--card); padding: 2rem; border-radius: var(--radius); width: 100%; max-width: 360px;
  display: flex; flex-direction: column; gap: .9rem; box-shadow: 0 4px 24px rgba(0,0,0,.06); }

/* topo e abas */
.topo { position: sticky; top: 0; z-index: 5; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 1rem; padding: .6rem 1.2rem; flex-wrap: wrap; }
.marca { font-weight: 800; }
.abas { display: flex; gap: .25rem; flex-wrap: wrap; }
.abas button { border: 0; background: transparent; padding: .5rem .8rem; border-radius: 8px; font: inherit; font-weight: 600;
  color: var(--muted); cursor: pointer; }
.abas button.ativa { background: #fdeaf2; color: var(--pri-dark); }
.topo-dir { margin-left: auto; display: flex; gap: .8rem; align-items: center; font-size: .9rem; }
.aba { max-width: 1200px; margin: 0 auto; padding: 1.2rem; }
.aba-topo { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }

.ajuda { background: var(--info-bg); border-radius: var(--radius); padding: .7rem 1rem; margin-bottom: 1rem; }
.ajuda summary { cursor: pointer; font-weight: 700; }
.ajuda ol { margin: .5rem 0; padding-left: 1.2rem; }

/* cartões das contas */
.cartoes { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 1rem; }
.cartao { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem;
  display: flex; flex-direction: column; gap: .8rem; }
.cartao.no-ar { border-color: #f5a3a3; box-shadow: 0 0 0 3px var(--live-bg); }
.cartao-topo { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; }
.cartao-topo .ig { color: var(--muted); font-size: .9rem; }
.selo { font-size: .78rem; font-weight: 700; padding: .2rem .55rem; border-radius: 99px; white-space: nowrap; }
.selo.livre { background: #f1f2f4; color: #4b5563; }
.selo.ar { background: var(--live); color: #fff; animation: pulsar 1.6s infinite; }
.selo.agendada { background: var(--info-bg); color: #3730a3; }
@keyframes pulsar { 50% { opacity: .65; } }
.passo { border-top: 1px dashed var(--line); padding-top: .7rem; display: flex; flex-direction: column; gap: .45rem; }
.passo-titulo { font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.passo .ok { color: var(--ok); font-size: .85rem; font-weight: 600; }
.passo .pendente { color: var(--warn); font-size: .85rem; font-weight: 600; }
.linha { display: flex; gap: .5rem; align-items: flex-end; flex-wrap: wrap; }
.cresce { flex: 1; min-width: 140px; }
.acoes { display: flex; gap: .5rem; justify-content: flex-end; flex-wrap: wrap; }
.cartao-rodape { display: flex; gap: .4rem; justify-content: flex-end; border-top: 1px solid var(--line); padding-top: .6rem; }
.no-ar-info { background: var(--live-bg); border-radius: 8px; padding: .7rem; display: flex; flex-direction: column; gap: .4rem; }
.agendada-info { background: var(--info-bg); border-radius: 8px; padding: .6rem .7rem; display: flex; justify-content: space-between;
  align-items: center; gap: .5rem; font-size: .9rem; }

/* barra de progresso */
.barra { height: 8px; background: #eceef1; border-radius: 99px; overflow: hidden; }
.barra > div { height: 100%; background: var(--pri); width: 0; transition: width .4s; }
.no-ar-info .barra > div { background: var(--live); }

/* upload */
.upload { margin-bottom: 1rem; }
.drop { border: 2px dashed #d5d8dd; border-radius: var(--radius); padding: 1.2rem; text-align: center; transition: .15s; }
.drop.arrastando { border-color: var(--pri); background: #fdeaf2; }
.progresso-box { display: flex; flex-direction: column; gap: .3rem; }

/* listas */
.lista { display: flex; flex-direction: column; gap: .6rem; }
.item { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem;
  display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.item .codigo { font-weight: 800; font-family: ui-monospace, Menlo, monospace; background: #f1f2f4; padding: .2rem .45rem; border-radius: 6px; }
.item .principal { flex: 1; min-width: 200px; }
.item .detalhe { color: var(--muted); font-size: .88rem; }
.status { font-size: .85rem; font-weight: 600; white-space: nowrap; }
.status.pronta { color: var(--ok); } .status.erro { color: var(--live); } .status.fora_do_formato { color: var(--warn); }
.problemas { margin: .3rem 0 0; padding-left: 1.1rem; color: var(--warn); font-size: .85rem; }
.vazio { text-align: center; color: var(--muted); padding: 2rem; background: var(--card); border-radius: var(--radius); border: 1px dashed var(--line); }

/* tabela */
.tabela-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.tabela { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tabela th, .tabela td { padding: .6rem .8rem; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tabela th { font-size: .78rem; text-transform: uppercase; color: var(--muted); background: #fafbfc; }
.tabela input { width: 110px; padding: .3rem .45rem; }
.tabela tr:last-child td { border-bottom: 0; }

/* sistema */
.indicador { font-size: 1.6rem; font-weight: 800; }

/* modal e aviso */
.modal { position: fixed; inset: 0; background: rgba(17,24,39,.45); display: grid; place-items: center; z-index: 20; padding: 1rem; }
.modal-box { background: #fff; border-radius: var(--radius); padding: 1.3rem; width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: .8rem; }
#modal-corpo { display: flex; flex-direction: column; gap: .7rem; }
.toast { position: fixed; bottom: 1.2rem; left: 50%; transform: translateX(-50%); background: #111827; color: #fff;
  padding: .7rem 1.1rem; border-radius: 10px; z-index: 30; max-width: 90vw; box-shadow: 0 6px 24px rgba(0,0,0,.2); }
.toast.erro-toast { background: var(--live); }

@media (max-width: 640px) {
  .topo { padding: .5rem .8rem; }
  .topo-dir #resumo { display: none; }
  .aba { padding: .8rem; }
  .cartoes { grid-template-columns: 1fr; }
}
