/* CEAG — painel e admin. Cores da marca: laranja #F2622E, preto #161616, creme #FBF3EA. */
:root {
  --laranja: #F2622E; --queimado: #C9441A; --pessego: #FF8A5C;
  --preto: #161616; --noite: #0B0B0C; --creme: #FBF3EA; --areia: #E9DFD3; --grafite: #6B6560; --branco: #fff;
  --verde: #1E8A4C; --verde-claro: #E3F4EA; --amarelo: #8A5A00; --amarelo-claro: #FFF1D6; --vermelho: #B42318; --vermelho-claro: #FDE7E4;
  --raio: 14px; --sombra: 0 1px 2px rgba(22,22,22,.06), 0 4px 16px rgba(22,22,22,.06);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--preto); background: var(--creme);
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { min-height: 100vh; font-size: 16px; line-height: 1.45; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--queimado); }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 .5rem; }
h1 { font-size: 1.6rem; font-weight: 800; }
h2 { font-size: 1.2rem; font-weight: 800; }
h3 { font-size: 1rem; font-weight: 700; }
p { margin: 0 0 .75rem; }
.mudo { color: var(--grafite); font-size: .9rem; }
.peq { font-size: .85rem; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- topo ---------- */
.topo { background: var(--preto); color: var(--branco); position: sticky; top: 0; z-index: 20; }
.topo .wrap { display: flex; align-items: center; gap: .75rem; min-height: 58px; padding-top: .4rem; padding-bottom: .4rem; }
.topo .marca { display: flex; align-items: center; gap: .6rem; font-weight: 800; letter-spacing: -0.01em; text-decoration: none; color: inherit; min-width: 0; }
.topo .marca img { width: 32px; height: 32px; flex: none; }
.topo .marca span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topo .marca small { color: var(--pessego); font-weight: 600; font-size: .8rem; margin-left: .15rem; }
.topo .acoes { margin-left: auto; display: flex; gap: .4rem; flex: none; }
.topo .btn { background: transparent; color: var(--branco); border-color: #3A3634; }
.nav { display: flex; gap: .25rem; overflow-x: auto; scrollbar-width: none; background: var(--preto); border-top: 1px solid #2A2725; }
.nav::-webkit-scrollbar { display: none; }
.nav .wrap { display: flex; gap: .25rem; padding-top: 0; padding-bottom: 0; }
.nav a { color: #CFC8C1; text-decoration: none; padding: .7rem .8rem; font-weight: 600; font-size: .95rem; border-bottom: 3px solid transparent; white-space: nowrap; }
.nav a[aria-current="page"] { color: var(--branco); border-bottom-color: var(--laranja); }

.wrap { width: 100%; max-width: 960px; margin: 0 auto; padding: 1rem; }
main.wrap { padding-bottom: 6rem; }

/* ---------- cartões e listas ---------- */
.card { background: var(--branco); border: 1px solid var(--areia); border-radius: var(--raio); padding: 1rem; box-shadow: var(--sombra); margin-bottom: 1rem; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card-cab { display: flex; align-items: center; gap: .5rem; justify-content: space-between; flex-wrap: wrap; margin-bottom: .75rem; }
.card-cab h2, .card-cab h3 { margin: 0; }
.lista { list-style: none; margin: 0; padding: 0; }
.lista > li { display: flex; align-items: center; gap: .75rem; padding: .75rem 0; border-top: 1px solid var(--areia); }
.lista > li:first-child { border-top: 0; }
.lista .cresce { flex: 1; min-width: 0; }
.lista .titulo { font-weight: 700; overflow-wrap: anywhere; }
.lista .sub { color: var(--grafite); font-size: .87rem; overflow-wrap: anywhere; }
.lista .valor { font-weight: 700; white-space: nowrap; }
.clicavel { cursor: pointer; }
.cliente-item { width: 100%; text-align: left; background: var(--branco); border: 1px solid var(--areia); border-radius: var(--raio); padding: .9rem 1rem; margin-bottom: .6rem; display: flex; gap: .75rem; align-items: center; box-shadow: var(--sombra); cursor: pointer; }
.cliente-item:hover { border-color: var(--pessego); }
.cliente-item .cresce { flex: 1; min-width: 0; }
.cliente-item .titulo { font-weight: 800; }
.cliente-item .sub { color: var(--grafite); font-size: .87rem; }
.seta { color: var(--grafite); font-size: 1.3rem; flex: none; }
.vazio { text-align: center; color: var(--grafite); padding: 1.5rem 1rem; border: 2px dashed var(--areia); border-radius: var(--raio); }

/* ---------- números ---------- */
.grade { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; margin-bottom: 1rem; }
@media (min-width: 720px) { .grade { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.numero { background: var(--branco); border: 1px solid var(--areia); border-radius: var(--raio); padding: .85rem; box-shadow: var(--sombra); min-width: 0; }
.numero .rot { font-size: .8rem; color: var(--grafite); font-weight: 600; }
.numero .val { font-size: 1.3rem; font-weight: 800; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.numero.destaque { background: var(--preto); color: var(--branco); border-color: var(--preto); }
.numero.destaque .rot { color: #CFC8C1; }
.numero.destaque .val { color: var(--pessego); }
.positivo { color: var(--verde); }
.negativo { color: var(--vermelho); }
.progresso { height: 10px; background: var(--areia); border-radius: 99px; overflow: hidden; margin: .5rem 0 .25rem; }
.progresso > div { height: 100%; background: var(--laranja); border-radius: 99px; }

/* ---------- chips de status ---------- */
.chip { display: inline-flex; align-items: center; gap: .3rem; font-size: .78rem; font-weight: 700; padding: .2rem .55rem; border-radius: 99px; background: var(--areia); color: var(--preto); white-space: nowrap; }
.chip.ok { background: var(--verde-claro); color: var(--verde); }
.chip.alerta { background: var(--amarelo-claro); color: var(--amarelo); }
.chip.erro { background: var(--vermelho-claro); color: var(--vermelho); }
.chip.neutro { background: #EFEAE4; color: var(--grafite); }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .3rem; }

/* ---------- botões ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 44px; padding: .55rem 1rem; border-radius: 99px; border: 1.5px solid var(--areia); background: var(--branco); color: var(--preto); font-weight: 700; font-size: .95rem; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--grafite); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.prim { background: var(--laranja); border-color: var(--laranja); color: var(--preto); }
.btn.prim:hover { background: #E0531F; border-color: #E0531F; }
.btn.escuro { background: var(--preto); border-color: var(--preto); color: var(--branco); }
.btn.perigo { color: var(--vermelho); border-color: #F3C1BB; }
.btn.zap { background: #25D366; border-color: #25D366; color: #0B2E17; }
.btn.peq { min-height: 36px; padding: .35rem .8rem; font-size: .87rem; }
.btn.bloco { width: 100%; }
.btn.icone { width: 40px; min-height: 40px; padding: 0; font-size: 1.1rem; }
.botoes { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
.link-btn { background: none; border: 0; padding: 0; color: var(--queimado); font-weight: 700; cursor: pointer; text-decoration: underline; }

/* ---------- formulários ---------- */
.campo { display: block; margin-bottom: .85rem; }
.campo > label, .campo > span { display: block; font-weight: 700; font-size: .9rem; margin-bottom: .3rem; }
.campo > small { display: block; color: var(--grafite); font-size: .8rem; margin-top: .25rem; }
.campo input, .campo select, .campo textarea { width: 100%; min-height: 46px; padding: .6rem .8rem; border: 1.5px solid var(--areia); border-radius: 10px; background: var(--branco); font-size: 16px; }
.campo textarea { min-height: 96px; resize: vertical; }
.campo input:focus, .campo select:focus, .campo textarea:focus, .btn:focus-visible, a:focus-visible, button:focus-visible { outline: 3px solid var(--pessego); outline-offset: 1px; border-color: var(--laranja); }
.duas { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 .75rem; }
.marcar { display: flex; align-items: center; gap: .6rem; margin-bottom: .85rem; font-weight: 600; cursor: pointer; }
.marcar input { width: 22px; height: 22px; accent-color: var(--laranja); flex: none; }
.erro-form { color: var(--vermelho); font-weight: 600; font-size: .9rem; min-height: 1.2em; margin: .25rem 0 .5rem; }
.sep { border: 0; border-top: 1px solid var(--areia); margin: 1rem 0; }

/* ---------- abas ---------- */
.abas { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.abas::-webkit-scrollbar { display: none; }
.abas button { border: 1.5px solid var(--areia); background: var(--branco); border-radius: 99px; padding: .5rem .95rem; font-weight: 700; cursor: pointer; white-space: nowrap; min-height: 42px; }
.abas button[aria-selected="true"] { background: var(--preto); border-color: var(--preto); color: var(--branco); }

/* ---------- avisos ---------- */
.aviso { border-radius: var(--raio); padding: .85rem 1rem; margin-bottom: 1rem; font-weight: 600; border: 1px solid; }
.aviso.ok { background: var(--verde-claro); color: var(--verde); border-color: #BFE3CD; }
.aviso.alerta { background: var(--amarelo-claro); color: var(--amarelo); border-color: #F5D9A3; }
.aviso.erro { background: var(--vermelho-claro); color: var(--vermelho); border-color: #F3C1BB; }
.aviso p:last-child { margin: 0; }

/* ---------- login ---------- */
.entrada { min-height: 100vh; display: grid; place-items: center; padding: 1rem; background: var(--noite); background-image: radial-gradient(60% 50% at 50% 0%, rgba(242,98,46,.28), transparent 70%); }
.entrada .card { width: 100%; max-width: 400px; margin: 0; padding: 1.5rem; }
.entrada .logo { width: 56px; height: 56px; margin-bottom: 1rem; }

/* ---------- editor ---------- */
.categoria { background: var(--branco); border: 1px solid var(--areia); border-radius: var(--raio); margin-bottom: 1rem; box-shadow: var(--sombra); overflow: hidden; }
.categoria-cab { display: flex; align-items: center; gap: .5rem; padding: .8rem 1rem; background: #FFF9F3; border-bottom: 1px solid var(--areia); }
.categoria-cab h3 { margin: 0; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.item { display: flex; align-items: center; gap: .75rem; padding: .7rem 1rem; border-top: 1px solid var(--areia); }
.item:first-of-type { border-top: 0; }
.item .foto { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; background: var(--areia); flex: none; display: grid; place-items: center; color: var(--grafite); font-size: .7rem; text-align: center; }
.item .cresce { flex: 1; min-width: 0; }
.item .titulo { font-weight: 700; overflow-wrap: anywhere; }
.item .sub { color: var(--grafite); font-size: .87rem; }
.item.esgotado .titulo, .item.esgotado .foto { opacity: .45; }
.item-botao { flex: 1; min-width: 0; display: flex; align-items: center; gap: .75rem; background: none; border: 0; padding: 0; text-align: left; cursor: pointer; }
.chave { position: relative; width: 48px; height: 28px; flex: none; }
.chave input { opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; position: relative; z-index: 1; }
.chave span { position: absolute; inset: 0; background: #CFC8C1; border-radius: 99px; transition: background .15s; pointer-events: none; }
.chave span::after { content: ""; position: absolute; width: 22px; height: 22px; top: 3px; left: 3px; background: #fff; border-radius: 50%; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.chave input:checked + span { background: var(--verde); }
.chave input:checked + span::after { transform: translateX(20px); }
.chave input:focus-visible + span { outline: 3px solid var(--pessego); outline-offset: 2px; }
.galeria { margin-bottom: 1rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .75rem; }
.galeria figure { margin: 0; background: var(--branco); border: 1px solid var(--areia); border-radius: var(--raio); overflow: hidden; }
.galeria img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.galeria figcaption { padding: .5rem; font-size: .85rem; display: flex; gap: .35rem; align-items: center; justify-content: space-between; }
.galeria figcaption span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.foto-campo { display: flex; gap: .75rem; align-items: center; margin-bottom: .85rem; }
.foto-campo .previa { width: 88px; height: 88px; border-radius: 12px; object-fit: cover; background: var(--areia); flex: none; display: grid; place-items: center; color: var(--grafite); font-size: .75rem; text-align: center; }
.barra-salvar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--preto); color: var(--branco); box-shadow: 0 -4px 20px rgba(0,0,0,.25); padding-bottom: env(safe-area-inset-bottom); }
.barra-salvar .wrap { display: flex; gap: .5rem; align-items: center; padding-top: .7rem; padding-bottom: .7rem; }
.barra-salvar .msg { flex: 1; min-width: 0; font-weight: 600; font-size: .92rem; }
.barra-salvar .btn:not(.prim) { background: transparent; color: var(--branco); border-color: #4A4542; }

/* ---------- janela (modal) ---------- */
.fundo-modal { position: fixed; inset: 0; background: rgba(11,11,12,.6); z-index: 50; display: flex; align-items: flex-end; justify-content: center; padding: 0; }
@media (min-width: 640px) { .fundo-modal { align-items: center; padding: 1rem; } }
.modal { background: var(--creme); width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; border-radius: 20px 20px 0 0; padding: 1.25rem 1rem calc(1rem + env(safe-area-inset-bottom)); }
@media (min-width: 640px) { .modal { border-radius: 20px; padding: 1.5rem; } }
.modal-cab { display: flex; align-items: center; gap: .5rem; margin-bottom: 1rem; }
.modal-cab h2 { margin: 0; flex: 1; }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; top: 1rem; transform: translateX(-50%); z-index: 60; background: var(--preto); color: var(--branco); padding: .75rem 1.1rem; border-radius: 14px; font-weight: 700; box-shadow: 0 6px 24px rgba(0,0,0,.3); max-width: calc(100% - 2rem); text-align: center; }
.toast.erro { background: var(--vermelho); }

.carregando { color: var(--grafite); padding: 2rem 0; text-align: center; }
.link-copiar { display: flex; gap: .5rem; align-items: stretch; }
.link-copiar input { flex: 1; min-width: 0; min-height: 44px; padding: .5rem .7rem; border: 1.5px solid var(--areia); border-radius: 10px; background: var(--branco); font-size: .85rem; }
.tabela-mini { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tabela-mini td { padding: .35rem 0; border-top: 1px solid var(--areia); }
.tabela-mini td:last-child { text-align: right; font-weight: 700; white-space: nowrap; }
.tabela-mini tr:first-child td { border-top: 0; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
