:root {
  --azul-neon: #00d9ff;
  --azul-neon-fraco: rgba(0, 217, 255, 0.35);
  --fundo: #050810;
  --fundo-card: #0b0f1a;
  --fundo-card-vidro: rgba(14, 18, 28, 0.62);
  --fundo-sidebar: #080c14;
  --fundo-sidebar-vidro: rgba(8, 12, 20, 0.55);
  --texto: #e6f7ff;
  --texto-fraco: #7fa7b8;
  --desfoque-sidebar: 20px;
  --desfoque-card: 22px;
}

* { box-sizing: border-box; }

/* ---------- Scrollbar customizado (mais discreto que o padrão do navegador) ---------- */

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(160, 180, 195, 0.35) transparent;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background-color: rgba(160, 180, 195, 0.35);
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
  background-color: color-mix(in srgb, var(--azul-neon) 45%, transparent);
  background-clip: padding-box;
}

body {
  color-scheme: dark;
  background: var(--fundo);
  color: var(--texto);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Arial, sans-serif;
  margin: 0;
  min-height: 100vh;
}

/* ---------- Layout com barra lateral ---------- */

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--fundo-sidebar-vidro);
  backdrop-filter: blur(var(--desfoque-sidebar)) saturate(160%);
  -webkit-backdrop-filter: blur(var(--desfoque-sidebar)) saturate(160%);
  border-right: 1px solid var(--azul-neon-fraco);
  display: flex;
  flex-direction: column;
  padding: 24px 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1), padding 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.recolhida {
  width: 0;
  padding: 24px 0;
  overflow: hidden;
  border-right: none;
}

.sidebar.recolhida .logo-topo,
.sidebar.recolhida .sidebar-links,
.sidebar.recolhida .sidebar-rodape {
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
}

.sidebar:not(.recolhida) .logo-topo,
.sidebar:not(.recolhida) .sidebar-links,
.sidebar:not(.recolhida) .sidebar-rodape {
  opacity: 1;
  transition: opacity 0.25s ease 0.1s;
}

.botao-menu {
  position: fixed;
  top: 16px;
  left: 12px;
  z-index: 50;
  background: var(--fundo-sidebar);
  border: 1px solid var(--azul-neon-fraco);
  color: var(--azul-neon);
  border-radius: 10px;
  width: 34px;
  height: 34px;
  font-size: 16px;
  cursor: pointer;
}

.botao-menu:hover {
  background: color-mix(in srgb, var(--azul-neon) 10%, transparent);
}

.botao-tema {
  position: fixed;
  top: 16px;
  left: 54px;
  z-index: 50;
  background: var(--fundo-sidebar);
  border: 1px solid var(--azul-neon-fraco);
  color: var(--azul-neon);
  border-radius: 10px;
  width: 34px;
  height: 34px;
  font-size: 15px;
  cursor: pointer;
}

.botao-tema:hover {
  background: color-mix(in srgb, var(--azul-neon) 10%, transparent);
}

/* ---------- Tema claro ---------- */

body.tema-claro {
  color-scheme: light;
  --azul-neon: #0077b6;
  --azul-neon-fraco: rgba(0, 119, 182, 0.3);
  --fundo: #f2f6fa;
  --fundo-card: #ffffff;
  --fundo-card-vidro: rgba(255, 255, 255, 0.65);
  --fundo-sidebar: #ffffff;
  --fundo-sidebar-vidro: rgba(255, 255, 255, 0.7);
  --texto: #10151c;
  --texto-fraco: #55636f;
}

body.tema-claro .card,
body.tema-claro .sidebar,
body.tema-claro .botao-menu,
body.tema-claro .botao-tema {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

body.tema-claro input,
body.tema-claro select {
  background: #f5f8fb;
  color: var(--texto);
}

body.tema-claro .botao:hover {
  color: #ffffff;
}

/* ---------- Tema preto absoluto ---------- */

body.tema-preto {
  --azul-neon: #00d9ff;
  --azul-neon-fraco: rgba(0, 217, 255, 0.25);
  --fundo: #000000;
  --fundo-card: #000000;
  --fundo-card-vidro: rgba(0, 0, 0, 0.75);
  --fundo-sidebar: #000000;
  --fundo-sidebar-vidro: rgba(0, 0, 0, 0.85);
  --texto: #f5f5f5;
  --texto-fraco: #8a8a8a;
}

/* ---------- Tema branco puro ---------- */

body.tema-branco {
  color-scheme: light;
  --azul-neon: #0077b6;
  --azul-neon-fraco: rgba(0, 119, 182, 0.2);
  --fundo: #ffffff;
  --fundo-card: #ffffff;
  --fundo-card-vidro: rgba(255, 255, 255, 0.92);
  --fundo-sidebar: #ffffff;
  --fundo-sidebar-vidro: rgba(255, 255, 255, 0.96);
  --texto: #0a0a0a;
  --texto-fraco: #6b7280;
}

body.tema-branco .card,
body.tema-branco .sidebar,
body.tema-branco .botao-menu,
body.tema-branco .botao-tema {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

body.tema-branco input,
body.tema-branco select {
  background: #f5f8fb;
  color: var(--texto);
}

/* ---------- Tema vidro transparente (bom em cima de papel de parede) ---------- */

body.tema-vidro {
  --azul-neon: #00d9ff;
  --azul-neon-fraco: rgba(0, 217, 255, 0.3);
  --fundo-card-vidro: rgba(14, 18, 28, 0.25);
  --fundo-sidebar-vidro: rgba(8, 12, 20, 0.25);
  --texto: #eaf6fb;
  --texto-fraco: #a9c5d1;
  --desfoque-sidebar: 30px;
  --desfoque-card: 34px;
}

/* ---------- Tema verde tecnológico ---------- */

body.tema-verde {
  --azul-neon: #39ff88;
  --azul-neon-fraco: rgba(57, 255, 136, 0.3);
  --texto: #e8fff0;
  --texto-fraco: #7fb897;
}

/* ---------- Tema estilo Apple (minimalista, cinza claro + acentos discretos) ---------- */

body.tema-apple {
  color-scheme: light;
  --azul-neon: #0071e3;
  --azul-neon-fraco: rgba(0, 113, 227, 0.18);
  --fundo: #f5f5f7;
  --fundo-card: #ffffff;
  --fundo-card-vidro: rgba(255, 255, 255, 0.4);
  --fundo-sidebar: #ffffff;
  --fundo-sidebar-vidro: rgba(255, 255, 255, 0.45);
  --texto: #1d1d1f;
  --texto-fraco: #6e6e73;
  --desfoque-sidebar: 28px;
  --desfoque-card: 26px;
}

body.tema-apple .card,
body.tema-apple .sidebar,
body.tema-apple .botao-menu,
body.tema-apple .botao-tema {
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

body.tema-apple .card {
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.05) 45%),
    var(--fundo-card-vidro);
}

body.tema-apple .card h2,
body.tema-apple .card h3 {
  color: var(--texto);
  text-shadow: none;
  font-weight: 600;
  letter-spacing: -0.01em;
}

body.tema-apple input,
body.tema-apple select {
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.5);
  color: var(--texto);
}

body.tema-apple input:focus,
body.tema-apple select:focus {
  box-shadow: 0 0 0 4px var(--azul-neon-fraco);
}

