/* Mecânica do Jony · mockup. Base visual herdada do ERP da JL (papéis de interface), com âmbar de oficina como cor de ação. */
:root {
  --fundo: #0b0e12;
  --superficie: #151a21;
  --superficie-2: #1c232c;
  --borda: #26303c;
  --texto: #eef2f5;
  --texto-fraco: #97a3ae;
  --ambar: #f59e0b;
  --ambar-escuro: #b45309;
  --azul: #3b9fd6;
  --verde: #22a36a;
  --vermelho: #e05252;
  --roxo: #8b7cf6;
  --zap: #25d366;
  --raio: 12px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--fundo);
  color: var(--texto);
  font: 15px/1.45 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.faixa-demo {
  background: repeating-linear-gradient(-45deg, #f59e0b, #f59e0b 14px, #e08e00 14px, #e08e00 28px);
  color: #111; text-align: center; font-size: 12.5px; font-weight: 700; padding: 5px 12px;
  position: sticky; top: 0; z-index: 30;
}

.app { display: grid; grid-template-columns: 252px 1fr; min-height: calc(100vh - 27px); }

/* Barra lateral */
.lateral {
  background: var(--superficie); border-right: 1px solid var(--borda);
  display: flex; flex-direction: column; padding: 18px 12px; gap: 14px;
  position: sticky; top: 27px; height: calc(100vh - 27px); overflow-y: auto;
}
.marca { display: flex; gap: 11px; align-items: center; padding: 4px 8px 10px; }
.marca-icone { width: 40px; height: 40px; border-radius: 11px; background: var(--ambar); display: grid; place-items: center; }
.marca-icone svg { width: 26px; height: 26px; fill: #0b0e12; stroke: none; }
.marca b { display: block; font-size: 15.5px; letter-spacing: -.01em; }
.marca small { color: var(--texto-fraco); font-size: 12px; }
nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
nav .grupo { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--texto-fraco); padding: 12px 10px 4px; }
nav a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 9px; color: #c9d2da; font-weight: 500; }
nav a:hover { background: var(--superficie-2); color: var(--texto); }
nav a.ativo { background: rgba(245,158,11,.13); color: var(--ambar); }
nav a .contador { margin-left: auto; background: var(--superficie-2); color: var(--texto); font-size: 11.5px; padding: 1px 7px; border-radius: 99px; font-weight: 600; }
nav a.ativo .contador { background: var(--ambar); color: #111; }
.perfil { border-top: 1px solid var(--borda); padding: 12px 8px 0; }
.perfil label { display: block; font-size: 11.5px; color: var(--texto-fraco); margin-bottom: 6px; }
.perfil select { width: 100%; }

/* Topo */
.conteudo { min-width: 0; }
.topo {
  display: flex; align-items: center; gap: 14px; padding: 18px 28px;
  border-bottom: 1px solid var(--borda); background: rgba(11,14,18,.88); backdrop-filter: blur(8px);
  position: sticky; top: 27px; z-index: 10;
}
.topo-titulo { flex: 1; min-width: 0; }
.topo h1 { margin: 0; font-size: 21px; letter-spacing: -.02em; }
.topo p { margin: 2px 0 0; color: var(--texto-fraco); font-size: 13.5px; }
.topo-acoes { display: flex; gap: 10px; align-items: center; }
.zap-status { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: #b9f5d0; background: rgba(37,211,102,.1); border: 1px solid rgba(37,211,102,.3); padding: 6px 11px; border-radius: 99px; white-space: nowrap; }
.zap-status i { width: 8px; height: 8px; border-radius: 50%; background: var(--zap); box-shadow: 0 0 0 3px rgba(37,211,102,.25); }
.botao-menu { display: none; background: none; border: 0; padding: 6px; cursor: pointer; }
main { padding: 24px 28px 60px; max-width: 1400px; }

/* Controles */
.botao {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--borda); background: var(--superficie-2); padding: 8px 14px;
  border-radius: 9px; font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap;
}
.botao:hover { border-color: #3a4757; }
.botao.primario { background: var(--ambar); border-color: var(--ambar); color: #111; }
.botao.primario:hover { background: #fbb33a; }
.botao.zap { background: var(--zap); border-color: var(--zap); color: #062b14; }
.botao.pequeno { padding: 5px 10px; font-size: 13px; }
.botao.fantasma { background: none; }
.botao svg { width: 16px; height: 16px; }
input, select, textarea {
  background: var(--fundo); border: 1px solid var(--borda); border-radius: 9px; padding: 8px 11px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(245,158,11,.5); border-color: var(--ambar); }
textarea { resize: vertical; min-height: 84px; }
.campo { display: flex; flex-direction: column; gap: 5px; }
.campo span { font-size: 12.5px; color: var(--texto-fraco); font-weight: 500; }
.linha-campos { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }

/* Cartões e grades */
.grade { display: grid; gap: 16px; }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g21 { grid-template-columns: 2fr 1fr; }
.cartao { background: var(--superficie); border: 1px solid var(--borda); border-radius: var(--raio); padding: 18px; min-width: 0; }
.cartao h2 { font-size: 15.5px; margin: 0 0 14px; display: flex; align-items: center; gap: 8px; }
.cartao h2 .acao { margin-left: auto; }
.numero small { color: var(--texto-fraco); font-size: 13px; display: block; }
.numero b { font-size: 26px; letter-spacing: -.02em; display: block; margin: 4px 0 2px; }
.numero em { font-style: normal; font-size: 12.5px; color: var(--verde); }
.numero em.ruim { color: var(--vermelho); }
.numero .icone { float: right; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; }
.espaco { height: 16px; }
.fraco { color: var(--texto-fraco); }
.mini { font-size: 12.5px; }

/* Etiquetas */
.etq { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 99px; white-space: nowrap; }
.etq.ambar { background: rgba(245,158,11,.15); color: #fbbf4a; }
.etq.azul { background: rgba(59,159,214,.15); color: #7cc4ec; }
.etq.verde { background: rgba(34,163,106,.16); color: #5fd59f; }
.etq.vermelho { background: rgba(224,82,82,.16); color: #f08a8a; }
.etq.roxo { background: rgba(139,124,246,.16); color: #b3a8ff; }
.etq.cinza { background: var(--superficie-2); color: var(--texto-fraco); }
.etq.zap { background: rgba(37,211,102,.14); color: #6ee7a0; }

/* Tabela */
.tabela-caixa { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; font-weight: 600; color: var(--texto-fraco); text-transform: uppercase; letter-spacing: .04em; padding: 9px 12px; border-bottom: 1px solid var(--borda); white-space: nowrap; }
td { padding: 11px 12px; border-bottom: 1px solid var(--borda); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(255,255,255,.02); }
td.dir, th.dir { text-align: right; }
.placa { font-family: ui-monospace, Consolas, monospace; font-weight: 700; background: #e9edf1; color: #111; padding: 2px 7px; border-radius: 4px; font-size: 12.5px; border-top: 3px solid #1d4ed8; letter-spacing: .04em; white-space: nowrap; }

/* Pátio (kanban) */
.kanban { display: grid; grid-template-columns: repeat(6, minmax(230px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.coluna { background: var(--superficie); border: 1px solid var(--borda); border-radius: var(--raio); padding: 10px; min-height: 300px; }
.coluna h3 { font-size: 13px; margin: 2px 4px 10px; display: flex; align-items: center; gap: 7px; }
.coluna h3 .bola { width: 9px; height: 9px; border-radius: 50%; }
.coluna h3 .qtd { margin-left: auto; color: var(--texto-fraco); font-weight: 500; }
.carro { background: var(--superficie-2); border: 1px solid var(--borda); border-radius: 10px; padding: 11px; margin-bottom: 9px; cursor: pointer; transition: transform .12s, border-color .12s; }
.carro:hover { border-color: #3d4a5a; transform: translateY(-1px); }
.carro .topo-carro { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-bottom: 6px; }
.carro b { display: block; font-size: 14px; }
.carro p { margin: 2px 0 8px; font-size: 12.5px; color: var(--texto-fraco); }
.carro .rodape { display: flex; gap: 6px; align-items: center; justify-content: space-between; }
.carro.novo { animation: brilho 1.4s ease; }
@keyframes brilho { 0% { box-shadow: 0 0 0 2px var(--ambar); } 100% { box-shadow: 0 0 0 0 transparent; } }

/* Listas */
.lista { display: flex; flex-direction: column; }
.item { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--borda); }
.item:last-child { border-bottom: 0; }
.item .bolha { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.item .meio { flex: 1; min-width: 0; }
.item .meio b { display: block; font-size: 14px; }
.item .meio small { color: var(--texto-fraco); font-size: 12.5px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bolha.ambar { background: rgba(245,158,11,.14); color: var(--ambar); }
.bolha.verde { background: rgba(34,163,106,.15); color: #5fd59f; }
.bolha.azul { background: rgba(59,159,214,.15); color: #7cc4ec; }
.bolha.zap { background: rgba(37,211,102,.14); color: var(--zap); }
.bolha.vermelho { background: rgba(224,82,82,.15); color: #f08a8a; }
.bolha.roxo { background: rgba(139,124,246,.15); color: #b3a8ff; }
.bolha.cinza { background: var(--superficie-2); color: var(--texto-fraco); }

/* Gráfico de barras */
.barras { display: flex; align-items: flex-end; gap: 10px; height: 180px; padding-top: 10px; }
.barras .b { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.barras .b i { display: block; width: 100%; max-width: 44px; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, #f8b23a, #d97706); }
.barras .b.hoje i { background: linear-gradient(180deg, #7cc4ec, #2b7fb0); }
.barras .b span { font-size: 11.5px; color: var(--texto-fraco); }
.barras .b em { font-style: normal; font-size: 11px; color: var(--texto-fraco); }

/* Abas */
.abas { display: flex; gap: 4px; border-bottom: 1px solid var(--borda); margin-bottom: 18px; overflow-x: auto; }
.abas button { background: none; border: 0; padding: 10px 14px; color: var(--texto-fraco); font-weight: 600; border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; }
.abas button.ativa { color: var(--ambar); border-color: var(--ambar); }

/* Barra de ferramentas */
.ferramentas { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.ferramentas input { max-width: 320px; }
.ferramentas .mola { flex: 1; }

/* Modelos de mensagem */
.modelo { border: 1px solid var(--borda); border-radius: 10px; padding: 14px; background: var(--superficie-2); }
.modelo header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.modelo header b { flex: 1; }
.modelo p { margin: 0; font-size: 13.5px; color: #cdd6de; white-space: pre-line; }
.modelo .var { color: var(--ambar); font-weight: 600; }
.chave { position: relative; width: 40px; height: 22px; flex: none; }
.chave input { opacity: 0; width: 0; height: 0; position: absolute; }
.chave span { position: absolute; inset: 0; border-radius: 99px; background: #3a4552; cursor: pointer; transition: .15s; }
.chave span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: .15s; }
.chave input:checked + span { background: var(--zap); }
.chave input:checked + span::after { transform: translateX(18px); }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 50; display: grid; place-items: center; padding: 16px; }
.modal[hidden] { display: none; }
.janela { background: var(--superficie); border: 1px solid var(--borda); border-radius: 14px; width: min(760px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.janela > header { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--borda); position: sticky; top: 0; background: var(--superficie); z-index: 1; }
.janela > header h2 { margin: 0; font-size: 17px; flex: 1; }
.janela > header button { background: none; border: 0; cursor: pointer; color: var(--texto-fraco); padding: 4px; }
.janela .corpo { padding: 20px; }
.janela > footer { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--borda); flex-wrap: wrap; }
.totais { margin-top: 14px; margin-left: auto; width: min(320px, 100%); }
.totais div { display: flex; justify-content: space-between; padding: 4px 0; font-size: 14px; }
.totais div.total { font-size: 18px; font-weight: 800; border-top: 1px solid var(--borda); padding-top: 9px; margin-top: 5px; }
.linha-tempo { list-style: none; margin: 0; padding: 0; }
.linha-tempo li { position: relative; padding: 0 0 16px 26px; }
.linha-tempo li::before { content: ""; position: absolute; left: 6px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--borda); }
.linha-tempo li::after { content: ""; position: absolute; left: 10px; top: 18px; bottom: 0; width: 2px; background: var(--borda); }
.linha-tempo li:last-child::after { display: none; }
.linha-tempo li.feito::before { background: var(--verde); }
.linha-tempo li.agora::before { background: var(--ambar); box-shadow: 0 0 0 4px rgba(245,158,11,.25); }
.linha-tempo b { display: block; font-size: 14px; }
.linha-tempo small { color: var(--texto-fraco); font-size: 12.5px; }

/* Avisos */
.avisos { position: fixed; right: 18px; top: 92px; z-index: 70; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.aviso { background: #0f2a1b; border: 1px solid rgba(37,211,102,.45); color: #d7fbe5; padding: 11px 14px; border-radius: 11px; display: flex; gap: 10px; align-items: center; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.4); animation: entra .25s ease; max-width: 360px; }
.aviso.info { background: #1a2230; border-color: var(--borda); color: var(--texto); }
.aviso svg { color: var(--zap); }
@keyframes entra { from { transform: translateY(12px); opacity: 0; } }

/* Celular com a conversa do WhatsApp */
.celular { position: fixed; right: 24px; bottom: 24px; width: 300px; z-index: 60; border-radius: 30px; background: #000; padding: 9px; box-shadow: 0 30px 70px rgba(0,0,0,.6); border: 1px solid #333; animation: entra .3s ease; }
.celular[hidden] { display: none; }
.celular .tela-cel { border-radius: 22px; overflow: hidden; background: #0b141a; }
.celular .cab { background: #202c33; display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.celular .cab .foto { width: 34px; height: 34px; border-radius: 50%; background: var(--ambar); display: grid; place-items: center; }
.celular .cab .foto svg { width: 20px; height: 20px; fill: #111; stroke: none; }
.celular .cab b { display: block; font-size: 13.5px; }
.celular .cab small { color: #8696a0; font-size: 11.5px; }
.celular .cab button { margin-left: auto; background: none; border: 0; color: #8696a0; cursor: pointer; }
.celular .conversa { padding: 14px 10px; min-height: 260px; max-height: 360px; overflow-y: auto; background: #0b141a radial-gradient(rgba(255,255,255,.03) 1px, transparent 1px) 0 0/14px 14px; display: flex; flex-direction: column; gap: 6px; }
.balao { align-self: flex-end; background: #005c4b; color: #e9edef; padding: 7px 9px 5px; border-radius: 9px 2px 9px 9px; font-size: 13px; max-width: 88%; white-space: pre-line; animation: entra .3s ease; }
.balao small { display: block; text-align: right; font-size: 10.5px; color: #9fd6c8; margin-top: 2px; }
.balao.dele { align-self: flex-start; background: #202c33; border-radius: 2px 9px 9px 9px; }
.balao .link { color: #53bdeb; text-decoration: underline; }
.celular .rodape-cel { background: #202c33; padding: 8px 12px; font-size: 11.5px; color: #8696a0; text-align: center; }

/* Página do cliente (o link que vai no WhatsApp) */
.pagina-cliente { max-width: 460px; margin: 0 auto; }
.pagina-cliente .moldura { background: #f6f7f9; color: #14181d; border-radius: 22px; overflow: hidden; border: 8px solid #000; box-shadow: 0 30px 70px rgba(0,0,0,.5); }
.pagina-cliente .cab-cli { background: #0b0e12; color: #fff; padding: 18px; display: flex; gap: 12px; align-items: center; }
.pagina-cliente .corpo-cli { padding: 18px; }
.pagina-cliente .cartao-cli { background: #fff; border-radius: 14px; padding: 16px; margin-bottom: 14px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.pagina-cliente .cartao-cli h3 { margin: 0 0 10px; font-size: 15px; }
.pagina-cliente .linha-tempo li::before, .pagina-cliente .linha-tempo li::after { background: #d6dce2; }
.pagina-cliente .linha-tempo li.feito::before { background: var(--verde); }
.pagina-cliente .linha-tempo li.agora::before { background: var(--ambar); }
.pagina-cliente .linha-tempo small { color: #66727e; }
.pagina-cliente table td, .pagina-cliente table th { border-color: #e6e9ed; padding: 8px 4px; color: #14181d; }
.pagina-cliente .botao { border-color: #d6dce2; background: #fff; color: #14181d; }
.pagina-cliente .botao.zap { background: var(--zap); border-color: var(--zap); color: #062b14; }
.pagina-cliente .botao.primario { background: var(--ambar); border-color: var(--ambar); }

/* Como funciona */
.passos { counter-reset: passo; display: grid; gap: 14px; }
.passo { display: flex; gap: 14px; }
.passo::before { counter-increment: passo; content: counter(passo); width: 32px; height: 32px; border-radius: 50%; background: var(--ambar); color: #111; font-weight: 800; display: grid; place-items: center; flex: none; }
.passo b { display: block; }
.passo p { margin: 2px 0 0; color: var(--texto-fraco); font-size: 14px; }
.incluso { list-style: none; padding: 0; margin: 0; display: grid; gap: 9px; }
.incluso li { display: flex; gap: 9px; align-items: flex-start; font-size: 14.5px; }
.incluso li svg { color: var(--verde); margin-top: 1px; }
.destaque { background: linear-gradient(135deg, rgba(245,158,11,.16), rgba(245,158,11,.03)); border-color: rgba(245,158,11,.4); }
.heroi { padding: 26px; }
.heroi h2 { font-size: 24px; letter-spacing: -.02em; margin: 0 0 8px; }
.heroi p { color: #cdd6de; margin: 0; max-width: 720px; font-size: 15.5px; }

.fundo-menu { display: none; }

@media (max-width: 1180px) {
  .g4 { grid-template-columns: repeat(2, 1fr); }
  .g21 { grid-template-columns: 1fr; }
  .g3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .lateral { position: fixed; left: 0; top: 0; height: 100vh; width: 270px; z-index: 40; transform: translateX(-100%); transition: transform .2s; }
  .app.menu-aberto .lateral { transform: none; }
  .app.menu-aberto + .fundo-menu { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 35; }
  .botao-menu { display: block; }
  .topo { padding: 12px 16px; gap: 10px; }
  .topo h1 { font-size: 18px; }
  .topo p { display: none; }
  .zap-status { display: none; }
  main { padding: 16px 16px 60px; }
  .g2, .g3 { grid-template-columns: 1fr; }
  .kanban { grid-template-columns: repeat(6, 78vw); scroll-snap-type: x mandatory; }
  .coluna { scroll-snap-align: start; }
  .celular { right: 50%; transform: translateX(50%); bottom: 12px; width: min(300px, calc(100vw - 32px)); }
  .esconde-cel { display: none; }
  #novaOS { padding: 8px 11px; font-size: 13px; }
}
@media (max-width: 520px) {
  .g4 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .numero b { font-size: 20px; }
  .numero .icone { display: none; }
  .cartao { padding: 14px; }
}
@media print {
  .faixa-demo, .lateral, .topo, .avisos, .celular { display: none !important; }
}
