/* Vupt Gestão — identidade Vupt (preto quente + âmbar), cores extraídas do logotipo */
:root {
  --fundo: #121110;
  --fundo-marca: #22201d;
  --cartao: #1e1c1a;
  --cartao-2: #2a2724;
  --linha: #34302c;
  --texto: #f2eee9;
  --texto-2: #a8a19a;
  --texto-3: #7a746e;
  --ambar: #e89c12;
  --ambar-escuro: #d38c0b;
  --verde: #34c759;
  --vermelho: #ff5a4f;
  --laranja: #ff9f0a;
  --azul: #5aa9ff;
  --raio: 14px;
  --abas: 64px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--fundo);
  color: var(--texto);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select { font: inherit; color: inherit; }
a { color: var(--ambar); text-decoration: none; }
.num { font-variant-numeric: tabular-nums; }
.verde { color: var(--verde); } .vermelho { color: var(--vermelho); } .laranja { color: var(--laranja); }
.azul { color: var(--azul); } .ambar { color: var(--ambar); } .sec { color: var(--texto-2); } .ter { color: var(--texto-3); }
.peq { font-size: 13px; } .neg { font-weight: 600; }

/* ---------- Estrutura ---------- */
.app { min-height: 100vh; min-height: 100dvh; }
.conteudo { max-width: 860px; margin: 0 auto; padding: 0 16px calc(var(--abas) + 32px + env(safe-area-inset-bottom)); }
.topo {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: color-mix(in srgb, var(--fundo) 85%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--linha);
}
.topo .logo { height: 26px; display: block; }
.titulo { font-size: 28px; font-weight: 800; margin: 20px 0 12px; letter-spacing: -0.02em; }
.titulo-linha { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }

.abas {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: space-around;
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--fundo-marca) 92%, transparent);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--linha);
}
.aba {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 4px 0; font-size: 11px; color: var(--texto-2); background: none; border: 0; cursor: pointer;
}
.aba svg { width: 24px; height: 24px; }
.aba.ativa { color: var(--ambar); }

@media (min-width: 900px) {
  .abas {
    top: 0; right: auto; width: 220px; flex-direction: column; justify-content: flex-start; gap: 4px;
    padding: 24px 12px; border-top: 0; border-right: 1px solid var(--linha); background: var(--fundo-marca);
  }
  .abas .logo-lateral { display: block; height: 30px; width: auto; align-self: flex-start; margin: 0 8px 24px; }
  .aba { flex: none; flex-direction: row; gap: 12px; padding: 10px 12px; font-size: 15px; border-radius: 10px; }
  .aba.ativa { background: var(--cartao-2); }
  .topo { display: none; }
  .app { padding-left: 220px; }
  .conteudo { padding-bottom: 48px; padding-top: 12px; }
}
.logo-lateral { display: none; }