body.tema-apple .botao {
  background: rgba(0, 113, 227, 0.82);
  backdrop-filter: blur(14px) saturate(180%);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 980px;
  font-weight: 500;
  letter-spacing: normal;
  box-shadow: 0 4px 16px rgba(0, 113, 227, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

body.tema-apple .botao:hover {
  background: rgba(0, 119, 237, 0.92);
  box-shadow: 0 4px 20px rgba(0, 113, 227, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

body.tema-apple .botao-secundario {
  background: rgba(255, 255, 255, 0.3);
  color: var(--texto);
  border-color: rgba(255, 255, 255, 0.5);
}

body.tema-apple .botao-secundario:hover {
  background: rgba(255, 255, 255, 0.45);
  color: var(--texto);
}

.logo-topo {
  margin: 0;
  padding: 36px 16px 14px;
  display: flex;
  justify-content: center;
}

/* Logo num balãozinho arredondado: funciona em qualquer tema (o fundo preto da
   imagem vira parte do balão em vez de um bloco preto colado na barra). */
.logo-sidebar {
  display: block;
  box-sizing: border-box;
  width: 216px;
  padding: 8px 8px;
  margin: 0 auto;
  background: #000000;
  border-radius: 24px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14), 0 8px 22px rgba(0, 0, 0, 0.35);
}

.sidebar-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 14px;
  flex: 1;
}

.link-sidebar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  margin: 3px 0;
  color: var(--texto-fraco);
  text-decoration: none;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: 0.15s;
}

.icone-link {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.link-sidebar:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.10);
  color: var(--texto);
}

.link-sidebar.ativo {
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.02) 60%),
    color-mix(in srgb, var(--azul-neon) 14%, transparent);
  border-color: color-mix(in srgb, var(--azul-neon) 35%, transparent);
  color: var(--azul-neon);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 0 16px color-mix(in srgb, var(--azul-neon) 8%, transparent);
}

.sidebar-rodape {
  padding: 16px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.10);
  text-align: center;
}

.cartao-usuario-sidebar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 12px;
  margin-bottom: 12px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.01) 60%), rgba(5, 8, 16, 0.5);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10);
}

.nome-usuario {
  font-size: 17px;
  font-weight: 700;
  color: var(--texto);
  letter-spacing: 0.3px;
}

.sair {
  display: inline-block;
  color: var(--texto-fraco);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 20px;
  border: 1px solid transparent;
  border-radius: 20px;
  transition: 0.2s;
}

.sair:hover {
  color: var(--azul-neon);
  border-color: var(--azul-neon-fraco);
  background: color-mix(in srgb, var(--azul-neon) 6%, transparent);
}

.conteudo-principal {
  flex: 1;
  min-width: 0; /* sem isso o flex não encolhe abaixo da tabela e o celular dá zoom-out na página toda */
  padding: 36px 40px;
  max-width: 1000px;
  margin: 0 auto;
}

.grid-financeiro {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

@media (max-width: 760px) {
  .grid-financeiro {
    grid-template-columns: 1fr;
  }
}

/* ---------- Login (sem sidebar) ---------- */

.container {
  max-width: 960px;
  margin: 40px auto;
  padding: 0 20px;
}

.cena-fundo {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image: url("/static/cena/bg-desktop.jpg?v=3");
  background-size: cover;
  background-position: center;
}

@media (max-width: 760px) {
  .cena-fundo {
    background-image: url("/static/cena/bg-mobile.jpg?v=3");
  }
}

.cena-fundo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(3,6,12,0.55), rgba(3,6,12,0.4) 40%, rgba(3,6,12,0.65));
}

