/* ==========================================================================
   Pulso Temp — estilos do app
   Ordem: base, controles, login, shell, componentes, telas e, NO FIM, todo o
   responsivo e o movimento reduzido (regra posterior vence; media query no meio
   do arquivo perderia para o que vem depois).
   ========================================================================== */

/* ==========================================================================
   Base
   ========================================================================== */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { min-height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--f-ui); font-size: var(--t-md); line-height: 1.55;
  font-variant-numeric: lining-nums; overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}
body.travado { overflow: hidden; }
h1, h2, h3, h4 { margin: 0; font-weight: 750; line-height: 1.22; letter-spacing: -.02em; }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }
img, svg { max-width: 100%; }
button { font: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums lining-nums; }
.id { font-family: var(--f-id); font-size: max(12px, .9em); letter-spacing: -.01em; }
.emo { font-family: var(--f-emoji); font-style: normal; line-height: 1; }
.sub { font-size: var(--t-sm); color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0);
      clip-path: inset(50%); white-space: nowrap; margin: -1px; padding: 0; border: 0; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.pular { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: #fff;
         padding: 10px 14px; border-radius: var(--r-sm); font-weight: 700; }
.pular:focus { top: 12px; }
.grow { flex: 1; }
.lnk { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

.boot { min-height: 100svh; display: grid; place-items: center; background: var(--frost-grad); }
.boot img { animation: respira 1.6s ease-in-out infinite; }
@keyframes respira { 50% { transform: scale(.92); opacity: .7; } }

/* ==========================================================================
   Controles
   ========================================================================== */
input, select, textarea {
  font: inherit; width: 100%; min-width: 0; color: var(--ink); background: var(--surface);
  border: 1.5px solid var(--field-line); border-radius: var(--r-sm); padding: 9px 12px;
  transition: border-color .13s, box-shadow .13s;
}
input::placeholder, textarea::placeholder { color: #6B7A90; }
input:hover, select:hover, textarea:hover { border-color: var(--ink-2); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--anel); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; accent-color: var(--accent); }
select {
  appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%2356657B' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
textarea { resize: vertical; min-height: 88px; }
[aria-invalid] { border-color: var(--crit-ink) !important; }

.btn {
  font-weight: 700; font-size: 13.5px; cursor: pointer; text-decoration: none !important;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 40px; padding: 9px 17px; border-radius: var(--r-sm);
  border: 1.5px solid transparent; background: var(--accent); color: #fff;
  transition: background .13s, border-color .13s, box-shadow .13s, transform .07s; white-space: nowrap;
}
.btn:hover { background: var(--accent-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn.ghost { background: var(--surface); color: var(--ink-2); border-color: var(--rule-2); }
.btn.ghost:hover { background: var(--surface-3); border-color: var(--rule-3); color: var(--ink); }
.btn.quiet { background: transparent; color: var(--ink-2); padding: 8px 10px; }
.btn.quiet:hover { background: var(--surface-3); color: var(--ink); }
.btn.danger { background: var(--crit-ink); }
.btn.danger:hover { background: #8F0E2F; }
.btn.ok { background: var(--ok-ink); }
.btn.ok:hover { background: #035239; }
.btn.zap { background: #128C4B; }
.btn.zap:hover { background: #0D6E3A; }
.btn.ico { padding: 0; width: 40px; min-width: 40px; }
.btn.sm { min-height: 32px; padding: 5px 11px; font-size: 13px; }
.btn.largo { width: 100%; }
.btn.grande { min-height: 52px; font-size: 15.5px; padding: 12px 22px; border-radius: var(--r-md); }
.btn .emo { font-size: 1.1em; }
.btn.carregando { position: relative; color: transparent !important; pointer-events: none; }
.btn.carregando::after {
  content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid rgba(255,255,255,.45); border-top-color: #fff; animation: gira .7s linear infinite;
}
.btn.ghost.carregando::after { border-color: var(--rule-2); border-top-color: var(--accent); }
@keyframes gira { to { transform: rotate(360deg); } }

/* Segmentado (períodos, abas pequenas) */
.seg { display: inline-flex; background: var(--surface-3); border-radius: var(--r-md); padding: 3px; gap: 2px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg button {
  border: 0; background: transparent; padding: 7px 14px; border-radius: 9px; cursor: pointer;
  font-weight: 700; font-size: 13px; color: var(--ink-2); white-space: nowrap; min-height: 34px;
}
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--surface); color: var(--accent-ink); box-shadow: var(--sh-2); }

/* Chips de filtro com contagem */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 6px 13px 6px 10px;
  border: 1.5px solid var(--rule-2); background: var(--surface); border-radius: var(--r-full);
  font-weight: 700; font-size: 13px; color: var(--ink-2); cursor: pointer; transition: all .13s;
}
.chip:hover { border-color: var(--rule-3); color: var(--ink); }
.chip .n { font-variant-numeric: tabular-nums; background: var(--surface-3); border-radius: var(--r-full); padding: 0 7px; min-width: 22px; text-align: center; font-size: 12px; }
.chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.chip[aria-pressed="true"] .n { background: var(--surface); }
.chip.c-crit[aria-pressed="true"] { border-color: var(--crit); background: var(--crit-soft); color: var(--crit-ink); }
.chip.c-off[aria-pressed="true"] { border-color: var(--off); background: var(--off-soft); color: var(--off-ink); }
.chip.c-warn[aria-pressed="true"] { border-color: var(--warn); background: var(--warn-soft); color: var(--warn-ink); }
.chip.c-ok[aria-pressed="true"] { border-color: var(--ok); background: var(--ok-soft); color: var(--ok-ink); }
.chip.c-none[aria-pressed="true"] { border-color: var(--none); background: var(--none-soft); color: var(--none-ink); }
.chip:disabled { opacity: .5; cursor: default; }

/* Busca */
.busca { position: relative; min-width: 0; }
.busca .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.busca input { padding-left: 36px; }

/* Interruptor */
.interruptor { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; font-size: 13.5px; color: var(--ink-2); min-height: 36px; }
.interruptor input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.int-trilho { width: 40px; height: 24px; border-radius: 12px; background: var(--rule-3); position: relative; flex: none; transition: background .15s; }
.int-trilho::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: var(--sh-1); transition: transform .18s var(--ease); }
.interruptor input:checked + .int-trilho { background: var(--accent); }
.interruptor input:checked + .int-trilho::after { transform: translateX(16px); }
.interruptor input:focus-visible + .int-trilho { outline: 2.5px solid var(--accent); outline-offset: 2px; }

/* Campos de formulário */
.campo { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.campo > label, .rot-campo { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.campo-dica { font-size: var(--t-xs); color: var(--muted); }
.campo-erro { font-size: var(--t-xs); color: var(--crit-ink); font-weight: 700; }
.campo-erro:empty { display: none; }
.form { display: grid; gap: var(--s4); }
.form-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); }
.form-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); }
.form-sec { font-size: var(--t-sm); font-weight: 800; color: var(--ink); padding-top: var(--s2); border-top: 1px solid var(--rule); margin-top: var(--s2); }
.form-sec:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.checks label { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13.5px; cursor: pointer; min-height: 32px; }

/* ==========================================================================
   Login
   ========================================================================== */
.login { display: grid; grid-template-columns: 1.15fr .85fr; min-height: 100svh; background: var(--surface); }
.login-arte {
  position: relative; overflow: hidden; background: var(--frost-grad);
  border-right: 1px solid var(--rule); display: flex; flex-direction: column; justify-content: space-between;
  padding: clamp(28px, 4vw, 56px); isolation: isolate;
}
.login-arte canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.marca { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none !important; min-width: 0; }
.marca img { display: block; border-radius: 10px; box-shadow: 0 4px 14px rgba(14, 165, 233, .32); }
.marca-txt { font-size: 18px; font-weight: 700; letter-spacing: -.03em; white-space: nowrap; }
.marca-txt b { font-weight: 800; background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-h { font-size: clamp(30px, 3.6vw, 50px); font-weight: 800; letter-spacing: -.04em; line-height: 1.04; max-width: 13ch; color: var(--ink); }
.login-p { color: var(--ink-2); max-width: 44ch; font-size: 15.5px; margin-top: var(--s4); }
.login-vitrine { display: flex; flex-wrap: wrap; gap: 14px; margin: var(--s8) 0 var(--s4); }
.vitrine {
  background: rgba(255, 255, 255, .78); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, .9); border-radius: var(--r-lg); box-shadow: var(--sh-3);
  padding: 14px 16px; min-width: 190px; animation: flutua 7s ease-in-out infinite;
}
.vitrine:nth-child(2) { animation-delay: -2.3s; }
.vitrine:nth-child(3) { animation-delay: -4.6s; }
.vitrine .v-nome { font-size: 12.5px; font-weight: 700; color: var(--ink-2); display: flex; gap: 6px; align-items: center; }
.vitrine .v-temp { font-size: 30px; font-weight: 800; letter-spacing: -.04em; font-variant-numeric: tabular-nums; line-height: 1.1; margin-top: 4px; }
.vitrine .v-temp.ok { color: var(--ok-ink); } .vitrine .v-temp.warn { color: var(--warn-ink); }
.vitrine .regua { margin-top: 8px; }
.vitrine .v-rod { display: flex; justify-content: space-between; margin-top: 6px; font-size: 12px; color: var(--muted); }
@keyframes flutua { 50% { transform: translateY(-8px); } }
.login-fatos { display: flex; flex-wrap: wrap; gap: var(--s4) var(--s8); padding-top: var(--s5); border-top: 1.5px solid var(--accent-line); }
.login-fatos div { display: flex; flex-direction: column; }
.login-fatos b { font-size: 17px; font-weight: 800; letter-spacing: -.02em; color: var(--accent-ink); }
.login-fatos span { font-size: var(--t-xs); color: var(--muted); }

.login-form { display: grid; place-items: center; padding: clamp(24px, 5vw, 48px) clamp(18px, 5vw, 36px); }
.login-inner { width: min(380px, 100%); display: flex; flex-direction: column; gap: var(--s5); }
.login-inner h1 { font-size: 26px; letter-spacing: -.03em; }
.login-inner .hd p { color: var(--muted); margin-top: 4px; }
.login-inner .so-celular { display: none; }
.campo-senha { position: relative; }
.campo-senha input { padding-right: 84px; }
.ver-senha { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); min-height: 34px; padding: 0 12px; border: 0; border-radius: var(--r-xs); background: transparent; color: var(--accent-ink); font-size: 13px; font-weight: 700; cursor: pointer; }
.ver-senha:hover { background: var(--accent-soft); }
.aviso { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; padding: 11px 13px; border-radius: var(--r-md); background: var(--crit-soft); color: var(--crit-ink); border: 1px solid var(--crit-line); }
.aviso.info { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent-line); }
.aviso.warn { background: var(--warn-soft); color: var(--warn-ink); border-color: var(--warn-line); }
.aviso.ok { background: var(--ok-soft); color: var(--ok-ink); border-color: var(--ok-line); }
.aviso .emo { font-size: 18px; }
.aviso b { font-weight: 800; }
.demo { border-top: 1px solid var(--rule); padding-top: var(--s4); }
.demo h2 { font-size: 13.5px; font-weight: 800; color: var(--ink-2); display: flex; align-items: center; gap: 7px; }
.demo p { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.demo ul { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.demo-conta {
  width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; cursor: pointer;
  padding: 8px 10px; border: 1.5px solid var(--rule); border-radius: var(--r-sm); background: var(--surface-2); min-height: 44px;
}
.demo-conta:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.demo-conta .emo { font-size: 18px; }
.demo-conta .id { color: var(--ink); font-weight: 500; display: block; overflow: hidden; text-overflow: ellipsis; }
.demo-conta .papel { font-size: 12px; color: var(--muted); font-weight: 700; }
.demo-conta > span:nth-child(2) { min-width: 0; flex: 1; }

/* ==========================================================================
   Shell
   ========================================================================== */
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100svh; }
.side {
  background: var(--surface); border-right: 1px solid var(--rule); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100svh; min-width: 0;
}
.side > .marca { padding: 18px 20px 14px; }
.side-rede { margin: 0 14px 6px; padding: 10px 12px; border-radius: var(--r-md); background: var(--surface-3); display: flex; flex-direction: column; min-width: 0; }
.side-rede-rot { font-size: 12px; color: var(--muted); font-weight: 600; }
.side-rede b { font-size: 13.5px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-rede .sub { font-size: 12px; }
.side-nav { flex: 1; overflow-y: auto; padding: 4px 12px 12px; }
.nav-grp { padding-top: 12px; }
.nav-grp-rot { font-size: 12px; font-weight: 700; color: var(--muted); padding: 4px 10px 6px; }
.side-nav a {
  display: flex; align-items: center; gap: 11px; min-height: 40px; padding: 8px 10px; margin-bottom: 2px;
  border-radius: var(--r-sm); color: var(--ink-2); font-size: 14px; font-weight: 650; text-decoration: none; position: relative;
  transition: background .12s, color .12s;
}
.side-nav a:hover { background: var(--surface-3); color: var(--ink); }
.side-nav a.on { background: var(--accent-soft); color: var(--accent-ink); font-weight: 800; }
.side-nav a.on::before { content: ''; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: var(--accent-grad); }
.nav-emo { font-family: var(--f-emoji); font-size: 17px; width: 22px; text-align: center; flex: none; }
.nav-badge {
  margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: var(--r-full);
  background: var(--crit-ink); color: #fff; font-size: 12px; font-weight: 800; line-height: 22px; text-align: center; font-variant-numeric: tabular-nums;
}
.side-ft { border-top: 1px solid var(--rule); padding: 12px 14px; display: flex; align-items: center; gap: 10px; }
.side-ft .quem { min-width: 0; flex: 1; }
.side-ft .quem b { display: block; font-size: 13.5px; font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-ft .quem span { display: block; font-size: 12px; color: var(--muted); }

.avatar {
  border-radius: 50%; flex: none; display: inline-grid; place-items: center; font-weight: 800; letter-spacing: -.02em;
  background: hsl(var(--h, 200) 85% 93%); color: hsl(var(--h, 200) 70% 28%); border: 1.5px solid hsl(var(--h, 200) 70% 82%);
}

.principal { min-width: 0; display: flex; flex-direction: column; }
.topo {
  position: sticky; top: 0; z-index: 30; min-height: var(--top-h);
  display: flex; align-items: center; gap: var(--s4); padding: 10px var(--pad-x);
  background: rgba(255, 255, 255, .86); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--rule);
}
.topo .marca-mini { display: none; }
.topo-tit { min-width: 0; }
.topo h1 { font-size: var(--t-xl); letter-spacing: -.03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topo h1:focus { outline: none; }
.topo-sub { margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topo-rede { font-size: 13px; font-weight: 700; color: var(--ink-2); padding: 6px 12px; background: var(--surface-3); border-radius: var(--r-full); white-space: nowrap; }
.topo-user { display: none; }
.aovivo { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.aovivo i { width: 8px; height: 8px; border-radius: 50%; background: var(--none); position: relative; }
.aovivo[data-estado="aovivo"] { color: var(--ok-ink); }
.aovivo[data-estado="aovivo"] i { background: var(--ok); }
.aovivo[data-estado="aovivo"] i::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: var(--ok); animation: onda 2s ease-out infinite; }
.aovivo[data-estado="caiu"] { color: var(--warn-ink); }
.aovivo[data-estado="caiu"] i { background: var(--warn); }
@keyframes onda { to { transform: scale(2.8); opacity: 0; } }
.sino { position: relative; }
.sino-cont { position: absolute; top: 2px; right: 1px; min-width: 19px; height: 19px; border-radius: 10px; background: var(--crit-ink); color: #fff; font-size: 11.5px; font-weight: 800; line-height: 15px; text-align: center; border: 2px solid var(--surface); padding: 0 4px; }

.conteudo { padding: var(--s6) var(--pad-x) 72px; width: 100%; max-width: var(--content-max); margin-inline: auto; min-width: 0; outline: none; }

.barra-baixo { display: none; }

/* Gaveta "Mais" e lista do sino */
.mais-menu { display: flex; flex-direction: column; gap: var(--s4); }
.mais-quem { display: flex; gap: 12px; align-items: center; padding: 12px; background: var(--surface-3); border-radius: var(--r-md); }
.mais-quem b { display: block; }
.mais-grp { display: flex; flex-direction: column; gap: 4px; }
.mais-item { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 10px 12px; border-radius: var(--r-sm); color: var(--ink); font-weight: 700; font-size: 15px; text-decoration: none !important; }
.mais-item:hover { background: var(--surface-3); }
.mais-item > span:first-child { font-family: var(--f-emoji); font-size: 20px; width: 26px; text-align: center; }
.sino-lista { display: flex; flex-direction: column; gap: 8px; }
.sino-item { display: flex; gap: 12px; padding: 12px; border-radius: var(--r-md); border: 1.5px solid var(--rule); color: var(--ink); text-decoration: none !important; background: var(--surface); }
.sino-item:hover { border-color: var(--rule-3); }
.sino-item.sev-crit { border-left: 4px solid var(--crit); }
.sino-item.sev-warn { border-left: 4px solid var(--warn); }
.sino-emo { font-size: 22px; font-family: var(--f-emoji); }
.sino-txt { display: flex; flex-direction: column; min-width: 0; font-size: 13.5px; }

/* ==========================================================================
   Componentes
   ========================================================================== */
/* Selos (sempre emoji + rótulo, nunca só cor) */
.selo {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: var(--r-full);
  font-size: 12.5px; font-weight: 750; white-space: nowrap; border: 1px solid; line-height: 1.4;
}
.selo .emo { font-size: 13px; }
.selo-ok { background: var(--ok-soft); color: var(--ok-ink); border-color: var(--ok-line); }
.selo-warn { background: var(--warn-soft); color: var(--warn-ink); border-color: var(--warn-line); }
.selo-crit { background: var(--crit-soft); color: var(--crit-ink); border-color: var(--crit-line); }
.selo-off { background: var(--off-soft); color: var(--off-ink); border-color: var(--off-line); }
.selo-none { background: var(--none-soft); color: var(--none-ink); border-color: var(--none-line); }
.selo-accent { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent-line); }
.selo-cold { background: var(--cold-soft); color: var(--cold-ink); border-color: #BFD3FF; }

.prio { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 750; color: var(--ink-2); white-space: nowrap; }
.prio-barras { display: inline-flex; gap: 2px; align-items: flex-end; height: 12px; }
.prio-barras i { width: 4px; border-radius: 1.5px; background: var(--rule-2); }
.prio-barras i:nth-child(1) { height: 5px; } .prio-barras i:nth-child(2) { height: 8px; } .prio-barras i:nth-child(3) { height: 12px; }
.prio-crit { color: var(--crit-ink); } .prio-crit .prio-barras i.on { background: var(--crit); }
.prio-warn { color: var(--warn-ink); } .prio-warn .prio-barras i.on { background: var(--warn); }
.prio-accent { color: var(--accent-ink); } .prio-accent .prio-barras i.on { background: var(--accent-vivo); }

/* Sinal Wi‑Fi */
.sinal { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.nw { white-space: nowrap; }
.wifi rect { fill: var(--rule-2); }
.wifi-4 rect.on, .wifi-3 rect.on { fill: var(--ok); }
.wifi-2 rect.on { fill: var(--warn); }
.wifi-1 rect.on { fill: var(--crit); }

/* Régua da faixa */
.regua { position: relative; height: 18px; display: flex; align-items: center; }
.regua-trilho { position: relative; width: 100%; height: 8px; border-radius: 4px; background: linear-gradient(90deg, #DBE7FF, var(--surface-3) 30%, var(--surface-3) 70%, #FFE1E8); }
.regua-faixa { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--ok) 32%, white); border-radius: 4px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ok) 45%, white); }
.regua-marca {
  position: absolute; top: 50%; width: 16px; height: 16px; margin-left: -8px; transform: translateY(-50%);
  border-radius: 50%; background: var(--surface); border: 4px solid var(--ok); box-shadow: 0 1px 4px rgba(14, 40, 80, .3);
  transition: left .9s var(--ease), border-color .3s;
}
.regua-warn .regua-marca { border-color: var(--warn); }
.regua-crit .regua-marca { border-color: var(--crit); }
.regua-off .regua-marca, .regua-none .regua-marca { border-color: var(--off); }
.regua-off .regua-faixa { filter: grayscale(1); opacity: .6; }

/* Sparkline */
.spark { display: block; overflow: visible; }
.spark-faixa { fill: var(--faixa); }
.spark-area { fill: currentColor; opacity: .07; }
.spark-linha { fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark-vazio { stroke: var(--rule-2); stroke-dasharray: 3 4; }
.spark-ok { color: var(--accent-vivo); } .spark-warn { color: var(--warn); } .spark-crit { color: var(--crit); }
.spark-off, .spark-none { color: var(--off); }

/* Blocos (seções com fundo branco) */
.bloco { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--sh-1); padding: var(--s5); min-width: 0; }
.bloco-hd { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s4); flex-wrap: wrap; }
.bloco-hd h2 { font-size: var(--t-lg); display: flex; align-items: center; gap: 8px; }
.bloco-hd h2 .emo { font-size: 18px; }
.bloco-hd .sub { margin-top: 2px; }
.secao-tit { font-size: var(--t-lg); font-weight: 800; display: flex; align-items: center; gap: 8px; margin: var(--s6) 0 var(--s3); }
.secao-tit .n { font-size: 13px; color: var(--muted); font-weight: 700; }
.barra-ferr { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; margin-bottom: var(--s4); }
.barra-ferr .busca { flex: 1 1 220px; max-width: 360px; }
.barra-ferr select { width: auto; min-width: 160px; }
.voltar { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: 13.5px; color: var(--ink-2); margin-bottom: var(--s3); }
.voltar:hover { color: var(--accent); text-decoration: none; }

/* Estados */
.estado { text-align: center; padding: 56px 20px; display: flex; flex-direction: column; align-items: center; gap: 8px; max-width: 520px; margin: 0 auto; }
.estado-emo { font-size: 48px; font-family: var(--f-emoji); margin-bottom: 4px; }
.estado h3 { font-size: 18px; }
.estado p { color: var(--muted); }
.estado .btn { margin-top: 10px; }
.estado-erro h3 { color: var(--crit-ink); }
.esq-grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--s4); }
.esq { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 18px; display: flex; flex-direction: column; gap: 12px; min-height: 200px; }
.esq i { display: block; height: 14px; border-radius: 7px; background: linear-gradient(90deg, var(--surface-3) 0%, #F8FBFE 45%, var(--surface-3) 90%); background-size: 300% 100%; animation: brilho 1.4s ease-in-out infinite; }
.esq i:nth-child(1) { width: 60%; }
.esq i:nth-child(2) { width: 45%; height: 40px; border-radius: 10px; }
.esq i:nth-child(3) { width: 100%; height: 50px; margin-top: auto; }
.esq-linha { grid-template-columns: 1fr; }
.esq-linha .esq { min-height: 64px; flex-direction: row; align-items: center; }
.esq-linha .esq i { height: 14px !important; margin: 0; }
@keyframes brilho { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* Toasts */
.toasts { position: fixed; z-index: 90; top: 76px; right: 20px; display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; gap: 11px; align-items: flex-start; padding: 13px 12px 13px 14px;
  background: var(--surface); border: 1px solid var(--rule-2); border-left: 4px solid var(--accent-vivo);
  border-radius: var(--r-md); box-shadow: var(--sh-3); animation: entraToast .3s var(--ease);
}
.toast-ok { border-left-color: var(--ok); } .toast-erro { border-left-color: var(--crit); } .toast-alerta { border-left-color: var(--crit); background: #FFFAFB; }
.toast-emo { font-size: 20px; font-family: var(--f-emoji); line-height: 1.2; }
.toast-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; }
.toast-txt b { font-weight: 800; }
.toast-txt .lnk { align-self: flex-start; margin-top: 4px; font-size: 13px; }
.toast-x { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 4px; border-radius: 6px; width: 28px; height: 28px; display: grid; place-items: center; }
.toast-x:hover { background: var(--surface-3); color: var(--ink); }
.toast.saindo { animation: saiToast .2s ease-in forwards; }
@keyframes entraToast { from { opacity: 0; transform: translateX(24px); } }
@keyframes saiToast { to { opacity: 0; transform: translateX(24px); } }

/* Modal e gaveta */
.camada { position: fixed; inset: 0; z-index: 80; background: var(--scrim); display: grid; animation: fade .18s ease-out; }
.camada.saindo { animation: fadeOut .18s ease-in forwards; }
@keyframes fade { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
.camada-modal { place-items: center; padding: 20px; overflow-y: auto; }
.modal {
  width: min(var(--w, 560px), 100%); max-height: calc(100svh - 40px); display: flex; flex-direction: column;
  background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--sh-3); outline: none; animation: sobe .24s var(--ease);
}
@keyframes sobe { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.camada-gaveta { justify-items: end; }
.gaveta {
  width: min(var(--w, 520px), 100%); height: 100%; display: flex; flex-direction: column;
  background: var(--surface); box-shadow: var(--sh-3); outline: none; animation: desliza .26s var(--ease);
  border-radius: var(--r-xl) 0 0 var(--r-xl);
}
@keyframes desliza { from { transform: translateX(40px); opacity: 0; } }
.dlg-hd { display: flex; align-items: flex-start; gap: 12px; padding: 18px 18px 14px 22px; border-bottom: 1px solid var(--rule); }
.dlg-emo { font-size: 24px; font-family: var(--f-emoji); line-height: 1.2; }
.dlg-tit { flex: 1; min-width: 0; padding-top: 4px; }
.dlg-tit h2 { font-size: 18px; }
.dlg-bd { padding: 20px 22px; overflow-y: auto; flex: 1; }
.dlg-ft { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--rule); background: var(--surface-2); border-radius: 0 0 var(--r-xl) var(--r-xl); flex-wrap: wrap; }
.gaveta .dlg-ft { border-radius: 0 0 0 var(--r-xl); }
.txt-conf { font-size: 15px; color: var(--ink-2); }

/* Tabela responsiva */
.tabela-wrap { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); overflow-x: auto; box-shadow: var(--sh-1); }
.tabela { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tabela th { text-align: left; font-size: 12.5px; font-weight: 750; color: var(--muted); padding: 11px 14px; background: var(--surface-2); border-bottom: 1px solid var(--rule); white-space: nowrap; }
.tabela td { padding: 12px 14px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.tabela tr:last-child td { border-bottom: 0; }
.tabela tr.clicavel { cursor: pointer; }
.tabela tr.clicavel:hover td { background: var(--surface-2); }
.tabela .dir { text-align: right; }
.tabela .acoes { text-align: right; white-space: nowrap; }
.tabela .acoes .btn { margin-left: 4px; }
.t-nome { display: flex; align-items: center; gap: 10px; min-width: 0; }
.t-nome .emo { font-size: 20px; }
.t-nome b { display: block; font-weight: 750; }
.t-nome .sub { font-size: 12.5px; }

/* Legenda */
.legenda { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--ink-2); margin-top: 8px; }
.legenda span { display: inline-flex; align-items: center; gap: 6px; }
.legenda i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.leg-crit { background: var(--crit); } .leg-off { background: var(--off); } .leg-ok { background: var(--ok); }
.leg-warn { background: var(--warn); } .leg-faixa { background: color-mix(in srgb, var(--ok) 25%, white); border: 1px solid var(--faixa-linha); }
.leg-linha { background: var(--accent-vivo); height: 3px !important; border-radius: 2px !important; }
.leg-banda { background: color-mix(in srgb, var(--accent-vivo) 18%, white); }

/* Gráficos */
.graf { position: relative; width: 100%; min-width: 0; }
.graf-svg { display: block; width: 100%; height: auto; overflow: visible; touch-action: pan-y; }
.graf-eixo text { font-size: 11.5px; fill: var(--muted); font-family: var(--f-ui); font-variant-numeric: tabular-nums; }
.graf-eixo-x { font-size: 11.5px; fill: var(--muted); }
.graf-grade { stroke: var(--rule); stroke-width: 1; }
.graf-faixa { fill: var(--faixa); }
.graf-limite { stroke: var(--faixa-linha); stroke-width: 1.5; stroke-dasharray: 5 4; }
.graf-limite-txt { font-size: 11.5px; fill: var(--ok-ink); font-weight: 700; }
.graf-banda { fill: color-mix(in srgb, var(--accent-vivo) 16%, transparent); }
.graf-linha { fill: none; stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.graf-alerta-crit { fill: rgba(225, 29, 72, .10); }
.graf-alerta-off { fill: rgba(100, 116, 139, .12); }
.graf-alerta-emo { font-size: 12px; }
.graf-fita-crit { fill: var(--crit); } .graf-fita-off { fill: var(--off); }
.graf-guia { stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 3 3; }
.graf-ponto { fill: var(--surface); stroke: var(--ink); stroke-width: 2.5; }
.graf-dica { position: absolute; z-index: 3; pointer-events: none; background: var(--ink); color: #fff; border-radius: var(--r-sm); padding: 8px 11px; font-size: 12.5px; display: flex; flex-direction: column; gap: 1px; box-shadow: var(--sh-3); min-width: 140px; }
.graf-dica b { font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.graf-dica b.fora { color: #FDA4B8; }
.graf-dica .sub { color: #C6D2E2; font-size: 12px; }
.graf-vazio { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 40px 0; color: var(--muted); }
.graf-vazio span { font-size: 32px; }
.graf-barra-crit { fill: var(--crit); } .graf-barra-off { fill: var(--off); } .graf-barra-warn { fill: var(--warn); }
.graf-col:hover .graf-barra { opacity: .8; }

.barras { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.barra-item { display: grid; grid-template-columns: minmax(120px, 34%) 1fr auto; gap: 12px; align-items: center; }
.barra-rot { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 650; min-width: 0; }
.barra-rot .emo { font-size: 17px; }
.barra-nome { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barra-trilho { height: 12px; background: var(--surface-3); border-radius: 6px; overflow: hidden; }
.barra-fill { display: block; height: 100%; border-radius: 6px; transform-origin: left; animation: cresce .7s var(--ease) both; animation-delay: calc(var(--i, 0) * 50ms); }
.barra-accent { background: var(--accent-grad); } .barra-crit { background: var(--crit); } .barra-ok { background: var(--ok); }
.barra-warn { background: var(--warn); } .barra-off { background: var(--off); }
.barra-val { font-weight: 800; font-size: 13.5px; text-align: right; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; min-width: 64px; }
.barra-val .sub { font-weight: 600; font-size: 12px; }
@keyframes cresce { from { transform: scaleX(0); } }

.donut-w { position: relative; flex: none; }
.donut { display: block; }
.donut-fundo { stroke: var(--surface-3); }
.donut-seg { transition: stroke-dasharray .6s var(--ease); }
.donut-ok { stroke: var(--ok); } .donut-warn { stroke: var(--warn); } .donut-crit { stroke: var(--crit); }
.donut-off { stroke: var(--off); } .donut-none { stroke: var(--none); } .donut-accent { stroke: var(--accent-vivo); }
.donut-centro { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; line-height: 1.1; }

/* ==========================================================================
   Painel
   ========================================================================== */
.painel-topo { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s4); }
.sel-filial { display: flex; align-items: center; gap: 8px; }
.sel-filial label { font-weight: 700; font-size: 13px; color: var(--ink-2); }
.sel-filial select { width: auto; min-width: 200px; max-width: 320px; font-weight: 700; }
.atualizado { font-size: 12.5px; color: var(--muted); margin-left: auto; }

/* Faixa de KPIs: uma régua contínua, não doze cartões soltos */
.kpis {
  display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); background: var(--surface);
  border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--sh-1); overflow: hidden; margin-bottom: var(--s5);
}
.kpi { padding: 14px 16px 13px; border-right: 1px solid var(--rule); display: flex; flex-direction: column; gap: 2px; min-width: 0; position: relative; text-align: left; background: none; border-top: 0; border-bottom: 0; border-left: 0; color: inherit; }
.kpi:last-child { border-right: 0; }
button.kpi { cursor: pointer; }
button.kpi:hover { background: var(--surface-2); }
button.kpi[aria-pressed="true"] { background: var(--accent-soft); }
.kpi-top { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.kpi-top .emo { font-size: 15px; }
.kpi-v { font-size: var(--t-2xl); font-weight: 800; letter-spacing: -.035em; font-variant-numeric: tabular-nums; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-n { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi.k-crit .kpi-v { color: var(--crit-ink); } .kpi.k-warn .kpi-v { color: var(--warn-ink); }
.kpi.k-off .kpi-v { color: var(--off-ink); } .kpi.k-ok .kpi-v { color: var(--ok-ink); }
.kpi.k-zero .kpi-v { color: var(--rule-3); }
.kpi.k-crit:not(.k-zero)::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--crit); }
.kpi.k-dinheiro .kpi-v { font-size: 21px; }
.kpi.k-perda .kpi-v, .kpi.k-atraso .kpi-v { color: var(--crit-ink); }

.painel-filtros { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; margin-bottom: var(--s4); }
.painel-filtros .busca { flex: 1 1 220px; max-width: 340px; margin-left: auto; }

.grade-eq { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 292px), 1fr)); gap: var(--s4); }
.grupo-filial { margin-bottom: var(--s6); }
.grupo-filial-hd {
  display: flex; align-items: center; gap: 10px; margin-bottom: var(--s3); flex-wrap: wrap;
  width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer;
  background: transparent; border: 0; border-radius: var(--r-md); padding: 6px 8px; margin-left: -8px;
  transition: background .15s;
}
.grupo-filial-hd:hover { background: var(--surface-3); }
.grupo-filial-hd:focus-visible { outline: none; box-shadow: var(--anel); }
.grupo-filial-hd h2 { font-size: 16px; margin: 0; }
.grupo-filial-hd .seta { display: inline-block; font-size: 14px; color: var(--muted); transition: transform .2s; }
.grupo-filial.recolhida .grupo-filial-hd .seta { transform: rotate(-90deg); }
.grupo-filial.recolhida { margin-bottom: var(--s2); }
.grupo-filial.recolhida .grupo-filial-hd { background: var(--surface); box-shadow: var(--sh-1); margin-left: 0; padding: 10px 12px; }
.grupo-acoes { display: flex; justify-content: flex-end; margin-bottom: var(--s2); }
.grupo-filial-hd .contagens { display: flex; gap: 6px; flex-wrap: wrap; }

/* Cartão de equipamento: o objeto principal do produto */
.eq {
  --cor: var(--ok); --cor-ink: var(--ok-ink); --cor-soft: var(--ok-soft);
  position: relative; display: flex; flex-direction: column; gap: 10px; padding: 16px 16px 14px;
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--sh-2);
  color: var(--ink); text-decoration: none !important; overflow: hidden; min-width: 0;
  transition: box-shadow .18s, transform .18s, border-color .18s;
  animation: entraCartao .45s var(--ease) both; animation-delay: calc(min(var(--i, 0), 24) * 35ms);
}
.eq::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--cor); }
.eq:hover { box-shadow: var(--sh-3); transform: translateY(-2px); border-color: var(--rule-2); }
.eq.st-warn { --cor: var(--warn); --cor-ink: var(--warn-ink); --cor-soft: var(--warn-soft); }
.eq.st-crit { --cor: var(--crit); --cor-ink: var(--crit-ink); --cor-soft: var(--crit-soft); border-color: var(--crit-line); background: linear-gradient(180deg, #FFF5F7 0%, var(--surface) 60%); animation: entraCartao .45s var(--ease) both, pulsaCrit 2.4s ease-in-out .6s infinite; }
.eq.st-off { --cor: var(--off); --cor-ink: var(--off-ink); --cor-soft: var(--off-soft); background: #F7F9FB; }
.eq.st-off .eq-temp, .eq.st-off .spark, .eq.st-off .eq-emo { filter: grayscale(1); opacity: .62; }
.eq.st-off .sinal { opacity: .35; filter: grayscale(1); }
.eq.st-none { --cor: var(--none); --cor-ink: var(--none-ink); --cor-soft: var(--none-soft); background: var(--surface-2); }
.eq.frio { --cor: var(--cold); }
@keyframes entraCartao { from { opacity: 0; transform: translateY(10px); } }
@keyframes pulsaCrit { 0%, 100% { box-shadow: var(--sh-2), 0 0 0 0 rgba(225, 29, 72, 0); } 50% { box-shadow: var(--sh-2), 0 0 0 6px rgba(225, 29, 72, .16); } }
.eq-hd { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.eq-emo { font-size: 26px; font-family: var(--f-emoji); line-height: 1.1; flex: none; }
.eq-nome { min-width: 0; flex: 1; }
.eq-nome b { display: block; font-size: 15px; font-weight: 800; letter-spacing: -.015em; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.eq-nome span { display: block; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eq-meio { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.eq-temp { font-size: var(--t-temp); font-weight: 800; letter-spacing: -.05em; line-height: 1; color: var(--cor-ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.eq-temp small { font-size: .45em; font-weight: 700; letter-spacing: 0; margin-left: 2px; color: var(--muted); }
.eq-temp.rolou { animation: brilhoNum .9s ease-out; }
@keyframes brilhoNum { 0% { text-shadow: 0 0 0 transparent; } 30% { text-shadow: 0 0 18px color-mix(in srgb, var(--cor) 60%, transparent); } }
.eq-faixa { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; margin-top: -4px; }
.eq-rod { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); }
.eq-rod .quando { margin-right: auto; }
.eq-caso { display: inline-flex; align-items: center; gap: 5px; font-weight: 800; font-size: 12.5px; color: var(--crit-ink); background: var(--crit-soft); padding: 2px 8px; border-radius: var(--r-full); }
.eq-caso.andamento { color: var(--accent-ink); background: var(--accent-soft); }
.eq-aviso { font-size: 12.5px; font-weight: 700; color: var(--cor-ink); background: var(--cor-soft); border-radius: var(--r-sm); padding: 5px 9px; }

/* ==========================================================================
   Filiais
   ========================================================================== */
.grade-fil { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: var(--s4); }
.fil {
  display: flex; flex-direction: column; gap: 14px; padding: 18px; background: var(--surface);
  border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--sh-2); color: var(--ink);
  text-decoration: none !important; position: relative; animation: entraCartao .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 50ms);
  transition: box-shadow .18s, transform .18s; cursor: pointer; text-align: left; width: 100%;
}
.fil:hover { box-shadow: var(--sh-3); transform: translateY(-2px); }
.fil-hd { display: flex; gap: 14px; align-items: center; }
.fil-hd .tt { min-width: 0; flex: 1; }
.fil-hd h3 { font-size: 16.5px; }
.fil-hd .sub { font-size: 12.5px; }
.fil-cod { font-family: var(--f-id); font-size: 12px; color: var(--muted); }
.fil-st { display: flex; flex-wrap: wrap; gap: 6px; }
.fil-num { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--rule); padding-top: 12px; }
.fil-num div { display: flex; flex-direction: column; padding-right: 8px; }
.fil-num b { font-size: 18px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.fil-num span { font-size: 12px; color: var(--muted); }
.fil.pior-crit { border-color: var(--crit-line); }
.fil.pior-crit::after { content: ''; position: absolute; inset: -1px; border-radius: inherit; border: 2px solid var(--crit); opacity: .5; pointer-events: none; }
.donut-centro b { font-size: 17px; font-weight: 800; letter-spacing: -.03em; }
.donut-centro span { font-size: 11.5px; color: var(--muted); font-weight: 700; }

/* ==========================================================================
   Equipamento (detalhe)
   ========================================================================== */
.eqd-cab {
  --cor: var(--ok); --cor-ink: var(--ok-ink); --cor-soft: var(--ok-soft);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s5); align-items: center;
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-xl); box-shadow: var(--sh-2);
  padding: var(--s6); margin-bottom: var(--s5); position: relative; overflow: hidden;
}
.eqd-cab::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--cor); }
.eqd-cab.st-warn { --cor: var(--warn); --cor-ink: var(--warn-ink); --cor-soft: var(--warn-soft); }
.eqd-cab.st-crit { --cor: var(--crit); --cor-ink: var(--crit-ink); --cor-soft: var(--crit-soft); background: linear-gradient(100deg, #FFF3F6, var(--surface) 55%); }
.eqd-cab.st-off { --cor: var(--off); --cor-ink: var(--off-ink); --cor-soft: var(--off-soft); }
.eqd-cab.st-none { --cor: var(--none); --cor-ink: var(--none-ink); }
.eqd-id { display: flex; gap: 14px; align-items: flex-start; min-width: 0; }
.eqd-id > .emo { font-size: 40px; }
.eqd-id h2 { font-size: 24px; letter-spacing: -.03em; }
.eqd-id .linha { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-top: 6px; font-size: 13px; color: var(--ink-2); }
.eqd-temp { text-align: right; }
.eqd-temp .v { font-size: var(--t-hero); font-weight: 800; letter-spacing: -.05em; line-height: 1; color: var(--cor-ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.eqd-temp .v small { font-size: .4em; color: var(--muted); font-weight: 700; letter-spacing: 0; }
.eqd-temp .regua { width: 240px; margin: 10px 0 2px auto; }
.eqd-temp .sub { white-space: nowrap; }
.eqd-acoes { grid-column: 1 / -1; display: flex; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--rule); padding-top: var(--s4); align-items: center; }
.eqd-grade { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(280px, 1fr); gap: var(--s5); align-items: start; }
.eqd-grade > div { display: flex; flex-direction: column; gap: var(--s5); min-width: 0; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: var(--r-md); overflow: hidden; }
.stat { background: var(--surface); padding: 12px 14px; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.stat span { font-size: 12.5px; color: var(--muted); font-weight: 650; display: flex; align-items: center; gap: 5px; }
.stat b { font-size: 20px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat b.ruim { color: var(--crit-ink); } .stat b.bom { color: var(--ok-ink); }
.dica-btn { border: 0; background: var(--surface-3); width: 20px; height: 20px; border-radius: 50%; font-size: 12px; font-weight: 800; color: var(--ink-2); cursor: help; display: inline-grid; place-items: center; position: relative; padding: 0; }
.dica-btn:hover, .dica-btn:focus-visible { background: var(--accent-soft); color: var(--accent-ink); }
.dica-pop { position: absolute; z-index: 10; bottom: calc(100% + 8px); right: -10px; width: min(260px, 80vw); background: var(--ink); color: #fff; padding: 10px 12px; border-radius: var(--r-sm); font-size: 12.5px; font-weight: 500; line-height: 1.5; text-align: left; box-shadow: var(--sh-3); pointer-events: none; opacity: 0; transition: opacity .15s; }
.dica-btn:hover .dica-pop, .dica-btn:focus-visible .dica-pop { opacity: 1; }
.dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 13.5px; margin: 0; }
.dl dt { color: var(--muted); font-weight: 600; }
.dl dd { margin: 0; font-weight: 650; text-align: right; min-width: 0; overflow-wrap: anywhere; }
.lista-mini { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.lista-mini li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--rule); font-size: 13.5px; }
.lista-mini li:last-child { border-bottom: 0; }
.lista-mini .emo { font-size: 18px; }
.lista-mini .meio { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ==========================================================================
   Alertas
   ========================================================================== */
.al-ativos { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: var(--s4); margin-bottom: var(--s6); }
.al-card {
  display: grid; grid-template-columns: auto 1fr; gap: 12px 14px; padding: 16px 18px; border-radius: var(--r-lg);
  background: var(--surface); border: 1.5px solid var(--crit-line); box-shadow: var(--sh-2); position: relative; overflow: hidden;
  animation: entraCartao .4s var(--ease) both; animation-delay: calc(var(--i, 0) * 40ms);
}
.al-card.sev-crit { background: linear-gradient(180deg, #FFF4F6, var(--surface) 70%); }
.al-card.sev-warn { border-color: var(--warn-line); background: linear-gradient(180deg, #FFFAEE, var(--surface) 70%); }
.al-card.tipo-off { border-color: var(--off-line); background: linear-gradient(180deg, #F3F6F9, var(--surface) 70%); }
.al-emo { font-size: 32px; font-family: var(--f-emoji); line-height: 1; }
.al-card h3 { font-size: 15.5px; }
.al-card .linha { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 13px; color: var(--ink-2); margin-top: 4px; align-items: center; }
.al-num { grid-column: 1 / -1; display: flex; gap: 0; border-top: 1px solid var(--rule); padding-top: 12px; }
.al-num div { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.al-num b { font-size: 18px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.al-num span { font-size: 12px; color: var(--muted); }
.al-num .pior { color: var(--crit-ink); }
.al-acoes { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; }
.dur-viva { font-variant-numeric: tabular-nums; }

/* ==========================================================================
   Casos
   ========================================================================== */
.kanban { display: grid; grid-template-columns: repeat(4, minmax(250px, 1fr)); gap: var(--s4); align-items: start; overflow-x: auto; padding-bottom: 6px; }
.kb-col { background: var(--bg-2); border-radius: var(--r-lg); padding: 12px; display: flex; flex-direction: column; gap: 10px; min-height: 200px; border: 1px solid var(--rule); }
.kb-hd { display: flex; align-items: center; gap: 8px; padding: 2px 4px 4px; font-weight: 800; font-size: 14px; }
.kb-hd .emo { font-size: 16px; }
.kb-hd .n { margin-left: auto; background: var(--surface); border-radius: var(--r-full); padding: 1px 9px; font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.kb-vazio { text-align: center; color: var(--muted); font-size: 13px; padding: 22px 8px; border: 1.5px dashed var(--rule-2); border-radius: var(--r-md); }
.caso-c {
  display: flex; flex-direction: column; gap: 9px; padding: 13px 14px; background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--r-md); box-shadow: var(--sh-1); color: var(--ink); text-decoration: none !important; position: relative;
  animation: entraCartao .35s var(--ease) both; animation-delay: calc(var(--i, 0) * 30ms); transition: box-shadow .15s, border-color .15s;
}
.caso-c:hover { box-shadow: var(--sh-2); border-color: var(--rule-3); }
.caso-c.atrasado { border-color: var(--crit-line); box-shadow: inset 4px 0 0 var(--crit), var(--sh-1); }
.caso-c-hd { display: flex; align-items: center; gap: 8px; }
.caso-num { font-family: var(--f-id); font-size: 12.5px; font-weight: 700; color: var(--accent-ink); }
.caso-c-hd .prio { margin-left: auto; }
.caso-c h3 { font-size: 14px; font-weight: 750; line-height: 1.35; }
.caso-c .eqlinha { font-size: 12.5px; color: var(--ink-2); display: flex; gap: 6px; align-items: center; min-width: 0; }
.caso-c .eqlinha span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.caso-c .ultimo { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.caso-c-rod { display: flex; align-items: center; gap: 6px 8px; flex-wrap: wrap; font-size: 12.5px; border-top: 1px solid var(--rule); padding-top: 9px; }
.caso-c-rod .resp { white-space: nowrap; }
.caso-c-rod .resp { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--ink-2); font-weight: 650; }
.caso-c-rod .resp span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sla { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink-2); padding: 2px 8px; border-radius: var(--r-full); background: var(--surface-3); }
.sla.perto { color: var(--warn-ink); background: var(--warn-soft); }
.sla.atrasado { color: #fff; background: var(--crit-ink); }
.sla.ok { color: var(--ok-ink); background: var(--ok-soft); }
.alerta-vivo { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 800; color: var(--crit-ink); }
.alerta-vivo i { width: 7px; height: 7px; border-radius: 50%; background: var(--crit); animation: piscaPonto 1.4s ease-in-out infinite; }
@keyframes piscaPonto { 50% { opacity: .25; } }
.lista-casos { display: none; flex-direction: column; gap: 10px; }

/* Detalhe do caso */
.cd-cab { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-xl); box-shadow: var(--sh-2); padding: var(--s5) var(--s6); margin-bottom: var(--s5); display: flex; flex-direction: column; gap: 12px; }
.cd-cab-l1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cd-cab h2 { font-size: 22px; letter-spacing: -.03em; }
.cd-meta { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 13px; color: var(--ink-2); }
.cd-meta > div { display: flex; flex-direction: column; }
.cd-meta span { font-size: 12px; color: var(--muted); font-weight: 650; }
.cd-meta b { font-weight: 750; display: flex; align-items: center; gap: 6px; }
.cd-acoes { display: flex; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--rule); padding-top: 14px; }
.cd-grade { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); gap: var(--s5); align-items: start; }
.cd-grade > div { display: flex; flex-direction: column; gap: var(--s5); min-width: 0; }
.tl { list-style: none; margin: 0; padding: 0; position: relative; }
.tl::before { content: ''; position: absolute; left: 19px; top: 8px; bottom: 8px; width: 2px; background: var(--rule); }
.tl li { display: grid; grid-template-columns: 40px 1fr; gap: 12px; padding: 0 0 18px; position: relative; animation: entraCartao .35s var(--ease) both; animation-delay: calc(var(--i, 0) * 30ms); }
.tl-ic { width: 40px; height: 40px; border-radius: 50%; background: var(--surface); border: 2px solid var(--rule); display: grid; place-items: center; font-size: 18px; font-family: var(--f-emoji); position: relative; z-index: 1; }
.tl-ABERTURA .tl-ic, .tl-ALERTA .tl-ic { border-color: var(--crit-line); background: var(--crit-soft); }
.tl-NORMALIZOU .tl-ic, .tl-FECHAMENTO .tl-ic { border-color: var(--ok-line); background: var(--ok-soft); }
.tl-WHATSAPP .tl-ic { border-color: #A8E6C3; background: #E7F8EE; }
.tl-ESCALONAMENTO .tl-ic { border-color: var(--warn-line); background: var(--warn-soft); }
.tl-COMENTARIO .tl-ic { border-color: var(--accent-line); background: var(--accent-soft); }
.tl-corpo { padding-top: 2px; min-width: 0; }
.tl-corpo .tl-hd { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.tl-corpo .tl-hd b { color: var(--ink); font-size: 13.5px; }
.tl-txt { font-size: 14px; margin-top: 3px; white-space: pre-wrap; color: var(--ink-2); }
.tl-COMENTARIO .tl-txt { background: var(--surface-3); padding: 9px 12px; border-radius: 4px 12px 12px 12px; color: var(--ink); }
.comentar { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.comentar .lin { display: flex; gap: 10px; justify-content: flex-end; }
.fechamento { display: grid; gap: 10px; font-size: 13.5px; }
.fechamento .causa-g { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 800; }
.fechamento .causa-g .emo { font-size: 28px; }

/* Modal Resolver: causas em botões grandes */
.causas { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.causa-b {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 84px; padding: 10px 6px;
  border: 1.5px solid var(--rule-2); background: var(--surface); border-radius: var(--r-md); cursor: pointer; font-weight: 750; font-size: 13px; color: var(--ink-2); text-align: center; line-height: 1.25;
  transition: all .13s;
}
.causa-b .emo { font-size: 26px; }
.causa-b:hover { border-color: var(--rule-3); background: var(--surface-2); }
.causa-b[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); box-shadow: var(--anel); }
.sim-nao { display: flex; gap: 8px; }
.sim-nao button { flex: 1; min-height: 48px; border: 1.5px solid var(--rule-2); background: var(--surface); border-radius: var(--r-md); font-weight: 750; cursor: pointer; font-size: 14px; display: inline-flex; gap: 8px; align-items: center; justify-content: center; }
.sim-nao button[aria-pressed="true"].nao { border-color: var(--ok); background: var(--ok-soft); color: var(--ok-ink); }
.sim-nao button[aria-pressed="true"].sim { border-color: var(--crit); background: var(--crit-soft); color: var(--crit-ink); }
.prefixo { position: relative; }
.prefixo span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 700; }
.prefixo input { padding-left: 40px; }

/* Mensagem de WhatsApp (balão) */
.zap-fundo { background: #EFEAE2; background-image: radial-gradient(rgba(0,0,0,.035) 1px, transparent 1px); background-size: 14px 14px; border-radius: var(--r-lg); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.bolha { align-self: flex-end; max-width: min(520px, 92%); background: #D9FDD3; border-radius: 10px 2px 10px 10px; padding: 8px 10px 6px 12px; box-shadow: 0 1px 1px rgba(0,0,0,.12); font-size: 14px; color: #111B21; position: relative; animation: entraCartao .3s var(--ease) both; animation-delay: calc(var(--i, 0) * 25ms); }
.bolha-hd { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12px; font-weight: 750; color: #1F6E43; margin-bottom: 3px; }
.bolha-hd .para { color: #3B4A54; font-weight: 650; }
.bolha-txt { white-space: pre-wrap; overflow-wrap: anywhere; }
.bolha-txt strong { font-weight: 800; }
.bolha-rod { display: flex; justify-content: flex-end; align-items: center; gap: 6px; font-size: 11.5px; color: #4E6370; margin-top: 3px; }
.tique { font-weight: 800; letter-spacing: -2px; }
.tique.lido { color: #027EB5; }
.tique.erro { color: var(--crit-ink); letter-spacing: 0; }
.bolha.erro { background: #FFE8EC; }
.bolha.simulado { background: #F0F4F8; border: 1.5px dashed #9FB0C3; }
.bolha .caso-lnk { font-weight: 750; font-size: 12px; }

/* ==========================================================================
   Relatórios
   ========================================================================== */
.rel-topo { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s4); margin-bottom: var(--s5); }
.rel-num { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 16px 18px; box-shadow: var(--sh-1); display: flex; flex-direction: column; gap: 2px; }
.rel-num span { font-size: 13px; font-weight: 700; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.rel-num b { font-size: 28px; font-weight: 800; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.rel-num .sub { font-size: 12.5px; }
.rel-num.perda b { color: var(--crit-ink); }
.rel-num.evitada b { color: var(--ok-ink); }
.rel-balanca { grid-column: span 2; }
.balanca { display: flex; height: 14px; border-radius: 7px; overflow: hidden; margin-top: 10px; background: var(--surface-3); }
.balanca i { display: block; height: 100%; }
.balanca .b-ev { background: var(--ok); } .balanca .b-pe { background: var(--crit); }
.rel-grade { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s5); }
.rel-grade .largo { grid-column: 1 / -1; }
.medidor { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; width: 90px; display: inline-block; vertical-align: middle; margin-right: 8px; }
.medidor i { display: block; height: 100%; border-radius: 4px; }
.pos { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--surface-3); font-weight: 800; font-size: 12.5px; }
.pos.p1 { background: #FFF1C2; } .pos.p2 { background: #EEF2F6; } .pos.p3 { background: #FBE3D2; }

/* ==========================================================================
   Cadastros
   ========================================================================== */
.abas { display: flex; gap: 4px; border-bottom: 1.5px solid var(--rule); margin-bottom: var(--s5); overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.abas a { display: inline-flex; align-items: center; gap: 7px; padding: 10px 14px; font-weight: 700; font-size: 14px; color: var(--ink-2); border-bottom: 3px solid transparent; white-space: nowrap; text-decoration: none !important; border-radius: 8px 8px 0 0; }
.abas a:hover { color: var(--ink); background: var(--surface-3); }
.abas a.on { color: var(--accent-ink); border-bottom-color: var(--accent); }
.abas a .emo { font-size: 16px; }
.cad-hd { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: var(--s4); }
.cad-hd .busca { flex: 1 1 220px; max-width: 340px; }
.cad-hd .btn:last-child { margin-left: auto; }
.cad-hd select { width: auto; min-width: 180px; max-width: 260px; }
.bloco .tabela-wrap { box-shadow: none; }
.emojis { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 6px; }
.emojis button { height: 42px; border: 1.5px solid var(--rule); background: var(--surface); border-radius: var(--r-sm); font-size: 22px; cursor: pointer; font-family: var(--f-emoji); }
.emojis button:hover { border-color: var(--rule-3); }
.emojis button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: var(--anel); }
.tipos-esc { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.tipo-b { display: flex; gap: 8px; align-items: center; text-align: left; padding: 10px; border: 1.5px solid var(--rule-2); border-radius: var(--r-md); background: var(--surface); cursor: pointer; min-height: 56px; }
.tipo-b .emo { font-size: 22px; }
.tipo-b b { display: block; font-size: 13px; line-height: 1.25; }
.tipo-b span span { font-size: 12px; color: var(--muted); }
.tipo-b:hover { border-color: var(--rule-3); }
.tipo-b[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.previa-faixa { background: var(--surface-2); border: 1px solid var(--rule); border-radius: var(--r-md); padding: 12px 14px; }
.previa-faixa .regua { margin: 8px 0 4px; }
.previa-faixa .lado { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.token-caixa { background: var(--ink); color: #E8F4FF; border-radius: var(--r-md); padding: 14px; font-family: var(--f-id); font-size: 14px; word-break: break-all; display: flex; gap: 10px; align-items: center; }
.token-caixa code { flex: 1; }
.token-caixa pre { flex: 1; margin: 0; font: inherit; white-space: pre-wrap; word-break: break-all; min-width: 0; }
.token-caixa .btn { flex-shrink: 0; }
/* Cartão "Sensores com token da empresa" (Cadastros › Sensores, ADMIN) */
.tk-emp { margin-bottom: var(--s4); }
.tk-emp .bloco-hd { margin-bottom: var(--s3); }
.tk-emp .bloco-hd .sub { max-width: 78ch; }
.tk-emp-corpo { display: grid; gap: var(--s3); }
.tk-emp-grade { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: var(--s3); align-items: start; }
.tk-emp-item { display: grid; gap: 6px; min-width: 0; }
.tk-emp-item .token-caixa { font-size: 13px; padding: 11px 12px; }
.tk-emp-pe { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; padding-top: var(--s3); border-top: 1px solid var(--rule); }
.tk-emp-pe .sub { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
@media (max-width: 900px) {
  .tk-emp-grade { grid-template-columns: minmax(0, 1fr); }
  .tk-emp-pe .btn { width: 100%; justify-content: center; }
}
.codigo-par { font-family: var(--f-id); font-weight: 700; font-size: 34px; letter-spacing: .18em; color: var(--accent-ink); }
.online { display: inline-flex; align-items: center; gap: 6px; font-weight: 750; font-size: 12.5px; }
.online i { width: 8px; height: 8px; border-radius: 50%; }
.online.sim { color: var(--ok-ink); } .online.sim i { background: var(--ok); }
.online.nao { color: var(--off-ink); } .online.nao i { background: var(--off); }
.regras-grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: var(--s4); }
.regra { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.regra h3 { font-size: 15px; display: flex; gap: 8px; align-items: center; }
.regra h3 .emo { font-size: 20px; }
.regra p { font-size: 13px; color: var(--muted); }
.regra .val { display: flex; align-items: center; gap: 10px; }
.regra .val input { width: 110px; font-weight: 800; font-size: 16px; }
.escopo { display: flex; flex-wrap: wrap; gap: 6px; }
.escopo label { display: inline-flex; gap: 6px; align-items: center; border: 1.5px solid var(--rule-2); border-radius: var(--r-full); padding: 5px 12px 5px 8px; font-size: 13px; font-weight: 650; cursor: pointer; }
.escopo label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }

/* ==========================================================================
   WhatsApp
   ========================================================================== */
.zap-grade { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: var(--s5); align-items: start; }
.zap-grade > div { display: flex; flex-direction: column; gap: var(--s5); min-width: 0; }
.canal-st { display: flex; gap: 14px; align-items: center; }
.canal-st .emo { font-size: 36px; }
.canal-st h3 { font-size: 17px; }
.passos { list-style: none; margin: 0; padding: 0; counter-reset: p; display: flex; flex-direction: column; gap: 12px; }
.passos li { counter-increment: p; display: grid; grid-template-columns: 30px 1fr; gap: 10px; font-size: 13.5px; color: var(--ink-2); }
.passos li::before { content: counter(p); width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); font-weight: 800; display: grid; place-items: center; font-size: 13px; }
.passos b { color: var(--ink); }

/* ==========================================================================
   Instalar sensor (pensado para o celular do técnico)
   ========================================================================== */
.inst { max-width: 640px; margin: 0 auto; }
.inst-passos { display: flex; gap: 6px; }
.inst-passos div { flex: 1; height: 6px; border-radius: 3px; background: var(--rule); transition: background .3s; }
.inst-passos div.feito { background: var(--ok); }
.inst-passos div.agora { background: var(--accent-grad); }
.inst-legenda { font-size: 13px; font-weight: 750; color: var(--accent-ink); margin: 8px 0 var(--s4); }
.inst-card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-xl); box-shadow: var(--sh-2); padding: var(--s6); display: flex; flex-direction: column; gap: var(--s5); animation: entraCartao .35s var(--ease) both; }
.inst-card h2 { font-size: 22px; letter-spacing: -.03em; display: flex; gap: 10px; align-items: center; }
.inst-card h2 .emo { font-size: 30px; }
.inst-card .lead { color: var(--ink-2); font-size: 15px; }
.inst-card select, .inst-card input { min-height: 52px; font-size: 16px; }
.inst-nav { display: flex; gap: 10px; flex-wrap: wrap; }
.inst-nav .btn { flex: 1 1 140px; white-space: normal; text-align: center; }
.eq-esc { display: flex; flex-direction: column; gap: 8px; max-height: 340px; overflow-y: auto; padding: 2px; }
.eq-esc button { flex: none; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1.5px solid var(--rule-2); border-radius: var(--r-md); background: var(--surface); text-align: left; cursor: pointer; min-height: 60px; }
.eq-esc button .emo { font-size: 26px; }
.eq-esc button b { display: block; font-size: 15px; }
.eq-esc button .sub { font-size: 12.5px; }
.eq-esc button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: var(--anel); }
.eq-esc button .tem { margin-left: auto; flex: none; }
.eq-esc button > span:nth-child(2) { flex: 1; min-width: 0; }
.eq-esc button .sub { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.codigo-gigante {
  font-family: var(--f-id); font-weight: 700; font-size: clamp(44px, 13vw, 72px); letter-spacing: .14em; text-align: center;
  color: var(--ink); background: var(--frost-grad); border: 2px dashed var(--accent-line); border-radius: var(--r-xl); padding: 22px 8px 22px calc(8px + .14em);
  line-height: 1; user-select: all;
}
.contagem { text-align: center; font-weight: 750; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.contagem.acabando { color: var(--crit-ink); }
.instr { list-style: none; counter-reset: s; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.instr li { counter-increment: s; display: grid; grid-template-columns: 52px 1fr; gap: 14px; align-items: center; padding: 12px; background: var(--surface-2); border: 1px solid var(--rule); border-radius: var(--r-md); }
.instr .ilu { width: 52px; height: 52px; border-radius: 14px; background: var(--accent-soft); display: grid; place-items: center; font-size: 26px; font-family: var(--f-emoji); position: relative; }
.instr .ilu::after { content: counter(s); position: absolute; top: -6px; left: -6px; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12px; font-weight: 800; display: grid; place-items: center; font-family: var(--f-ui); }
.instr p { font-size: 15px; color: var(--ink); line-height: 1.45; }
.instr code { font-family: var(--f-id); font-weight: 700; background: var(--surface); border: 1px solid var(--rule-2); padding: 1px 6px; border-radius: 6px; font-size: .92em; }
.espera { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 18px 0 6px; text-align: center; }
.radar { width: 140px; height: 140px; position: relative; display: grid; place-items: center; }
.radar i { position: absolute; inset: 0; border-radius: 50%; border: 3px solid var(--accent-vivo); opacity: 0; animation: radar 2.4s ease-out infinite; }
.radar i:nth-child(2) { animation-delay: .8s; } .radar i:nth-child(3) { animation-delay: 1.6s; }
.radar span { font-size: 52px; font-family: var(--f-emoji); }
@keyframes radar { 0% { transform: scale(.35); opacity: .9; } 100% { transform: scale(1); opacity: 0; } }
.festa { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 10px 0; }
.festa .emo { font-size: 64px; animation: pula .8s var(--ease) both; }
.festa .t { font-size: clamp(40px, 11vw, 60px); font-weight: 800; letter-spacing: -.05em; color: var(--ok-ink); font-variant-numeric: tabular-nums; line-height: 1; }
@keyframes pula { 0% { transform: scale(.3) rotate(-20deg); opacity: 0; } 60% { transform: scale(1.15) rotate(6deg); opacity: 1; } }
.confete { position: fixed; top: -10px; width: 9px; height: 14px; z-index: 95; pointer-events: none; border-radius: 2px; animation: cai 2.6s linear forwards; }
@keyframes cai { to { transform: translateY(105vh) rotate(720deg); opacity: .8; } }

/* ==========================================================================
   Relatório de temperatura por período (o laudo) — #/relatorios/temperatura
   Na tela: filtros, cabeçalho, resumo e uma seção por equipamento.
   Na impressão (fim do arquivo): A4, sem menu, uma seção por página.
   ========================================================================== */
.abas-rel .aba-curto { display: none; }
.laudo-filtros { margin-bottom: var(--s4); display: flex; flex-direction: column; gap: var(--s3); }
.laudo-campos { display: grid; grid-template-columns: minmax(140px, 170px) minmax(140px, 170px) minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: var(--s3); align-items: end; }
.laudo-campos select { width: 100%; min-width: 0; }
.laudo-gerar .btn { min-width: 120px; }
.laudo-atalhos { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.laudo-atalhos .chip { min-height: 32px; padding: 4px 12px; font-size: 13px; }
.laudo-erro { background: var(--crit-soft); border: 1px solid var(--crit-line); color: var(--crit-ink); font-weight: 700; border-radius: var(--r-sm); padding: 10px 14px; font-size: 13.5px; }
.laudo-barra { display: flex; justify-content: flex-end; }
.laudo-acoes { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: var(--s4); }
.laudo { display: flex; flex-direction: column; gap: var(--s5); }
.laudo .ruim { color: var(--crit-ink); }
.laudo .frio { color: var(--cold-ink); }
.laudo .bom { color: var(--ok-ink); }

.laudo-cab {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s3) var(--s5); align-items: center;
  background: var(--frost-grad); border: 1px solid var(--accent-line); border-radius: var(--r-lg); padding: var(--s5) var(--s6); box-shadow: var(--sh-1);
}
.laudo-marca { display: flex; align-items: center; gap: 10px; padding-right: var(--s5); border-right: 1px solid var(--accent-line); }
.laudo-marca b { display: block; font-size: 18px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.laudo-marca b span { color: var(--accent); }
.laudo-marca .sub { display: block; font-weight: 700; color: var(--ink-2); }
.laudo-tit h2 { font-size: var(--t-2xl); letter-spacing: -.035em; }
.laudo-per { color: var(--ink-2); margin-top: 2px; }
.laudo-per b { font-variant-numeric: tabular-nums; }
.laudo-meta { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s3); margin: 0; padding-top: var(--s3); border-top: 1px solid var(--accent-line); }
.laudo-meta dt { font-size: 12px; font-weight: 750; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.laudo-meta dd { margin: 0; font-weight: 700; font-size: 13.5px; }

.laudo-tab-w { overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--r-md); background: var(--surface); }
.laudo-tab-w:focus-visible { outline-offset: 2px; }
.laudo-tab { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.laudo-tab th, .laudo-tab td { padding: 8px 12px; border-bottom: 1px solid var(--rule); text-align: left; white-space: nowrap; }
.laudo-tab thead th { font-size: 12.5px; font-weight: 750; color: var(--muted); background: var(--surface-2); }
.laudo-tab tbody th { font-weight: 650; }
.laudo-tab tbody th .sub { font-weight: 600; }
.laudo-tab .dir { text-align: right; }
.laudo-tab tr:last-child > * { border-bottom: 0; }
.laudo-tab tr.vazio > * { background: repeating-linear-gradient(135deg, var(--surface-2) 0 8px, var(--surface) 8px 16px); color: var(--muted); }
.laudo-tab tr.clicavel { cursor: pointer; }
.laudo-tab tr.clicavel:hover > * { background: var(--accent-soft); }
.laudo-tab tr.clicavel:focus-visible { outline: 2.5px solid var(--accent); outline-offset: -2.5px; }
.laudo-tab .emo { font-size: 16px; }

.laudo-eq { display: flex; flex-direction: column; gap: var(--s4); scroll-margin-top: 80px; }
.laudo-eq:focus { outline: none; }
.laudo-run { display: none; }
.laudo-eq-hd { display: flex; gap: 14px; align-items: flex-start; }
.laudo-eq-hd > .emo { font-size: 38px; }
.laudo-id { flex: 1; min-width: 0; }
.laudo-id h2 { font-size: 21px; letter-spacing: -.03em; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.laudo-id h2 .id { font-size: 13px; font-weight: 700; color: var(--accent-ink); background: var(--accent-soft); border-radius: 6px; padding: 1px 7px; letter-spacing: 0; }
.laudo-ficha { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--ink-2); }
.laudo-ficha b { color: var(--ok-ink); font-variant-numeric: tabular-nums; }
.laudo-ver { flex: none; }
.laudo-kpis { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: var(--r-md); overflow: hidden; margin: 0; }
.laudo-kpi { background: var(--surface); padding: 10px 12px; min-width: 0; }
.laudo-kpi dt { font-size: 12px; color: var(--muted); font-weight: 700; }
.laudo-kpi dd { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.laudo-graf .legenda { margin-top: 4px; }
.leg-fora { background: rgba(225, 29, 72, .22); border: 1px solid var(--crit); }
.laudo-sec h3 { font-size: 15px; display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.laudo-sec h3 .emo { font-size: 16px; }
.laudo-sec h3 .cont { background: var(--crit-soft); color: var(--crit-ink); border-radius: var(--r-full); padding: 0 9px; font-size: 12.5px; font-weight: 800; }
.laudo-ok { background: var(--ok-soft); border: 1px solid var(--ok-line); color: var(--ok-ink); border-radius: var(--r-md); padding: 12px 14px; font-weight: 750; }

/* ==========================================================================
   RESPONSIVO — tudo daqui para baixo
   ========================================================================== */
@media (min-width: 1900px) {
  :root { --t-temp: 44px; }
  .kpi-v { font-size: 30px; }
}
@media (max-width: 1500px) {
  .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .kpi:nth-child(4n) { border-right: 0; }
  .kpi:nth-child(-n+4) { border-bottom: 1px solid var(--rule); }
}
@media (max-width: 1280px) {
  .eqd-grade, .cd-grade, .zap-grade { grid-template-columns: minmax(0, 1fr); }
  .rel-topo { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kanban { grid-template-columns: repeat(4, minmax(240px, 1fr)); }
}
@media (max-width: 1100px) {
  :root { --side-w: 78px; --pad-x: 22px; }
  .side > .marca { justify-content: center; padding: 16px 0 12px; }
  .side .marca-txt, .side-rede, .nav-grp-rot, .nav-rot, .side-ft .quem { display: none; }
  .side-nav { padding: 4px 10px; }
  .side-nav a { justify-content: center; padding: 10px 0; min-height: 46px; }
  .side-nav a .nav-emo { font-size: 20px; }
  .side-nav a .nav-badge { position: absolute; top: 2px; right: 2px; margin: 0; min-width: 19px; height: 19px; line-height: 19px; font-size: 11.5px; padding: 0 5px; }
  .side-nav a.on::before { left: -10px; }
  .side-ft { flex-direction: column; padding: 12px 0; }
  .rel-grade { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .login { grid-template-columns: 1fr; }
  .login-arte { display: none; }
  .login-inner .so-celular { display: flex; }
  .login-form { background: var(--frost-grad); align-items: start; padding-top: 48px; }
  .login-inner { background: var(--surface); padding: 24px 22px; border-radius: var(--r-xl); box-shadow: var(--sh-3); }
  .kanban { display: none; }
  .lista-casos { display: flex; }
  .form-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Celular: a navegação vira barra inferior */
@media (max-width: 760px) {
  :root { --pad-x: 16px; --t-temp: 38px; --t-hero: 46px; }
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .topo { padding: 8px 12px 8px 16px; gap: 10px; min-height: 58px; }
  .topo .marca-mini { display: inline-flex; }
  .topo .marca-mini img { width: 30px; height: 30px; }
  .topo h1 { font-size: 18px; }
  .topo-sub { display: none; }
  .topo-rede { display: none; }
  .aovivo span { display: none; }
  .conteudo { padding: var(--s4) var(--pad-x) calc(var(--nav-h) + 28px + env(safe-area-inset-bottom)); }
  .barra-baixo {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; z-index: 40; left: 0; right: 0; bottom: 0;
    background: rgba(255, 255, 255, .94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--rule); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); box-shadow: 0 -6px 20px rgba(14, 40, 80, .07);
  }
  .barra-baixo a, .barra-baixo button {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px;
    font-size: 12px; font-weight: 750; color: var(--muted); text-decoration: none !important; border: 0; background: none; cursor: pointer; border-radius: 12px;
  }
  .barra-baixo .bb-emo { font-family: var(--f-emoji); font-size: 21px; line-height: 1.1; position: relative; padding: 2px 14px; border-radius: 14px; transition: background .15s; }
  .barra-baixo button .bb-emo { font-family: var(--f-ui); font-weight: 800; color: var(--ink-2); }
  .barra-baixo a.on { color: var(--accent-ink); }
  .barra-baixo a.on .bb-emo { background: var(--accent-soft); }
  .barra-baixo .nav-badge { position: absolute; top: -4px; right: 0; margin: 0; min-width: 19px; height: 19px; line-height: 19px; font-size: 11.5px; padding: 0 5px; font-family: var(--f-ui); }
  .toasts { top: auto; bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); right: 16px; left: 16px; width: auto; }
  @keyframes entraToast { from { opacity: 0; transform: translateY(16px); } }
  @keyframes saiToast { to { opacity: 0; transform: translateY(16px); } }

  /* Gaveta vira folha de baixo */
  .camada-gaveta { justify-items: stretch; align-items: end; }
  .gaveta { height: auto; max-height: 92svh; width: 100%; border-radius: var(--r-xl) var(--r-xl) 0 0; animation: sobeFolha .28s var(--ease); }
  .gaveta .dlg-ft { border-radius: 0; padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .gaveta .dlg-bd { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
  @keyframes sobeFolha { from { transform: translateY(40px); opacity: 0; } }
  .camada-modal { padding: 0; align-items: end; }
  .modal { width: 100%; max-height: 94svh; border-radius: var(--r-xl) var(--r-xl) 0 0; animation: sobeFolha .28s var(--ease); }
  .modal .dlg-ft { border-radius: 0; padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .dlg-ft .btn { flex: 1; }
  .dlg-bd { padding: 16px; }
  .dlg-hd { padding: 14px 12px 12px 16px; }

  input, select, textarea { font-size: 16px; }   /* evita zoom do iOS */
  .form-2, .form-3 { grid-template-columns: minmax(0, 1fr); }

  /* KPIs compactos: os 4 status numa linha (o "bate o olho"), o resto em 2 colunas */
  .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .kpi { border-right: 1px solid var(--rule) !important; border-bottom: 1px solid var(--rule) !important; padding: 9px 10px; }
  .kpi:nth-child(n+5) { grid-column: span 2; }
  .kpi:nth-child(4), .kpi:nth-child(6), .kpi:nth-child(8) { border-right: 0 !important; }
  .kpi:nth-last-child(-n+2) { border-bottom: 0 !important; }
  .kpi:nth-child(-n+4) { align-items: center; text-align: center; }
  .kpi:nth-child(-n+4) .kpi-n { display: none; }
  .kpi:nth-child(-n+4) .kpi-top { flex-direction: column; gap: 0; font-size: 12px; }
  .kpi:nth-child(-n+4) .kpi-top .emo { font-size: 17px; }
  .kpi-v { font-size: 22px; }
  .kpi.k-dinheiro .kpi-v { font-size: 19px; }
  .painel-topo { gap: 8px; }
  .sel-filial { flex: 1; }
  .sel-filial label { display: none; }
  .sel-filial select { width: 100%; max-width: none; min-width: 0; }
  .atualizado { width: 100%; margin: 0; order: 9; }
  .painel-filtros .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 calc(-1 * var(--pad-x)); padding: 2px var(--pad-x); scrollbar-width: none; width: calc(100% + 2 * var(--pad-x)); }
  .painel-filtros .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
  .painel-filtros .busca { max-width: none; margin: 0; flex: 1 1 100%; }
  .grade-eq { grid-template-columns: minmax(0, 1fr); gap: 12px; }

  .eqd-cab { grid-template-columns: minmax(0, 1fr); padding: 18px; }
  .eqd-temp { text-align: left; }
  .eqd-temp .regua { margin-left: 0; width: 100%; }
  .eqd-id h2 { font-size: 20px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cd-cab { padding: 16px; }
  .cd-cab h2 { font-size: 19px; }
  .cd-acoes .btn { flex: 1 1 calc(50% - 8px); }
  .rel-topo { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .rel-num { padding: 13px 14px; }
  .rel-num.perda, .rel-num.evitada { grid-column: 1 / -1; }
  .rel-num:not(.perda):not(.evitada) b { font-size: 22px; }
  .rel-balanca { grid-column: auto; }
  .barra-item { grid-template-columns: minmax(0, 1fr) auto; }
  .barra-item .barra-trilho { grid-column: 1 / -1; grid-row: 2; }
  .causas { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .causa-b { min-height: 76px; font-size: 12.5px; }
  .bloco { padding: 16px; border-radius: var(--r-md); }
  .cad-hd .busca { flex: 1 1 100%; max-width: none; }
  .cad-hd select { flex: 1 1 150px; max-width: none; }
  .cad-hd .btn:last-child { margin-left: auto; }
  .barra-ferr .busca { flex: 1 1 100%; max-width: none; }
  .barra-ferr > select { flex: 1 1 150px; min-width: 0; width: auto; }
  .barra-ferr .grow { display: none; }
  .barra-ferr > .btn:last-child { margin-left: auto; }

  /* Tabela vira cartões */
  .tabela-wrap { background: none; border: 0; box-shadow: none; overflow: visible; }
  .tabela, .tabela tbody, .tabela tr, .tabela td { display: block; width: 100%; }
  .tabela thead { display: none; }
  .tabela tr { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-md); margin-bottom: 10px; padding: 8px 14px; box-shadow: var(--sh-1); }
  .tabela td { border: 0; padding: 6px 0; display: flex; justify-content: space-between; gap: 12px; align-items: center; text-align: right; }
  .tabela td::before { content: attr(data-rot); font-size: 12.5px; color: var(--muted); font-weight: 700; text-align: left; flex: none; }
  .tabela td.principal-col { display: block; text-align: left; padding: 6px 0 8px; border-bottom: 1px solid var(--rule); margin-bottom: 4px; }
  .tabela td.principal-col::before { display: none; }
  .tabela td.acoes { justify-content: flex-end; border-top: 1px solid var(--rule); margin-top: 4px; padding-top: 10px; }
  .tabela td.acoes::before { display: none; }
  .tabela td:empty { display: none; }

  .inst-card { padding: 18px; border-radius: var(--r-lg); }
  .inst-card h2 { font-size: 20px; }
}
@media (max-width: 400px) {
  .causas { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .eq-temp { font-size: 34px; }
  .kpi-top { font-size: 12px; }
}

/* Relatório de temperatura: KPIs em 4 (tablet) e 2 colunas (celular); as tabelas rolam na horizontal */
@media (max-width: 1280px) {
  .laudo-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .laudo-campos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .laudo-gerar { grid-column: 1 / -1; }
  .laudo-gerar .btn { width: 100%; }
}
@media (max-width: 760px) {
  .abas-rel .aba-longo { display: none; }
  .abas-rel .aba-curto { display: inline; }
  .abas-rel a { flex: 1; justify-content: center; }
  .laudo-cab { grid-template-columns: minmax(0, 1fr); padding: var(--s4); }
  .laudo-marca { border-right: 0; padding-right: 0; }
  .laudo-tit h2 { font-size: 21px; }
  .laudo-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .laudo-campos { gap: 10px; }
  .laudo-campos .campo:nth-child(3), .laudo-campos .campo:nth-child(4) { grid-column: 1 / -1; }
  .laudo-campos input[type=date] { min-width: 0; width: 100%; }
  .laudo-atalhos { flex-wrap: nowrap; overflow-x: auto; margin: 0 calc(-1 * var(--pad-x)); padding: 2px var(--pad-x); scrollbar-width: none; }
  .laudo-atalhos::-webkit-scrollbar { display: none; }
  .laudo-atalhos .chip { flex: none; }
  .laudo-acoes { width: 100%; }
  .laudo-acoes .btn { flex: 1 1 calc(50% - 8px); }
  .laudo-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .laudo-kpi dd { font-size: 17px; }
  .laudo-eq-hd > .emo { font-size: 30px; }
  .laudo-id h2 { font-size: 18px; }
  .laudo-ver { display: none; }
  .laudo-tab th, .laudo-tab td { padding: 8px 10px; }
}

/* Aparelho de toque: alvos de 44 px */
@media (pointer: coarse) {
  .btn { min-height: 44px; }
  .btn.ico { width: 44px; min-width: 44px; }
  .btn.sm { min-height: 40px; }
  .chip { min-height: 40px; }
}

/* ==========================================================================
   Movimento reduzido: tudo parado, nada some
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; animation-delay: 0ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .eq.st-crit { box-shadow: var(--sh-2), 0 0 0 3px rgba(225, 29, 72, .22); }
  .vitrine { animation: none !important; }
  .radar i { opacity: .35; transform: scale(.8); }
  .confete { display: none; }
}

/* ==========================================================================
   IMPRESSÃO / PDF — o laudo de temperatura (window.print() ou Ctrl+P em
   #/relatorios/temperatura). A4 retrato, sem menu, barra lateral nem barra
   inferior; cabeçalho com a marca e a rede; resumo na 1ª página e cada
   equipamento a partir de uma página nova; cores preservadas.
   Antes de imprimir, a tela fixa o laudo na largura útil do A4
   (body.imprimindo) e redesenha os gráficos nessa largura.
   ========================================================================== */
body.imprimindo .laudo { width: 700px; max-width: none; }

@page {
  size: A4 portrait;
  margin: 12mm 11mm 14mm;
  @bottom-left { content: "Pulso Temp · Relatório de temperatura"; font: 600 8pt Manrope, sans-serif; color: #56657B; }
  @bottom-right { content: "Página " counter(page) " de " counter(pages); font: 600 8pt Manrope, sans-serif; color: #56657B; }
}

/* ==========================================================================
   Administrador da plataforma: seletor de empresa, selo e lista de clientes
   A cor de marca da empresa (--marca-cliente) só tinge: um fio no topo, a
   borda do cartão da rede e o ponto do seletor. O tema continua o mesmo.
   ========================================================================== */
.topo { box-shadow: inset 0 3px 0 var(--marca-cliente, transparent); }
.side-rede { border-left: 3px solid var(--marca-cliente, transparent); }
.selo-plat {
  display: inline-flex; align-items: center; margin-left: 6px; padding: 1px 7px; border-radius: var(--r-full);
  font-size: 11px; font-weight: 800; letter-spacing: .02em; color: #4338CA; background: #EEF0FF; border: 1px solid #C7CCFB;
  vertical-align: 1px; white-space: nowrap;
}
.mais-quem .selo-plat { margin: 4px 0 0; }
.side-ft .quem .selo-plat { display: inline-flex; margin-left: 5px; padding: 0 6px; font-size: 10.5px; }
.side-rede-troca { text-align: left; cursor: pointer; border-top: 0; border-right: 0; border-bottom: 0; font: inherit; color: inherit; width: calc(100% - 28px); transition: background .12s; }
.side-rede-troca:hover { background: var(--accent-soft); }
.side-rede-troca .side-rede-rot { display: flex; justify-content: space-between; gap: 6px; }
.side-rede-trocar { color: var(--accent-ink); font-weight: 800; }
.side-rede-troca .emo { font-family: var(--f-emoji); }

.troca-emp {
  display: inline-flex; align-items: center; gap: 9px; min-height: 42px; max-width: 320px; padding: 4px 12px 4px 5px;
  border-radius: var(--r-full); border: 1.5px solid var(--rule-2); background: var(--surface); cursor: pointer;
  font: inherit; color: var(--ink); text-align: left; transition: border-color .12s, box-shadow .12s, background .12s;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--marca-cliente, #0EA5E9) 14%, transparent);
}
.troca-emp:hover { border-color: var(--marca-cliente, var(--accent-line)); background: var(--surface-2); }
.troca-emp-emo {
  font-family: var(--f-emoji); font-size: 18px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: color-mix(in srgb, var(--marca-cliente, #0EA5E9) 16%, #fff);
}
.troca-emp-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.troca-emp-txt small { font-size: 11px; font-weight: 700; color: var(--muted); }
.troca-emp-txt b { font-size: 13.5px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.troca-emp-seta { font-weight: 800; color: var(--accent-ink); font-size: 15px; }

.emp-lista { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.emp-lista > :not(.emp-cartao) { grid-column: 1 / -1; }
.emp-cartao {
  position: relative; display: flex; flex-direction: column; gap: 12px; text-align: left; cursor: pointer; font: inherit; color: var(--ink);
  padding: 14px 14px 12px 18px; border-radius: var(--r-lg); border: 1.5px solid var(--rule); background: var(--surface);
  box-shadow: var(--sh-1); overflow: hidden; transition: border-color .13s, box-shadow .13s, transform .07s;
}
.emp-cartao::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--cor); }
.emp-cartao:hover { border-color: var(--rule-3); box-shadow: var(--sh-2); }
.emp-cartao:active { transform: translateY(1px); }
.emp-cartao.atual { border-color: var(--accent-line); background: var(--surface-2); cursor: default; }
.emp-cartao:disabled { opacity: .55; cursor: progress; }
.emp-cartao.trocando { opacity: 1; border-color: var(--cor); }
.emp-cartao.trocando .emp-emo { animation: pulsa-emp 1s ease-in-out infinite; }
@keyframes pulsa-emp { 50% { transform: scale(.88); } }
.emp-topo { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.emp-emo {
  font-family: var(--f-emoji); font-size: 24px; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; flex: none;
  background: color-mix(in srgb, var(--cor) 14%, #fff); border: 1px solid color-mix(in srgb, var(--cor) 28%, #fff);
}
.emp-nome { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.emp-nome b { font-size: 15.5px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.emp-nome .sub { font-size: 12.5px; margin-top: 2px; }
.emp-atual { flex: none; font-size: 11.5px; }
.emp-inds { display: flex; flex-wrap: wrap; gap: 6px; }
.emp-ind {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: var(--r-full); font-size: 12.5px;
  background: var(--surface-3); color: var(--ink-2); border: 1px solid var(--rule);
}
.emp-ind > span:first-child { font-family: var(--f-emoji); }
.emp-ind b { font-weight: 800; font-variant-numeric: tabular-nums; }
.emp-ind-rot { color: var(--muted); }
.emp-ind.crit { background: var(--crit-soft); border-color: var(--crit-line); color: var(--crit-ink); }
.emp-ind.warn { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn-ink); }
.emp-ind.crit .emp-ind-rot, .emp-ind.warn .emp-ind-rot { color: inherit; }

.mais-emp {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; border-radius: var(--r-md); cursor: pointer; font: inherit; color: var(--ink);
  text-align: left; background: var(--surface); border: 1.5px solid var(--rule-2); border-left: 5px solid var(--marca-cliente, var(--accent-vivo));
}
.mais-emp:hover { background: var(--surface-2); }
.mais-emp-emo { font-family: var(--f-emoji); font-size: 24px; }
.mais-emp-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.mais-emp-txt small { font-size: 12px; color: var(--muted); font-weight: 700; }
.mais-emp-txt b { font-size: 15px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mais-emp-acao { font-size: 13px; font-weight: 800; color: var(--accent-ink); white-space: nowrap; }

@media (max-width: 1100px) {
  .troca-emp { max-width: 240px; }
}
@media (max-width: 760px) {
  .emp-lista { grid-template-columns: minmax(0, 1fr); }
  .troca-emp { padding: 3px 9px 3px 3px; gap: 4px; min-height: 40px; box-shadow: none; }
  .troca-emp-txt { display: none; }
}

/* Login: contas de demonstração agrupadas por empresa */
.demo-plat { margin-top: 10px; }
.demo-plat .demo-conta { border-color: #C7CCFB; background: #F6F7FF; }
.demo-plat .demo-conta:hover { border-color: #A5ADF8; background: #EEF0FF; }
.demo-abas { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.demo-aba {
  display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 5px 11px; border-radius: var(--r-full); cursor: pointer;
  font: inherit; font-size: 12.5px; font-weight: 750; color: var(--ink-2); background: var(--surface); border: 1.5px solid var(--rule-2);
}
.demo-aba:hover { border-color: var(--rule-3); }
.demo-aba[aria-selected="true"] { color: var(--ink); border-color: var(--cor); background: color-mix(in srgb, var(--cor) 9%, #fff); box-shadow: inset 0 -2px 0 var(--cor); }
.demo-aba .emo { font-family: var(--f-emoji); font-size: 15px; }
.demo-painel { margin-top: 8px; }
.demo-painel .demo-emp { font-size: 12px; color: var(--muted); margin: 0; }
.demo-painel ul { margin-top: 8px; }

@media print {
  *, *::before, *::after { -webkit-print-color-adjust: exact; print-color-adjust: exact; animation: none !important; transition: none !important; }
  html, body { background: #fff !important; }
  body { font-size: 10pt; }
  .side, .topo, .barra-baixo, .pular, .toasts, .camada, .boot,
  .tela-relatorios .abas, .laudo-filtros, .laudo-barra, .laudo-ver,
  .graf-dica, .graf-guia, .graf-ponto { display: none !important; }
  .app, .principal { display: block; min-height: 0; }
  .conteudo { padding: 0 !important; max-width: none; margin: 0; }
  .laudo { width: 100% !important; gap: 5mm; }
  .bloco, .laudo-cab, .laudo-tab-w, .laudo-kpis { box-shadow: none !important; }
  a { color: inherit; text-decoration: none; }

  /* Cabeçalho do laudo: sempre em duas colunas (mesmo impresso do celular) */
  .laudo-cab { grid-template-columns: auto minmax(0, 1fr); padding: 5mm 6mm; border-radius: 3mm; break-inside: avoid; }
  .laudo-marca { border-right: 1px solid var(--accent-line); padding-right: 5mm; }
  .laudo-tit h2 { font-size: 17pt; }
  .laudo-meta { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .laudo-meta dd { font-size: 9.5pt; }

  /* Cada equipamento numa página nova (depois do resumo); o que cabe junto fica junto */
  .laudo-resumo { break-inside: auto; padding: 4mm; }
  .laudo-resumo ~ .laudo-eq { break-before: page; }
  .laudo-eq { border: 0; padding: 0; gap: 4mm; border-radius: 0; }
  .laudo-run { display: block; font-size: 8pt; font-weight: 700; color: var(--muted); border-bottom: 1px solid var(--rule-2); padding-bottom: 1.5mm; margin-bottom: 1mm; }
  .laudo-eq-hd, .laudo-kpis, .laudo-graf, .laudo-ok { break-inside: avoid; }
  .laudo-eq-hd > .emo { font-size: 24pt; }
  .laudo-id h2 { font-size: 14pt; }
  .laudo-ficha { font-size: 9pt; }
  .laudo-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .laudo-kpi { padding: 2mm 3mm; }
  .laudo-kpi dt { font-size: 8pt; }
  .laudo-kpi dd { font-size: 12.5pt; }
  .laudo-graf .legenda { font-size: 8pt; }
  .laudo-sec h3 { font-size: 11pt; break-after: avoid; }

  /* Tabelas: sem rolagem, cabeçalho repetido em cada página, linha não parte ao meio */
  .laudo-tab-w { overflow: visible; border-radius: 0; }
  .laudo-tab { font-size: 8.5pt; }
  .laudo-tab th, .laudo-tab td { padding: 1.1mm 2.2mm; }
  .laudo-tab thead { display: table-header-group; }
  .laudo-tab tr { break-inside: avoid; }
}
