/* ============================================================
   Estação Meteorológica — tema escuro, responsivo, PWA
   ============================================================ */

:root {
  --fundo: #070b14;
  --superficie: rgba(17, 25, 40, 0.72);
  --superficie-forte: rgba(15, 23, 42, 0.9);
  --borda: rgba(148, 163, 184, 0.14);
  --borda-forte: rgba(148, 163, 184, 0.24);
  --texto: #e2e8f0;
  --texto-forte: #f8fafc;
  --suave: #94a3b8;
  --fraco: #64748b;
  --online: #34d399;
  --offline: #f87171;
  --alerta: #fbbf24;
  --raio: 20px;
  --sombra: 0 24px 60px -30px rgba(0, 0, 0, 0.9);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--fundo);
  color: var(--texto);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  line-height: 1.45;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---------- fundo ---------- */
.fundo {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background:
    radial-gradient(1100px 700px at 10% -10%, rgba(37, 99, 235, 0.16), transparent 60%),
    radial-gradient(900px 600px at 100% 0%, rgba(124, 58, 237, 0.14), transparent 55%),
    radial-gradient(900px 700px at 50% 110%, rgba(13, 148, 136, 0.1), transparent 60%);
}

.brilho {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.4;
  animation: flutuar 24s ease-in-out infinite alternate;
}

.brilho-1 {
  width: 460px;
  height: 460px;
  top: -180px;
  left: -120px;
  background: rgba(59, 130, 246, 0.35);
}

.brilho-2 {
  width: 420px;
  height: 420px;
  top: -140px;
  right: -120px;
  background: rgba(139, 92, 246, 0.3);
  animation-delay: -8s;
}

.brilho-3 {
  width: 520px;
  height: 520px;
  bottom: -260px;
  left: 35%;
  background: rgba(20, 184, 166, 0.22);
  animation-delay: -16s;
}

@keyframes flutuar {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(40px, 30px, 0) scale(1.08); }
}

/* ---------- estrutura ---------- */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 30px 20px 70px;
}

.topo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}

.marca {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.marca-icone {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  box-shadow: 0 10px 24px -12px rgba(59, 130, 246, 0.9);
  flex-shrink: 0;
}

.marca h1 {
  font-size: clamp(1.15rem, 2.4vw, 1.5rem);
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--texto-forte);
}

.marca-sub {
  font-size: 0.85rem;
  color: var(--suave);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.separador {
  color: var(--fraco);
}

.topo-acoes {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---------- botões ---------- */
.botao-icone {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--borda);
  background: var(--superficie);
  color: var(--suave);
  cursor: pointer;
  transition: color 0.18s, border-color 0.18s, transform 0.18s;
}

.botao-icone:hover {
  color: var(--texto-forte);
  border-color: var(--borda-forte);
}

.botao-icone.girando svg {
  animation: girar 0.9s linear infinite;
}

@keyframes girar {
  to { transform: rotate(360deg); }
}

.botao-instalar {
  border: 1px solid rgba(56, 189, 248, 0.4);
  background: rgba(56, 189, 248, 0.12);
  color: #bae6fd;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 550;
  padding: 9px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.18s, transform 0.18s;
}

.botao-instalar:hover {
  background: rgba(56, 189, 248, 0.2);
  transform: translateY(-1px);
}

.seletor {
  color-scheme: dark;
  border: 1px solid var(--borda);
  background: var(--superficie);
  color: var(--texto);
  font: inherit;
  font-size: 0.85rem;
  padding: 9px 12px;
  border-radius: 12px;
  cursor: pointer;
  max-width: 160px;
}

.seletor:hover {
  border-color: var(--borda-forte);
}

/* ---------- status ---------- */
.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--borda);
  background: var(--superficie);
  font-size: 0.83rem;
  color: var(--suave);
  white-space: nowrap;
}

.status .ponto {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--alerta);
  animation: pulsar 2s ease-out infinite;
}

