/* Telas do Painel de temperatura. Só tokens do tema (tema-amorix.css). */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
.conteudo > main { padding: 24px 28px 48px; display: flex; flex-direction: column; gap: 20px; }
main section { display: flex; flex-direction: column; gap: 16px; }

/* Marca no menu */
.logo .marca { font-weight: 800; font-size: 16px; letter-spacing: .04em; color: var(--text); }
.logo .logo-modulo { display: inline-flex; align-items: center; gap: 5px; color: var(--destaque); border-left: 1px solid var(--line); padding-left: 8px; white-space: nowrap; }
.logo .logo-modulo svg { width: 16px; height: 16px; flex: none; }
.logo .logo-modulo b { font-size: 11px; font-weight: 800; letter-spacing: .03em; }
.nav-contador { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 800; display: inline-grid; place-items: center; }

/* Comuns */
.hint { font-size: 12.5px; color: var(--text-muted); margin: 0; }
.explica { margin-top: -8px; }
.card { background: var(--surface-1); border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px; min-width: 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; }
.section-head h2 { font-size: 16px; font-weight: 800; margin: 0; }
.table-card-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 14px; margin-bottom: 14px; }
.card-titulo { font-size: 15px; font-weight: 800; margin: 0; }
.btn-peq { padding: 7px 14px; font-size: 12.5px; font-family: inherit; cursor: pointer; font-weight: 600; }
.voltar { color: var(--link); text-decoration: none; font-size: 13px; font-weight: 600; width: max-content; }
.voltar:hover { text-decoration: underline; }
.faixa-demo { margin: 16px 28px 0; padding: 10px 14px; border-radius: var(--r-sm); background: var(--warn-bg); color: var(--warn); font-size: 13px; font-weight: 600; border: 1px solid var(--warn); }

