/* Paleta oficial Anjos Backup (palette.py / monitor desktop) */
:root {
  --cor-fundo: #0B111B;
  --cor-cabecalho: #000000;
  --cor-nav: #0D1522;
  --cor-card: #0D1522;
  --cor-input: #0D1522;
  --cor-borda: #1C7ED6;
  --cor-texto: #FFFFFF;
  --cor-suave: #8B9BB0;
  --cor-azul: #1C7ED6;
  --cor-botao: #1363BE;
  --cor-hover: #1A7AE0;
  --cor-ciano: #4DA3FF;
  --cor-ok: #4ade80;
  --cor-erro: #f87171;
  --cor-alerta: #facc15;
  --fonte: "Segoe UI", sans-serif;
  --header-h: 64px;
  --nav-w: 180px;
  --radius: 10px;
  --scrollbar-size: 10px;
  --scrollbar-glow: rgba(77, 163, 255, 0.55);
}

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

/* Scrollbars suaves, arredondadas, azul neon */
* {
  scrollbar-width: thin;
  scrollbar-color: #4da3ff #0d1522;
}
*::-webkit-scrollbar {
  width: var(--scrollbar-size);
  height: var(--scrollbar-size);
}
*::-webkit-scrollbar-track {
  background: #0d1522;
  border-radius: 999px;
}
*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #6bb6ff 0%, #4da3ff 55%, #1c7ed6 100%);
  border-radius: 999px;
  border: 2px solid #0d1522;
  box-shadow:
    0 0 8px var(--scrollbar-glow),
    inset 0 0 4px rgba(255, 255, 255, 0.25);
}
*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #8ec8ff 0%, #6bb6ff 50%, #4da3ff 100%);
  box-shadow:
    0 0 12px rgba(77, 163, 255, 0.85),
    inset 0 0 5px rgba(255, 255, 255, 0.35);
}
*::-webkit-scrollbar-corner {
  background: transparent;
}

/* Fundo da página preto: navegadores que ignoram theme-color (Safari/iPhone) pintam a barra de cima com ele */
html, body {
  height: 100%;
  background: var(--cor-cabecalho, #000000);
  color: var(--cor-texto);
  font-family: var(--fonte);
  font-size: 13px;
}

.shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 100vh;
  background: var(--cor-fundo);
}

/* ===== HEADER ===== */
.app-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: var(--header-h);
  padding: 8px 16px;
  background: #000000;
  background-color: var(--cor-cabecalho, #000000);
  border-bottom: 2px solid #4da3ff;
  box-shadow:
    0 0 10px rgba(77, 163, 255, 0.65),
    0 0 22px rgba(77, 163, 255, 0.35),
    0 1px 0 rgba(77, 163, 255, 0.85);
  flex-shrink: 0;
  gap: 16px;
}

/* Computador: mesma altura do cabeçalho do Portal; logo no mesmo tamanho e posição (16px da borda, centralizada) */
@media (min-width: 981px) {
  .app-header {
    height: var(--header-h);
    padding: 0 16px;
  }
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  justify-self: start;
  text-decoration: none;
}

.header-status {
  display: contents;
}

@media (min-width: 981px) {
  .header-status {
    display: flex;
    gap: 10px;
  }
}

.brand-logo {
  height: 48px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}

.header-center {
  justify-self: center;
  text-align: center;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-user {
  display: block;
  font-size: var(--header-usuario-fonte, 12px) !important;
  font-weight: 700;
  font-family: "Cambria Math", "Segoe UI Symbol", "Segoe UI", "Times New Roman", serif;
  color: var(--cor-ciano);
  line-height: 1.15;
  white-space: nowrap;
  letter-spacing: 0.02em;
  margin-top: 2px;
  text-align: right;
}

.header-version {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: var(--cor-suave);
  line-height: 1.1;
  white-space: nowrap;
  letter-spacing: 0.04em;
  text-align: right;
  margin-top: 1px;
}

.header-conn-time {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: var(--cor-ciano);
  line-height: 1.1;
  white-space: nowrap;
  letter-spacing: 0.03em;
  text-align: right;
  margin-top: 1px;
  font-variant-numeric: tabular-nums;
}

.header-conn-time.off {
  color: var(--cor-erro);
}

.header-logout-form {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin: 0;
  max-width: 46vw;
}

.header-logged {
  font-size: 10px;
  font-weight: 600;
  color: var(--cor-suave);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* O nome estilizado fica ao lado do Sair (no lugar do nome simples), no computador e no celular */
.header-right:has(.header-logout-form) > .header-user,
.header-logged { display: none; }

.header-user.header-user-inline {
  display: block;
  margin-top: 0;
}

.header-logout {
  background: transparent;
  border: 1px solid var(--cor-borda);
  color: var(--cor-ciano);
  border-radius: 4px;
  padding: 1px 8px;
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.5;
  cursor: pointer;
  flex-shrink: 0;
}

.header-logout:hover {
  border-color: var(--cor-ciano);
  background: rgba(28, 126, 214, 0.2);
}

.header-title-img {
  height: 42px;
  width: auto;
  max-width: min(520px, 46vw);
  object-fit: contain;
  display: block;
}

.header-title-text {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--cor-ciano);
  letter-spacing: 0.02em;
  text-shadow: 0 0 12px rgba(28, 126, 214, 0.55);
}

.brand-fallback {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--cor-azul), var(--cor-ciano));
  font-weight: 800;
  color: #000;
}

.brand-name {
  font-size: 1.2rem;
  font-weight: 700;
}

.header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
  justify-self: end;
}

.service-badge,
.live-badge {
  font-weight: 700;
  font-size: 0.8rem;
  white-space: nowrap;
}

.service-badge.on,
.live-badge.on { color: var(--cor-ok); }

.service-badge.off,
.live-badge.off { color: var(--cor-erro); }

/* ===== BODY + NAV ===== */
.body {
  display: flex;
  flex: 1;
  min-height: 0;
}

.nav {
  width: var(--nav-w);
  flex-shrink: 0;
  background: var(--cor-nav);
  border-right: 1px solid rgba(28, 126, 214, 0.35);
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  text-align: left;
  background: transparent;
  color: var(--cor-texto);
  border: none;
  border-radius: 6px;
  padding: 11px 12px;
  font: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: background 0.15s ease;
}

/* Mesmo visual do menu do Portal: ícone na cor neon da opção; passar o mouse e a tela aberta acendem nessa cor */
.nav-item {
  --nav-tint: color-mix(in srgb, var(--nav-neon, var(--cor-ciano)) 14%, transparent);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15.2px; /* mesmo tamanho das letras do menu do Portal */
}

.nav-icon {
  flex-shrink: 0;
  font-size: 18.4px; /* mesmo tamanho dos ícones do menu do Portal */
  line-height: 1;
  color: var(--nav-neon, var(--cor-ciano));
}

.nav-item:hover,
.nav-item:focus-visible {
  background: var(--nav-tint);
  color: #fff;
}

.nav-item.selected {
  background: var(--nav-tint);
  color: #fff;
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--nav-neon, var(--cor-ciano)), 0 0 14px -6px var(--nav-neon, var(--cor-ciano));
}

.nav-footer {
  margin-top: auto;
  padding: 10px 8px;
  border-top: 1px solid rgba(28, 126, 214, 0.25);
}

.nav-footer small {
  display: block;
  color: var(--cor-suave);
  font-size: 0.7rem;
  word-break: break-all;
  line-height: 1.3;
}