/* ---------- Cartões e listas ---------- */
.secao { margin: 22px 0 6px; }
.secao-titulo { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--texto-2); margin: 0 4px 8px; display: flex; justify-content: space-between; gap: 8px; }
.secao-rodape { font-size: 13px; color: var(--texto-3); margin: 8px 4px 0; }
.cartao { background: var(--cartao); border-radius: var(--raio); overflow: hidden; }
.cartao.pad { padding: 16px; }
.lista > * + * { border-top: 1px solid var(--linha); }
.item {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; min-height: 48px;
  width: 100%; text-align: left; background: none; border: 0;
}
button.item, a.item { cursor: pointer; color: inherit; }
button.item:hover, a.item:hover { background: var(--cartao-2); }
.item .cresce { flex: 1; min-width: 0; }
.item .dir { text-align: right; white-space: nowrap; }
.item .seta { color: var(--texto-3); }
.trunca { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip { display: inline-block; font-size: 11px; padding: 1px 6px; border-radius: 99px; background: var(--cartao-2); color: var(--texto-2); }

.hero { text-align: center; padding: 22px 16px; }
.hero .valor { font-size: clamp(34px, 9vw, 46px); font-weight: 800; letter-spacing: -0.02em; margin: 4px 0; }
.aviso { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; padding: 12px 16px; }
.aviso svg { flex: none; width: 18px; height: 18px; margin-top: 1px; }

/* ---------- Controles ---------- */
.botao {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 16px; border-radius: 12px; border: 0; cursor: pointer; font-weight: 600;
  background: var(--ambar); color: #1a1205;
}
.botao:disabled { opacity: .45; cursor: default; }
.botao.sec { background: var(--cartao-2); color: var(--texto); }
.botao.perigo { background: transparent; color: var(--vermelho); }
.botao.peq { padding: 7px 12px; font-size: 14px; }
.botao svg { width: 18px; height: 18px; }
.acoes { display: flex; gap: 8px; flex-wrap: wrap; }

.seletor-mes { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 6px; }
.seletor-mes button { background: none; border: 0; color: var(--ambar); padding: 8px 12px; cursor: pointer; font-size: 20px; line-height: 1; }
.seletor-mes span { font-weight: 600; min-width: 170px; text-align: center; }

.segmentado { display: flex; background: var(--cartao-2); border-radius: 10px; padding: 3px; gap: 2px; }
.segmentado button { flex: 1; border: 0; background: none; padding: 7px 4px; border-radius: 8px; font-size: 14px; cursor: pointer; color: var(--texto-2); }
.segmentado button.ativo { background: #4a4540; color: var(--texto); }

.campo { display: block; padding: 10px 16px; }
.campo > span { display: block; font-size: 13px; color: var(--texto-2); margin-bottom: 4px; }
.campo input, .campo select, .busca {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--linha);
  background: var(--fundo); color: var(--texto); font-size: 16px;
}
.campo input:focus, .campo select:focus, .busca:focus { outline: 2px solid var(--ambar); outline-offset: -1px; border-color: transparent; }
.busca { margin: 8px 0; }
.check { display: flex; align-items: center; gap: 10px; padding: 12px 16px; }
.check input { width: 20px; height: 20px; accent-color: var(--ambar); }

/* ---------- Modal (folha) ---------- */
.fundo-modal {
  position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.6);
  display: flex; align-items: flex-end; justify-content: center;
  animation: aparecer .15s ease-out;
}
.modal {
  width: 100%; max-width: 620px; max-height: 92dvh; overflow: auto;
  background: var(--fundo); border-radius: 18px 18px 0 0;
  padding-bottom: env(safe-area-inset-bottom);
  animation: subir .2s ease-out;
}
@media (min-width: 700px) { .fundo-modal { align-items: center; } .modal { border-radius: 18px; } }
.modal-topo {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between;
  padding: 12px 12px; background: var(--fundo); border-bottom: 1px solid var(--linha);
}
.modal-topo h2 { font-size: 17px; margin: 0; text-align: center; flex: 1; }
.modal-topo button { min-width: 80px; }
.modal-corpo { padding: 4px 16px 24px; }
@keyframes aparecer { from { opacity: 0 } }
@keyframes subir { from { transform: translateY(30px); opacity: .5 } }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--abas) + 20px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  z-index: 60; background: #3a3632; color: var(--texto); padding: 12px 18px; border-radius: 12px;
  max-width: min(92vw, 520px); white-space: pre-line; box-shadow: 0 8px 30px rgba(0,0,0,.5); font-size: 15px;
}
.toast.erro { background: #5a1f1b; }

.vazio { text-align: center; padding: 48px 24px; color: var(--texto-2); }
.vazio svg { width: 44px; height: 44px; color: var(--texto-3); margin-bottom: 8px; }
.vazio h3 { color: var(--texto); margin: 4px 0 6px; font-size: 18px; }
.carregando { text-align: center; padding: 40px; color: var(--texto-3); }

/* ---------- Scanner ---------- */
.scanner { position: relative; background: #000; border-radius: var(--raio); overflow: hidden; min-height: 300px; }
.scanner video { border-radius: var(--raio); }
.scanner #leitor { width: 100%; }
.scanner-msg { margin-top: 12px; padding: 12px 16px; text-align: center; white-space: pre-line; }

/* ---------- Login ---------- */
.login { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px; background: radial-gradient(ellipse at 50% 30%, #302c27, var(--fundo-marca) 50%, #141312); }
.login form { width: 100%; max-width: 360px; }
.login .logo { display: block; width: 180px; margin: 0 auto 8px; }
.login p.sub { text-align: center; color: var(--texto-2); margin: 0 0 28px; }
.login .campo { padding: 6px 0; }
.login .botao { width: 100%; margin-top: 14px; padding: 13px; }
.login .erro { color: var(--vermelho); text-align: center; margin-top: 12px; min-height: 20px; }

.tabela-previa { width: 100%; border-collapse: collapse; font-size: 13px; }
.tabela-previa td { padding: 6px 8px; border-top: 1px solid var(--linha); }
.so-lateral { display: none; }
@media (min-width: 900px) { .so-lateral { display: flex; margin-top: auto; } }

/* ---------- Pré-cadastro ---------- */
.miniatura { width: 44px; height: 44px; border-radius: 8px; object-fit: contain; background: #fff; flex: none; }
.miniatura.vazia { display: flex; align-items: center; justify-content: center; background: var(--cartao-2); color: var(--texto-3); }
.miniatura.vazia svg { width: 22px; height: 22px; }
.foto-produto { text-align: center; }
.foto-produto img { width: 180px; height: 180px; object-fit: contain; background: #fff; border-radius: var(--raio); }
.sem-foto { width: 180px; height: 180px; margin: 0 auto; border-radius: var(--raio); background: var(--cartao); color: var(--texto-3);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.sem-foto svg { width: 40px; height: 40px; }
a.botao { text-decoration: none; }

/* ---------- Ajuste de preços ---------- */
.item.ajuste { align-items: flex-start; }
.item.ajuste > input[type=checkbox] { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--ambar); flex: none; }
.linha-preco { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.linha-preco label { display: flex; align-items: center; gap: 6px; }
.linha-preco .busca { width: 90px; margin: 0; text-align: right; }