.cena-fazenda {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.marcador {
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 300px;
  padding: 12px;
  background: rgba(5, 8, 16, 0.55);
  border: 1px solid var(--azul-neon-fraco);
  border-radius: 16px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  pointer-events: auto;
  cursor: default;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.marcador:hover,
.marcador:focus-visible {
  transform: translateY(-2px) scale(1.03);
  border-color: var(--azul-neon);
  box-shadow: 0 0 26px color-mix(in srgb, var(--azul-neon) 25%, transparent);
  outline: none;
}

.marcador-foto {
  width: 86px;
  height: 86px;
  flex-shrink: 0;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--azul-neon-fraco);
}

.marcador-foto img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.marcador-texto {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.marcador-nome {
  font-size: 12px;
  font-weight: 600;
  color: var(--texto);
  letter-spacing: 0.3px;
}

.marcador-status {
  font-size: 11px;
  color: var(--texto-fraco);
  display: flex;
  align-items: center;
  gap: 6px;
}

.marcador-status .valor-grande {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--azul-neon);
}

.marcador-status .status-ligado { display: none; color: #4dffa0; }
.marcador-status .status-desligado { display: inline; }
.marcador:hover .status-ligado,
.marcador:focus-visible .status-ligado { display: inline; }
.marcador:hover .status-desligado,
.marcador:focus-visible .status-desligado { display: none; }

.led {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #ff3b3b;
  box-shadow: 0 0 6px #ff3b3b;
}

.marcador:hover .led,
.marcador:focus-visible .led {
  background: #2bff6a;
  box-shadow: 0 0 8px #2bff6a;
}

.barra-caixa {
  position: relative;
  width: 100%;
  height: 7px;
  margin-top: 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.barra-caixa-preenchimento {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 50%;
  border-radius: 4px;
  background: linear-gradient(90deg, #0077ff, #4dd8ff, #0077ff);
  background-size: 200% 100%;
  transition: height 4.5s ease-in-out;
  animation: brilho-agua 3s linear infinite;
}

@keyframes brilho-agua {
  0% { background-position: 0% 0%; }
  100% { background-position: 200% 0%; }
}

.marcador-painel {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.25s ease, opacity 0.25s ease;
}

.marcador:hover .marcador-painel,
.marcador:focus-visible .marcador-painel {
  max-height: 90px;
  opacity: 1;
  margin-top: 4px;
}

.painel-linha {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 11px;
  color: var(--texto-fraco);
}

.painel-linha b {
  color: var(--azul-neon);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 760px) {
  .cena-fazenda {
    position: static;
    margin: 18px auto 0;
    width: fit-content;
    max-width: 100%;
  }
  .marcador { max-width: 310px; padding: 10px; gap: 10px; }
  .marcador-foto { width: 64px; height: 64px; }

  .card-login { padding: 26px 22px; }
  .logo-login { max-width: 210px; margin-bottom: 4px; }
  .subtitulo-login { margin: 2px 0 18px; }
  .form-login input { margin-bottom: 14px; }
  .form-login .campo-senha { margin-bottom: 14px; }
}

.legenda-3d {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  margin-top: 22px;
  color: var(--texto-fraco);
  font-size: 12px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  background: rgba(5, 8, 16, 0.5);
  border: 1px solid var(--azul-neon-fraco);
  border-radius: 999px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: none;
  opacity: 0;
  animation: legenda3dEntrar 1.2s ease 0.5s forwards;
}

.ponto-vivo {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--azul-neon);
  box-shadow: 0 0 8px var(--azul-neon);
  animation: piscarPonto 2s ease-in-out infinite;
}

@keyframes piscarPonto {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

@keyframes legenda3dEntrar {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 640px) {
  .legenda-3d { font-size: 10px; padding: 7px 14px; margin-top: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .ponto-vivo { animation: none; }
}

.wrapper-login {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.card-login {
  width: 100%;
  max-width: 380px;
  background: #000;
  border: 1px solid var(--azul-neon-fraco);
  border-radius: 22px;
  padding: 40px 34px;
  box-shadow: 0 0 40px color-mix(in srgb, var(--azul-neon) 10%, transparent);
  text-align: center;
}

.subtitulo-login {
  font-family: "Orbitron", "Segoe UI", sans-serif;
  font-weight: 600;
  color: var(--azul-neon);
  font-size: 18px;
  letter-spacing: 4px;
  text-transform: uppercase;
  text-shadow: 0 0 12px var(--azul-neon-fraco), 0 0 2px var(--azul-neon);
  margin: 6px 0 30px;
}

.form-login {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: left;
}

.form-login label {
  font-size: 12px;
  color: var(--texto-fraco);
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.form-login input {
  margin-bottom: 20px;
}

.form-login .campo-senha {
  margin-bottom: 20px;
}

.form-login .campo-senha input {
  margin-bottom: 0;
  width: 100%;
}

.botao-ios {
  margin-top: 14px;
  padding: 14px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(180deg, #00e5ff, #00a0d6);
  color: #001018;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  box-shadow: 0 6px 20px color-mix(in srgb, var(--azul-neon) 35%, transparent);
  transition: transform 0.15s, box-shadow 0.15s;
}

.botao-ios:hover {
  box-shadow: 0 8px 26px color-mix(in srgb, var(--azul-neon) 50%, transparent);
}

.botao-ios:active {
  transform: scale(0.97);
}

.logo-login {
  display: block;
  margin: 0 auto 8px;
  max-width: 100%;
  height: auto;
}

/* ---------- Selos (ADM / Cliente) ---------- */

.selo {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
}

.selo-pequeno {
  padding: 2px 8px;
  font-size: 9px;
  letter-spacing: 0.5px;
  opacity: 0.85;
}

.selo-admin {
  background: rgba(255, 193, 7, 0.15);
  color: #ffc107;
  border: 1px solid rgba(255, 193, 7, 0.5);
}

.selo-cliente {
  background: color-mix(in srgb, var(--azul-neon) 15%, transparent);
  color: var(--azul-neon);
  border: 1px solid var(--azul-neon-fraco);
}

.selo-online {
  background: rgba(76, 217, 100, 0.15);
  color: #4cd964;
  border: 1px solid rgba(76, 217, 100, 0.5);
}

.selo-offline {
  background: rgba(255, 107, 107, 0.15);
  color: #ff6b6b;
  border: 1px solid rgba(255, 107, 107, 0.5);
}

.badge-contagem {
  margin-left: auto;
  background: #ff6b6b;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ---------- Cards e formulários ---------- */

.card {
  position: relative;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.015) 45%),
    var(--fundo-card-vidro);
  backdrop-filter: blur(var(--desfoque-card)) saturate(170%);
  -webkit-backdrop-filter: blur(var(--desfoque-card)) saturate(170%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 28px;
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.28), 0 0 24px color-mix(in srgb, var(--azul-neon) 5%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

/* ---------- Modal de histórico (popup ao clicar num valor da página inicial) ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}

.modal-overlay.aberto {
  display: flex;
  animation: modal-abrir-fundo 0.15s ease;
}

.modal-overlay.aberto .modal-painel {
  animation: modal-abrir-painel 0.18s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes modal-abrir-fundo {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modal-abrir-painel {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.modal-painel {
  max-width: 640px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  margin-bottom: 0;
}

.modal-painel-cabecalho {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.modal-painel-cabecalho h4 {
  margin: 0;
}

.modal-fechar {
  background: none;
  border: none;
  color: var(--texto-fraco);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

.valor-destaque[role="button"] {
  cursor: pointer;
  transition: transform 0.15s;
}

.valor-destaque[role="button"]:hover {
  transform: translateY(-2px);
}

.card h2, .card h3 {
  color: var(--azul-neon);
  margin-top: 0;
  text-shadow: 0 0 6px var(--azul-neon-fraco);
  text-align: center;
}

.card-interno {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 18px;
  padding: 16px 18px;
}

label {
  display: block;
  margin: 12px 0 4px;
  color: var(--texto-fraco);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

input, select {
  width: 100%;
  padding: 11px 14px;
  background: #0f1622;
  border: 1px solid var(--azul-neon-fraco);
  border-radius: 12px;
  color: var(--texto);
  font-size: 14px;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--azul-neon);
  box-shadow: 0 0 10px var(--azul-neon-fraco);
}

input:disabled {
  opacity: 0.55;
}

/* ---------- Botões ---------- */

.botao {
  display: inline-block;
  padding: 11px 22px;
  background: transparent;
  border: 1px solid var(--azul-neon);
  color: var(--azul-neon);
  border-radius: 14px;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 1px;
  cursor: pointer;
  text-decoration: none;
  transition: 0.2s;
}

.botao:hover {
  background: var(--azul-neon);
  color: #001018;
  box-shadow: 0 0 16px var(--azul-neon);
}

.botao-secundario {
  border-color: var(--texto-fraco);
  color: var(--texto-fraco);
}

.botao-perigo {
  border-color: #ff6b6b;
  color: #ff6b6b;
}

.botao-perigo:hover {
  background: #ff6b6b;
  color: #1a0505;
  box-shadow: 0 0 12px #ff6b6b;
}

.linha-botoes {
  display: flex;
  gap: 12px;
  margin-top: 18px;
}

.linha-botoes .botao {
  flex: 0 0 auto;
  min-width: 110px;
  text-align: center;
}

/* ---------- Senha com olhinho ---------- */

.campo-senha {
  position: relative;
}

.campo-senha input {
  padding-right: 36px;
}

/* esconde o olhinho nativo do Edge/IE pra nao sobrepor o nosso .olho-senha */
.campo-senha input::-ms-reveal,
.campo-senha input::-ms-clear {
  display: none;
}

.olho-senha {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  opacity: 0.7;
  user-select: none;
}

.olho-senha:hover { opacity: 1; }

/* ---------- Cartões de usuário / hidrômetro ---------- */

.cartao-usuario {
  border-top: 1px solid color-mix(in srgb, var(--azul-neon) 15%, transparent);
  padding-top: 18px;
  margin-top: 10px;
}

.cartao-usuario:first-of-type {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}

.linha-editavel {
  border-top: 1px solid color-mix(in srgb, var(--azul-neon) 10%, transparent);
  padding-top: 14px;
  margin-top: 4px;
  padding-bottom: 8px;
}

.linha-checkboxes {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.opcao-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--texto-fraco);
  font-size: 13px;
  text-transform: none;
  letter-spacing: normal;
  cursor: pointer;
}

.opcao-checkbox input {
  width: auto;
  accent-color: var(--azul-neon);
}

.linha-form {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.linha-form > div { flex: 1; min-width: 160px; }

.hidrometros-do-usuario {
  margin-top: 14px;
  padding: 14px;
  background: color-mix(in srgb, var(--azul-neon) 4%, transparent);
  border-radius: 8px;
}

.lista-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: color-mix(in srgb, var(--azul-neon) 10%, transparent);
  border: 1px solid var(--azul-neon-fraco);
  border-radius: 20px;
  padding: 4px 6px 4px 12px;
  font-size: 13px;
}

.tag-remover {
  background: none;
  border: none;
  color: var(--texto-fraco);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 50%;
}

.tag-remover:hover {
  color: #ff6b6b;
  background: rgba(255, 107, 107, 0.15);
}

.texto-fraco {
  color: var(--texto-fraco);
  font-size: 13px;
}

.cartao-hidrometro {
  text-align: center;
}

.nome-hidrometro {
  color: var(--texto);
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 4px;
}

.nome-destaque {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 14px;
  padding: 10px 26px;
  border: 1px solid #ff6b6b;
  border-radius: 999px;
  color: var(--azul-neon);
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  text-shadow: 0 0 10px var(--azul-neon-fraco);
  box-shadow: 0 0 14px rgba(255, 107, 107, 0.25);
}

.rodape-cartao {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
}

.painel-valores {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 14px;
}

.botao-recarregar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  padding: 10px 22px;
  background: color-mix(in srgb, var(--azul-neon) 8%, transparent);
  border: 1px solid var(--azul-neon);
  color: var(--azul-neon);
  border-radius: 14px;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: 0.2s;
}

.botao-recarregar:hover {
  background: var(--azul-neon);
  color: #001018;
  box-shadow: 0 0 16px var(--azul-neon);
}

.botao-recarregar-flutuante {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--fundo-sidebar);
  border: 1px solid var(--azul-neon-fraco);
  color: var(--azul-neon);
  border-radius: 12px;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  transition: 0.2s;
}

.botao-recarregar-flutuante:hover {
  background: var(--azul-neon);
  color: #001018;
  box-shadow: 0 0 16px var(--azul-neon);
}

.botao-recarregar-flutuante .icone-link {
  width: 15px;
  height: 15px;
}

.valor-destaque {
  background: color-mix(in srgb, var(--azul-neon) 6%, transparent);
  border: 1px solid var(--azul-neon-fraco);
  border-radius: 16px;
  padding: 12px 20px;
  min-width: 130px;
  text-align: center;
}

.valor-numero {
  display: block;
  font-size: 24px;
  font-weight: 700;
  color: var(--azul-neon);
  text-shadow: 0 0 8px var(--azul-neon-fraco);
}

.valor-rotulo {
  display: block;
  font-size: 11px;
  color: var(--texto-fraco);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

/* ---------- Tabela de relatório ---------- */

table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  margin-top: 20px;
}

th, td {
  padding: 10px 12px;
  text-align: center;
  border-bottom: 1px solid color-mix(in srgb, var(--azul-neon) 15%, transparent);
  font-size: 14px;
}

th {
  color: var(--azul-neon);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 1px;
}

/* Relatório Detalhado tem muitas colunas: no computador a página usa quase
   toda a largura do navegador (as outras páginas continuam em 1000px) */
@media (min-width: 761px) {
  .conteudo-principal:has(.card-largo) { max-width: 1600px; padding-left: 24px; padding-right: 24px; }
  .card-largo { overflow-x: auto; }            /* notebook pequeno: rola em vez de cortar */
  .card-largo table { table-layout: auto; }    /* coluna do tamanho do conteúdo */
  .card-largo table th, .card-largo table td { padding: 10px 8px; }
  .card-largo table td { white-space: nowrap; } /* data e hora numa linha só */
}

/* Barrinha de % do quadrimestre (Relatório Detalhado) */
.barra-quad {
  height: 6px;
  min-width: 60px;
  margin: 0 auto 4px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}
.barra-quad span {
  display: block;
  height: 100%;
  border-radius: 3px;
}

tr.total td {
  font-weight: 700;
  color: var(--azul-neon);
  border-top: 1px solid var(--azul-neon);
}

/* No celular a tabela cabe na tela sem arrastar: margens menores, colunas do
   tamanho do conteúdo e títulos quebrando com hífen (FUNCIONA-MENTO).
   overflow-x fica só de reserva pra tabela muito larga. Desktop não muda. */
@media (max-width: 760px) {
  .conteudo-principal { padding: 64px 10px 24px; }
  .card { padding: 18px 12px; border-radius: 22px; overflow-x: auto; }
  .card table { width: 100%; table-layout: auto; }
  .card table th,
  .card table td { padding: 8px 3px; font-size: 11.5px; }
  .card table th { font-size: 10px; letter-spacing: 0.3px; -webkit-hyphens: auto; hyphens: auto; overflow-wrap: anywhere; }
  .card table td { white-space: nowrap; }
  /* iOS: campo de data tem largura mínima própria e vazava do card */
  input[type="date"] { -webkit-appearance: none; appearance: none; min-width: 0; display: block; }
}

.erro {
  color: #ff6b6b;
  margin: 10px 0;
}

/* ---------- Dropdown de exportar (PDF / Excel) ---------- */
.dropdown-exportar {
  position: relative;
  display: inline-block;
}

.menu-exportar {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 160px;
  background: var(--fundo-card);
  border: 1px solid var(--azul-neon-fraco);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  z-index: 50;
}

.menu-exportar.aberto {
  display: block;
}

.menu-exportar button {
  display: block;
  width: 100%;
  padding: 10px 16px;
  background: transparent;
  border: none;
  color: var(--texto);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: 0.15s;
}

.menu-exportar button:hover {
  background: var(--azul-neon-fraco);
  color: var(--azul-neon);
}

/* Botões flutuantes de contato (WhatsApp/Instagram), mesmo estilo do site marceloautomacoesgo.com.br */
.float-btn {
  position: fixed;
  right: 30px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: transform 0.3s;
  text-decoration: none;
}

.float-btn:hover {
  transform: scale(1.1);
}

.float-btn svg {
  width: 32px;
  height: 32px;
  fill: #fff;
}

.whatsapp-btn {
  bottom: 30px;
  background: #25d366;
  box-shadow: 0 4px 30px rgba(37, 211, 102, 0.714);
}

.instagram-btn {
  bottom: 100px;
  background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285aeb 90%);
  box-shadow: 0 4px 20px rgba(214, 36, 159, 0.5);
}

.float-tooltip {
  position: fixed;
  right: 100px;
  color: #fff;
  padding: 8px 15px;
  border-radius: 20px;
  font-size: 13.6px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 9998;
  pointer-events: none;
}

.whatsapp-tooltip {
  bottom: 42px;
  background: #25d366;
}

.instagram-tooltip {
  bottom: 112px;
  background: #d6249f;
}

.whatsapp-btn:hover + .whatsapp-tooltip,
.instagram-btn:hover + .instagram-tooltip {
  opacity: 1;
}

@media (max-width: 480px) {
  .float-btn {
    width: 52px;
    height: 52px;
    right: 16px;
  }
  .whatsapp-btn { bottom: 16px; }
  .instagram-btn { bottom: 78px; }
  .float-tooltip { display: none; }
}

/* ---------- Anéis de Consumo do Quadrimestre (Página Inicial) ---------- */
.aneis-quadrimestre {
  display: flex;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
  margin: 14px 0 4px;
}
.anel-quadrimestre {
  position: relative;
  display: flex;
}
.anel-botao {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: inherit;
  font: inherit;
}
.anel-svg {
  width: 96px;
  height: 96px;
  transform: rotate(-90deg);
}
.anel-trilho {
  fill: none;
  stroke: rgba(255, 255, 255, 0.12);
  stroke-width: 10;
}
.anel-progresso {
  fill: none;
  stroke: var(--cor-anel, var(--azul-neon));
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 100 100;
  stroke-dashoffset: calc(100 - var(--pct, 0));
  transition: stroke-dashoffset 0.8s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.anel-svg-tempo .anel-progresso {
  stroke: #4cd964;
}
.anel-valor {
  position: absolute;
  top: 34px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
}
.anel-rotulo {
  font-size: 11px;
  color: var(--texto-fraco, #7fa7b8);
  text-align: center;
  max-width: 110px;
}
.aviso-quadrimestre {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  margin: 6px 0 0;
}
.modal-painel-quadri {
  max-width: 380px;
}
.corpo-quadrimestre {
  text-align: center;
  font-size: 14px;
  line-height: 1.9;
  color: #fff;
  padding: 6px 0 4px;
}

/* =====================================================================
   Página inicial — Painel de controle (design A)
   Tudo escopado em .inicio-a: não afeta nenhuma outra tela.
   Usa as variáveis do tema ativo, então funciona em todos os temas.
   ===================================================================== */

.inicio-a .card { --st: var(--azul-neon); }

/* ---- Cabeçalho (hero) ---- */
.inicio-a .inicio-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 30px 34px;
  text-align: left;
  background:
    radial-gradient(720px 220px at 0% 0%, color-mix(in srgb, var(--azul-neon) 22%, transparent), transparent 70%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.015) 55%),
    var(--fundo-card-vidro);
}
.inicio-a .inicio-hero h3 {
  margin: 0 0 6px;
  text-align: left;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--texto);
  text-shadow: none;
}
.inicio-a .inicio-hero p { margin: 0; }
.inicio-a .inicio-ao-vivo::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 9px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6);
  animation: inicio-pulso 2s infinite;
  vertical-align: 1px;
}
.inicio-a .inicio-chip {
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--azul-neon);
  background: color-mix(in srgb, var(--azul-neon) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--azul-neon) 35%, transparent);
}
@keyframes inicio-pulso {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55); }
  70% { box-shadow: 0 0 0 9px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

/* ---- Cartão de cada poço (cor muda com online/offline) ---- */
.inicio-a .cartao-hidrometro:has([id^="status-conexao"].selo-online) { --st: #34d399; }
.inicio-a .cartao-hidrometro:has([id^="status-conexao"].selo-offline) { --st: #f87171; }

.inicio-a .cartao-hidrometro,
.inicio-a .cartao-clima {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  padding: 28px 30px 24px;
  border-radius: 30px;
  text-align: left;
  background:
    radial-gradient(900px 260px at 0% 0%, color-mix(in srgb, var(--st) 13%, transparent), transparent 62%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.012) 50%),
    var(--fundo-card-vidro);
  border: 1px solid color-mix(in srgb, var(--st) 30%, rgba(255, 255, 255, 0.08));
  box-shadow:
    0 18px 50px rgba(0, 0, 0, 0.32),
    0 0 70px color-mix(in srgb, var(--st) 9%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.inicio-a .cartao-hidrometro::before,
.inicio-a .cartao-clima::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--st), transparent 72%);
}

.inicio-a .nome-hidrometro {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-align: left;
}
.inicio-a .nome-hidrometro::before {
  content: "";
  flex: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--st);
  box-shadow: 0 0 14px var(--st);
}
.inicio-a .cartao-hidrometro:has([id^="status-conexao"].selo-online) .nome-hidrometro::before {
  animation: inicio-pulso 2s infinite;
}

