:root {
  --navy: #242d3b; --navy2: #1a212c; --azul: #0170b9; --texto: #4b4f58; --forte: #1b222c;
  --verm: #d64545; --verde: #2e9e6a; --amar: #e0a12e; --fundo: #eef1f5; --linha: #d5dbe3; --branco: #fff;
  --raio: 14px; --sombra: 0 1px 2px rgba(20,30,45,.08), 0 2px 10px rgba(20,30,45,.06);
  --topo-h: 56px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fundo); color: var(--forte); font: 16px/1.45 Roboto, system-ui, sans-serif; overflow-x: hidden; min-height: 100vh; }
h1, h2, h3 { font-family: Catamaran, Roboto, sans-serif; margin: 0; line-height: 1.15; color: var(--forte); }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.tarja { background: #0f141c; color: #c3cad4; font-size: 11px; line-height: 1.3; text-align: center; padding: 4px 12px; padding-top: max(4px, env(safe-area-inset-top)); letter-spacing: .01em; }

.topo { position: sticky; top: 0; z-index: 20; height: var(--topo-h); background: var(--navy); color: #fff; display: flex; align-items: center; gap: 10px; padding: 0 12px; box-shadow: 0 2px 8px rgba(0,0,0,.18); }
.topo-voltar { width: 46px; height: 46px; margin-left: -6px; border: 0; background: transparent; color: #fff; border-radius: 12px; display: grid; place-items: center; }
.topo-voltar svg { width: 28px; height: 28px; }
.topo-voltar:active { background: rgba(255,255,255,.12); }
.topo-logo { height: 34px; width: auto; }
.topo-titulo { flex: 1; min-width: 0; font: 700 18px/1.1 Catamaran, sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topo-conexao { width: 10px; height: 10px; border-radius: 50%; background: #7a8696; flex: none; }
.topo-conexao.on { background: #3fd08a; box-shadow: 0 0 0 3px rgba(63,208,138,.25); }
.topo-sair { border: 1px solid rgba(255,255,255,.35); background: transparent; color: #fff; border-radius: 10px; height: 38px; padding: 0 12px; font-weight: 500; font-size: 14px; }

.instalar { display: flex; align-items: center; gap: 10px; background: var(--azul); color: #fff; padding: 10px 12px; }
.instalar-texto { flex: 1; font-size: 14px; line-height: 1.3; }
.instalar-fechar { border: 0; background: transparent; color: #fff; font-size: 26px; width: 40px; height: 40px; line-height: 1; }

.view { max-width: 640px; margin: 0 auto; padding: 14px 16px 40px; }

/* botões */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; padding: 0 18px; border-radius: 12px; border: 0; font-weight: 700; font-size: 17px; text-decoration: none; text-align: center; line-height: 1.15; transition: transform .06s, filter .15s; user-select: none; }
.btn:active { transform: scale(.98); filter: brightness(.92); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn svg { width: 22px; height: 22px; flex: none; }
.btn-grande { width: 100%; min-height: 66px; font-size: 20px; border-radius: 14px; }
.btn-bloco { width: 100%; }
.btn-azul { background: var(--azul); color: #fff; }
.btn-navy { background: var(--navy); color: #fff; }
.btn-verde { background: var(--verde); color: #fff; }
.btn-verm { background: var(--verm); color: #fff; }
.btn-amar { background: var(--amar); color: #1b1300; }
.btn-claro { background: #fff; color: var(--navy); }
.btn-borda { background: #fff; color: var(--navy); box-shadow: inset 0 0 0 2px var(--navy); }
.btn-borda-verm { background: #fff; color: var(--verm); box-shadow: inset 0 0 0 2px var(--verm); }
.btn-pequeno { min-height: 42px; font-size: 15px; padding: 0 14px; border-radius: 10px; }
.duplo { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* cartões e seções */
.secao { margin: 22px 0 10px; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.secao h2 { font-size: 21px; }
.secao .conta { font-size: 14px; color: var(--texto); font-weight: 500; }
.cartao { background: #fff; border-radius: var(--raio); box-shadow: var(--sombra); padding: 14px; margin-bottom: 12px; }
.cartao.toque { cursor: pointer; }
.cartao.toque:active { background: #f6f8fb; }
.vazio { color: var(--texto); background: #fff; border: 2px dashed var(--linha); border-radius: var(--raio); padding: 16px; text-align: center; font-size: 15px; }
.muted { color: var(--texto); }
.peq { font-size: 14px; }

.saud { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.avatar { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; color: #fff; font: 800 20px Catamaran, sans-serif; flex: none; }
.saud h1 { font-size: 24px; }

.status-tec { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.status-tec button { min-height: 58px; border-radius: 12px; border: 2px solid var(--linha); background: #fff; font-weight: 700; font-size: 15px; color: var(--texto); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 4px; line-height: 1.1; }
.status-tec button i { width: 12px; height: 12px; border-radius: 50%; display: block; }
.status-tec button[aria-pressed="true"] { color: #fff; border-color: transparent; }
.status-tec .s-livre i { background: var(--verde); } .status-tec .s-livre[aria-pressed="true"] { background: var(--verde); }
.status-tec .s-em-atendimento i { background: var(--azul); } .status-tec .s-em-atendimento[aria-pressed="true"] { background: var(--azul); }
.status-tec .s-folga i { background: #7a8696; } .status-tec .s-folga[aria-pressed="true"] { background: #5b6575; }
.status-tec button[aria-pressed="true"] i { background: #fff; }

/* chamado na lista */
.ch { position: relative; border-left: 6px solid var(--azul); }
.ch.emergencia { border-left-color: var(--verm); background: #fff5f5; }
.ch.alta { border-left-color: var(--amar); }
.ch-linha1 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ch-num { font: 800 18px Catamaran, sans-serif; }
.ch-tipo { font: 700 19px/1.2 Catamaran, sans-serif; margin: 6px 0 2px; }
.ch.emergencia .ch-tipo { color: #b42323; }
.ch-local { font-size: 15px; color: var(--texto); }
.ch-acoes { margin-top: 12px; display: flex; gap: 10px; }
.ch-acoes .btn { flex: 1; }
.selo { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 3px 10px; font-size: 13px; font-weight: 700; line-height: 1.3; background: #e7ecf2; color: var(--navy); white-space: nowrap; }
.selo.verm { background: var(--verm); color: #fff; }
.selo.amar { background: #fcefd2; color: #7a5200; }
.selo.azul { background: #dcecf8; color: #014f83; }
.selo.verde { background: #dcf2e7; color: #1d6b47; }
.selo.cinza { background: #e7ecf2; color: #4b4f58; }
.pisca { animation: pisca 1s infinite; }
@keyframes pisca { 50% { opacity: .45; } }
.tempo { margin-left: auto; font-size: 13px; color: var(--texto); }

.prev { display: flex; align-items: center; gap: 12px; }
.prev-hora { font: 800 22px Catamaran, sans-serif; color: var(--navy); min-width: 62px; text-align: center; background: #eef3f8; border-radius: 10px; padding: 8px 4px; }
.prev-info { flex: 1; min-width: 0; }
.prev-info b { display: block; font-size: 16px; }
.seta { color: #9aa5b3; font-size: 26px; line-height: 1; }

.avisos { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.avisos .btn { flex: 1 1 160px; }

/* detalhe */
.det-cab { margin: 4px 0 14px; }
.det-cab h1 { font-size: 27px; margin: 8px 0 4px; }
.det-cab.emergencia h1 { color: #b42323; }
.faixa-emerg { background: var(--verm); color: #fff; border-radius: 12px; padding: 10px 14px; font-weight: 700; display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.rot { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #6b7480; margin-bottom: 4px; }
.cartao h3 { font-size: 19px; }
.end { font-size: 17px; margin: 4px 0 12px; }
.dados { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin-top: 8px; }
.dados div { min-width: 0; }
.dados b { display: block; font-size: 16px; overflow-wrap: anywhere; }
.dados span { font-size: 13px; color: #6b7480; }
.hist { list-style: none; margin: 8px 0 0; padding: 0; }
.hist li { padding: 8px 0; border-top: 1px solid #edf0f4; font-size: 15px; }
.hist li:first-child { border-top: 0; }
.hist small { color: #6b7480; display: block; font-size: 13px; }
.desc { font-size: 17px; margin: 6px 0 0; white-space: pre-wrap; }
.linha-tempo { list-style: none; margin: 8px 0 0; padding: 0 0 0 18px; border-left: 3px solid #dfe5ec; }
.linha-tempo li { position: relative; padding: 4px 0 10px 8px; font-size: 15px; }
.linha-tempo li::before { content: ''; position: absolute; left: -26px; top: 9px; width: 13px; height: 13px; border-radius: 50%; background: var(--azul); border: 3px solid #fff; box-shadow: 0 0 0 1px #c7d2de; }
.linha-tempo small { color: #6b7480; display: block; font-size: 13px; }
.passo { position: sticky; bottom: 0; background: linear-gradient(to top, var(--fundo) 75%, rgba(238,241,245,0)); padding: 14px 0 max(10px, env(safe-area-inset-bottom)); margin-top: 6px; z-index: 5; }
.passo > .btn + .btn, .passo > .btn + .duplo { margin-top: 10px; }
.trilho { display: flex; gap: 6px; margin: 12px 0 2px; }
.trilho span { flex: 1; height: 7px; border-radius: 4px; background: #d7dee7; }
.trilho span.ok { background: var(--verde); }
.trilho span.agora { background: var(--azul); }
.trilho-rot { display: flex; justify-content: space-between; font-size: 12px; color: #6b7480; }

/* formulário da OS e preventiva */
.campo { margin-top: 14px; }
.campo > label, .campo > .rot2 { display: block; font-weight: 700; font-size: 16px; margin-bottom: 8px; }
.entrada { width: 100%; min-height: 54px; border: 2px solid #c5ced9; border-radius: 12px; padding: 12px 14px; font-size: 17px; background: #fff; }
.entrada:focus { outline: none; border-color: var(--azul); box-shadow: 0 0 0 3px rgba(1,112,185,.18); }
textarea.entrada { min-height: 96px; resize: vertical; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 46px; padding: 8px 14px; border-radius: 999px; border: 2px solid #c5ced9; background: #fff; font-size: 15px; font-weight: 500; text-align: left; line-height: 1.2; }
.chip[aria-pressed="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }
.chip[aria-pressed="true"]::before { content: '✓ '; font-weight: 700; }
.addserv { display: flex; gap: 8px; margin-top: 10px; }
.addserv .entrada { flex: 1; min-width: 0; }
.pecas { list-style: none; padding: 0; margin: 0; }
.peca { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid #edf0f4; }
.peca:first-child { border-top: 0; }
.peca-info { flex: 1; min-width: 0; }
.peca-info b { display: block; font-size: 15px; line-height: 1.25; }
.peca-info small { color: #6b7480; font-size: 13px; }
.peca-info small.baixo { color: #b42323; font-weight: 700; }
.qtd { display: flex; align-items: center; gap: 4px; flex: none; }
.qtd button { width: 48px; height: 48px; border-radius: 12px; border: 2px solid var(--navy); background: #fff; color: var(--navy); font-size: 26px; font-weight: 700; line-height: 1; display: grid; place-items: center; padding: 0; }
.qtd button:disabled { opacity: .3; }
.qtd output { min-width: 34px; text-align: center; font: 800 22px Catamaran, sans-serif; }
.peca.usada { background: #f1f7fc; margin: 0 -14px; padding-left: 14px; padding-right: 14px; }
.reais { position: relative; }
.reais::before { content: 'R$'; position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-weight: 700; color: #6b7480; }
.reais .entrada { padding-left: 46px; }
.total { display: flex; justify-content: space-between; align-items: baseline; font-size: 15px; color: var(--texto); padding: 4px 0; }
.total b { color: var(--forte); font-size: 16px; }
.total.grande b { font: 800 26px Catamaran, sans-serif; }
.assin { position: relative; border: 2px dashed #9aa7b6; border-radius: 12px; background: #fbfcfd; height: 180px; touch-action: none; overflow: hidden; }
.assin canvas { width: 100%; height: 100%; display: block; touch-action: none; }
.assin .dica { position: absolute; left: 0; right: 0; bottom: 34px; text-align: center; color: #9aa7b6; font-size: 14px; pointer-events: none; }
.assin .base { position: absolute; left: 18px; right: 18px; bottom: 28px; border-top: 2px solid #c9d1db; pointer-events: none; }
.assin-acoes { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; font-size: 13px; color: #6b7480; gap: 8px; }
.erro-form { color: #b42323; font-weight: 700; margin: 0 0 8px; }
.erro-form:empty { display: none; }
.passo .erro-form { background: #fff; border-radius: 10px; padding: 10px 12px; box-shadow: inset 0 0 0 2px #f1b9b9; }

.check { list-style: none; padding: 0; margin: 0; }
.check li + li { margin-top: 8px; }
.check button { width: 100%; min-height: 62px; display: flex; align-items: center; gap: 14px; padding: 10px 14px; border-radius: 12px; border: 2px solid #c5ced9; background: #fff; text-align: left; font-size: 16px; font-weight: 500; line-height: 1.25; }
.check button .cx { width: 34px; height: 34px; border-radius: 9px; border: 3px solid #9aa7b6; flex: none; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 20px; }
.check button[aria-pressed="true"] { border-color: var(--verde); background: #effaf4; }
.check button[aria-pressed="true"] .cx { background: var(--verde); border-color: var(--verde); }
.check .n { color: #6b7480; font-size: 13px; font-weight: 700; display: block; }
.progresso { height: 10px; background: #dfe5ec; border-radius: 6px; overflow: hidden; margin-top: 8px; }
.progresso i { display: block; height: 100%; background: var(--verde); transition: width .2s; }

.sucesso { text-align: center; padding: 30px 6px; }
.sucesso .ok { width: 92px; height: 92px; border-radius: 50%; background: var(--verde); color: #fff; display: grid; place-items: center; margin: 0 auto 16px; font-size: 52px; font-weight: 800; }
.sucesso h1 { font-size: 28px; }
.sucesso p { font-size: 17px; color: var(--texto); }
.resumo { text-align: left; margin: 18px 0; }

/* entrar */
.entrar { min-height: calc(100vh - 30px); background: var(--navy); color: #fff; margin: -14px -16px -40px; padding: 24px 16px 40px; }
.entrar-cab { text-align: center; padding: 10px 0 18px; }
.entrar-cab img { width: 150px; height: auto; }
.entrar-cab h1 { color: #fff; font-size: 26px; margin-top: 12px; }
.entrar-cab p { color: #c3cad4; margin: 6px 0 0; }
.entrar-lista { max-width: 460px; margin: 0 auto; display: grid; gap: 10px; }
.tec-op { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 76px; padding: 12px 14px; border-radius: 14px; border: 2px solid rgba(255,255,255,.18); background: rgba(255,255,255,.06); color: #fff; text-align: left; }
.tec-op:active, .tec-op[aria-pressed="true"] { background: rgba(255,255,255,.16); border-color: #fff; }
.tec-op b { display: block; font-size: 18px; }
.tec-op small { color: #c3cad4; font-size: 14px; }
.pin { max-width: 340px; margin: 0 auto; text-align: center; }
.pin-pontos { display: flex; justify-content: center; gap: 16px; margin: 18px 0 8px; }
.pin-pontos i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #fff; }
.pin-pontos i.on { background: #fff; }
.pin-pontos.erro { animation: treme .35s; }
.pin-pontos.erro i { border-color: #ff8a8a; }
@keyframes treme { 25% { transform: translateX(-10px); } 75% { transform: translateX(10px); } }
.teclado { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.teclado button { height: 66px; border-radius: 14px; border: 0; background: rgba(255,255,255,.1); color: #fff; font: 700 26px Catamaran, sans-serif; }
.teclado button:active { background: rgba(255,255,255,.25); }
.teclado .apagar { font-size: 16px; font-family: Roboto, sans-serif; }
.pin-msg { min-height: 1.4em; color: #ff9d9d; font-weight: 700; }
.pin-exemplo { margin-top: 18px; font-size: 14px; color: #c3cad4; background: rgba(255,255,255,.07); border-radius: 10px; padding: 10px; }
.trocar { background: transparent; border: 0; color: #9fd0f2; text-decoration: underline; font-size: 15px; padding: 10px; }

/* modal */
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(15,20,28,.6); display: flex; align-items: flex-end; justify-content: center; }
.modal-caixa { background: #fff; width: 100%; max-width: 560px; border-radius: 18px 18px 0 0; padding: 18px 16px max(18px, env(safe-area-inset-bottom)); max-height: 92vh; overflow: auto; }
.modal-caixa h2 { font-size: 22px; margin-bottom: 6px; }
.modal-caixa .duplo { margin-top: 14px; }

/* alerta em tela cheia */
.alerta { position: fixed; inset: 0; z-index: 100; color: #fff; display: flex; flex-direction: column; padding: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom)); background: var(--navy2); overflow: auto; }
.alerta.emergencia { background: #a91f1f; animation: fundoalerta 1.1s infinite; }
@keyframes fundoalerta { 50% { background: #d64545; } }
.alerta-topo { text-align: center; margin-top: 10px; }
.alerta-sino { width: 96px; height: 96px; margin: 8px auto 12px; border-radius: 50%; background: rgba(255,255,255,.16); display: grid; place-items: center; animation: sino 1s infinite; }
.alerta-sino svg { width: 56px; height: 56px; }
@keyframes sino { 0%,100% { transform: rotate(0); } 20% { transform: rotate(-14deg); } 40% { transform: rotate(12deg); } 60% { transform: rotate(-8deg); } }
.alerta-tag { display: inline-block; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; font-size: 14px; background: rgba(0,0,0,.25); padding: 6px 12px; border-radius: 999px; }
.alerta h1 { color: #fff; font-size: 34px; margin: 12px 0 4px; }
.alerta-num { font-size: 18px; opacity: .9; }
.alerta-info { background: rgba(0,0,0,.22); border-radius: 14px; padding: 14px; margin: 18px 0; font-size: 17px; }
.alerta-info b { display: block; font-size: 19px; }
.alerta-info p { margin: 8px 0 0; }
.alerta-acoes { margin-top: auto; display: grid; gap: 10px; }
.alerta-acoes .btn-grande { min-height: 74px; font-size: 22px; }
.alerta .btn-verde { background: #fff; color: #1d6b47; }
.alerta.emergencia .btn-verde { color: #a91f1f; }
.alerta .btn-recusar { background: transparent; color: #fff; box-shadow: inset 0 0 0 2px rgba(255,255,255,.7); }

.toast { position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 120; background: #10161f; color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 500; max-width: calc(100% - 32px); box-shadow: 0 6px 24px rgba(0,0,0,.3); text-align: center; }
.toast.erro { background: #b42323; }

.carregando { text-align: center; padding: 60px 0; color: var(--texto); }
.faixa-emerg svg { width: 26px; height: 26px; flex: none; }
.dados a { color: var(--azul); font-weight: 500; }
.toast { bottom: auto; top: calc(var(--topo-h) + 44px); }
