/* BOXE — visual pensado para a oficina: dedo grande, mão suja, sol na tela. */
:root {
  --fundo: #16181d;
  --painel: #20232a;
  --painel-2: #2a2e37;
  --linha: #363b46;
  --texto: #f2f3f5;
  --texto-2: #a6adbb;
  --ambar: #f5a623;
  --ambar-escuro: #c9851a;
  --verde: #3ecf8e;
  --vermelho: #ff6b5e;
  --azul: #5aa9ff;
  --raio: 14px;
  --toque: 56px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--fundo); color: var(--texto); }
body {
  font-family: Inter, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.4;
  min-height: 100dvh;
  padding-bottom: env(safe-area-inset-bottom);
}
button, input, select, textarea { font: inherit; color: inherit; }

.carregando {
  display: grid; place-items: center; height: 100dvh;
  font-family: "Barlow Condensed", sans-serif; font-size: 48px; color: var(--ambar); letter-spacing: 2px;
}

/* ---------- estrutura ---------- */
.tela { max-width: 640px; margin: 0 auto; padding: 16px 16px 120px; }
.topo {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; background: var(--fundo); border-bottom: 1px solid var(--linha);
}
.topo .marca { font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 26px; color: var(--ambar); letter-spacing: 1px; }
.topo .titulo { font-weight: 600; font-size: 17px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topo .voltar { width: 44px; height: 44px; border-radius: 12px; border: 0; background: var(--painel); font-size: 22px; }
.topo .sub { color: var(--texto-2); font-size: 13px; }

h2 { font-family: "Barlow Condensed", sans-serif; font-size: 22px; letter-spacing: .5px; margin: 24px 0 10px; text-transform: uppercase; color: var(--texto-2); }

/* ---------- botões ---------- */
.botao {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: var(--toque); padding: 0 20px; width: 100%;
  border: 0; border-radius: var(--raio); background: var(--painel-2);
  font-weight: 600; font-size: 17px; cursor: pointer;
}
.botao:active { transform: scale(.98); }
.botao.principal { background: var(--ambar); color: #1a1205; }
.botao.principal:active { background: var(--ambar-escuro); }
.botao.verde { background: var(--verde); color: #04140c; }
.botao.perigo { background: transparent; color: var(--vermelho); border: 1px solid var(--vermelho); }
.botao.leve { background: transparent; border: 1px solid var(--linha); }
.botao:disabled { opacity: .5; }
.botoes { display: grid; gap: 10px; }
.botoes.dois { grid-template-columns: 1fr 1fr; }

/* ação gigante da tela inicial */
.acoes-grandes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; }
.acao-grande {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: 132px; border: 0; border-radius: 20px; background: var(--ambar); color: #1a1205;
  font-weight: 700; font-size: 18px; cursor: pointer;
}
.acao-grande .ic { font-size: 40px; line-height: 1; }
.acao-grande.secundaria { background: var(--painel-2); color: var(--texto); }
.acao-grande:active { transform: scale(.98); }
.linha-digitar { display: flex; gap: 8px; margin-top: 12px; }
.linha-digitar input { flex: 1; }
.linha-digitar .botao { width: auto; }

/* ---------- campos ---------- */
label { display: block; font-size: 13px; color: var(--texto-2); margin: 14px 0 6px; }
input, select, textarea {
  width: 100%; min-height: 52px; padding: 12px 14px;
  background: var(--painel); border: 1px solid var(--linha); border-radius: 12px; font-size: 17px;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--ambar); border-color: transparent; }
input.placa { text-transform: uppercase; font-family: "Barlow Condensed", sans-serif; font-size: 26px; letter-spacing: 3px; text-align: center; }
.grade-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }

/* ---------- cartões ---------- */
.cartao { background: var(--painel); border: 1px solid var(--linha); border-radius: var(--raio); padding: 14px 16px; }
.cartao + .cartao { margin-top: 10px; }
.cartao.toque { cursor: pointer; }
.cartao.toque:active { background: var(--painel-2); }
.lista { display: grid; gap: 10px; }

.placa-tag {
  display: inline-block; padding: 2px 10px; border-radius: 6px;
  background: #e9ecf1; color: #111; border-top: 5px solid #1f4ea3;
  font-family: "Barlow Condensed", sans-serif; font-size: 20px; font-weight: 700; letter-spacing: 2px;
}
.os-linha { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.os-linha .carro { font-weight: 600; margin-top: 6px; }
.os-linha .dono { color: var(--texto-2); font-size: 14px; }
.os-linha .valores { text-align: right; white-space: nowrap; }
.os-linha .total { font-weight: 600; }
.os-linha .falta { color: var(--vermelho); font-size: 13px; }
.os-linha .quitado { color: var(--verde); font-size: 13px; }

.etiqueta { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--painel-2); color: var(--texto-2); }
.etiqueta.ambar { background: rgba(245,166,35,.15); color: var(--ambar); }
.etiqueta.verde { background: rgba(62,207,142,.15); color: var(--verde); }