/* ---- Com anéis do quadrimestre: anéis à esquerda, números à direita ---- */
.inicio-a .cartao-hidrometro:has(.aneis-quadrimestre) {
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 30px;
}
.inicio-a .cartao-hidrometro > * { grid-column: 1 / -1; }
.inicio-a .cartao-hidrometro:has(.aneis-quadrimestre) > .aneis-quadrimestre { grid-column: 1; grid-row: 2; align-self: stretch; align-content: center; align-items: center; }
.inicio-a .cartao-hidrometro:has(.aneis-quadrimestre) > .aviso-quadrimestre { grid-column: 1 / -1; grid-row: 3; }
.inicio-a .cartao-hidrometro:has(.aneis-quadrimestre) > .painel-valores { grid-column: 2; grid-row: 2; }
@media (max-width: 980px) {
  .inicio-a .cartao-hidrometro:has(.aneis-quadrimestre) { grid-template-columns: minmax(0, 1fr); }
  .inicio-a .cartao-hidrometro:has(.aneis-quadrimestre) > .aneis-quadrimestre,
  .inicio-a .cartao-hidrometro:has(.aneis-quadrimestre) > .aviso-quadrimestre,
  .inicio-a .cartao-hidrometro:has(.aneis-quadrimestre) > .painel-valores { grid-column: 1; grid-row: auto; }
}