/* ===== PAGES ===== */
.pages {
  flex: 1;
  min-width: 0;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

.page {
  display: none;
  flex-direction: column;
  height: 100%;
  padding: 14px 16px;
  gap: 10px;
  overflow: hidden;
  animation: fadeIn 0.25s ease;
}

.page.active { display: flex; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.page-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.title {
  margin: 0;
  flex: 1;
  font-size: 20px;
  font-weight: 700;
  color: var(--cor-texto);
}

.toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.hint {
  color: var(--cor-suave);
  font-size: 0.85rem;
  flex-shrink: 0;
}

/* ===== KPIs ===== */
.kpis {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.kpis.compact .card { min-width: 100px; }

.card {
  flex: 1;
  min-width: 110px;
  background: var(--cor-card);
  border: 1px solid var(--cor-borda);
  border-radius: var(--radius);
  padding: 12px 14px;
}

button.card.kpi-clickable {
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease, background-color 0.15s ease, background-image 0.15s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  background-color: var(--cor-card);
  background-image: none;
}

/* Película neon no BLOCO INTEIRO — só quando .selected (clique) */
button.card.kpi-clickable.selected,
button.card.kpi-clickable[aria-selected="true"],
.gerencia-bloco.selected {
  /* lavagem translúcida cobrindo 100% do bloco, cor = borda neon */
  background-image: linear-gradient(
    rgba(77, 163, 255, 0.42),
    rgba(77, 163, 255, 0.42)
  ) !important;
  background-color: var(--cor-card) !important;
  border-color: #4da3ff !important;
  box-shadow:
    inset 0 0 0 1px rgba(77, 163, 255, 0.75),
    inset 0 0 28px rgba(77, 163, 255, 0.28),
    0 0 14px rgba(77, 163, 255, 0.55) !important;
  transform: translateY(-1px);
}

button.card.kpi-tone-ok.selected,
button.card.kpi-tone-ok[aria-selected="true"] {
  background-image: linear-gradient(
    rgba(57, 255, 20, 0.38),
    rgba(57, 255, 20, 0.38)
  ) !important;
  border-color: #39ff14 !important;
  box-shadow:
    inset 0 0 0 1px rgba(57, 255, 20, 0.75),
    inset 0 0 28px rgba(57, 255, 20, 0.28),
    0 0 14px rgba(57, 255, 20, 0.55) !important;
}

button.card.kpi-tone-danger.selected,
button.card.kpi-tone-danger[aria-selected="true"] {
  background-image: linear-gradient(
    rgba(255, 42, 42, 0.38),
    rgba(255, 42, 42, 0.38)
  ) !important;
  border-color: #ff2a2a !important;
  box-shadow:
    inset 0 0 0 1px rgba(255, 42, 42, 0.75),
    inset 0 0 28px rgba(255, 42, 42, 0.28),
    0 0 14px rgba(255, 42, 42, 0.55) !important;
}

button.card.kpi-tone-warn.selected,
button.card.kpi-tone-warn[aria-selected="true"] {
  background-image: linear-gradient(
    rgba(255, 230, 0, 0.38),
    rgba(255, 230, 0, 0.38)
  ) !important;
  border-color: #ffe600 !important;
  box-shadow:
    inset 0 0 0 1px rgba(255, 230, 0, 0.75),
    inset 0 0 28px rgba(255, 230, 0, 0.28),
    0 0 14px rgba(255, 230, 0, 0.55) !important;
}

button.card.kpi-tone-neon.selected,
button.card.kpi-tone-neon[aria-selected="true"] {
  background-image: linear-gradient(
    rgba(77, 163, 255, 0.42),
    rgba(77, 163, 255, 0.42)
  ) !important;
  border-color: #4da3ff !important;
  box-shadow:
    inset 0 0 0 1px rgba(77, 163, 255, 0.75),
    inset 0 0 28px rgba(77, 163, 255, 0.28),
    0 0 14px rgba(77, 163, 255, 0.55) !important;
}

button.card.kpi-clickable:hover:not(.selected):not([aria-selected="true"]) {
  border-color: var(--cor-ciano);
  box-shadow: 0 0 0 1px rgba(77, 163, 255, 0.35);
}

.gerencia-bloco:hover:not(.selected) {
  border-color: var(--cor-ciano);
  box-shadow: 0 0 0 1px rgba(77, 163, 255, 0.35);
}

/* Bordas neon na cor do resultado (KPI / Backup) — estado normal */
.card.kpi-tone-neon,
button.card.kpi-tone-neon {
  border-color: #4da3ff;
  box-shadow:
    0 0 6px rgba(77, 163, 255, 0.55),
    0 0 16px rgba(77, 163, 255, 0.28),
    inset 0 0 10px rgba(77, 163, 255, 0.06);
}
.card.kpi-tone-ok,
button.card.kpi-tone-ok {
  border-color: #39ff14;
  box-shadow:
    0 0 6px rgba(57, 255, 20, 0.55),
    0 0 16px rgba(57, 255, 20, 0.28),
    inset 0 0 10px rgba(57, 255, 20, 0.06);
}
.card.kpi-tone-danger,
button.card.kpi-tone-danger {
  border-color: #ff2a2a;
  box-shadow:
    0 0 6px rgba(255, 42, 42, 0.55),
    0 0 16px rgba(255, 42, 42, 0.28),
    inset 0 0 10px rgba(255, 42, 42, 0.06);
}
.card.kpi-tone-warn,
button.card.kpi-tone-warn {
  border-color: #ffe600;
  box-shadow:
    0 0 6px rgba(255, 230, 0, 0.55),
    0 0 16px rgba(255, 230, 0, 0.28),
    inset 0 0 10px rgba(255, 230, 0, 0.06);
}

button.card.kpi-tone-neon:hover:not(.selected):not([aria-selected="true"]) {
  border-color: #4da3ff;
  box-shadow:
    0 0 8px rgba(77, 163, 255, 0.75),
    0 0 22px rgba(77, 163, 255, 0.4),
    0 0 0 1px rgba(77, 163, 255, 0.45);
}
button.card.kpi-tone-ok:hover:not(.selected):not([aria-selected="true"]) {
  border-color: #39ff14;
  box-shadow:
    0 0 8px rgba(57, 255, 20, 0.75),
    0 0 22px rgba(57, 255, 20, 0.4),
    0 0 0 1px rgba(57, 255, 20, 0.45);
}
button.card.kpi-tone-danger:hover:not(.selected):not([aria-selected="true"]) {
  border-color: #ff2a2a;
  box-shadow:
    0 0 8px rgba(255, 42, 42, 0.75),
    0 0 22px rgba(255, 42, 42, 0.4),
    0 0 0 1px rgba(255, 42, 42, 0.45);
}
button.card.kpi-tone-warn:hover:not(.selected):not([aria-selected="true"]) {
  border-color: #ffe600;
  box-shadow:
    0 0 8px rgba(255, 230, 0, 0.75),
    0 0 22px rgba(255, 230, 0, 0.4),
    0 0 0 1px rgba(255, 230, 0, 0.45);
}

.card-value.danger {
  color: #ff2a2a !important;
  text-shadow: 0 0 8px rgba(255, 42, 42, 0.55);
}
.card-value.ok {
  color: #39ff14 !important;
  text-shadow: 0 0 8px rgba(57, 255, 20, 0.55);
}
.card-value.warn {
  color: #ffe600 !important;
  text-shadow: 0 0 8px rgba(255, 230, 0, 0.55);
}
.card-value.card-value-neon {
  color: #4df0ff !important;
  text-shadow:
    0 0 6px rgba(77, 240, 255, 0.95),
    0 0 16px rgba(77, 163, 255, 0.65),
    0 0 28px rgba(28, 126, 214, 0.45);
  letter-spacing: 0.06em;
  font-weight: 800;
}
.kpi-caption {
  font-size: 10px;
  letter-spacing: 0.4px;
  line-height: 1.25;
  white-space: normal;
}

.dash-detail {
  flex: 1;
  min-height: 0;
}

.dash-panel-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}

.dashboard-charts {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 12px;
  min-height: 0;
  overflow: auto;
}

.dashboard-charts.dash-single-block {
  grid-template-columns: 1fr;
}

.dashboard-hero {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 8px 12px 4px;
}

.dashboard-hero-img {
  max-width: min(520px, 100%);
  max-height: 220px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
}

@media (max-width: 1100px) {
  .dashboard-charts { grid-template-columns: 1fr; }
}

/* Celular: Fluxo e Rede em blocos separados (scroll independente, sem âpuloâ) */
@media (max-width: 980px) {
  /* Sem logo/imagem do Dashboard no celular — só o conteúdo do bloco */
  .dashboard-hero,
  .dashboard-hero-img {
    display: none !important;
  }
  .dashboard-charts.dash-mobile-stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow: visible;
  }
  .dashboard-charts.dash-mobile-stack > .chart-block {
    flex: 0 0 auto;
    width: 100%;
  }
  .dashboard-charts.dash-mobile-stack > .topology-block {
    margin-top: 4px;
    border-top: 2px solid rgba(28, 126, 214, 0.45);
    padding-top: 14px;
  }
  #section-dashboard .dash-detail.grow,
  #section-dashboard #dashPanelBody.grow {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }
}

.chart-block {
  background: rgba(11, 17, 27, 0.55);
  border: 1px solid rgba(77, 163, 255, 0.4);
  border-radius: 8px;
  padding: 12px;
  box-shadow:
    0 0 14px rgba(77, 163, 255, 0.22),
    inset 0 0 28px rgba(77, 163, 255, 0.05);
}

.chart-title {
  margin: 0 0 10px;
  font-size: 0.95rem;
  color: #4da3ff;
  text-shadow: 0 0 8px rgba(77, 163, 255, 0.75), 0 0 18px rgba(77, 163, 255, 0.35);
}

.chart-hint {
  margin-top: 10px;
  color: var(--cor-suave);
  font-size: 0.78rem;
}

.flow-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 6px;
  min-height: 170px;
  padding: 8px 4px 0;
}

