/* Painel administrativo Sonhoin Fest */
:root {
  --fundo: #fdf6ec;
  --cartao: #fffdf8;
  --tinta: #4a2a12;
  --suave: #8a6a50;
  --borda: #ecdcc4;
  --rosa: #e8608f;
  --rosa-escuro: #c94473;
  --verde: #1d7a3a;
  --verde-fundo: #d6f1dc;
  --cinza-fundo: #eee6db;
  --vermelho: #b3261e;
  --vermelho-fundo: #fde8e6;
  --raio: 16px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--fundo);
  color: var(--tinta);
  font: 16px/1.45 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  min-height: 100vh;
}
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0 0 12px; line-height: 1.2; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
a { color: var(--rosa-escuro); }
code { background: var(--cinza-fundo); padding: 1px 6px; border-radius: 6px; }
.suave { color: var(--suave); }
small { display: block; font-size: 0.85rem; }

/* botões e campos */
.botao {
  border: 2px solid var(--borda);
  background: #fff;
  color: var(--tinta);
  border-radius: 12px;
  padding: 10px 16px;
  font-weight: 600;
  font-size: 0.95rem;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
}
.botao:hover { border-color: var(--rosa); }
.botao:disabled { opacity: 0.5; cursor: not-allowed; }
.botao.principal { background: var(--rosa); border-color: var(--rosa); color: #fff; }
.botao.principal:hover { background: var(--rosa-escuro); border-color: var(--rosa-escuro); }
.botao.perigoso { background: var(--vermelho); border-color: var(--vermelho); color: #fff; }
.botao.pequeno { padding: 6px 12px; min-height: 36px; font-size: 0.85rem; }
input, select {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid var(--borda);
  border-radius: 12px;
  background: #fff;
  color: var(--tinta);
  font: inherit;
  min-height: 44px;
}
input:focus, select:focus { outline: none; border-color: var(--rosa); }
label { display: grid; gap: 6px; font-weight: 600; font-size: 0.92rem; }
.erro { color: var(--vermelho); font-weight: 600; margin: 0; }
.msg { margin: 0; font-weight: 600; color: var(--verde); }
.msg.ruim { color: var(--vermelho); }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-cartao { width: 100%; max-width: 380px; display: grid; gap: 14px; }
.marca { margin: 0; font-weight: 800; color: var(--rosa-escuro); letter-spacing: 0.02em; }
.marca span { font-weight: 600; color: var(--suave); }

/* topo */
.topo {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  padding: 10px 16px;
  background: var(--cartao);
  border-bottom: 1px solid var(--borda);
}
.topo .marca { margin-right: auto; }
.abas { display: flex; gap: 4px; }
.aba {
  border: none;
  background: none;
  padding: 8px 12px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--suave);
  cursor: pointer;
}
.aba.ativa { background: var(--cinza-fundo); color: var(--tinta); }
.quem { display: flex; align-items: center; gap: 8px; color: var(--suave); font-size: 0.9rem; }

.conteudo { max-width: 960px; margin: 0 auto; padding: 16px; }
.vista { display: grid; gap: 14px; }
.cartao {
  background: var(--cartao);
  border: 1px solid var(--borda);
  border-radius: var(--raio);
  padding: 18px;
  min-width: 0;
}
.formulario { display: grid; gap: 12px; }
.formulario h2, .formulario h3 { margin-bottom: 0; }
.linha { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.linha > label { flex: 1 1 140px; }
.linha > input { flex: 1 1 180px; width: auto; }
.voltar { justify-self: start; }

/* lista */
.barra { display: flex; flex-wrap: wrap; gap: 10px; }
.busca { flex: 1 1 220px; width: auto; }
.barra select { flex: 0 1 150px; width: auto; }
.lista { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.festa {
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  display: grid;
  gap: 8px;
  transition: border-color 0.15s, transform 0.15s;
}
.festa:hover { border-color: var(--rosa); transform: translateY(-1px); }
.festa-topo { display: flex; justify-content: space-between; gap: 8px; align-items: start; }
.festa-nome { font-weight: 700; font-size: 1.05rem; overflow-wrap: anywhere; }
.festa-end { color: var(--suave); font-size: 0.85rem; overflow-wrap: anywhere; }
.festa-info { display: flex; flex-wrap: wrap; gap: 6px; font-size: 0.85rem; }
.chip { background: var(--cinza-fundo); border-radius: 999px; padding: 2px 10px; }
.selo { flex: none; border-radius: 999px; padding: 3px 10px; font-size: 0.8rem; font-weight: 700; white-space: nowrap; }
.selo.ativa { background: var(--verde-fundo); color: var(--verde); }
.selo.encerrada { background: var(--cinza-fundo); color: var(--suave); }
.vazio { text-align: center; padding: 32px 16px; color: var(--suave); }

/* nova festa */
.endereco { display: flex; align-items: center; border: 2px solid var(--borda); border-radius: 12px; background: #fff; overflow: hidden; }
.endereco:focus-within { border-color: var(--rosa); }
.endereco input { border: none; min-width: 0; flex: 1; }
.sufixo { padding: 0 12px 0 0; color: var(--suave); white-space: nowrap; font-weight: 500; }
#nova-festa-aviso.ruim { color: var(--vermelho); }
#nova-festa-aviso.bom { color: var(--verde); }

/* detalhe */
.detalhe-topo { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.detalhe-topo h2 { margin-bottom: 4px; overflow-wrap: anywhere; }
.detalhe-topo a { overflow-wrap: anywhere; }
.numeros { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-top: 14px; }
.numero { background: var(--fundo); border-radius: 12px; padding: 10px 12px; }
.numero strong { display: block; font-size: 1.4rem; }
.numero span { font-size: 0.8rem; color: var(--suave); }
.atalhos { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; margin-bottom: 8px; }
.atalhos .botao { justify-content: flex-start; }
.pin { font-size: 1.2rem; letter-spacing: 0.08em; }
.perigo { border-color: #f3c6c1; background: var(--vermelho-fundo); }

/* histórico */
.historico { display: grid; }
.evento { display: grid; grid-template-columns: 150px 1fr; gap: 4px 12px; padding: 10px 0; border-top: 1px solid var(--borda); font-size: 0.92rem; }
.evento:first-child { border-top: none; }
.evento time { color: var(--suave); }
.evento .detalhe { grid-column: 2; color: var(--suave); font-size: 0.85rem; overflow-wrap: anywhere; }

.aviso {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  background: var(--tinta);
  color: #fff;
  padding: 10px 18px;
  border-radius: 12px;
  font-weight: 600;
  max-width: calc(100% - 32px);
  z-index: 10;
}

@media (max-width: 560px) {
  .topo .marca { width: 100%; }
  .quem { margin-left: auto; }
  .evento { grid-template-columns: 1fr; }
  .evento .detalhe { grid-column: 1; }
  .cartao { padding: 14px; }
}