/* pendências de cadastro */
.pendencia {
  display: flex; gap: 10px; align-items: flex-start;
  background: rgba(245,166,35,.1); border: 1px solid rgba(245,166,35,.35);
  border-radius: var(--raio); padding: 12px 14px; color: var(--texto); font-size: 14px;
}
.pendencia .ic { color: var(--ambar); font-size: 18px; }
.pendencia button { margin-top: 8px; }

/* etapas */
.etapas { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.etapas::-webkit-scrollbar { display: none; }
.etapa {
  flex: none; min-height: 44px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--linha); background: transparent; font-weight: 600; font-size: 14px;
}
.etapa.ativa { background: var(--ambar); color: #1a1205; border-color: var(--ambar); }

/* itens da OS */
.item { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--linha); }
.item:last-child { border-bottom: 0; }
.item .desc { font-weight: 500; }
.item .tipo { font-size: 12px; color: var(--texto-2); text-transform: uppercase; letter-spacing: .5px; }
.item .val { white-space: nowrap; font-weight: 600; }
.item .remover { border: 0; background: none; color: var(--texto-2); font-size: 13px; padding: 4px 0 0; }

.totais { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.totais .n { font-family: "Barlow Condensed", sans-serif; font-size: 26px; font-weight: 700; }
.totais .r { font-size: 12px; color: var(--texto-2); text-transform: uppercase; }
.totais .falta .n { color: var(--vermelho); }
.totais .pago .n { color: var(--verde); }

/* barra fixa inferior */
.barra-baixo {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, var(--fundo) 30%);
}
.barra-baixo .dentro { max-width: 640px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- gravação de voz ---------- */
.gravando {
  position: fixed; inset: 0; z-index: 20; background: rgba(10,11,14,.96);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; padding: 24px;
}
.gravando .pulso {
  width: 140px; height: 140px; border-radius: 50%; background: var(--vermelho);
  display: grid; place-items: center; font-size: 56px; animation: pulso 1.2s infinite;
}
@keyframes pulso { 0% { box-shadow: 0 0 0 0 rgba(255,107,94,.6); } 100% { box-shadow: 0 0 0 36px rgba(255,107,94,0); } }
.gravando .transcricao { max-width: 560px; min-height: 80px; text-align: center; font-size: 20px; }
.gravando .dica { color: var(--texto-2); font-size: 14px; text-align: center; }
.gravando .botoes { width: 100%; max-width: 420px; }

/* ---------- janela de confirmação ---------- */
.fundo-modal { position: fixed; inset: 0; z-index: 30; background: rgba(0,0,0,.6); display: flex; align-items: flex-end; justify-content: center; }
.modal {
  width: 100%; max-width: 640px; max-height: 88dvh; overflow-y: auto;
  background: var(--fundo); border-radius: 20px 20px 0 0; border-top: 1px solid var(--linha);
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
}
.modal h3 { margin: 0 0 4px; font-size: 20px; }
.modal .sub { color: var(--texto-2); margin: 0 0 12px; font-size: 14px; }

.aviso {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 40;
  max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 12px;
  background: var(--texto); color: var(--fundo); font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.aviso.erro { background: var(--vermelho); color: #fff; }

.vazio { text-align: center; color: var(--texto-2); padding: 32px 16px; border: 1px dashed var(--linha); border-radius: var(--raio); }
.foto-previa { width: 100%; max-height: 220px; object-fit: cover; border-radius: var(--raio); margin-bottom: 12px; }
.mudo { color: var(--texto-2); font-size: 14px; }
.centro { text-align: center; }
.esp { height: 12px; }
.link { background: none; border: 0; color: var(--ambar); font-weight: 600; padding: 8px 0; cursor: pointer; }

.login { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; }
.login .logo { font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 64px; color: var(--ambar); text-align: center; letter-spacing: 4px; }
.login .lema { text-align: center; color: var(--texto-2); margin-top: -6px; margin-bottom: 24px; }

.girando { width: 22px; height: 22px; border: 3px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: gira .8s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }

/* ---------- resumo do dono ---------- */
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kpi .r { font-size: 12px; color: var(--texto-2); text-transform: uppercase; letter-spacing: .4px; }
.kpi .n { font-family: "Barlow Condensed", sans-serif; font-size: 28px; font-weight: 700; line-height: 1.15; margin: 2px 0; }
.kpi .n.verde { color: var(--verde); }
.kpi .n.vermelho { color: var(--vermelho); }
.kpi .var { font-size: 13px; font-weight: 600; color: var(--texto-2); }
.kpi .var.sobe { color: var(--verde); }
.kpi .var.desce { color: var(--vermelho); }
@media (min-width: 720px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpis .cartao + .cartao { margin-top: 0; }