.flow-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.flow-bar-wrap {
  height: 120px;
  width: 100%;
  max-width: 48px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.flow-bar {
  width: 100%;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, #7ec8ff, #1c7ed6);
  box-shadow:
    0 0 8px rgba(77, 163, 255, 0.8),
    0 0 18px rgba(28, 126, 214, 0.5);
  animation: barRise 0.55s ease;
}

.flow-bar.ok {
  background: linear-gradient(180deg, #9aff6a, #39ff14);
  box-shadow:
    0 0 10px rgba(57, 255, 20, 0.85),
    0 0 22px rgba(57, 255, 20, 0.45);
}

.flow-bar.danger {
  background: linear-gradient(180deg, #ff8a8a, #ff2a2a);
  box-shadow:
    0 0 10px rgba(255, 42, 42, 0.85),
    0 0 22px rgba(255, 42, 42, 0.45);
}

.flow-bar.fluxo {
  background: linear-gradient(180deg, #9aff6a, #39ff14);
  box-shadow:
    0 0 10px rgba(57, 255, 20, 0.9),
    0 0 24px rgba(57, 255, 20, 0.5);
}

@keyframes barRise {
  from { transform: scaleY(0.2); transform-origin: bottom; opacity: 0.4; }
  to { transform: none; opacity: 1; }
}

.flow-value {
  font-weight: 700;
  font-size: 1.05rem;
  color: #4da3ff;
  text-shadow: 0 0 6px rgba(77, 163, 255, 0.9), 0 0 14px rgba(77, 163, 255, 0.45);
}

.flow-value-ok,
.flow-value-fluxo {
  color: #39ff14 !important;
  text-shadow: 0 0 6px rgba(57, 255, 20, 0.95), 0 0 14px rgba(57, 255, 20, 0.55);
}

.flow-value-danger {
  color: #ff4d4d !important;
  text-shadow: 0 0 6px rgba(255, 42, 42, 0.95), 0 0 14px rgba(255, 42, 42, 0.5);
}

.flow-label {
  font-size: 0.72rem;
  color: #9eb6d4;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: center;
  text-shadow: 0 0 6px rgba(77, 163, 255, 0.3);
}

.flow-arrow {
  align-self: center;
  color: #4da3ff;
  font-size: 1.2rem;
  padding-bottom: 36px;
  opacity: 1;
  text-shadow: 0 0 8px rgba(77, 163, 255, 0.95), 0 0 16px rgba(77, 163, 255, 0.55);
}

.topology-wrap {
  width: 100%;
  overflow: hidden;
}

.topology-block .topology-wrap {
  background: radial-gradient(ellipse at center, rgba(28, 126, 214, 0.14), transparent 65%);
  border-radius: 8px;
  box-shadow: inset 0 0 40px rgba(77, 163, 255, 0.1);
}

.topology-svg {
  width: 100%;
  height: auto;
  min-height: 320px;
  display: block;
}

.topology-solo-server .topology-wrap {
  background: radial-gradient(ellipse at center, rgba(28, 126, 214, 0.22), transparent 60%);
}

.topo-server-name {
  fill: #7ec8ff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.topo-link {
  stroke-width: 2.5;
  fill: none;
  opacity: 0.95;
}

.topo-link.on {
  stroke: #39ff14;
  stroke-dasharray: 5 7;
  animation: dashMove 1s linear infinite;
  filter: drop-shadow(0 0 4px rgba(57, 255, 20, 0.95)) drop-shadow(0 0 10px rgba(57, 255, 20, 0.55));
}

.topo-link.off {
  stroke: #ff2a2a;
  stroke-dasharray: 3 8;
  animation: dashMove 1.6s linear infinite;
  opacity: 0.9;
  filter: drop-shadow(0 0 4px rgba(255, 42, 42, 0.9)) drop-shadow(0 0 10px rgba(255, 42, 42, 0.45));
}

@keyframes dashMove {
  to { stroke-dashoffset: -24; }
}

.topo-packet {
  stroke: none;
}

.topo-packet.on {
  fill: #39ff14;
  filter: url(#topoGlowOn) drop-shadow(0 0 6px rgba(57, 255, 20, 0.95));
}

.topo-packet.off {
  fill: #ff2a2a;
  filter: url(#topoGlowOff) drop-shadow(0 0 6px rgba(255, 42, 42, 0.9));
}

.topo-server image,
.topo-client image {
  pointer-events: none;
  filter: drop-shadow(0 0 8px rgba(77, 163, 255, 0.55));
}

.topo-client-name {
  fill: #c5d8f0;
  font-size: 11px;
  font-weight: 700;
  filter: drop-shadow(0 0 4px rgba(77, 163, 255, 0.55));
}

.topo-client-status {
  fill: var(--cor-suave);
  font-size: 9px;
}

.topo-client.on .topo-client-status {
  fill: #39ff14;
  filter: drop-shadow(0 0 4px rgba(57, 255, 20, 0.85));
}
.topo-client.off .topo-client-status {
  fill: #ff4d4d;
  filter: drop-shadow(0 0 4px rgba(255, 42, 42, 0.8));
}

.occ-meaning {
  color: var(--cor-suave);
  font-size: 0.85rem;
  max-width: 320px;
}

.static-kpis .card { cursor: default; }
.static-kpis .kpi-clickable { cursor: pointer; }

.kpi-caption {
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--cor-suave);
  text-transform: uppercase;
}

.card-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--cor-ciano);
  line-height: 1.2;
  margin-top: 2px;
}

#backupSummary .card-value.danger,
.static-kpis .card-value.danger {
  color: #f87171 !important;
}
#backupSummary .card-value.warn,
.static-kpis .card-value.warn {
  color: #facc15 !important;
}
#backupSummary .card-value.ok,
.static-kpis .card-value.ok {
  color: #4ade80 !important;
}
/* Ícone que leva ao Portal: mesmo tamanho, posição e efeito do ícone no rodapé do menu do Portal */
.nav-portal-link {
  display: flex;
  justify-content: center;
  margin: 0 0 6px;
  border-radius: 8px;
  transition: filter 0.15s ease, transform 0.15s ease;
}

.nav-portal-link img {
  width: auto;
  display: block;
}

.nav-portal-link:hover,
.nav-portal-link:focus-visible {
  filter: drop-shadow(0 0 8px rgba(77, 163, 255, 0.75));
  transform: scale(1.05);
}

.nav-portal-link + small {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(28, 126, 214, 0.25);
}

/* Mesmo tamanho e alinhamento do rodapé do menu do Portal */
.nav-footer small {
  color: var(--cor-suave);
  font-size: 11px;
  line-height: 1.3;
  word-break: break-word;
  text-align: center;
}
tr.dash-backup-company-row { cursor: pointer; }
tr.dash-backup-company-row:hover td { background: rgba(28, 126, 214, 0.12); }

button.card.kpi-word-only {
  justify-content: center;
  align-items: center;
  text-align: center;
  min-height: 72px;
  padding: 10px 8px;
}
.card-value.card-value-word {
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--cor-ciano);
  margin: 0;
  padding: 0;
  text-align: center;
  line-height: 1.1;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 980px) {
  button.card.kpi-word-only {
    min-height: 64px;
    padding: 8px 4px;
  }
  .card-value.card-value-word {
    font-size: var(--dashboard-kpi-fonte-mobile, 11px) !important;
    letter-spacing: 0.02em;
    white-space: normal;
    word-break: break-word;
    hyphens: auto;
    line-height: 1.15;
    max-width: 100%;
  }
}

.backup-dia-status {
  white-space: normal;
  text-align: left;
  line-height: 1.25;
  font-weight: 600;
}
.pill.pill-success.backup-dia-status { color: var(--cor-ok); }
.pill.pill-partial.backup-dia-status { color: var(--cor-alerta); }
.pill.pill-failed.backup-dia-status { color: var(--cor-erro); }

.section-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--cor-texto);
}

