/* ============================================================
   Controle de temperatura (cadeia fria) — docs/temperatura/
   Painel Admin → Temperatura, modal "Faixas e alertas", aba
   Temperatura do Dashboard da frota, tratativa e gráfico.
   Estados sempre com forma + texto (✓ ▲ ◎ ■ ⊘), azul para
   "fora da faixa" — nunca só laranja × verde.
   ============================================================ */

/* ---- Painel Admin: faixa inativa/oculta na lista -------------------------- */
body.ui-new-nav .hg-fuel__row-off td { color: var(--color-text-secondary, #5b636e); }
body.ui-new-nav .hg-fuel__row-off .hg-fuel__rule-name { text-decoration: line-through; }

/* ---- Modal da faixa ------------------------------------------------------- */
body.ui-new-nav .hg-temp-profile-dialog { width: min(760px, 96vw); }
body.ui-new-nav .hg-temp-profile fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
/* O teto de 280px de .hg-fuel-config .hg-fuel__input vence --num/--tiny: número e unidade na mesma linha. */
body.ui-new-nav .hg-temp-profile .hg-fuel__unit { flex-wrap: nowrap; }
body.ui-new-nav .hg-temp-profile .hg-fuel__unit + .hg-fuel__unit { margin-top: 6px; }
body.ui-new-nav .hg-temp-profile .hg-fuel__input--num { width: 88px; max-width: 88px; }
body.ui-new-nav .hg-temp-profile .hg-fuel__input--tiny { width: 72px; max-width: 72px; }

/* Régua das zonas (desenhada pelo script do modal). */
body.ui-new-nav .hg-temp-zone {
    display: flex;
    height: 26px;
    margin-top: 14px;
    border-radius: var(--hg-ui-control-radius, 6px);
    overflow: hidden;
    font-size: var(--hg-ui-font-2xs, 10px);
    font-weight: 600;
    line-height: 26px;
    text-align: center;
    white-space: nowrap;
}
body.ui-new-nav .hg-temp-zone:empty { display: none; }
body.ui-new-nav .hg-temp-zone__z { overflow: hidden; text-overflow: clip; }
body.ui-new-nav .hg-temp-zone__z--ok   { background: var(--color-temp-band-strong); color: var(--color-primary-hover, #044a5f); }
body.ui-new-nav .hg-temp-zone__z--att  {
    background: repeating-linear-gradient(45deg, var(--color-temp-attention-stripe) 0 4px, var(--color-temp-attention-fill) 4px 8px);
    color: var(--color-temp-attention);
}
body.ui-new-nav .hg-temp-zone__z--out  { background: var(--color-temp-out); color: var(--color-text-on-primary, #fff); }
body.ui-new-nav .hg-temp-zone__z--crit { background: var(--color-temp-critical); color: var(--color-text-on-primary, #fff); }

/* ---- Selos de estado (painel, gráfico, tratativa) ------------------------- */
body.ui-new-nav .hg-temp-state {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 8px;
    border-radius: 20px;
    font-size: var(--hg-ui-font-2xs, 10px);
    font-weight: 600;
    line-height: 1.6;
    white-space: nowrap;
    border: 1px solid transparent;
}
body.ui-new-nav .hg-temp-state--ok        { color: var(--color-temp-ok); border-color: transparent; padding-left: 0; }
body.ui-new-nav .hg-temp-state--attention,
body.ui-new-nav .hg-temp-state--tolerated { color: var(--color-temp-attention); border: 1px dashed var(--color-temp-attention); }
body.ui-new-nav .hg-temp-state--out       { background: var(--color-temp-out); color: var(--color-text-on-primary, #fff); }
body.ui-new-nav .hg-temp-state--critical  { background: var(--color-temp-critical); color: var(--color-text-on-primary, #fff); }
body.ui-new-nav .hg-temp-state--silent    { color: var(--color-temp-silent); border-color: var(--color-temp-silent); }
body.ui-new-nav .hg-temp-state--paused,
body.ui-new-nav .hg-temp-state--loading   { color: var(--color-text-secondary, #5b636e); border-color: var(--color-border-neutral, #e5e7eb); }
body.ui-new-nav .hg-temp-state--closed    { color: var(--color-text-primary, #2e3138); border-color: var(--color-text-secondary, #5b636e); }
body.ui-new-nav .hg-temp-state--treated   { color: var(--color-temp-ok); border-color: var(--color-temp-ok); }

/* ---- Cadastro do sensor: bloco "Controle de temperatura" ------------------ */
body.ui-new-nav .hg-temp-sensor {
    margin: 4px 0 14px;
    padding: 12px 14px 4px;
    border: 2px solid var(--color-primary, #05617a);
    border-radius: var(--hg-ui-table-radius, 10px);
    background: var(--color-primary-tint, #f0f7f9);
}
body.ui-new-nav .hg-temp-sensor[hidden] { display: none !important; }
body.ui-new-nav .hg-temp-sensor__head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin-bottom: 10px;
}
body.ui-new-nav .hg-temp-sensor__head b { font-size: var(--hg-ui-font-md, 13px); color: var(--color-primary-hover, #044a5f); }
body.ui-new-nav .hg-temp-sensor__monitor {
    margin: 0 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: var(--hg-ui-font-sm, 12px);
    font-weight: 600;
}
/* Faixa livre: os quatro limites deste sensor, abaixo da linha da faixa. */
body.ui-new-nav .hg-temp-sensor__free {
    margin: -2px 0 12px;
    padding: 10px 12px 2px;
    border: 1px dashed var(--color-primary, #05617a);
    border-radius: var(--hg-ui-control-radius, 6px);
    background: var(--color-white, #fff);
}
body.ui-new-nav .hg-temp-sensor__free[hidden] { display: none !important; }
body.ui-new-nav .hg-temp-sensor__free-title {
    margin-bottom: 8px;
    font-size: var(--hg-ui-font-sm, 12px);
    font-weight: 600;
    color: var(--color-primary-hover, #044a5f);
}
body.ui-new-nav .hg-temp-sensor__sub {
    margin: 2px 0 8px;
    padding-top: 10px;
    border-top: 1px solid var(--color-temp-band-strong);
    font-size: var(--hg-ui-font-sm, 12px);
    font-weight: 600;
    color: var(--color-primary-hover, #044a5f);
}

/* ---- Gráfico do histórico: temperatura com faixa -------------------------- */
body.ui-new-nav .hg-temp-graph[hidden],
body.ui-new-nav .hg-temp-foot[hidden] { display: none !important; }

body.ui-new-nav .hg-temp-graph__head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 14px;
    padding: 6px 10px;
    border: 1px solid var(--color-temp-band-strong);
    border-radius: 8px;
    background: var(--color-primary-tint, #f0f7f9);
    font-size: var(--hg-ui-font-xs, 11px);
    color: var(--color-history-graph-label, #334155);
}
body.ui-new-nav .hg-temp-graph__head > b { font-size: var(--hg-ui-font-sm, 12px); color: var(--color-temp-ok); }
body.ui-new-nav .hg-temp-graph__links { margin-left: auto; display: inline-flex; gap: 4px; }
body.ui-new-nav .hg-temp-graph__links a { text-decoration: none; }
body.ui-new-nav .hg-temp-graph__report { border-color: var(--color-temp-ok) !important; color: var(--color-temp-ok) !important; }
body.ui-new-nav .hg-temp-graph__warn { color: var(--color-temp-silent); font-weight: 600; }

/* Cartões: estado em forma + texto, borda grossa azul quando fora. */
body.ui-new-nav .hg-temp-tile__sub {
    margin: 0;
    font-size: var(--hg-ui-font-2xs, 10px);
    color: var(--color-history-graph-footer-text, #7a8794);
}
body.ui-new-nav .hg-temp-tile--out { border: 2px solid var(--color-temp-out) !important; }
body.ui-new-nav .hg-temp-tile--out .hg-history-graph__tile-value,
body.ui-new-nav .hg-temp-tile--out .hg-temp-tile__sub { color: var(--color-temp-out); font-weight: 600; }
body.ui-new-nav .hg-temp-tile--att .hg-temp-tile__sub { color: var(--color-temp-attention); font-weight: 600; }

/* Legenda */
body.ui-new-nav .hg-temp-key { display: inline-block; width: 16px; height: 0; vertical-align: middle; }
body.ui-new-nav .hg-temp-key--main { border-top: 3px solid var(--color-temp-ok); }
body.ui-new-nav .hg-temp-key--companion { border-top: 2px solid var(--color-temp-silent); }
body.ui-new-nav .hg-temp-key--band { height: 10px; background: var(--color-temp-band); border-top: 1px dashed var(--color-temp-ok); border-bottom: 1px dashed var(--color-temp-ok); }
body.ui-new-nav .hg-temp-key--door { width: 9px; height: 12px; background: var(--color-temp-door); }
body.ui-new-nav .hg-temp-key--ring { width: 10px; height: 10px; border: 2px solid var(--color-temp-out); border-radius: 50%; box-sizing: border-box; }
body.ui-new-nav .hg-temp-key--crit { border-top: 2px dotted var(--color-temp-critical); }
body.ui-new-nav .hg-temp-key-text--att { color: var(--color-temp-attention); }

/* Trilhas e ocorrências: rolam por conta própria para não espremer o gráfico. */
body.ui-new-nav .hg-temp-foot {
    flex: 0 0 auto;
    max-height: 32%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
body.ui-new-nav .hg-temp-tracks { display: flex; flex-direction: column; gap: 4px; }
body.ui-new-nav .hg-temp-track { display: flex; align-items: center; gap: 6px; }
body.ui-new-nav .hg-temp-track__label {
    flex: 0 0 auto;
    width: 48px;
    text-align: right;
    font-size: var(--hg-ui-font-2xs, 10px);
    font-weight: 600;
    color: var(--color-history-graph-label, #334155);
}
body.ui-new-nav .hg-temp-track__bar {
    position: relative;
    flex: 1 1 auto;
    height: 12px;
    background: var(--color-temp-track);
    overflow: hidden;
}
body.ui-new-nav .hg-temp-track__bar--ok { background: var(--color-temp-band-strong); }
body.ui-new-nav .hg-temp-track__tail { font-size: var(--hg-ui-font-2xs, 10px); color: var(--color-history-graph-footer-text, #7a8794); }
body.ui-new-nav .hg-temp-track__seg { position: absolute; top: 0; bottom: 0; }
body.ui-new-nav .hg-temp-track__seg--attention {
    background: repeating-linear-gradient(45deg, var(--color-temp-attention-stripe) 0 3px, var(--color-temp-attention-fill) 3px 6px);
}
body.ui-new-nav .hg-temp-track__seg--tolerated { background: var(--color-temp-attention); }
body.ui-new-nav .hg-temp-track__seg--out { background: var(--color-temp-out); }
body.ui-new-nav .hg-temp-track__seg--critical { background: var(--color-temp-critical); }
body.ui-new-nav .hg-temp-track__seg--loading {
    background: repeating-linear-gradient(45deg, var(--color-temp-silent) 0 1px, var(--color-temp-track) 1px 5px);
}
body.ui-new-nav .hg-temp-track__seg--door { background: var(--color-temp-silent); }
body.ui-new-nav .hg-temp-track__seg--ign { background: var(--color-temp-band-strong); }

body.ui-new-nav .hg-temp-track__legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 12px;
    font-size: var(--hg-ui-font-2xs, 10px);
    color: var(--color-history-graph-footer-text, #7a8794);
}
body.ui-new-nav .hg-temp-track__legend span { display: inline-flex; align-items: center; gap: 4px; }
body.ui-new-nav .hg-temp-track__sw { display: inline-block; width: 12px; height: 9px; }
body.ui-new-nav .hg-temp-track__sw--ok { background: var(--color-temp-band-strong); }
body.ui-new-nav .hg-temp-track__sw--attention {
    background: repeating-linear-gradient(45deg, var(--color-temp-attention-stripe) 0 3px, var(--color-temp-attention-fill) 3px 6px);
}
body.ui-new-nav .hg-temp-track__sw--tolerated { background: var(--color-temp-attention); }
body.ui-new-nav .hg-temp-track__sw--out { background: var(--color-temp-out); }
body.ui-new-nav .hg-temp-track__sw--critical { background: var(--color-temp-critical); }
body.ui-new-nav .hg-temp-track__sw--loading {
    background: repeating-linear-gradient(45deg, var(--color-temp-silent) 0 1px, var(--color-temp-track) 1px 5px);
}

body.ui-new-nav .hg-temp-occ {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--hg-ui-font-xs, 11px);
    background: var(--color-white, #fff);
    border: 1px solid var(--color-history-graph-header-border, #e6edf3);
}
body.ui-new-nav .hg-temp-occ caption {
    caption-side: top;
    text-align: left;
    padding: 0 0 4px;
    font-size: var(--hg-ui-font-2xs, 10px);
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--color-history-graph-footer-text, #7a8794);
}
body.ui-new-nav .hg-temp-occ th {
    padding: 5px 8px;
    font-size: var(--hg-ui-font-2xs, 10px);
    font-weight: 600;
    text-align: left;
    color: var(--color-history-graph-footer-text, #7a8794);
    border-bottom: 1px solid var(--color-border-neutral, #e5e7eb);
}
body.ui-new-nav .hg-temp-occ td { padding: 5px 8px; border-bottom: 1px solid var(--color-border-soft, #f0f1f3); vertical-align: middle; }
body.ui-new-nav .hg-temp-occ tr.is-excursion td { background: var(--color-temp-out-soft); }
body.ui-new-nav .hg-temp-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
body.ui-new-nav .hg-temp-right { text-align: right; white-space: nowrap; }
body.ui-new-nav .hg-temp-muted { color: var(--color-history-graph-footer-text, #7a8794); }

/* ---- Tratativa da excursão (modal) ---------------------------------------- */
body.ui-new-nav .hg-temp-ex { display: flex; flex-direction: column; gap: 12px; font-size: var(--hg-ui-font-sm, 12px); }
body.ui-new-nav .hg-temp-ex__top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
body.ui-new-nav .hg-temp-ex__tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px; }
body.ui-new-nav .hg-temp-ex__tile {
    padding: 7px 10px;
    border: 1px solid var(--color-history-graph-header-border, #e6edf3);
    border-radius: 8px;
    background: var(--color-history-graph-header-background, #f8fafc);
}
body.ui-new-nav .hg-temp-ex__tile p { margin: 0; font-size: var(--hg-ui-font-2xs, 10px); color: var(--color-history-graph-footer-text, #7a8794); }
body.ui-new-nav .hg-temp-ex__tile b { display: block; font-size: var(--hg-ui-font-md, 13px); color: var(--color-history-graph-label, #334155); }
body.ui-new-nav .hg-temp-ex__tile small { font-size: var(--hg-ui-font-2xs, 10px); color: var(--color-history-graph-footer-text, #7a8794); }
body.ui-new-nav .hg-temp-ex__tile--out { border: 2px solid var(--color-temp-out); background: var(--color-white, #fff); }
body.ui-new-nav .hg-temp-ex__tile--out b,
body.ui-new-nav .hg-temp-ex__tile--out small { color: var(--color-temp-out); font-weight: 600; }
body.ui-new-nav .hg-temp-ex__chart { overflow-x: auto; border: 1px solid var(--color-history-graph-header-border, #e6edf3); border-radius: 8px; padding: 6px; background: var(--color-white, #fff); }
body.ui-new-nav .hg-temp-ex__chart svg { max-width: 100%; height: auto; }
body.ui-new-nav .hg-temp-ex__cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
body.ui-new-nav .hg-temp-ex h5 {
    margin: 0 0 6px;
    font-size: var(--hg-ui-font-xs, 11px);
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--color-text-secondary, #5b636e);
}
body.ui-new-nav .hg-temp-ex__dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 10px; margin: 0; }
body.ui-new-nav .hg-temp-ex__dl dt { font-weight: 400; color: var(--color-text-secondary, #5b636e); }
body.ui-new-nav .hg-temp-ex__dl dd { margin: 0; font-weight: 600; }
body.ui-new-nav .hg-temp-ex__hint { margin: 8px 0 0; padding: 7px 10px; border-radius: 6px; background: var(--color-primary-tint, #f0f7f9); }
body.ui-new-nav .hg-temp-ex__timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
body.ui-new-nav .hg-temp-ex__timeline li span { display: inline-block; min-width: 42px; color: var(--color-text-secondary, #5b636e); font-variant-numeric: tabular-nums; }
body.ui-new-nav .hg-temp-ex__timeline li.is-out { color: var(--color-temp-out); font-weight: 600; }
body.ui-new-nav .hg-temp-ex__timeline li.is-critical { color: var(--color-temp-critical); font-weight: 600; }
body.ui-new-nav .hg-temp-ex__timeline li.is-ok { color: var(--color-temp-ok); }
body.ui-new-nav .hg-temp-ex__form {
    padding: 12px 14px;
    border: 1px solid var(--color-history-graph-border, #e2e8f0);
    border-radius: 10px;
    background: var(--color-history-graph-background, #f5f7fa);
}
body.ui-new-nav .hg-temp-ex__chips { display: flex; flex-wrap: wrap; gap: 5px; }
body.ui-new-nav .hg-temp-ex__chip {
    padding: 5px 10px;
    border: 1px solid var(--color-border-input, #d1d5db);
    border-radius: 14px;
    background: var(--color-white, #fff);
    color: var(--color-text-primary, #2e3138);
    font-size: var(--hg-ui-font-xs, 11px);
    font-weight: 600;
    cursor: pointer;
}
body.ui-new-nav .hg-temp-ex__chip.is-on { background: var(--color-primary, #05617a); border-color: var(--color-primary, #05617a); color: var(--color-text-on-primary, #fff); }

/* ---- Dashboard da frota › aba Temperatura --------------------------------- */
body.ui-new-nav .hg-fdp__badge--temp { background: var(--color-temp-out); }
body.ui-new-nav .hg-temp-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
body.ui-new-nav .hg-temp-pane [hidden] { display: none !important; }
body.ui-new-nav .hg-temp-pane__bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; margin-bottom: 12px; }
body.ui-new-nav .hg-temp-pane__views {
    display: inline-flex;
    border: 1px solid var(--color-history-graph-track-border, #d8e1ea);
    border-radius: var(--hg-ui-control-radius, 6px);
    overflow: hidden;
    background: var(--color-white, #fff);
}
body.ui-new-nav .hg-temp-pane__views button {
    height: 30px;
    padding: 0 14px;
    border: 0;
    border-left: 1px solid var(--color-history-graph-track-border, #d8e1ea);
    background: var(--color-white, #fff);
    color: var(--color-history-graph-label, #334155);
    font-size: var(--hg-ui-font-sm, 12px);
    font-weight: 600;
    cursor: pointer;
}
body.ui-new-nav .hg-temp-pane__views button:first-child { border-left: 0; }
body.ui-new-nav .hg-temp-pane__views button.is-on { background: var(--color-primary, #05617a); color: var(--color-text-on-primary, #fff); }
body.ui-new-nav .hg-temp-pane__input {
    height: 30px;
    padding: 0 10px;
    border: 1px solid var(--color-border-input, #d1d5db);
    border-radius: var(--hg-ui-control-radius, 6px);
    background: var(--color-white, #fff);
    font-size: var(--hg-ui-font-sm, 12px);
    color: var(--color-text-primary, #2e3138);
    max-width: 220px;
}
body.ui-new-nav .hg-temp-pane__check { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: var(--hg-ui-font-sm, 12px); font-weight: 400; }
body.ui-new-nav .hg-temp-pane__updated { margin-left: auto; font-size: var(--hg-ui-font-xs, 11px); color: var(--color-text-secondary, #5b636e); }
body.ui-new-nav .hg-temp-pane__btn {
    display: inline-flex;
    align-items: center;
    height: 28px;
    padding: 0 12px;
    border: 1px solid var(--color-primary, #05617a);
    border-radius: var(--hg-ui-btn-radius, 4px);
    background: var(--color-white, #fff);
    color: var(--color-primary, #05617a);
    font-size: var(--hg-ui-font-sm, 12px);
    font-weight: 600;
    text-decoration: none;
}
body.ui-new-nav .hg-temp-pane__btn:hover { background: var(--color-primary-tint, #f0f7f9); text-decoration: none; }
/* Indicadores: os seis na mesma linha, ~20 % mais baixos que o cartão padrão
   do dashboard (detalhe em uma linha, texto inteiro no title). */
body.ui-new-nav .hg-temp-pane__kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
body.ui-new-nav .hg-temp-pane__kpis .hg-fd__kpi { padding: 7px 10px 7px 12px; }
body.ui-new-nav .hg-temp-pane__kpis .hg-fd__kpi-label {
    margin-bottom: 2px;
    letter-spacing: .05em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
body.ui-new-nav .hg-temp-pane__kpis .hg-fd__kpi-detail {
    margin-top: 2px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
body.ui-new-nav .hg-temp-pane__kpis .hg-fd__kpi-meta { margin-top: 4px; }
body.ui-new-nav .hg-temp-pane__kpis .hg-fd__kpi-bar { height: 3px; }
body.ui-new-nav .hg-temp-pane__kpis .hg-fd__kpi-meta-legend { margin-top: 2px; gap: 6px; line-height: 1.2; white-space: nowrap; overflow: hidden; }
body.ui-new-nav .hg-temp-pane__kpis .hg-fd__kpi-meta-legend span:last-child { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1000px) {
    body.ui-new-nav .hg-temp-pane__kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
    body.ui-new-nav .hg-temp-pane__kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
body.ui-new-nav .hg-temp-kpi--out { border: 2px solid var(--color-temp-out) !important; }
body.ui-new-nav .hg-temp-kpi--out::before { display: none; }
body.ui-new-nav .hg-temp-kpi--att { border: 1px dashed var(--color-temp-attention) !important; }
body.ui-new-nav .hg-temp-kpi--att::before { display: none; }
body.ui-new-nav .hg-temp-ok { color: var(--color-temp-ok); font-weight: 600; }
body.ui-new-nav .hg-temp-att { color: var(--color-temp-attention); }
body.ui-new-nav .hg-temp-out { color: var(--color-temp-out); }
body.ui-new-nav .hg-temp-crit { color: var(--color-temp-critical); font-weight: 600; }
body.ui-new-nav .hg-temp-count {
    margin-left: auto;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    box-sizing: border-box;
    border-radius: 10px;
    background: var(--color-temp-out);
    color: var(--color-text-on-primary, #fff);
    font-size: var(--hg-ui-font-xs, 11px);
    font-weight: 700;
    line-height: 20px;
    text-align: center;
}

body.ui-new-nav .hg-temp-pane__cols { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; }
body.ui-new-nav .hg-temp-pane__main { flex: 999 1 640px; min-width: 0; }
body.ui-new-nav .hg-temp-pane__side { flex: 1 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
body.ui-new-nav .hg-temp-pane__scroll { max-height: 62vh; overflow: auto; }
body.ui-new-nav .hg-temp-pane__table { min-width: 780px; }
body.ui-new-nav .hg-temp-pane__nowrap { white-space: nowrap; }
body.ui-new-nav .hg-temp-pane__value { font-size: var(--hg-ui-font-lg, 15px); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
body.ui-new-nav .hg-temp-row--critical .hg-temp-pane__value { color: var(--color-temp-critical); }
body.ui-new-nav .hg-temp-row--out .hg-temp-pane__value { color: var(--color-temp-out); }
body.ui-new-nav .hg-temp-row--attention .hg-temp-pane__value,
body.ui-new-nav .hg-temp-row--tolerated .hg-temp-pane__value { color: var(--color-temp-attention); }
body.ui-new-nav .hg-temp-row--silent .hg-temp-pane__value,
body.ui-new-nav .hg-temp-row--paused .hg-temp-pane__value { color: var(--color-temp-silent); }
body.ui-new-nav .hg-temp-row--critical td,
body.ui-new-nav .hg-temp-row--out td { background: var(--color-temp-out-soft); }
body.ui-new-nav .hg-temp-pane__since { margin-top: 2px; font-size: var(--hg-ui-font-xs, 11px); color: var(--color-text-secondary, #5b636e); white-space: nowrap; }
body.ui-new-nav .hg-temp-pane__actions { display: flex; gap: 8px; justify-content: flex-end; font-size: var(--hg-ui-font-xs, 11px); font-weight: 600; }
body.ui-new-nav .hg-temp-pane__mini { margin: 12px 0 0; }

/* Régua "posição na faixa": a faixa ocupa 25%–75%; o marcador muda de forma. */
body.ui-new-nav .hg-temp-gauge { position: relative; display: inline-block; width: 104px; height: 16px; vertical-align: middle; }
body.ui-new-nav .hg-temp-gauge::before {
    content: "";
    position: absolute;
    left: 0; right: 0; top: 5px;
    height: 6px;
    border-radius: 3px;
    background: var(--color-temp-track);
}
body.ui-new-nav .hg-temp-gauge__band { position: absolute; left: 25%; width: 50%; top: 5px; height: 6px; background: var(--color-temp-band-strong); }
body.ui-new-nav .hg-temp-gauge__mark { position: absolute; top: 1px; width: 4px; height: 14px; margin-left: -2px; border-radius: 2px; background: var(--color-temp-ok); }
body.ui-new-nav .hg-temp-gauge__mark--out { top: 2px; width: 12px; height: 12px; margin-left: -6px; box-sizing: border-box; border-radius: 50%; border: 3px solid var(--color-temp-out); background: var(--color-white, #fff); }
body.ui-new-nav .hg-temp-gauge__mark--critical { top: 2px; width: 12px; height: 12px; margin-left: -6px; border-radius: 2px; background: var(--color-temp-critical); }
body.ui-new-nav .hg-temp-gauge__mark--attention,
body.ui-new-nav .hg-temp-gauge__mark--tolerated {
    top: 0; width: 0; height: 0; margin-left: -6px; border-radius: 0; background: none;
    border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 12px solid var(--color-temp-attention);
}
body.ui-new-nav .hg-temp-gauge__mark--silent,
body.ui-new-nav .hg-temp-gauge__mark--paused,
body.ui-new-nav .hg-temp-gauge__mark--loading { background: var(--color-white, #fff); border: 1px dashed var(--color-temp-silent); }

/* Miniatura das últimas 6 h */
body.ui-new-nav .hg-temp-spark { display: block; }
body.ui-new-nav .hg-temp-spark__band { fill: var(--color-temp-band); }
body.ui-new-nav .hg-temp-spark__line { fill: none; stroke: var(--color-temp-ok); stroke-width: 1.4; stroke-linejoin: round; }
body.ui-new-nav .hg-temp-spark__dot { fill: var(--color-temp-ok); }
body.ui-new-nav .hg-temp-spark__out { fill: var(--color-white, #fff); stroke: var(--color-temp-out); stroke-width: 1.8; }
body.ui-new-nav .hg-temp-spark__crit { fill: var(--color-temp-critical); }
body.ui-new-nav .hg-temp-spark__att { fill: var(--color-white, #fff); stroke: var(--color-temp-attention); stroke-width: 1.4; }

/* Cartões de excursão */
body.ui-new-nav .hg-temp-exc { padding: 9px 11px; margin-bottom: 9px; border: 1px solid var(--color-border-neutral, #e5e7eb); border-radius: 8px; }
body.ui-new-nav .hg-temp-exc--out { border: 2px solid var(--color-temp-out); }
body.ui-new-nav .hg-temp-exc--critical { border: 2px solid var(--color-temp-critical); }
body.ui-new-nav .hg-temp-exc__head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
body.ui-new-nav .hg-temp-exc p { margin: 5px 0 0; font-size: var(--hg-ui-font-sm, 12px); }
body.ui-new-nav .hg-temp-exc .hg-temp-pane__btn { margin-top: 8px; }

/* Barras horizontais (indicadores) */
body.ui-new-nav .hg-temp-bars { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px 10px; align-items: center; font-size: var(--hg-ui-font-sm, 12px); }
body.ui-new-nav .hg-temp-bars__track { height: 10px; border-radius: 2px; background: var(--color-surface-2, #f0f2f5); overflow: hidden; }
body.ui-new-nav .hg-temp-bars__track i { display: block; height: 10px; border-radius: 2px; background: var(--color-temp-out); }
body.ui-new-nav .hg-temp-bars + .hg-temp-bars { margin-top: 10px; }
body.ui-new-nav .hg-fd__card .hg-temp-bars__track--none i { background: var(--color-white, #fff); border: 1px dashed var(--color-temp-silent); box-sizing: border-box; }
body.ui-new-nav .hg-temp-hours { display: flex; gap: 8px; align-items: flex-end; height: 150px; }
body.ui-new-nav .hg-temp-hours__col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; height: 100%; font-size: var(--hg-ui-font-xs, 11px); }
body.ui-new-nav .hg-temp-hours__bar { flex: 1; width: 70%; display: flex; align-items: flex-end; }
body.ui-new-nav .hg-temp-hours__bar i { display: block; width: 100%; border-radius: 2px 2px 0 0; background: var(--color-primary, #05617a); }
body.ui-new-nav .hg-temp-hours__col small { color: var(--color-text-secondary, #5b636e); white-space: nowrap; }

/* ---- Aba Temperatura: gráfico do veículo (o mesmo do popup do histórico) -- */
body.ui-new-nav .hg-temp-chart { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
body.ui-new-nav .hg-temp-chart .hg-fd__card-head { margin-bottom: 0; }
body.ui-new-nav .hg-temp-chart__ranges { margin-left: auto; display: inline-flex; flex-wrap: wrap; gap: 4px; }
body.ui-new-nav .hg-temp-chart .hg-temp-graph__links { align-items: center; flex-wrap: wrap; }
body.ui-new-nav .hg-temp-chart__select {
    height: 24px;
    max-width: 260px;
    padding: 0 6px;
    border: 1px solid var(--color-temp-ok);
    border-radius: 6px;
    background: var(--color-white, #fff);
    font-size: var(--hg-ui-font-xs, 11px);
    font-weight: 600;
    color: var(--color-temp-ok);
    cursor: pointer;
}
body.ui-new-nav .hg-temp-chart__select:focus { outline: 2px solid var(--color-temp-band-strong); outline-offset: 1px; }
/* No popup a área do gráfico absorve a altura do modal; aqui ela é fixa. */
body.ui-new-nav .hg-temp-chart__plot { flex: 0 0 auto; height: 320px; }
@media (max-width: 640px) {
    body.ui-new-nav .hg-temp-chart__plot { height: 240px; }
    body.ui-new-nav .hg-temp-chart__select { max-width: 100%; }
}

/* Navegação no tempo, no canto de cima do gráfico (temperature_pane_chart.js
   navigate). O flot reserva a faixa de cima (NAV_TOP) para ela não cobrir
   linha nem etiqueta. */
body.ui-new-nav .hg-temp-chart__nav {
    position: absolute;
    top: 5px;
    right: 8px;
    z-index: 2;
    display: inline-flex;
    gap: 3px;
    padding: 2px;
    border: 1px solid var(--color-history-graph-track-border, #d8e1ea);
    border-radius: 7px;
    background: var(--color-white, #fff);
}
body.ui-new-nav .hg-temp-chart__nav[hidden] { display: none; }
body.ui-new-nav .hg-temp-chart__nav button {
    min-width: 24px;
    height: 22px;
    padding: 0 6px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    font-size: var(--hg-ui-font-xs, 11px);
    font-weight: 600;
    line-height: 22px;
    color: var(--color-temp-ok);
    cursor: pointer;
}
body.ui-new-nav .hg-temp-chart__nav button:hover:not(:disabled),
body.ui-new-nav .hg-temp-chart__nav button:focus-visible { background: var(--color-primary-tint, #f0f7f9); outline: none; }
body.ui-new-nav .hg-temp-chart__nav button:disabled { color: var(--color-temp-silent); opacity: .45; cursor: default; }
body.ui-new-nav .hg-temp-chart__nav .hg-temp-chart__now { margin-left: 2px; border: 1px solid var(--color-temp-ok); }
body.ui-new-nav .hg-temp-chart__nav .hg-temp-chart__now:disabled { border-color: transparent; }

/* Ajuste da faixa no gráfico (alças de Mín./Máx., temperature_pane_chart.js):
   barra com os quatro números, Salvar e Cancelar, acima do gráfico. */
body.ui-new-nav .hg-temp-adjust[hidden] { display: none !important; }
body.ui-new-nav .hg-temp-adjust {
    padding: 8px 12px;
    border: 2px solid var(--color-temp-ok);
    border-radius: var(--hg-ui-control-radius, 6px);
    background: var(--color-primary-tint, #f0f7f9);
    font-size: var(--hg-ui-font-sm, 12px);
}
body.ui-new-nav .hg-temp-adjust__row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; }
body.ui-new-nav .hg-temp-adjust__title { color: var(--color-primary-hover, #044a5f); }
body.ui-new-nav .hg-temp-adjust__field { display: inline-flex; align-items: center; gap: 5px; margin: 0; font-weight: 600; color: var(--color-text-primary, #2e3138); white-space: nowrap; }
body.ui-new-nav .hg-temp-adjust__field input {
    width: 72px;
    height: 26px;
    padding: 0 6px;
    border: 1px solid var(--color-border-neutral, #e5e7eb);
    border-radius: 4px;
    background: var(--color-white, #fff);
    font-variant-numeric: tabular-nums;
}
body.ui-new-nav .hg-temp-adjust__field input:focus { outline: 2px solid var(--color-temp-band-strong); outline-offset: 1px; border-color: var(--color-temp-ok); }
body.ui-new-nav .hg-temp-adjust__actions { display: inline-flex; gap: 6px; margin-left: auto; }
body.ui-new-nav .hg-temp-adjust__save,
body.ui-new-nav .hg-temp-adjust__cancel {
    height: 28px;
    padding: 0 12px;
    border-radius: var(--hg-ui-btn-radius, 4px);
    font-size: var(--hg-ui-font-sm, 12px);
    font-weight: 600;
    cursor: pointer;
}
body.ui-new-nav .hg-temp-adjust__save { border: 1px solid var(--color-temp-ok); background: var(--color-temp-ok); color: var(--color-text-on-primary, #fff); }
body.ui-new-nav .hg-temp-adjust__cancel { border: 1px solid var(--color-temp-ok); background: var(--color-white, #fff); color: var(--color-temp-ok); }
body.ui-new-nav .hg-temp-adjust__save[disabled],
body.ui-new-nav .hg-temp-adjust__cancel[disabled] { opacity: .6; cursor: default; }
body.ui-new-nav .hg-temp-adjust__note { margin: 6px 0 0; font-size: var(--hg-ui-font-xs, 11px); color: var(--color-text-secondary, #5b636e); }
body.ui-new-nav .hg-temp-adjust__error { margin: 6px 0 0; font-weight: 600; color: var(--color-temp-out); }
body.ui-new-nav .hg-temp-adjust__ok { margin: 0; font-weight: 600; color: var(--color-temp-ok); }
@media (max-width: 640px) {
    body.ui-new-nav .hg-temp-adjust__actions { margin-left: 0; }
}