.status[data-estado="online"] {
  color: #a7f3d0;
  border-color: rgba(52, 211, 153, 0.28);
}

.status[data-estado="online"] .ponto {
  background: var(--online);
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.7);
  animation: none;
}

.status[data-estado="offline"],
.status[data-estado="erro"] {
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.3);
}

.status[data-estado="offline"] .ponto,
.status[data-estado="erro"] .ponto {
  background: var(--offline);
  animation: none;
}

@keyframes pulsar {
  0% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.45); }
  70% { box-shadow: 0 0 0 8px rgba(251, 191, 36, 0); }
  100% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0); }
}

/* ---------- cards ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.card {
  position: relative;
  padding: 20px 20px 18px;
  border-radius: var(--raio);
  border: 1px solid var(--borda);
  background: linear-gradient(160deg, rgba(30, 41, 59, 0.55), rgba(15, 23, 42, 0.75));
  box-shadow: var(--sombra);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s;
}

.card::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--cor), transparent);
  opacity: 0.55;
}

.card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--cor) 35%, transparent);
}

.card[data-tipo="temp"] { --cor: #fb7185; --cor-suave: rgba(251, 113, 133, 0.16); }
.card[data-tipo="umidade"] { --cor: #38bdf8; --cor-suave: rgba(56, 189, 248, 0.16); }
.card[data-tipo="orvalho"] { --cor: #34d399; --cor-suave: rgba(52, 211, 153, 0.16); }
.card[data-tipo="condicao"] { --cor: #fbbf24; --cor-suave: rgba(251, 191, 36, 0.16); }

.card-topo {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
}

.card-icone {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--cor-suave);
  color: var(--cor);
  font-size: 1rem;
}

.card-icone svg {
  display: block;
}

.card-rotulo {
  font-size: 0.78rem;
  font-weight: 550;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--suave);
}

.card-valor {
  display: flex;
  align-items: baseline;
  gap: 5px;
  font-size: clamp(2.3rem, 4.2vw, 3rem);
  font-weight: 680;
  letter-spacing: -0.03em;
  color: var(--texto-forte);
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
}

.card-valor .unidade {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--suave);
  letter-spacing: 0;
}

.card-valor-texto {
  font-size: clamp(1.45rem, 2.8vw, 1.85rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--cor);
  padding: 0.2em 0;
}

.card-valor.atualizou {
  animation: piscar 0.55s ease;
}

@keyframes piscar {
  0% { opacity: 0.35; }
  100% { opacity: 1; }
}

.card-rodape {
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--fraco);
}

/* ---------- painéis ---------- */
.painel {
  padding: 22px;
  border-radius: var(--raio);
  border: 1px solid var(--borda);
  background: var(--superficie);
  box-shadow: var(--sombra);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  margin-bottom: 18px;
}

.painel h2 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--texto-forte);
  letter-spacing: -0.01em;
}

.painel-sub {
  font-size: 0.8rem;
  color: var(--fraco);
  margin-top: 3px;
}

.painel-rodape {
  margin-top: 14px;
}

.painel-topo {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

/* ---------- períodos ---------- */
.periodos {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--borda);
  background: rgba(2, 6, 23, 0.45);
}

.periodos button {
  border: 0;
  background: transparent;
  color: var(--suave);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 550;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.16s, color 0.16s;
}

.periodos button:hover {
  color: var(--texto-forte);
}

.periodos button.ativo {
  background: rgba(56, 189, 248, 0.18);
  color: #bae6fd;
}

/* ---------- gráfico ---------- */
.grafico-area {
  position: relative;
  height: 320px;
}

.grafico-vazio {
  padding: 26px 0 10px;
  text-align: center;
  color: var(--fraco);
  font-size: 0.9rem;
}

/* ---------- grade inferior ---------- */
.grade {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 18px;
}

.grade .painel {
  margin-bottom: 0;
}

/* ---------- tabela resumo ---------- */
.tabela-resumo {
  display: flex;
  flex-direction: column;
  margin-top: 10px;
}