.split {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 12px;
  flex: 1;
  min-height: 0;
}

@media (max-width: 980px) {
  .split { grid-template-columns: 1fr; overflow-y: auto; }
  .body { flex-direction: column; }
  .nav {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    border-right: none;
    border-bottom: 1px solid rgba(28, 126, 214, 0.35);
  }
  .nav-footer { display: none; }
  .header-title-img { max-width: 220px; height: 28px; }

  /* Celular: cabeçalho e menu formam um único bloco preto, como no Portal */
  .app-header {
    border-bottom: none;
    box-shadow: none;
  }
  .nav {
    background: var(--cor-cabecalho, #000000);
    border-bottom: 2px solid #4da3ff;
    box-shadow:
      0 8px 10px -6px rgba(77, 163, 255, 0.65),
      0 16px 22px -12px rgba(77, 163, 255, 0.35),
      0 1px 0 rgba(77, 163, 255, 0.85);
    position: relative;
    z-index: 1;
  }
}

.panel-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  background: var(--cor-card);
  border: 1px solid var(--cor-borda);
  border-radius: var(--radius);
  padding: 12px;
}

.grow {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

/* ===== TABLES ===== */
.table-wrap {
  border: 1px solid var(--cor-borda);
  border-radius: 8px;
  background: var(--cor-input);
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th, td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid rgba(28, 126, 214, 0.2);
}

th {
  position: sticky;
  top: 0;
  background: var(--cor-fundo);
  color: var(--cor-suave);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  z-index: 1;
}

tr:hover td { background: rgba(28, 126, 214, 0.08); }
tr.selected td { background: rgba(28, 126, 214, 0.22); }

.pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 700;
}

.pill-success, .pill-active { background: rgba(74, 222, 128, 0.15); color: var(--cor-ok); }
.pill-failed, .pill-offline { background: rgba(248, 113, 113, 0.15); color: var(--cor-erro); }

/* Coluna Backup (Clientes) — neon */
.pill-neon-ok {
  color: #39ff14;
  background: rgba(57, 255, 20, 0.1);
  border: 1px solid rgba(57, 255, 20, 0.55);
  text-shadow: 0 0 6px rgba(57, 255, 20, 0.85), 0 0 14px rgba(57, 255, 20, 0.45);
  font-weight: 700;
  letter-spacing: 0.02em;
}
.pill-neon-blue {
  color: #1ee3ff;
  background: rgba(30, 227, 255, 0.1);
  border: 1px solid rgba(30, 227, 255, 0.55);
  text-shadow: 0 0 6px rgba(30, 227, 255, 0.85), 0 0 14px rgba(30, 227, 255, 0.45);
  font-weight: 700;
  letter-spacing: 0.02em;
}
.pill-neon-run {
  color: #ffe600;
  background: rgba(255, 230, 0, 0.1);
  border: 1px solid rgba(255, 230, 0, 0.55);
  text-shadow: 0 0 6px rgba(255, 230, 0, 0.85), 0 0 14px rgba(255, 230, 0, 0.45);
  font-weight: 700;
  letter-spacing: 0.02em;
}
.pill-neon-err {
  color: #ff2a2a;
  background: rgba(255, 42, 42, 0.12);
  border: 1px solid rgba(255, 42, 42, 0.55);
  text-shadow: 0 0 6px rgba(255, 42, 42, 0.85), 0 0 14px rgba(255, 42, 42, 0.45);
  font-weight: 700;
  letter-spacing: 0.02em;
}
.pill-neon-idle {
  color: #cbd5e1;
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.4);
  font-weight: 700;
  letter-spacing: 0.02em;
}
.pill-partial, .pill-pending { background: rgba(250, 204, 21, 0.15); color: var(--cor-alerta); }
.pill-running {
  background: rgba(74, 222, 128, 0.18);
  color: var(--cor-ok);
}
.pill-running .run-dots::after {
  content: "";
  display: inline-block;
  min-width: 1.15em;
  text-align: left;
  animation: rundots 1.2s steps(4, end) infinite;
}
@keyframes rundots {
  0% { content: ""; }
  25% { content: "."; }
  50% { content: ".."; }
  75% { content: "..."; }
}

code.mono {
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.78rem;
  word-break: break-all;
}

.license-status-select {
  appearance: auto;
  border: 1px solid var(--cor-borda);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  min-width: 120px;
  background: #0b111b;
  color: var(--cor-texto);
  color-scheme: dark;
}

.license-status-select option {
  background: #0b111b;
  color: #e8f1ff;
}

.license-status-select option[value="ACTIVE"] {
  color: #4ade80;
  background: #0b1a12;
}

.license-status-select option[value="EXPIRED"],
.license-status-select option[value="SUSPENDED"],
.license-status-select option[value="REVOKED"] {
  color: #f87171;
  background: #1a0b0b;
}

.license-status-ativa {
  border-color: rgba(74, 222, 128, 0.55);
  color: var(--cor-ok);
  background: rgba(74, 222, 128, 0.12);
}

.license-status-bloqueada,
.license-status-suspensa {
  border-color: rgba(248, 113, 113, 0.55);
  color: var(--cor-erro);
  background: rgba(248, 113, 113, 0.12);
}

input[type="date"] {
  color-scheme: dark;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 1;
  filter: invert(1) brightness(1.4);
}

.occurrence-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: auto;
}

.occurrence-item {
  padding: 10px 12px;
  background: rgba(248, 113, 113, 0.08);
  border-left: 3px solid var(--cor-erro);
  border-radius: 0 8px 8px 0;
}

.occurrence-item strong { display: block; margin-bottom: 2px; }
.occurrence-item small { color: var(--cor-suave); }

.empty-state {
  text-align: center;
  padding: 28px;
  color: var(--cor-suave);
}