.inicio-a .aneis-quadrimestre {
  margin: 0;
  gap: 26px;
  padding: 20px 26px;
  border-radius: 24px;
  background: color-mix(in srgb, var(--texto) 4%, transparent);
  border: 1px solid color-mix(in srgb, var(--texto) 10%, transparent);
}
.inicio-a .anel-svg {
  width: 118px;
  height: 118px;
  filter: drop-shadow(0 0 7px color-mix(in srgb, var(--cor-anel, var(--azul-neon)) 55%, transparent));
}
.inicio-a .anel-svg-tempo { filter: drop-shadow(0 0 7px rgba(76, 217, 100, 0.5)); }
.inicio-a .anel-trilho { stroke: color-mix(in srgb, var(--texto) 14%, transparent); }
.inicio-a .anel-valor { top: 46px; font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.inicio-a .anel-rotulo { font-size: 12px; max-width: 124px; margin-top: 4px; }
.inicio-a .aviso-quadrimestre { text-align: left; margin: 0; font-size: 13px; }

/* ---- Cartões de valores ---- */
.inicio-a .painel-valores {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(176px, 1fr));
  gap: 14px;
  margin: 0;
  justify-content: stretch;
}
.inicio-a .valor-destaque {
  --c: var(--azul-neon);
  position: relative;
  min-width: 0;
  padding: 20px 20px 18px;
  text-align: left;
  border-radius: 22px;
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--c) 13%, rgba(255, 255, 255, 0.04)), rgba(255, 255, 255, 0.02) 75%);
  border: 1px solid color-mix(in srgb, var(--c) 26%, rgba(255, 255, 255, 0.07));
  transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
}
.inicio-a .valor-destaque[data-metrica]::before {
  content: "";
  position: absolute;
  top: 16px;
  right: 16px;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--ic) center / 20px no-repeat, color-mix(in srgb, var(--c) 17%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 30%, transparent);
}
.inicio-a .valor-numero {
  margin-top: 14px;
  padding-right: 6px;
  font-size: 36px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
  color: var(--texto);
  text-shadow: none;
}
.inicio-a .valor-rotulo {
  margin-top: 8px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
}
.inicio-a .valor-destaque[role="button"]:hover {
  transform: translateY(-3px);
  border-color: var(--c);
  box-shadow: 0 16px 34px color-mix(in srgb, var(--c) 24%, transparent);
}
.inicio-a .valor-destaque[role="button"]:focus-visible { outline: 2px solid var(--c); outline-offset: 2px; }

/* Barra de nível (usa --pct, atualizado ao vivo pelo status-ao-vivo.js) */
.inicio-a .valor-destaque[data-metrica="nivel"][style*="--pct"] {
  padding-bottom: 38px;
  background:
    linear-gradient(90deg, var(--c) var(--pct, 0%), rgba(255, 255, 255, 0.1) var(--pct, 0%)) no-repeat left 20px bottom 17px / calc(100% - 40px) 8px,
    linear-gradient(160deg, color-mix(in srgb, var(--c) 13%, rgba(255, 255, 255, 0.04)), rgba(255, 255, 255, 0.02) 75%);
}