.tabela-linha {
  display: grid;
  grid-template-columns: 1.6fr repeat(3, 1fr);
  gap: 8px;
  padding: 10px 4px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.09);
  font-variant-numeric: tabular-nums;
}

.tabela-linha:last-child {
  border-bottom: 0;
}

.tabela-linha span:nth-child(n + 2) {
  text-align: right;
}

.tabela-cabecalho {
  padding-top: 0;
  border-bottom-color: var(--borda);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fraco);
}

.tabela-linha [role="rowheader"],
.tabela-linha span:first-child {
  color: var(--suave);
  font-size: 0.86rem;
}

.tabela-linha span:nth-child(n + 2) {
  color: var(--texto);
  font-size: 0.9rem;
}

/* ---------- detalhes ---------- */
.detalhes {
  display: flex;
  flex-direction: column;
  margin-top: 10px;
}

.detalhes > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.09);
}

.detalhes > div:last-child {
  border-bottom: 0;
}

.detalhes dt {
  color: var(--suave);
  font-size: 0.86rem;
}

.detalhes dd {
  color: var(--texto);
  font-size: 0.88rem;
  font-weight: 550;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.detalhe-sinal {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.barras {
  display: inline-flex;
  align-items: flex-end;
  gap: 3px;
  height: 14px;
}

.barras i {
  display: block;
  width: 4px;
  border-radius: 1px;
  background: rgba(148, 163, 184, 0.22);
}

.barras i:nth-child(1) { height: 5px; }
.barras i:nth-child(2) { height: 8px; }
.barras i:nth-child(3) { height: 11px; }
.barras i:nth-child(4) { height: 14px; }

.barras[data-qualidade="1"] i:nth-child(1) { background: var(--offline); }
.barras[data-qualidade="2"] i:nth-child(-n + 2) { background: var(--alerta); }
.barras[data-qualidade="3"] i:nth-child(-n + 3) { background: #a3e635; }
.barras[data-qualidade="4"] i { background: var(--online); }

/* ---------- vazio ---------- */
.vazio-geral {
  padding: 60px 26px;
  text-align: center;
  border-radius: var(--raio);
  border: 1px dashed var(--borda-forte);
  background: var(--superficie);
}

.vazio-geral h2 {
  font-size: 1.2rem;
  margin-bottom: 8px;
  color: var(--texto-forte);
}

.vazio-geral p {
  color: var(--suave);
  font-size: 0.92rem;
  margin-bottom: 16px;
}

.vazio-geral code {
  display: inline-block;
  padding: 9px 14px;
  border-radius: 10px;
  background: rgba(2, 6, 23, 0.7);
  border: 1px solid var(--borda);
  color: #7dd3fc;
  font-size: 0.85rem;
}

/* ---------- rodapé ---------- */
.rodape {
  margin-top: 34px;
  text-align: center;
  color: var(--fraco);
  font-size: 0.78rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rodape-fino {
  opacity: 0.7;
}

/* ---------- aviso offline ---------- */
.aviso-offline {
  position: fixed;
  bottom: max(18px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px;
  border-radius: 14px;
  border: 1px solid rgba(248, 113, 113, 0.35);
  background: rgba(69, 10, 10, 0.88);
  color: #fecaca;
  font-size: 0.84rem;
  box-shadow: 0 18px 40px -20px rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  max-width: calc(100vw - 32px);
}

.noscript {
  padding: 20px;
  text-align: center;
  color: var(--alerta);
}

/* ---------- foco e acessibilidade ---------- */
:focus-visible {
  outline: 2px solid #7dd3fc;
  outline-offset: 2px;
}

/* ---------- responsivo ---------- */
@media (max-width: 900px) {
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grade {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .container {
    padding: 20px 14px 60px;
  }

  .topo {
    align-items: flex-start;
    margin-bottom: 20px;
  }

  .topo-acoes {
    width: 100%;
  }

  .status {
    flex: 1;
    justify-content: center;
  }

  .card {
    padding: 17px 16px 15px;
  }

  .card-valor {
    font-size: clamp(2rem, 9vw, 2.6rem);
  }

  .card-valor-texto {
    font-size: 1.4rem;
  }

  .painel {
    padding: 17px 15px;
    border-radius: 17px;
  }

  .grafico-area {
    height: 260px;
  }

  .periodos {
    width: 100%;
    justify-content: space-between;
  }

  .periodos button {
    flex: 1;
    padding: 7px 6px;
  }

  .tabela-linha {
    grid-template-columns: 1.3fr repeat(3, 1fr);
    font-size: 0.85rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================
   Navegação e página de histórico
   ============================================================ */

.abas {
  display: flex;
  gap: 5px;
  width: fit-content;
  margin: 0 0 20px;
  padding: 4px;
  border: 1px solid var(--borda);
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.35);
}

.abas a {
  padding: 8px 18px;
  border-radius: 999px;
  color: var(--suave);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 550;
  transition: background 0.16s, color 0.16s;
}

.abas a:hover {
  color: var(--texto-forte);
}

.abas a[aria-current="page"] {
  background: rgba(56, 189, 248, 0.16);
  color: #bae6fd;
}

.painel-acoes {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.link-historico {
  font-size: 0.8rem;
  color: #7dd3fc;
  text-decoration: none;
  white-space: nowrap;
}

.link-historico:hover {
  text-decoration: underline;
}

/* ---------- filtros ---------- */
.filtros {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.presets button {
  border: 1px solid var(--borda);
  background: rgba(2, 6, 23, 0.35);
  color: var(--suave);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 550;
  padding: 8px 13px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.16s, color 0.16s, border-color 0.16s;
}

.presets button:hover {
  color: var(--texto-forte);
  border-color: var(--borda-forte);
}

.presets button.ativo {
  background: rgba(56, 189, 248, 0.16);
  border-color: rgba(56, 189, 248, 0.35);
  color: #bae6fd;
}

.intervalo-personalizado {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
}

.intervalo-personalizado label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.75rem;
  color: var(--fraco);
}

.intervalo-personalizado input {
  color-scheme: dark;
  background: rgba(2, 6, 23, 0.55);
  border: 1px solid var(--borda);
  border-radius: 10px;
  color: var(--texto);
  font: inherit;
  font-size: 0.83rem;
  padding: 8px 10px;
}

.intervalo-personalizado input:hover {
  border-color: var(--borda-forte);
}

.botao-primario,
.botao-secundario {
  border-radius: 10px;
  font: inherit;
  font-size: 0.83rem;
  font-weight: 550;
  padding: 9px 15px;
  cursor: pointer;
  transition: background 0.16s, opacity 0.16s;
}

.botao-primario {
  border: 1px solid rgba(56, 189, 248, 0.4);
  background: rgba(56, 189, 248, 0.16);
  color: #bae6fd;
}

.botao-primario:hover {
  background: rgba(56, 189, 248, 0.24);
}

.botao-secundario {
  border: 1px solid var(--borda);
  background: var(--superficie);
  color: var(--texto);
}

.botao-secundario:hover:not(:disabled) {
  border-color: var(--borda-forte);
}

.botao-secundario:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.filtro-resumo {
  font-size: 0.82rem;
  color: var(--suave);
}

/* ---------- cards de resumo ---------- */
.resumo-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.resumo-item {
  padding: 16px 18px;
  border: 1px solid var(--borda);
  border-radius: 16px;
  background: var(--superficie);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.resumo-rotulo {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--suave);
  margin-bottom: 6px;
}

.resumo-valor {
  display: block;
  font-size: 1.65rem;
  font-weight: 650;
  line-height: 1.1;
  color: var(--texto-forte);
  font-variant-numeric: tabular-nums;
}

.resumo-faixa {
  display: block;
  margin-top: 5px;
  font-size: 0.75rem;
  color: var(--fraco);
}

/* ---------- tabela ---------- */
.tabela-scroll {
  overflow-x: auto;
  margin-top: 6px;
  border-radius: 12px;
}

.tabela-historico {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
}

.tabela-historico th {
  position: sticky;
  top: 0;
  padding: 9px 10px;
  text-align: right;
  font-size: 0.7rem;
  font-weight: 550;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fraco);
  background: var(--superficie-forte);
  border-bottom: 1px solid var(--borda);
  white-space: nowrap;
}

.tabela-historico th:first-child,
.tabela-historico td:first-child {
  text-align: left;
}

.tabela-historico td {
  padding: 9px 10px;
  text-align: right;
  color: var(--texto);
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  white-space: nowrap;
}

.tabela-historico tbody tr:hover td {
  background: rgba(56, 189, 248, 0.05);
}

.paginacao {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

.paginacao span {
  font-size: 0.8rem;
  color: var(--suave);
  font-variant-numeric: tabular-nums;
  text-align: center;
}

@media (max-width: 900px) {
  .resumo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .abas {
    width: 100%;
  }

  .abas a {
    flex: 1;
    text-align: center;
  }

  .intervalo-personalizado {
    align-items: stretch;
  }

  .intervalo-personalizado label {
    flex: 1 1 46%;
  }

  .intervalo-personalizado input {
    width: 100%;
  }

  .intervalo-personalizado .botao-primario,
  .intervalo-personalizado .botao-secundario {
    flex: 1 1 100%;
  }

  .resumo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .resumo-item {
    padding: 14px;
  }

  .resumo-valor {
    font-size: 1.4rem;
  }

  .paginacao {
    flex-wrap: wrap;
  }

  .paginacao span {
    order: -1;
    width: 100%;
  }
}

@media (max-width: 620px) {
  /* No celular, a tabela mostra o essencial; RSSI e uptime ficam no desktop */
  .tabela-historico {
    min-width: 0;
    font-size: 0.8rem;
  }

  .tabela-historico th,
  .tabela-historico td {
    padding: 8px 6px;
  }

  .tabela-historico th:nth-child(5),
  .tabela-historico td:nth-child(5),
  .tabela-historico th:nth-child(6),
  .tabela-historico td:nth-child(6) {
    display: none;
  }
}

.aviso-servidor {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  margin-bottom: 18px;
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: 14px;
  background: rgba(120, 53, 15, 0.35);
  color: #fde68a;
  font-size: 0.85rem;
  line-height: 1.5;
}

.aviso-servidor code {
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.3);
  font-size: 0.82em;
}

.acesso-celular {
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--suave);
}

.acesso-celular a {
  color: #7dd3fc;
  word-break: break-all;
}

/* ============================================================
   v2.4 — acabamento de produto (marca, diálogos, rodapé)
   ============================================================ */

.marca-local {
  color: var(--suave);
}

.condicao-indicador {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.15);
  flex-shrink: 0;
}

.condicao-indicador[data-nivel="2"] {
  background: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.condicao-indicador[data-nivel="3"] {
  background: #fbbf24;
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.16);
}

.condicao-indicador[data-nivel="4"] {
  background: #fb7185;
  box-shadow: 0 0 0 3px rgba(251, 113, 133, 0.16);
}

/* ---------- rodapé ---------- */
.rodape {
  margin-top: 34px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--fraco);
  font-size: 0.78rem;
  text-align: center;
}

.rodape-linha {
  display: flex;
  align-items: center;
  gap: 6px;
}

.rodape-ponto {
  opacity: 0.5;
}

.rodape-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
}

.link-botao {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  color: var(--suave);
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
  transition: color 0.16s;
}

.link-botao:hover {
  color: var(--texto-forte);
  text-decoration: underline;
}

/* ---------- diálogos ---------- */
.dialogo {
  width: min(520px, calc(100vw - 32px));
  max-height: min(86vh, 720px);
  margin: auto;
  padding: 0;
  overflow: auto;
  border: 1px solid var(--borda-forte);
  border-radius: 22px;
  background: #0d1526;
  color: var(--texto);
  box-shadow: 0 40px 90px -40px rgba(0, 0, 0, 0.95);
  color-scheme: dark;
}

.dialogo::backdrop {
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.dialogo[open] {
  animation: aparecer 0.18s ease-out;
}

@keyframes aparecer {
  from { opacity: 0; transform: translateY(6px) scale(0.99); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.dialogo-cabecalho {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 22px 0;
}

.dialogo-cabecalho h2 {
  font-size: 1.08rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--texto-forte);
}

.dialogo-fechar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 1px solid var(--borda);
  background: transparent;
  color: var(--suave);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.dialogo-fechar:hover {
  color: var(--texto-forte);
  border-color: var(--borda-forte);
}

.dialogo-corpo {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 22px 22px;
}

.dialogo-destaque {
  font-size: 1.05rem;
  font-weight: 650;
  color: var(--texto-forte);
}

.dialogo-texto {
  font-size: 0.9rem;
  color: var(--suave);
}

.dialogo-nota {
  font-size: 0.76rem;
  color: var(--fraco);
}

.dialogo-acoes {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.sistema-linha {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--borda);
  font-size: 0.88rem;
}

.sistema-linha:last-of-type {
  border-bottom: 0;
}

.sistema-linha > span:first-child {
  color: var(--suave);
  flex-shrink: 0;
}

.sistema-linha strong {
  color: var(--texto-forte);
  font-weight: 550;
  text-align: right;
}

.sistema-linha-rede {
  align-items: flex-start;
}

.sistema-url {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.sistema-url a {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #7dd3fc;
  text-decoration: none;
}

.sistema-url a:hover {
  text-decoration: underline;
}

.botao-copiar {
  flex-shrink: 0;
  border: 1px solid var(--borda);
  background: var(--superficie);
  color: var(--suave);
  font: inherit;
  font-size: 0.74rem;
  padding: 4px 9px;
  border-radius: 7px;
  cursor: pointer;
}

.botao-copiar:hover {
  color: var(--texto-forte);
  border-color: var(--borda-forte);
}

/* ---------- aviso offline ---------- */
.aviso-acao {
  margin-left: 4px;
  border: 1px solid rgba(248, 113, 113, 0.4);
  background: rgba(248, 113, 113, 0.12);
  color: #fecaca;
  font: inherit;
  font-size: 0.76rem;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}

.aviso-acao:hover {
  background: rgba(248, 113, 113, 0.2);
}

.vazio-geral .botao-primario {
  margin-top: 6px;
}

@media (max-width: 620px) {
  .marca h1 {
    font-size: 1.08rem;
  }

  .marca-sub {
    font-size: 0.78rem;
  }

  .topo {
    gap: 12px;
  }

  .topo-acoes {
    width: 100%;
    justify-content: flex-end;
    gap: 8px;
  }

  .dialogo {
    width: calc(100vw - 20px);
    max-height: 88vh;
    border-radius: 18px;
  }

  .dialogo-cabecalho {
    padding: 16px 16px 0;
  }

  .dialogo-corpo {
    padding: 12px 16px 18px;
  }

  .sistema-linha {
    flex-direction: column;
    gap: 2px;
  }

  .sistema-linha strong {
    text-align: left;
  }

  .sistema-url a {
    max-width: 150px;
  }

  .dialogo-acoes {
    justify-content: stretch;
  }

  .dialogo-acoes .botao-primario,
  .dialogo-acoes .botao-secundario {
    flex: 1 1 auto;
  }

  .rodape {
    margin-top: 26px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dialogo[open] {
    animation: none;
  }
}

.resolucao-campo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--suave);
  white-space: nowrap;
}

.resolucao-campo .seletor {
  padding: 6px 8px;
  font-size: 0.78rem;
}

@media (max-width: 620px) {
  .resolucao-campo span {
    display: none;
  }
}