.error-msg {
  color: var(--cor-erro);
  font-size: 0.85rem;
  max-width: 280px;
  word-break: break-word;
}

/* Chave / erro: no PC o valor aparece; no celular fica oculto (ver @media) */
.secret-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  vertical-align: middle;
  flex-wrap: wrap;
}
.secret-mask {
  display: none;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: var(--cor-suave);
}
.secret-value {
  max-width: 220px;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.secret-key .secret-value[hidden] {
  /* no desktop o [hidden] é revertido pelo CSS mobile-only abaixo */
  display: inline !important;
  position: static !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  clip: auto !important;
  overflow: visible !important;
  white-space: normal !important;
}
.secret-copy,
.secret-reveal {
  display: none;
  flex: 0 0 auto;
  padding: 4px 8px !important;
  font-size: 0.72rem !important;
  white-space: nowrap;
}
td.secret-cell {
  max-width: 280px;
}

/* ===== RELATÓRIO (mesmo visual dos blocos da tela Monitoramento) ===== */
#section-relatorio.page.active {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}
#section-relatorio .panel-block {
  background: rgba(11, 17, 27, 0.55);
  border: 1px solid rgba(77, 163, 255, 0.4);
  border-radius: 8px;
  box-shadow:
    0 0 14px rgba(77, 163, 255, 0.22),
    inset 0 0 28px rgba(77, 163, 255, 0.05);
}
.relatorio-filtros-block {
  flex-shrink: 0;
}
.relatorio-filtros-block .filters,
.relatorio-filtros-block .relatorio-filtros {
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}
.relatorio-tabela-block {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.relatorio-tabela-block .table-wrap {
  flex: 1;
  min-height: 0;
  background: rgba(8, 14, 24, 0.55);
  border-color: rgba(77, 163, 255, 0.28);
}
#relatorioSummary {
  margin-top: 0;
  flex-shrink: 0;
}
#relatorioSummary .kpi-clickable {
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: left;
}
/* Resultado do KPI na mesma cor neon do bloco */
#relatorioSummary .kpi-tone-neon .card-value,
#relatorioSummary .card-value.card-value-neon {
  color: #4da3ff !important;
  text-shadow:
    0 0 8px rgba(77, 163, 255, 0.85),
    0 0 18px rgba(77, 163, 255, 0.4);
}
#relatorioSummary .kpi-tone-ok .card-value,
#relatorioSummary .card-value.ok {
  color: #39ff14 !important;
  text-shadow:
    0 0 8px rgba(57, 255, 20, 0.85),
    0 0 18px rgba(57, 255, 20, 0.4);
}
#relatorioSummary .kpi-tone-danger .card-value,
#relatorioSummary .card-value.danger {
  color: #ff2a2a !important;
  text-shadow:
    0 0 8px rgba(255, 42, 42, 0.85),
    0 0 18px rgba(255, 42, 42, 0.4);
}
#relatorioSummary .kpi-tone-warn .card-value,
#relatorioSummary .card-value.warn {
  color: #ffe600 !important;
  text-shadow:
    0 0 8px rgba(255, 230, 0, 0.85),
    0 0 18px rgba(255, 230, 0, 0.4);
}
#section-relatorio .relatorio-tabela-block > .section-title {
  color: #4da3ff;
  text-shadow: 0 0 8px rgba(77, 163, 255, 0.75), 0 0 18px rgba(77, 163, 255, 0.35);
}
#relatorioTable tbody tr.relatorio-company-row {
  cursor: pointer;
}
#relatorioTable tbody tr.relatorio-company-row:hover td {
  background: rgba(28, 126, 214, 0.12);
}
#relatorioTable tbody tr.relatorio-company-row.expanded td,
#relatorioTable tbody tr.relatorio-company-row.selected td {
  background: rgba(77, 163, 255, 0.16) !important;
  box-shadow: inset 0 0 0 1px rgba(77, 163, 255, 0.45);
}
.relatorio-detalhe {
  padding: 10px 4px 6px;
}
.relatorio-detalhe-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin-bottom: 10px;
}
.relatorio-detalhe-head strong {
  color: var(--cor-ciano);
}
.relatorio-detalhe table {
  width: 100%;
  border-collapse: collapse;
}
.relatorio-detalhe th,
.relatorio-detalhe td {
  padding: 6px 8px;
  text-align: left;
  white-space: nowrap;
}
.relatorio-detalhe th {
  color: var(--cor-suave);
  font-size: 0.75rem;
  border-bottom: 1px solid rgba(28, 126, 214, 0.35);
}

/* ===== FILTERS ===== */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  flex-shrink: 0;
  padding: 12px;
  background: var(--cor-card);
  border: 1px solid var(--cor-borda);
  border-radius: var(--radius);
}

.filters label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--cor-suave);
  font-size: 0.8rem;
}

.filters input,
.filters select,
.modal input,
.modal select {
  background: var(--cor-fundo);
  border: 1px solid var(--cor-borda);
  color: var(--cor-texto);
  padding: 8px 10px;
  border-radius: 6px;
  font: inherit;
  min-width: 150px;
}

/* ===== BUTTONS ===== */
.btn {
  background: var(--cor-botao);
  color: var(--cor-texto);
  border: none;
  border-radius: 6px;
  padding: 8px 14px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn:hover { background: var(--cor-hover); }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--cor-borda);
  color: var(--cor-texto);
}

.btn-ghost:hover { background: rgba(28, 126, 214, 0.2); }

.btn-danger {
  background: transparent;
  border: 1px solid var(--cor-erro);
  color: var(--cor-erro);
  padding: 4px 10px;
  font-size: 0.8rem;
  border-radius: 6px;
  cursor: pointer;
}

.btn-danger:hover { background: rgba(248, 113, 113, 0.15); }

/* ===== MODAL ===== */
.modal {
  background: var(--cor-card);
  border: 1px solid var(--cor-borda);
  border-radius: var(--radius);
  color: var(--cor-texto);
  padding: 22px;
  max-width: 420px;
  width: 90%;
}

.modal::backdrop { background: rgba(0, 0, 0, 0.65); }
.modal h2 { margin-bottom: 16px; font-size: 1.15rem; }
.modal label {
  display: block;
  margin-bottom: 12px;
  font-size: 0.85rem;
  color: var(--cor-suave);
}
.modal input,
.modal select {
  display: block;
  width: 100%;
  margin-top: 5px;
}
.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 18px;
}

.modal-licenca {
  max-width: 360px;
  padding: 18px 20px 16px;
  margin: auto;
  border-radius: 12px;
}

.modal-licenca-logo {
  display: block;
  height: 42px;
  width: auto;
  margin: 0 auto 10px;
  object-fit: contain;
}

.modal-licenca h2 {
  text-align: center;
  font-size: 1rem;
  margin: 0 0 14px;
}

.licenca-campo {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 6px 10px;
  align-items: start;
  margin-bottom: 10px;
  font-size: 0.86rem;
}

.licenca-label {
  color: var(--cor-suave);
  font-size: 0.78rem;
  padding-top: 2px;
}

.licenca-chave {
  display: block;
  word-break: break-all;
  line-height: 1.35;
}

.licenca-campo .btn-sm {
  grid-column: 1 / -1;
  justify-self: center;
  padding: 3px 10px;
  font-size: 0.75rem;
  margin-top: 2px;
}

.modal-licenca .modal-actions {
  justify-content: center;
}

.licenca-dias {
  margin-top: 6px;
}

.licenca-dias input {
  max-width: 120px;
}

.licenca-msg {
  margin: 12px 0 0;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--cor-ciano, #4da3ff);
}

.licenca-msg.hidden { display: none; }

.licenca-expand-actions {
  display: flex;
  justify-content: flex-start;
  margin: 10px 0 4px;
}
.licenca-expand-actions .btn {
  min-height: 40px;
}