/* Cores dos cardzinhos: tudo na cor do Hidrômetro; só vazão (com vazão) e temperatura mudam */
.inicio-a .valor-destaque { --c: #22d3ee; }
.inicio-a .valor-destaque[data-metrica="volume_total"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2322d3ee' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 14l4-4'/%3E%3Cpath d='M3.34 19a10 10 0 1 1 17.32 0'/%3E%3C/svg%3E"); }
.inicio-a .valor-destaque[data-metrica="vazao_media"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2322d3ee' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 12h-4l-3 9L9 3l-3 9H2'/%3E%3C/svg%3E"); }
.inicio-a .valor-destaque[data-metrica="consumo"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2322d3ee' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 22a7 7 0 0 0 7-7c0-2-1-3.9-3-5.5s-3.5-4-4-6.5c-.5 2.5-2 4.9-4 6.5C6 11.1 5 13 5 15a7 7 0 0 0 7 7z'/%3E%3C/svg%3E"); }
.inicio-a .valor-destaque[data-metrica="consumo_mensal"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2322d3ee' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E"); }
.inicio-a .valor-destaque[data-metrica="horas_funcionamento"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2322d3ee' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 6v6l4 2'/%3E%3C/svg%3E"); }
.inicio-a .valor-destaque[data-metrica="temperatura"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2322d3ee' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 4v10.54a4 4 0 1 1-4 0V4a2 2 0 0 1 4 0Z'/%3E%3C/svg%3E"); }
.inicio-a .valor-destaque[data-metrica="nivel"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2322d3ee' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 6c.6.5 1.2 1 2.5 1C7 7 7 5 9.5 5c2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1'/%3E%3Cpath d='M2 12c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1'/%3E%3Cpath d='M2 18c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1'/%3E%3C/svg%3E"); }
.inicio-a .valor-destaque[data-metrica="vazao_media"][data-cor="vermelho"] { --c: #f87171; --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f87171' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 12h-4l-3 9L9 3l-3 9H2'/%3E%3C/svg%3E"); }
.inicio-a .valor-destaque[data-metrica="temperatura"][data-cor="amarelo"] { --c: #fbbf24; --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fbbf24' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 4v10.54a4 4 0 1 1-4 0V4a2 2 0 0 1 4 0Z'/%3E%3C/svg%3E"); }
.inicio-a .valor-destaque[data-metrica="temperatura"][data-cor="vermelho"] { --c: #f87171; --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f87171' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 4v10.54a4 4 0 1 1-4 0V4a2 2 0 0 1 4 0Z'/%3E%3C/svg%3E"); }

/* ---- Rodapé (leitura + selos) ---- */
.inicio-a .rodape-cartao {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0;
  padding-top: 18px;
  border-top: 1px solid color-mix(in srgb, var(--texto) 10%, transparent);
}
.inicio-a .rodape-cartao > .texto-fraco { order: 2; flex: 1 1 100%; text-align: center; font-size: 13px; }
.inicio-a .rodape-cartao .selo { padding: 6px 14px; font-size: 12px; }
.inicio-a .switch-caixa { margin: 0; }

@media (max-width: 600px) {
  .inicio-a .cartao-hidrometro, .inicio-a .cartao-clima { padding: 22px 18px 20px; border-radius: 24px; }
  .inicio-a .nome-hidrometro { font-size: 24px; }
  .inicio-a .valor-numero { font-size: 30px; }
  .inicio-a .inicio-hero { padding: 24px 22px; }
  .inicio-a .inicio-hero h3 { font-size: 26px; }
}

/* =====================================================================
   Página inicial — variantes de layout (B e C) e ajuste do Liquid Glass.
   A é a base (.inicio-a); B e C só sobrescrevem o layout.
   ===================================================================== */

/* ---- Liquid Glass / Vidro: cards mais definidos (antes se misturavam ao fundo) ---- */
body.tema-apple .inicio-a .cartao-hidrometro,
body.tema-apple .inicio-a .cartao-clima {
  background:
    radial-gradient(900px 260px at 0% 0%, color-mix(in srgb, var(--st) 14%, transparent), transparent 62%),
    rgba(255, 255, 255, 0.82);
  border: 1px solid color-mix(in srgb, var(--st) 38%, rgba(0, 0, 0, 0.1));
  box-shadow: 0 14px 40px rgba(20, 30, 50, 0.22), 0 2px 6px rgba(20, 30, 50, 0.12);
}
body.tema-apple .inicio-a .valor-destaque {
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 16%, #ffffff), #ffffff 80%);
  border: 1px solid color-mix(in srgb, var(--c) 34%, rgba(0, 0, 0, 0.1));
  box-shadow: 0 2px 8px rgba(20, 30, 50, 0.08);
}
body.tema-apple .inicio-a .inicio-hero {
  background: radial-gradient(720px 220px at 0% 0%, color-mix(in srgb, var(--azul-neon) 24%, transparent), transparent 70%), rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 14px 40px rgba(20, 30, 50, 0.2);
}
body.tema-vidro .inicio-a .cartao-hidrometro,
body.tema-vidro .inicio-a .cartao-clima {
  background:
    radial-gradient(900px 260px at 0% 0%, color-mix(in srgb, var(--st) 13%, transparent), transparent 62%),
    rgba(10, 16, 28, 0.62);
}

/* =====================================================================
   Totais no cabeçalho (só admin)
   ===================================================================== */
.inicio-a .inicio-stats { display: flex; gap: 12px; flex-wrap: wrap; }
.inicio-a .stat-item {
  --c: var(--azul-neon);
  min-width: 100px;
  padding: 14px 20px 12px;
  border-radius: 20px;
  text-align: center;
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 16%, rgba(255, 255, 255, 0.04)), rgba(255, 255, 255, 0.02) 80%);
  border: 1px solid color-mix(in srgb, var(--c) 34%, rgba(255, 255, 255, 0.08));
}
.inicio-a .stat-num {
  display: block;
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
  color: var(--texto);
}
.inicio-a .stat-rot {
  display: block;
  margin-top: 6px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--texto-fraco);
}
body.tema-apple .inicio-a .stat-item {
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 16%, #ffffff), #ffffff 80%);
  border: 1px solid color-mix(in srgb, var(--c) 36%, rgba(0, 0, 0, 0.1));
}

/* =====================================================================
   Tamanho COMPACTO da Página Inicial (classe inicio-c)
   Cartão vertical e menor, sempre um poço por linha (nunca dois lado a lado):
   nome, anéis, valores, selos centralizados e "última leitura" por baixo.
   ===================================================================== */
.inicio-a.inicio-c .cartao-hidrometro.cartao-hidrometro {
  margin: 0 0 20px;
  padding: 24px 22px 18px;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr);
  text-align: center;
}
.inicio-a.inicio-c .cartao-hidrometro.cartao-hidrometro > * { grid-column: 1; grid-row: auto; }
.inicio-a.inicio-c .nome-hidrometro { justify-content: center; font-size: 24px; }
.inicio-a.inicio-c .aneis-quadrimestre { justify-self: center; padding: 0; gap: 20px; background: none; border: 0; }
.inicio-a.inicio-c .anel-svg { width: 84px; height: 84px; }
.inicio-a.inicio-c .anel-valor { top: 31px; font-size: 17px; }
.inicio-a.inicio-c .anel-rotulo { font-size: 11px; max-width: 96px; }
.inicio-a.inicio-c .aviso-quadrimestre { text-align: center; }

.inicio-a.inicio-c .painel-valores { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.inicio-a.inicio-c .painel-valores > .valor-destaque { flex: 0 1 232px; }
.inicio-a.inicio-c .valor-destaque {
  min-height: 64px;
  padding: 12px 14px 12px 58px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: left;
}
.inicio-a.inicio-c .valor-destaque[data-metrica]::before {
  top: 50%;
  right: auto;
  left: 13px;
  width: 34px;
  height: 34px;
  transform: translateY(-50%);
  background-size: 18px, auto;
}
.inicio-a.inicio-c .valor-numero { font-size: 23px; margin-top: 0; padding: 0; }
.inicio-a.inicio-c .valor-rotulo { font-size: 10px; margin-top: 3px; letter-spacing: 0.06em; }
.inicio-a.inicio-c .valor-destaque[data-metrica="nivel"][style*="--pct"] {
  padding-bottom: 22px;
  background:
    linear-gradient(90deg, var(--c) var(--pct, 0%), rgba(255, 255, 255, 0.1) var(--pct, 0%)) no-repeat left 14px bottom 8px / calc(100% - 28px) 5px,
    linear-gradient(160deg, color-mix(in srgb, var(--c) 13%, rgba(255, 255, 255, 0.04)), rgba(255, 255, 255, 0.02) 75%);
}

.inicio-a.inicio-c .rodape-cartao { justify-content: center; padding-top: 14px; gap: 8px; }
.inicio-a.inicio-c .rodape-cartao > .texto-fraco { order: 2; flex: 1 1 100%; text-align: center; font-size: 12.5px; }
.inicio-a.inicio-c .switch-caixa { justify-self: center; }

/* =====================================================================
   Celular: tudo centralizado e compacto. Anéis em cima e cardzinhos
   quadrados do mesmo tamanho, DOIS por linha (página bem mais curta).
   Vale para Expandido e Compacto.
   ===================================================================== */
@media (max-width: 600px) {
  .inicio-a .cartao-hidrometro.cartao-hidrometro { gap: 12px; padding: 20px 14px 16px; }
  .inicio-a .nome-hidrometro { justify-content: center; font-size: 22px; }

  .inicio-a .aneis-quadrimestre { justify-self: center; padding: 0; gap: 18px; background: none; border: 0; }
  .inicio-a .anel-svg { width: 92px; height: 92px; }
  .inicio-a .anel-valor { top: 35px; font-size: 18px; }

  .inicio-a .painel-valores,
  .inicio-a.inicio-c .painel-valores { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .inicio-a .painel-valores > .valor-destaque,
  .inicio-a.inicio-c .painel-valores > .valor-destaque { flex: none; max-width: none; }
  .inicio-a .painel-valores > .valor-destaque:last-child:nth-child(odd) { grid-column: 1 / -1; justify-self: center; width: calc(50% - 5px); }
  .inicio-a .valor-destaque,
  .inicio-a.inicio-c .valor-destaque {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-width: 0;
    min-height: 104px;
    padding: 12px 8px;
    border-radius: 16px;
  }
  .inicio-a .valor-destaque[data-metrica]::before,
  .inicio-a.inicio-c .valor-destaque[data-metrica]::before {
    position: static;
    flex: none;
    display: block;
    width: 28px;
    height: 28px;
    margin: 0 auto 6px;
    transform: none;
    border-radius: 9px;
    background-size: 15px, auto;
  }
  .inicio-a .valor-numero,
  .inicio-a.inicio-c .valor-numero { margin: 0; padding: 0; font-size: 22px; text-align: center; }
  .inicio-a .valor-rotulo,
  .inicio-a.inicio-c .valor-rotulo { margin-top: 4px; font-size: 9.5px; letter-spacing: 0.05em; text-align: center; }
  .inicio-a .valor-destaque[data-metrica="nivel"][style*="--pct"],
  .inicio-a.inicio-c .valor-destaque[data-metrica="nivel"][style*="--pct"] {
    padding-bottom: 20px;
    background:
      linear-gradient(90deg, var(--c) var(--pct, 0%), rgba(255, 255, 255, 0.1) var(--pct, 0%)) no-repeat left 12px bottom 8px / calc(100% - 24px) 5px,
      linear-gradient(160deg, color-mix(in srgb, var(--c) 13%, rgba(255, 255, 255, 0.04)), rgba(255, 255, 255, 0.02) 75%);
  }

  .inicio-a .rodape-cartao { justify-content: center; padding-top: 12px; gap: 8px; }
  .inicio-a .rodape-cartao > .texto-fraco { order: 2; flex: 1 1 100%; text-align: center; font-size: 12px; }
  .inicio-a .switch-caixa { justify-self: center; }
}

/* ---- Página Inicial (admin): contador "Offline" clicável + balão com a lista ---- */
.stat-clicavel { cursor: pointer; font: inherit; color: inherit; appearance: none; transition: transform .15s, box-shadow .15s; }
.stat-clicavel:hover { transform: translateY(-2px); box-shadow: 0 8px 22px color-mix(in srgb, var(--c, #f87171) 28%, transparent); }
.stat-clicavel:focus-visible { outline: 2px solid var(--c, #f87171); outline-offset: 2px; }
.lista-offline { list-style: none; margin: 10px 0 0; padding: 0; max-height: 55vh; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.lista-offline li { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-radius: 14px; text-align: left;
  background: color-mix(in srgb, #f87171 10%, transparent); border: 1px solid color-mix(in srgb, #f87171 30%, transparent); }
.lista-offline li small { color: var(--texto-fraco); font-size: 12px; }
.lista-offline li.lista-offline-vazia { align-items: center; text-align: center; background: color-mix(in srgb, #34d399 10%, transparent); border-color: color-mix(in srgb, #34d399 30%, transparent); }

/* ===== Estação Meteorológica: ícone + cor por métrica, card clicável abre o balão de 24 h ===== */
.inicio-a .valor-destaque[data-metrica="clima-temperatura"] { --c: #fbbf24; --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fbbf24' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 4v10.54a4 4 0 1 1-4 0V4a2 2 0 0 1 4 0Z'/%3E%3C/svg%3E"); }
.inicio-a .valor-destaque[data-metrica="clima-sensacao"] { --c: #fbbf24; --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fbbf24' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 4v10.54a4 4 0 1 1-4 0V4a2 2 0 0 1 4 0Z'/%3E%3Cpath d='M18 5l2-2M19 9h2'/%3E%3C/svg%3E"); }
.inicio-a .valor-destaque[data-metrica="clima-ponto_orvalho"] { --c: #22d3ee; --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2322d3ee' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 22a7 7 0 0 0 7-7c0-2-1-3.9-3-5.5s-3.5-4-4-6.5c-.5 2.5-2 4.9-4 6.5C6 11.1 5 13 5 15a7 7 0 0 0 7 7z'/%3E%3C/svg%3E"); }
.inicio-a .valor-destaque[data-metrica="clima-umidade"] { --c: #22d3ee; --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2322d3ee' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 16.3c2.2 0 4-1.83 4-4.05 0-1.16-.57-2.26-1.71-3.19S7.29 6.75 7 5.3c-.29 1.45-1.14 2.84-2.29 3.76S3 11.1 3 12.25c0 2.22 1.8 4.05 4 4.05z'/%3E%3Cpath d='M12.56 6.6A10.97 10.97 0 0 0 14 3.02c.5 2.5 2 4.9 4 6.5s3 3.5 3 5.5a6.98 6.98 0 0 1-11.91 4.97'/%3E%3C/svg%3E"); }
.inicio-a .valor-destaque[data-metrica="clima-vento"] { --c: #22d3ee; --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2322d3ee' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17.7 7.7a2.5 2.5 0 1 1 1.8 4.3H2'/%3E%3Cpath d='M9.6 4.6A2 2 0 1 1 11 8H2'/%3E%3Cpath d='M12.6 19.4A2 2 0 1 0 14 16H2'/%3E%3C/svg%3E"); }
.inicio-a .valor-destaque[data-metrica="clima-rajada"] { --c: #22d3ee; --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2322d3ee' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12.8 19.6A2 2 0 1 0 14 16H2'/%3E%3Cpath d='M17.5 8a2.5 2.5 0 1 1 2 4H2'/%3E%3Cpath d='M9.8 4.4A2 2 0 1 1 11 8H2'/%3E%3C/svg%3E"); }
.inicio-a .valor-destaque[data-metrica="clima-chuva"] { --c: #22d3ee; --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2322d3ee' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 14.9A7 7 0 1 1 15.7 8h1.8a4.5 4.5 0 0 1 2.5 8.2'/%3E%3Cpath d='M16 14v6M8 14v6M12 16v6'/%3E%3C/svg%3E"); }
.inicio-a .valor-destaque[data-metrica="clima-pressao"] { --c: #22d3ee; --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2322d3ee' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 14l4-4'/%3E%3Cpath d='M3.34 19a10 10 0 1 1 17.32 0'/%3E%3C/svg%3E"); }
.inicio-a .valor-destaque[data-metrica="clima-indoor_temperatura"] { --c: #fbbf24; --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fbbf24' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 10l9-7 9 7v10a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1z'/%3E%3Cpath d='M12 9v6'/%3E%3Ccircle cx='12' cy='16.5' r='1.5'/%3E%3C/svg%3E"); }
.inicio-a .valor-destaque[data-metrica="clima-indoor_umidade"] { --c: #22d3ee; --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2322d3ee' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 10l9-7 9 7v10a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1z'/%3E%3Cpath d='M12 9.5c-1.2 1.6-2.5 3-2.5 4.5a2.5 2.5 0 0 0 5 0c0-1.5-1.3-2.9-2.5-4.5z'/%3E%3C/svg%3E"); }
.inicio-a .valor-destaque[data-metrica="clima-solar"] { --c: #fbbf24; --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fbbf24' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M6.34 17.66l-1.41 1.41M19.07 4.93l-1.41 1.41'/%3E%3C/svg%3E"); }
.inicio-a .valor-destaque[data-metrica="clima-uvi"] { --c: #fbbf24; --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fbbf24' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2v2M4.93 4.93l1.41 1.41M20 12h2M19.07 4.93l-1.41 1.41M15.95 16.95A5 5 0 1 0 8 12'/%3E%3Cpath d='M3 20h18M7 16h10'/%3E%3C/svg%3E"); }
.clima-resumo { display: flex; gap: 10px; margin: 4px 0 10px; }
.clima-resumo:empty { display: none; }
.clima-resumo > div { flex: 1; text-align: center; padding: 8px 6px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.08); }
.clima-resumo b { display: block; font-size: 17px; color: var(--texto); }
.clima-resumo span { font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--texto-fraco, #8a93a6); }

/* ===== Liquid Glass (estilo Apple) — 04/12/2026 =====
   Camada por cima dos 6 temas: só usa as variáveis de cada tema (--azul-neon, --fundo-*-vidro).
   Regras (Apple, "Materials"): brilho só na borda de cima (luz batendo no vidro), superfície maior =
   vidro mais grosso; botões = vidro leve; nunca vidro claro sobre vidro claro; respeita
   "reduzir transparência" e "reduzir movimento". */
:root {
  --vidro-brilho: rgba(255, 255, 255, 0.55);
  --vidro-brilho-fraco: rgba(255, 255, 255, 0.10);
  --vidro-sombra-borda: rgba(0, 0, 0, 0.18);
}

/* Cards: borda especular (clara em cima/esquerda, some embaixo) desenhada com máscara */
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(150deg, var(--vidro-brilho), var(--vidro-brilho-fraco) 30%,
              transparent 55%, color-mix(in srgb, var(--azul-neon) 25%, transparent) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  pointer-events: none;
}
.card {
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.32), 0 2px 8px rgba(0, 0, 0, 0.18),
              inset 0 1px 0 rgba(255, 255, 255, 0.18), inset 0 -1px 0 var(--vidro-sombra-borda);
}

/* Barra lateral: vidro mais grosso + reflexo vertical na borda */
.sidebar {
  backdrop-filter: blur(calc(var(--desfoque-sidebar) + 8px)) saturate(190%);
  -webkit-backdrop-filter: blur(calc(var(--desfoque-sidebar) + 8px)) saturate(190%);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0) 35%),
    var(--fundo-sidebar-vidro);
  border-right: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.06), 8px 0 30px rgba(0, 0, 0, 0.18);
}

/* Item de menu ativo: gota de vidro tingida */
.link-sidebar { transition: background .2s, border-color .2s, color .2s, transform .1s ease-out; }
.link-sidebar:active { transform: scale(0.97); }
.link-sidebar.ativo {
  background:
    radial-gradient(120% 140% at 20% 0%, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 55%),
    color-mix(in srgb, var(--azul-neon) 16%, transparent);
  border-color: color-mix(in srgb, var(--azul-neon) 40%, rgba(255, 255, 255, 0.2));
  box-shadow: inset 0 1px 0 var(--vidro-brilho), inset 0 -1px 0 var(--vidro-sombra-borda),
              0 6px 18px color-mix(in srgb, var(--azul-neon) 14%, transparent);
}

/* Botões: pílula de vidro; resposta no toque (aperta na hora, não ao soltar) */
.botao, .botao-ios {
  position: relative;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.02) 60%),
    color-mix(in srgb, var(--azul-neon) 12%, transparent);
  backdrop-filter: blur(14px) saturate(180%);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  border: 1px solid color-mix(in srgb, var(--azul-neon) 45%, rgba(255, 255, 255, 0.25));
  box-shadow: inset 0 1px 0 var(--vidro-brilho), inset 0 -1px 0 var(--vidro-sombra-borda),
              0 4px 14px rgba(0, 0, 0, 0.20);
  transition: background .2s, box-shadow .2s, color .2s, transform .1s ease-out;
}
.botao:hover, .botao-ios:hover {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.30), rgba(255, 255, 255, 0.04) 60%),
    color-mix(in srgb, var(--azul-neon) 30%, transparent);
  color: var(--texto);
  box-shadow: inset 0 1px 0 var(--vidro-brilho), inset 0 -1px 0 var(--vidro-sombra-borda),
              0 6px 22px color-mix(in srgb, var(--azul-neon) 30%, transparent);
}
.botao:active, .botao-ios:active { transform: scale(0.97); }
.botao-perigo {
  border-color: color-mix(in srgb, #ff6b6b 55%, rgba(255, 255, 255, 0.2));
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.02) 60%),
              color-mix(in srgb, #ff6b6b 12%, transparent);
}
.botao-perigo:hover { background: color-mix(in srgb, #ff6b6b 32%, transparent); color: #fff; }
.botao-secundario {
  border-color: rgba(255, 255, 255, 0.22);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.02) 60%);
}

/* Campos: vidro afundado (sombra interna em cima, brilho embaixo) */
input, select {
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.25), inset 0 -1px 0 rgba(255, 255, 255, 0.06);
  border-radius: 12px;
}

/* Janelas (modais): vidro mais grosso que os cards */
.modal-painel, .modal-painel-quadri {
  backdrop-filter: blur(40px) saturate(190%);
  -webkit-backdrop-filter: blur(40px) saturate(190%);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45), inset 0 1px 0 var(--vidro-brilho);
}

/* Temas claros: brilho mais forte, sombra de borda mais leve */
body.tema-claro, body.tema-branco, body.tema-apple {
  --vidro-brilho: rgba(255, 255, 255, 0.9);
  --vidro-brilho-fraco: rgba(255, 255, 255, 0.35);
  --vidro-sombra-borda: rgba(0, 0, 0, 0.06);
}

@media (prefers-reduced-motion: reduce) {
  .botao:active, .botao-ios:active, .link-sidebar:active { transform: none; }
}