/* Chips de período */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font: inherit; font-size: 12.5px; font-weight: 600; padding: 6px 12px; border-radius: 999px; cursor: pointer; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.chip:hover { color: var(--text); }
.chip[aria-pressed="true"] { background: var(--amx-amarelo); color: #0B1F4B; border-color: var(--amx-amarelo); }

/* Selos de situação */
.status-badge { flex: none; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.status-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-badge.ok { background: var(--ok-bg); color: var(--ok); }
.status-badge.atencao { background: var(--warn-bg); color: var(--warn); }
.status-badge.alerta, .status-badge.erro_sonda { background: var(--bad-bg); color: var(--bad); }
.status-badge.sem_dados { background: var(--surface-2); color: var(--muted); }
.tag-aprox { font-size: 11px; font-weight: 600; color: var(--warn); background: var(--warn-bg); padding: 2px 8px; border-radius: 999px; white-space: nowrap; }

/* Indicadores do topo */
.indicadores { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.indicador { container-type: inline-size; min-width: 0; background: var(--surface-1); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; }
.indicador .rotulo { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.indicador .valor { display: block; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.15; font-size: clamp(20px, 22cqi, 34px); white-space: nowrap; margin-top: 4px; }
.indicador.bom .valor { color: var(--ok); }
.indicador.ruim .valor { color: var(--bad); }
.indicador.neutro .valor { color: var(--muted); }
@media (max-width: 820px) { .indicadores { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Cartões de veículo */
.veiculos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.veiculo-card { container-type: inline-size; display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: inherit; background: var(--surface-1); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; border-left-width: 4px; transition: border-color .15s, transform .15s; min-width: 0; }
.veiculo-card:hover { border-color: var(--amx-azul-medio); transform: translateY(-1px); }
.veiculo-card.ok { border-left-color: var(--ok); }
.veiculo-card.atencao { border-left-color: var(--warn); }
.veiculo-card.alerta, .veiculo-card.erro_sonda { border-left-color: var(--bad); }
.veiculo-card.sem_dados { border-left-color: var(--line); }
.vc-topo { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.vc-placa { font-size: 17px; font-weight: 800; letter-spacing: .04em; margin: 0; }
.vc-desc { font-size: 12.5px; color: var(--text-muted); margin: 2px 0 0; overflow-wrap: anywhere; }
.vc-temp { font-weight: 800; line-height: 1; font-size: clamp(30px, 17cqi, 46px); white-space: nowrap; }
.vc-temp small { font-size: .45em; font-weight: 700; color: var(--text-muted); margin-left: 2px; }
.vc-temp.fora { color: var(--bad); }
.vc-temp.vazio { color: var(--muted); }
.vc-faixa { display: flex; align-items: center; gap: 8px; }
.barra-faixa { position: relative; flex: 1; height: 8px; border-radius: 99px; background: var(--surface-2); }
.barra-faixa .permitida { position: absolute; top: 0; bottom: 0; border-radius: 99px; background: var(--ok-bg); border: 1px solid var(--ok); }
.barra-faixa .marca-atual { position: absolute; top: -4px; width: 4px; height: 16px; border-radius: 2px; background: var(--text); transform: translateX(-2px); }
.barra-faixa .marca-atual.fora { background: var(--bad); }
.vc-faixa .lim { font-size: 11.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.vc-rodape { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; color: var(--text-muted); border-top: 1px solid var(--gridline); padding-top: 10px; }
.vc-rodape b { color: var(--text-secondary); font-weight: 600; }

/* Detalhe */
.detalhe-topo { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; }
.detalhe-topo .dt-id { min-width: 0; }
.detalhe-topo .dt-id h2 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: .04em; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.detalhe-topo .dt-temp { font-size: 40px; font-weight: 800; line-height: 1; white-space: nowrap; }
.detalhe-topo .dt-temp.fora { color: var(--bad); }
.detalhe-topo .dt-dados { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, max-content)); gap: 4px 24px; font-size: 12.5px; color: var(--text-muted); flex: 1; min-width: 220px; }
.detalhe-topo .dt-dados b { display: block; color: var(--text); font-size: 14px; overflow-wrap: anywhere; }
.detalhe-topo .sp { flex: 1; }

/* Gráfico */
.grafico { position: relative; width: 100%; height: 340px; }
.grafico svg { display: block; width: 100%; height: 100%; overflow: visible; }
.grafico .g-grade line { stroke: var(--gridline); stroke-width: 1; }
.grafico .g-eixo text { fill: var(--text-muted); font-size: 11px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.grafico .g-faixa { fill: var(--ok-bg); }
.grafico .g-limite { stroke: var(--ok); stroke-width: 1; stroke-dasharray: 4 4; opacity: .8; }
.grafico .g-limite-txt { fill: var(--ok); font-size: 11px; font-weight: 700; font-family: var(--font); }
.grafico .g-envelope { fill: var(--series-1); opacity: .15; }
.grafico .g-linha { fill: none; stroke: var(--series-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.grafico .g-linha.aprox { stroke-dasharray: 5 4; opacity: .7; }
.grafico .g-fora { fill: none; stroke: var(--bad); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.grafico .g-alerta { fill: var(--bad-bg); }
.grafico .g-lacuna { fill: var(--muted); opacity: .16; }
.grafico .g-lacuna-txt { fill: var(--text-secondary); font-size: 11px; font-weight: 700; font-family: var(--font); }
.grafico .g-cursor { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.grafico .g-ponto { fill: var(--series-1); stroke: var(--surface); stroke-width: 2; }
.grafico .g-ponto.fora { fill: var(--bad); }
.dica-grafico { position: fixed; z-index: 60; pointer-events: none; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 12px; box-shadow: 0 8px 22px var(--sombra); white-space: nowrap; }
.dica-grafico b { font-size: 15px; font-variant-numeric: tabular-nums; }
.legenda { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; font-size: 12px; color: var(--text-muted); }
.legenda span { display: inline-flex; align-items: center; gap: 6px; }
.legenda i { display: inline-block; width: 18px; height: 10px; border-radius: 3px; }
.lg-linha { background: var(--series-1); height: 3px !important; }
.lg-faixa { background: var(--ok-bg); border: 1px solid var(--ok); }
.lg-fora { background: var(--bad); height: 3px !important; }
.lg-aprox { height: 0 !important; border-top: 2px dashed var(--series-1); }
.lg-lacuna { background: var(--muted); opacity: .35; }
.tag-energia { font-size: 11px; font-weight: 700; color: var(--text-secondary); background: var(--surface-2); border: 1px solid var(--line); padding: 2px 8px; border-radius: 999px; white-space: nowrap; }

/* Tabelas */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); padding: 0 12px 10px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 12px 11px 0; border-bottom: 1px solid var(--gridline); vertical-align: middle; font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; }
td .sub { display: block; font-size: 12px; color: var(--text-muted); }
td a { color: var(--link); text-decoration: none; font-weight: 700; }
td a:hover { text-decoration: underline; }
.temp-ruim { color: var(--bad); font-weight: 700; }
.link-acao { background: none; border: 0; padding: 0; font: inherit; font-size: 13px; font-weight: 600; color: var(--link); cursor: pointer; }
.link-acao:hover { text-decoration: underline; }

/* Formulário e modal (padrão do Conecta) */
.ticket-form { display: grid; gap: 12px; }
.ticket-form label { font-size: 12px; font-weight: 700; color: var(--text-secondary); margin-bottom: 4px; display: block; }
.ticket-form input { width: 100%; padding: 9px 11px; border-radius: 8px; border: 1px solid var(--border); background: var(--page-plane); color: var(--text-primary); font-family: inherit; font-size: 13.5px; }
.form-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-overlay { position: fixed; inset: 0; z-index: 80; background: var(--fundo-dialogo); display: none; place-items: center; padding: 16px; }
.modal-overlay.open { display: grid; }
.modal-box { width: 100%; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; box-shadow: 0 18px 48px var(--sombra); }
.modal-box[data-largura="estreita"] { max-width: 380px; }
.modal-box[data-largura="media"] { max-width: 460px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.modal-head h2 { font-size: 17px; font-weight: 800; margin: 0; }
.modal-close { background: none; border: 0; color: var(--muted); font-size: 24px; line-height: 1; cursor: pointer; padding: 0 4px; }
.modal-close:hover { color: var(--text); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.modal-actions button { padding: 9px 16px; font-size: 13.5px; font-weight: 700; cursor: pointer; font-family: inherit; }

@media (max-width: 760px) {
  .conteudo > main { padding: 16px 16px 40px; }
  .faixa-demo { margin: 12px 16px 0; }
  .grafico { height: 260px; }
  .detalhe-topo .dt-temp { font-size: 34px; }
  .ocultar-celular { display: none; }
}
.rolagem-tabela, #alertasVeiculo, #listaAlertas, #tabelaVeiculos { overflow-x: auto; }
td.detalhe { min-width: 190px; }