@media (max-width: 720px) {
  .licenca-expand-actions {
    justify-content: stretch;
  }
  .licenca-expand-actions .btn {
    width: 100%;
  }
}


#licensesTable tbody tr.license-row.selected td {
  background: rgba(77, 163, 255, 0.16);
  box-shadow:
    inset 0 0 0 1px rgba(77, 163, 255, 0.45),
    inset 3px 0 0 var(--cor-ciano, #4da3ff);
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--cor-card);
  border: 1px solid var(--cor-borda);
  padding: 12px 16px;
  border-radius: 8px;
  z-index: 300;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  transition: opacity 0.25s ease;
}

.toast.hidden { opacity: 0; pointer-events: none; }
.toast.success { border-left: 4px solid var(--cor-ok); }
.toast.error { border-left: 4px solid var(--cor-erro); }

/* ===== Empresas / Gerenciamento / Manutenção ===== */
#companiesTable tbody tr.company-row,
tr.client-row { cursor: pointer; }
#companiesTable tbody tr.company-row:hover td,
tr.client-row:hover td { background: rgba(28, 126, 214, 0.12); }

#logsTable tbody tr.log-row-selectable { cursor: pointer; }
#logsTable tbody tr.log-row-selectable:hover td {
  background: rgba(28, 126, 214, 0.10);
}
#logsTable tbody tr.log-row-selectable.selected td {
  background: rgba(77, 163, 255, 0.16);
  box-shadow: inset 0 0 0 1px rgba(77, 163, 255, 0.45);
}
#logsTable .log-check {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.modal-empresa { max-width: 420px; }
.emp-campo {
  display: grid;
  gap: 2px;
  margin: 10px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(28, 126, 214, 0.25);
}
.emp-label {
  color: var(--cor-suave);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.emp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  margin-top: 8px;
}

.gerencia-blocos {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 12px;
}
.gerencia-bloco {
  background: #0f2744;
  color: var(--cor-texto);
  border: 1px solid #1a4f86;
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.gerencia-bloco:hover:not(.selected) {
  border-color: var(--cor-ciano);
  box-shadow: 0 0 0 1px rgba(77, 163, 255, 0.35);
}
.gerencia-bloco.selected {
  background-image: linear-gradient(
    rgba(77, 163, 255, 0.42),
    rgba(77, 163, 255, 0.42)
  ) !important;
  background-color: #0f2744 !important;
  border-color: #4da3ff !important;
  box-shadow:
    inset 0 0 0 1px rgba(77, 163, 255, 0.75),
    inset 0 0 28px rgba(77, 163, 255, 0.28),
    0 0 14px rgba(77, 163, 255, 0.55) !important;
}

table.zebra-azul tbody tr:nth-child(odd) td { background: #0d1c30; }
table.zebra-azul tbody tr:nth-child(even) td { background: #12263f; }
table.zebra-azul tbody tr.selected td,
table.zebra-azul tbody tr.license-row.selected td,
table.zebra-azul tbody tr.company-row.selected td,
table.zebra-azul tbody tr.backup-company-row.selected td {
  background: rgba(77, 163, 255, 0.16) !important;
  box-shadow: inset 0 0 0 1px rgba(77, 163, 255, 0.45);
}

.companies-restritas-block {
  margin-top: 16px;
  flex-shrink: 0;
}
.companies-ativos-block {
  flex: 1 1 auto;
  min-height: 160px;
  max-height: 48vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.companies-ativos-block .companies-ativos-wrap {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow: auto;
}
.companies-restritas-title {
  color: #f87171 !important;
}
table.zebra-vermelho tbody tr:nth-child(odd) td {
  background: rgba(127, 29, 29, 0.45);
  color: #fecaca;
}
table.zebra-vermelho tbody tr:nth-child(even) td {
  background: rgba(153, 27, 27, 0.55);
  color: #fecaca;
}
table.zebra-vermelho thead th {
  color: #fecaca;
  border-bottom-color: rgba(248, 113, 113, 0.45);
}
table.zebra-vermelho tbody tr.company-row td,
table.zebra-vermelho tbody tr.license-row td {
  color: #fecaca;
}
table.zebra-vermelho tbody tr.company-row strong,
table.zebra-vermelho tbody tr.license-row strong {
  color: #fee2e2;
}
#section-gerenciamento.page.active {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
#section-gerenciamento .licenses-ativos-wrap {
  flex: 1 1 auto;
  min-height: 140px;
  max-height: none;
  overflow: auto;
}
#section-empresas.page.active {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: auto;
}
.companies-ativos-title {
  flex-shrink: 0;
  margin: 0;
  color: #4ade80 !important;
}
#section-empresas .companies-ativos-wrap {
  /* altura vem do .companies-ativos-block no desktop */
  min-height: 0;
  max-height: none;
}

.pages table:not(.zebra-azul):not(.zebra-vermelho) tbody tr:nth-child(odd) td { background: #0d1c30; }
.pages table:not(.zebra-azul):not(.zebra-vermelho) tbody tr:nth-child(even) td { background: #12263f; }
.pages table tbody tr.row-expand td { background: #0c1828; }
.pages table tbody tr:hover:not(.row-expand) td {
  background: rgba(28, 126, 214, 0.16);
}

.license-detail {
  margin: 8px 0 14px;
  padding: 12px;
  border: 1px solid var(--cor-borda);
  border-radius: 10px;
  background: #0c1828;
}
.license-detail.hidden { display: none; }
.license-detail-head h3 { margin-bottom: 4px; }

.licenca-dias-row {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: nowrap;
  margin-top: 8px;
}
.licenca-dias {
  flex: 0 0 auto;
  max-width: 42%;
}
.licenca-dias input {
  max-width: 88px;
  width: 88px;
}
.licenca-vitalicia {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  padding: 0;
  border: none;
  background: transparent;
  margin-bottom: 6px;
  white-space: nowrap;
}
.licenca-vitalicia input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--cor-azul);
}
.btn-exec-backup {
  padding: 3px 8px !important;
  font-size: 0.72rem !important;
  line-height: 1.2;
  white-space: nowrap;
}

.backup-exec-buttons,
.backup-client-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
  align-items: center;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}
.backup-client-screen {
  text-align: center;
  padding: 18px 12px 22px;
}
.backup-client-title {
  margin: 0 0 8px;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--cor-texto);
}
.backup-client-status {
  margin: 0 0 14px;
  font-size: 0.95rem;
  color: var(--cor-suave);
  min-height: 1.2em;
}
.backup-running-line {
  margin: 0 0 10px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #f0c14b;
  min-height: 1.2em;
}
.backup-schedule-line {
  margin: 0 0 12px;
  font-size: 0.78rem;
  color: var(--cor-suave);
  line-height: 1.35;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}
.backup-client-hint {
  margin: 0 0 10px;
  font-size: 0.82rem;
  color: var(--cor-suave);
  line-height: 1.35;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}
.backup-client-empresa {
  margin: 0 0 8px;
  font-weight: 600;
  color: var(--cor-texto);
}
.backup-client-btn,
.backup-exec-buttons .btn,
.backup-motor-btn {
  width: 100%;
  max-width: 320px;
  text-align: center;
  min-height: 52px;
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 12px 18px;
  border-radius: 8px;
}
.backup-btn-label {
  display: block;
}
.backup-btn-sub {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--cor-suave);
  opacity: 0.95;
}
.btn-sm { padding: 4px 10px; font-size: 0.78rem; }
tr.backup-company-row { cursor: pointer; }
tr.backup-company-row:hover td { background: rgba(28, 126, 214, 0.12); }
.modal-backup-exec { max-width: 380px; }

.btn-danger {
  background: #8b1e2d;
  border: 1px solid #c0394a;
  color: #fff;
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
}
.btn-danger:hover { background: #a52638; }

tr.row-expand td {
  background: #0a1626 !important;
  border-top: none;
  padding: 12px 14px;
}
tr.row-expand .inline-detail {
  border: 1px solid rgba(28, 126, 214, 0.35);
  border-radius: 8px;
  padding: 12px;
}
tr.company-row.expanded td,
tr.license-row.expanded td,
tr.backup-company-row.expanded td,
tr.occ-row.expanded td {
  background: rgba(77, 163, 255, 0.14) !important;
  box-shadow: inset 0 0 0 1px rgba(77, 163, 255, 0.4);
}
.occ-row {
  cursor: pointer;
}
.occ-preview {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.occ-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 18px;
}
.occ-detail-span {
  grid-column: 1 / -1;
}
.occ-log-pre {
  margin: 6px 0 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.9em;
  color: var(--cor-texto, #e8eef7);
  background: rgba(0, 0, 0, 0.25);
  border-radius: 6px;
  padding: 10px 12px;
}
@media (max-width: 640px) {
  .backup-client-btn,
  .backup-motor-btn {
    max-width: 100%;
    min-height: 48px;
    font-size: 1rem;
  }
  .backup-client-buttons {
    max-width: 100%;
    padding: 0 4px;
  }
  .backup-btn-sub {
    white-space: normal;
    word-break: break-word;
  }
  #backupTable th,
  #backupTable td {
    font-size: 0.78rem;
    padding: 6px 4px;
  }

  /* Somente celular: chave oculta (copia sem exibir) + erro com Exibir */
  .secret-mask {
    display: inline !important;
    white-space: nowrap;
  }
  .secret-copy,
  .secret-reveal {
    display: inline-flex !important;
  }
  .secret-wrap.secret-key {
    flex-direction: column !important;
    align-items: stretch !important;
    flex-wrap: nowrap !important;
    gap: 4px !important;
    max-width: 100% !important;
    width: 100%;
  }
  .secret-wrap.secret-error {
    flex-wrap: wrap !important;
    max-width: 100%;
  }
  .secret-key .secret-value,
  .secret-key .secret-value[hidden],
  .secret-error:not(.is-revealed) .secret-value,
  td.secret-cell .secret-value {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
    word-break: normal !important;
    max-width: 0 !important;
  }
  .secret-error.is-revealed .secret-mask {
    display: none !important;
  }
  .secret-error.is-revealed .secret-value {
    position: static !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    clip: auto !important;
    overflow: visible !important;
    white-space: normal !important;
    max-width: min(52vw, 220px) !important;
    display: inline-block !important;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  /* Célula Chave isolada — não invade a coluna MAC */
  td.secret-cell {
    position: relative !important;
    overflow: hidden !important;
    width: 92px !important;
    max-width: 92px !important;
    min-width: 92px !important;
    white-space: normal !important;
    vertical-align: middle !important;
    box-sizing: border-box !important;
  }
  td.secret-cell .secret-copy {
    width: 100%;
    justify-content: center;
    font-size: 0.68rem !important;
    padding: 4px 6px !important;
  }
  /* Impede chave longa de esticar a linha no celular (mesmo se JS antigo) */
  #companiesTable td:not(.secret-cell) code.mono,
  #companiesRestrictedTable td:not(.secret-cell) code.mono,
  #licensesTable td:not(.secret-cell) code.mono,
  #licensesRestrictedTable td:not(.secret-cell) code.mono {
    display: inline-block;
    max-width: 88px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    word-break: normal;
  }
  td.secret-cell code.mono.secret-value {
    max-width: 0 !important;
  }
  #companiesTable,
  #companiesRestrictedTable,
  #licensesTable,
  #licensesRestrictedTable {
    table-layout: auto;
  }

  /*
   * Empresas no celular: bloco ativas SEMPRE visível acima do de restritas.
   */
  .pages:has(#section-empresas.active) {
    overflow: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  #section-empresas.page.active {
    display: block !important;
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
    overflow: visible !important;
    padding-bottom: 28px;
  }
  #section-empresas .companies-ativos-block {
    display: block !important;
    visibility: visible !important;
    flex: none !important;
    min-height: 0 !important;
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
    margin-bottom: 12px !important;
  }
  #section-empresas .companies-ativos-title {
    display: block !important;
    margin: 0 0 8px !important;
    font-size: 0.95rem;
    color: #4ade80 !important;
  }
  #section-empresas .companies-ativos-wrap {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    flex: none !important;
    width: 100% !important;
    min-height: 80px !important;
    max-height: none !important;
    height: auto !important;
    margin: 0 !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch;
  }
  #section-empresas #companiesTable {
    display: table !important;
    width: 100%;
    min-width: 480px;
  }
  #section-empresas #companiesTable tbody tr {
    height: auto !important;
  }
  #section-empresas .companies-restritas-block {
    display: block !important;
    flex: none !important;
    margin-top: 8px !important;
  }
  /* Gerenciamento: rolagem da página para ver tabelas e detalhes completos */
  .pages:has(#section-gerenciamento.active) {
    overflow: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
  #section-gerenciamento.page.active {
    display: flex !important;
    flex-direction: column !important;
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
    overflow: visible !important;
    gap: 10px !important;
    padding: 14px 12px 28px !important;
  }
  #section-gerenciamento .page-head,
  #section-gerenciamento .hint {
    flex: none !important;
  }
  #section-gerenciamento .licenses-ativos-wrap {
    flex: none !important;
    min-height: 120px !important;
    max-height: none !important;
    height: auto !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch;
  }
  #section-gerenciamento .companies-restritas-block {
    flex: none !important;
    margin-top: 8px !important;
    overflow: visible !important;
  }
  #section-gerenciamento .companies-restritas-block .table-wrap {
    overflow-x: auto !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch;
  }
  #licensesTable,
  #licensesRestrictedTable {
    min-width: 680px;
  }

  /*
   * Relatório no celular: rolagem + espaçamento vertical alinhado às outras telas.
   * Filtros de data mantêm o layout original (wrap horizontal).
   */
  .pages:has(#section-relatorio.active) {
    overflow: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
  #section-relatorio.page.active {
    display: flex !important;
    flex-direction: column !important;
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
    overflow: visible !important;
    gap: 10px !important;
    padding: 14px 12px 28px !important;
  }
  #section-relatorio .page-head {
    flex: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  #section-relatorio .relatorio-filtros-block {
    flex: none !important;
  }
  #section-relatorio .relatorio-filtros {
    flex: none !important;
    /* Layout original: wrap horizontal como nas outras telas */
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: flex-end !important;
    gap: 12px !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  #section-relatorio .relatorio-filtros label {
    width: auto;
    min-width: 0;
  }
  #section-relatorio .relatorio-filtros input,
  #section-relatorio .relatorio-filtros select {
    width: auto;
    min-width: 150px;
    box-sizing: border-box;
  }
  #section-relatorio .relatorio-filtros .btn {
    width: auto;
    min-height: auto;
  }
  #section-relatorio #relatorioSummary {
    flex: none !important;
    margin: 0 !important;
  }
  #section-relatorio .relatorio-tabela-block {
    flex: none !important;
    overflow: visible !important;
  }
  #section-relatorio .relatorio-tabela-block .table-wrap.grow,
  #section-relatorio .table-wrap.grow {
    flex: none !important;
    min-height: 160px !important;
    max-height: none !important;
    height: auto !important;
    margin: 0 !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch;
  }
  #relatorioTable {
    min-width: 680px;
  }
  #relatorioTable th,
  #relatorioTable td {
    font-size: 0.8rem;
    padding: 8px 8px;
    vertical-align: middle;
  }
  #relatorioTable tbody tr.relatorio-company-row td {
    padding-top: 10px;
    padding-bottom: 10px;
  }
  .page .hint:empty {
    display: none;
    margin: 0;
    padding: 0;
  }
}
.inline-backup-btns {
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: center;
}
.inline-backup-btns .btn,
.inline-backup-btns .backup-motor-btn {
  width: 100%;
  max-width: 420px;
}
.nested-table {
  width: 100%;
  margin-top: 4px;
}

/* Gerenciamento → empresa aberta: tamanho de cada .zip por execução */
.zip-sizes-wrap {
  max-height: 340px;
  overflow: auto;
  border: 1px solid rgba(28, 126, 214, 0.25);
  border-radius: 6px;
}
.zip-sizes-table {
  margin-top: 0;
}
.zip-sizes-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #0d1522;
}
.zip-sizes-table td {
  border-top: 1px solid rgba(28, 126, 214, 0.18);
}
.zip-sizes-table .cell-zip-quando {
  white-space: nowrap;
  vertical-align: top;
  color: #4da3ff;
  font-weight: 600;
}
.zip-sizes-table .cell-zip-tamanho {
  white-space: nowrap;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.zip-sizes-table th:last-child {
  text-align: right;
}
.zip-sizes .hint-erro {
  color: #f87171;
}
.zip-sizes-table tr.zip-grupo {
  display: none;
}
/* Celular: data vira faixa acima do grupo e a tabela cabe na tela (Tamanho sempre visível) */
@media (max-width: 980px) {
  .zip-sizes-wrap {
    max-width: calc(100vw - 64px);
  }
  .zip-sizes-table tr.zip-grupo {
    display: table-row;
  }
  .zip-sizes-table tr.zip-grupo td {
    color: #4da3ff;
    font-weight: 600;
    background: rgba(28, 126, 214, 0.12);
  }
  .zip-sizes-table .cell-zip-quando,
  .zip-sizes-table th:first-child {
    display: none;
  }
}

/* --- Modal Ler QR Code --- */
.modal-qr-scan {
  width: min(96vw, 420px);
  max-width: 420px;
}
.modal-qr-scan .qr-https-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid #b45309;
  border-radius: 8px;
  background: #431407;
  color: #fed7aa;
  font-size: 0.9rem;
  line-height: 1.35;
}
.modal-qr-scan .qr-https-banner.hidden {
  display: none;
}
.modal-qr-scan .qr-https-banner a {
  color: #fde68a;
  font-weight: 700;
  text-decoration: underline;
}
.modal-qr-scan .qr-permit-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px 16px;
  text-align: center;
  background: rgba(15, 23, 42, 0.82);
  color: #f8fafc;
  pointer-events: none;
}
.modal-qr-scan .qr-permit-overlay strong {
  font-size: 1.05rem;
  font-weight: 700;
  color: #facc15;
}
.modal-qr-scan .qr-permit-overlay span {
  font-size: 0.9rem;
  line-height: 1.35;
  max-width: 18rem;
  opacity: 0.95;
}
.modal-qr-scan .qr-permit-overlay.hidden {
  display: none;
}
.modal-qr-scan .qr-detect-banner {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 3;
  max-width: 92%;
  padding: 10px 16px;
  border-radius: 999px;
  background: #facc15;
  color: #111827;
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.modal-qr-scan .qr-detect-banner.hidden {
  display: none;
}
.modal-qr-scan .qr-viewfinder {
  pointer-events: none;
  position: absolute;
  inset: 18% 16%;
  border: 2px solid rgba(250, 204, 21, 0.85);
  border-radius: 12px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.28);
}
.modal-qr-scan .qr-native-block {
  position: relative;
  margin: 8px 0 14px;
  padding: 10px 12px;
  border: 1px solid #334155;
  border-radius: 8px;
  background: #0f172a;
}
.modal-qr-scan .qr-native-block.hidden,
.modal-qr-scan .qr-live-block.hidden {
  display: none;
}
.modal-qr-scan .qr-fallback-title {
  margin: 0 0 6px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #f8fafc;
}
.modal-qr-scan .qr-fallback-hint {
  margin: 0 0 12px;
}
.modal-qr-scan .btn-foto-qr {
  display: flex;
  width: 100%;
  justify-content: center;
  align-items: center;
  min-height: 52px;
  font-weight: 700;
}
.modal-qr-scan .qr-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  opacity: 0;
  pointer-events: none;
}
.modal-qr-scan .qr-video-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  max-height: 55vh;
  background: #0a0a0a;
  border-radius: 8px;
  overflow: hidden;
  margin: 8px 0 12px;
}
.modal-qr-scan .qr-video-wrap.qr-video-dimmed {
  display: none;
}
.modal-qr-scan #qrVideo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #111;
}
.modal-qr-scan .qr-scan-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.modal-qr-scan .qr-scan-actions.hidden {
  display: none;
}
.modal-qr-scan .btn-file {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}
.modal-qr-scan .qr-paste-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.9rem;
  margin: 8px 0 12px;
}
.modal-qr-scan .qr-paste-label input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid #334155;
  background: #0f172a;
  color: #e2e8f0;
  font-family: ui-monospace, monospace;
  font-size: 0.85rem;
}
.modal-qr-scan .qr-status {
  margin: 0 0 8px;
  font-size: 0.9rem;
  line-height: 1.35;
  min-height: 0;
}
.modal-qr-scan .qr-status.hidden {
  display: none;
}
.modal-qr-scan .qr-status-ok { color: #4ade80; }
.modal-qr-scan .qr-status-warn { color: #fbbf24; }
.modal-qr-scan .qr-status-error { color: #f87171; }
.modal-qr-scan #btnQrPermitir {
  font-weight: 700;
}
/* Colunas Empresa (cinza neon), Chave e Versão (azul neon) — todas as telas */
.cell-empresa-neon,
.cell-empresa-neon strong {
  color: #c5cdd8 !important;
  text-shadow: 0 0 6px rgba(197, 205, 216, 0.85), 0 0 14px rgba(139, 155, 176, 0.45);
  font-weight: 700;
}
.cell-chave-neon,
.cell-chave-neon code.mono,
.cell-chave-neon .secret-value {
  color: #1ee3ff !important;
  text-shadow: 0 0 6px rgba(30, 227, 255, 0.85), 0 0 14px rgba(30, 227, 255, 0.4);
  font-weight: 700;
}
.cell-chave-neon .secret-copy {
  color: #1ee3ff;
  border-color: rgba(30, 227, 255, 0.55);
  text-shadow: 0 0 6px rgba(30, 227, 255, 0.55);
}
.conn-force-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-width: 110px;
}
.td-conn-force {
  white-space: nowrap;
  vertical-align: middle;
}
.btn-force-conn {
  font-size: 0.72rem !important;
  padding: 4px 8px !important;
  min-height: 28px;
  line-height: 1.2;
  border: 1px solid rgba(77, 163, 255, 0.55) !important;
  color: #7ec8ff !important;
  background: rgba(28, 126, 214, 0.12) !important;
  white-space: nowrap;
}
.btn-force-conn:hover {
  background: rgba(28, 126, 214, 0.28) !important;
  border-color: #4da3ff !important;
}
.btn-force-conn.busy {
  opacity: 0.7;
  pointer-events: none;
}
@media (max-width: 720px) {
  .conn-force-wrap {
    min-width: 96px;
  }
  .btn-force-conn {
    font-size: 0.68rem !important;
    padding: 5px 8px !important;
  }
}
#section-gerenciamento .toolbar-gerenciamento .btn {
  min-height: 40px;
  padding: 8px 14px;
  white-space: nowrap;
}
@media (max-width: 720px) {
  #section-gerenciamento .page-head {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  #section-gerenciamento .toolbar-gerenciamento {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  #section-gerenciamento .toolbar-gerenciamento .btn {
    width: 100%;
    justify-content: center;
  }
}
