@import url('https://fonts.googleapis.com/css2?family=Public+Sans:wght@400;500;600;700&family=Source+Sans+3:wght@400;500;600&display=swap');

:root {
  --bg:       #F2F4F7;
  --surface:  #FFFFFF;
  --sf2:      #F8F9FB;
  --line:     #E4E9F0;
  --line-lt:  #EEF1F6;
  --text:     #1C2B3A;
  --muted:    #607080;
  --subtle:   #9AAABB;
  --brand:    #1A4A8F;
  --brand-dk: #123570;
  --brand-lt: #F0F5FC;
  --ok:       #1E7A50;
  --danger:   #B03020;
  --r:        10px;
  --r-sm:     7px;
  --sh:       0 1px 3px rgba(20,35,60,.06), 0 4px 12px rgba(20,35,60,.06);
  --sh-sm:    0 1px 3px rgba(20,35,60,.05);
  --sidebar-w: 256px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Source Sans 3", system-ui, sans-serif !important;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-size: 14px;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
h1, h2, h3, h4, h5, h6,
.header, .action-bar, .nav-tabs, .mobile-nav-bar,
.sidebar-title, .kpi-label, .kpi-value,
button, .btn { font-family: "Public Sans", system-ui, sans-serif; }
/* ── HEADER ─────────────────────────────── */
.header {
  background: linear-gradient(100deg, var(--brand-dk) 0%, var(--brand) 55%, #2558D9 100%);
  color: #fff;
  padding: 0 16px;
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  box-shadow: 0 1px 6px rgba(15,30,70,.25);
}
.logo-area { display: flex; align-items: center; gap: 16px; }
.logo-wrap {
  position: relative;
  display: inline-block;
  height: 52px;
  line-height: 0;
}
.logo {
  height: 52px;
  width: auto;
}
.logo-text-overlay {
  position: absolute;
  left: 0;
  top: 0;
  height: 52px;
  width: auto;
  filter: brightness(0) invert(1);
  clip-path: inset(0 0 0 30%);
  pointer-events: none;
}
.header-title {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -.2px;
  line-height: 1;
}
.a11y-controls { display: flex; gap: 4px; }
.a11y-btn {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.22);
  color: rgba(255,255,255,.92);
  border-radius: 5px;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 500;
  transition: background 140ms;
}
.a11y-btn:hover { background: rgba(255,255,255,.22); color: #fff; }
/* ── ACTION BAR ──────────────────────────── */
.action-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  overflow-x: auto;
  flex-wrap: nowrap;
  position: sticky;
  top: 0;
  z-index: 402;
  box-shadow: 0 2px 6px rgba(20,35,60,.06);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.action-bar::-webkit-scrollbar { display: none; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 16px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--muted);
  background: var(--sf2);
  transition: all 140ms;
  white-space: nowrap;
  flex-shrink: 0;
  min-height: 36px;
}
.btn:hover {
  background: var(--brand-lt);
  border-color: #c0d4f0;
  color: var(--brand);
}
/* limpar filtros — discreto, sem vermelho pesado */
.btn-clear {
  color: #8A4040;
  background: #FDF4F4;
  border-color: #EDD0D0;
}
.btn-clear:hover {
  background: #FAE8E8;
  border-color: #D08080;
  color: #7A2020;
}
/* última atualização */
.btn-update {
  margin-left: auto;
  color: #1E6645;
  background: #F2FAF6;
  border-color: #B8DEC9;
}
.btn-update:hover {
  background: #E4F5EC;
  border-color: #70B890;
  color: var(--ok);
}
.ico { width: 14px; height: 14px; fill: currentColor; flex-shrink: 0; }
/* ── NAV TABS ────────────────────────────── */
.nav-tabs {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 0 16px;
  display: flex;
  overflow-x: auto;
  flex-shrink: 0;
  scrollbar-width: none;
  gap: 0;
  position: sticky;
  top: 52px;
  z-index: 401;
}
.nav-tabs::-webkit-scrollbar { display: none; }
.nav-tab {
  display: inline-block;
  padding: 12px 18px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: all 140ms;
}
.nav-tab:hover { color: var(--brand); }
.nav-tab.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
  font-weight: 600;
}
/* ── MOBILE NAV — hamburger ──────────────── */
.mobile-nav-bar {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
  position: sticky;
  top: 52px;
  z-index: 401;
}
.hamburger-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  background: var(--sf2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  min-height: 36px;
  flex: 1;
  transition: all 140ms;
}
.hamburger-btn:hover {
  background: var(--brand-lt);
  border-color: #c0d4f0;
  color: var(--brand);
}
.hamburger-btn.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.mobile-nav-dropdown {
  display: none;
  flex-direction: column;
  background: var(--surface);
  border-bottom: 2px solid var(--brand);
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
  position: fixed;
  left: 0;
  right: 0;
  z-index: 99500;
  max-height: 70vh;
  overflow-y: auto;
}
.mobile-nav-dropdown.open { display: flex; }
.mobile-nav-dropdown .nav-tab {
  display: block;
  padding: 13px 20px;
  font-size: 14px;
  border-bottom: 1px solid var(--line-lt);
  border-left: 3px solid transparent;
  white-space: normal;
  margin-bottom: 0;
}
.mobile-nav-dropdown .nav-tab:last-child { border-bottom: none; }
.mobile-nav-dropdown .nav-tab:hover {
  background: var(--brand-lt);
  color: var(--brand);
}
.mobile-nav-dropdown .nav-tab.active {
  color: var(--brand);
  font-weight: 600;
  border-left-color: var(--brand);
  background: var(--brand-lt);
  border-bottom-color: var(--line-lt);
}
.btn-tour-mobile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--brand, #1351b4);
  color: #fff;
  border: none;
  padding: 6px 16px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  min-height: 36px;
  flex-shrink: 0;
  transition: background .15s;
}
.btn-tour-mobile:hover { background: #0d3f8f; }

/* ── BOTÃO FILTRO MOBILE (header) — base oculta no desktop ── */
.btn-filter-mobile {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  transition: background .15s;
  flex-shrink: 0;
}
.btn-filter-mobile:hover { background: rgba(255,255,255,.25); }
.btn-filter-mobile.active {
  background: rgba(255,255,255,.32);
  border-color: rgba(255,255,255,.55);
}

@media (max-width: 768px), (pointer: coarse) {
  .mobile-nav-bar { display: flex; }
  .nav-tabs       { display: none !important; }
  #btnTour        { display: none !important; }

  /* Header compacto */
  .header         { height: auto; padding: 10px 16px; flex-wrap: wrap; gap: 8px; align-items: center; }
  .header-title   { font-size: 20px; }
  .logo           { height: 36px; }
  .logo-text-overlay { height: 36px; }
  .logo-wrap      { height: 36px; }
  .a11y-controls  { gap: 4px; order: 3; width: 100%; }
  .a11y-btn       { padding: 4px 8px; font-size: 11px; }

  /* Logo ocupa espaço disponível no mobile para empurrar botão para a direita */
  .logo-area      { flex: 1; }

  /* Botão de filtro aparece no header mobile */
  .btn-filter-mobile { display: flex; }

  /* Oculta a seta ">" lateral — substituída pelo botão no header */
  .sidebar-expand-btn { display: none !important; }

  /* KPIs como carrossel swipeable no mobile */
  .kpi-row {
    display: flex !important;
    flex-direction: row !important;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 10px;
    padding-bottom: 6px;
    scrollbar-width: none;
  }
  .kpi-row::-webkit-scrollbar { display: none; }
  .kpi-row .kpi-card {
    flex: 0 0 82%;
    scroll-snap-align: start;
    min-width: 0;
  }

  /* Valor do KPI responsivo — escala com a largura da tela.
     Máx 28px: visualmente dominante. Se um valor for muito longo,
     quebra em 2 linhas como rede de segurança (não trunca com "..."). */
  .kpi-card .qv-slot {
    height: auto !important;
    min-height: 50px !important;
    font-size: clamp(18px, 6.5vw, 28px) !important;
    overflow: visible !important;
  }
  .kpi-card .qv-slot * {
    font-size: inherit !important;
    line-height: 1.15 !important;
    white-space: normal !important;
    word-break: break-word !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }

  /* Charts no mobile: altura maior pra acomodar listas KPI multi-linha
     que empilham label+valor em duas linhas. Charts simples (barras, linhas)
     também ficam confortáveis com mais espaço vertical. */
  .chart-body .qv-slot {
    height: 560px !important;
    min-height: 560px !important;
  }
}
/* ── LAYOUT ──────────────────────────────── */
.main-container {
  display: flex;
  flex: 1;
  min-height: 0;
  position: relative;
}
/* ── SIDEBAR ─────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width 260ms ease, opacity 260ms ease;
  overflow: hidden;
}
.sidebar.collapsed { width: 0; opacity: 0; }
.sidebar-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-lt);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.sidebar-head h3 {
  font-size: 11px;
  font-weight: 600;
  color: var(--subtle);
  letter-spacing: .06em;
  text-transform: uppercase;
}
.toggle-btn {
  width: 26px;
  height: 26px;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: var(--sf2);
  color: var(--subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 130ms;
}
.toggle-btn:hover { background: var(--brand-lt); color: var(--brand); border-color: #c0d4f0; }
.sidebar-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  flex: 1;
}
.sidebar-body::-webkit-scrollbar { width: 3px; }
.sidebar-body::-webkit-scrollbar-thumb { background: var(--line); border-radius: 2px; }
.sidebar-clear-btn {
  margin-top: 8px;
  width: 100%;
  border: 1px solid #d8e1ec;
  background: #eef3f8;
  color: #4f657d;
  border-radius: 7px;
  padding: 9px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.sidebar-clear-btn:hover {
  background: #e4ebf4;
  border-color: #c8d6e6;
}
.sidebar-clear-btn.has-selections {
  background: var(--brand, #1351b4);
  color: #fff;
  border-color: var(--brand, #1351b4);
}
.sidebar-clear-btn.has-selections:hover {
  background: #0d3f8f;
  border-color: #0d3f8f;
}
/* ── FILTROS — slots para app.getObject() ── */
.filter-slot {
  border-radius: var(--r-sm);
  overflow: hidden;
}
/* label do filtro */
.filter-slot-label {
  padding: 8px 10px 4px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: .03em;
}
/* slot onde Qlik injeta o objeto */
.qv-slot {
  width: 100%;
  min-height: 110px;
  position: relative;
  font-size: 11px;
  color: var(--line);
  font-style: italic;
}
/* placeholder SOMENTE quando o slot está vazio — sem conteúdo filho */
.qv-slot:empty::before {
  content: attr(data-label);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: inherit;
}
/* Qlik injeta .qv-object-wrapper dentro do slot — forçar a preencher 100% */
.qv-slot > div {
  width: 100% !important;
  height: 100% !important;
}
/* dentro de chart-body: altura fixa para gráficos (height explícito, não min-height) */
.chart-body .qv-slot {
  height: 420px;
  min-height: 420px;
  background: var(--sf2);
}
/* sidebar filtros: altura explícita */
.filter-slot .qv-slot {
  height: 90px;
  min-height: 90px;
}
/* ── EXPAND BTN ─────────────────────────── */
.sidebar-expand-btn {
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 48px;
  background: var(--brand);
  border: none;
  border-radius: 0 6px 6px 0;
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 2px 0 8px rgba(26,74,143,.25);
  z-index: 200;
  transition: width 140ms;
}
.sidebar-expand-btn:hover { width: 26px; }
.sidebar-expand-btn.visible { display: flex; }
/* ── CONTENT ─────────────────────────────── */
.content-wrapper {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}
.content-area {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
/* ── SELEÇÕES ATIVAS ────────────────────── */
/* discreta, quase invisível quando vazia */
.selections-bar {
  background: var(--sf2);
  border: 1px solid var(--line-lt);
  border-radius: var(--r-sm);
  padding: 8px 14px;
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.sel-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--brand-lt);
  border: 1px solid #c0d4f0;
  border-radius: 999px;
  padding: 2px 8px 2px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--brand);
}
.sel-chip-remove {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: none;
  background: #c0d4f0;
  color: var(--brand-dk);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  padding: 0;
  transition: background 130ms;
}
.sel-chip-remove:hover { background: var(--danger); color: #fff; }

/* ── Banner do período de referência ── */
.period-banner {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: var(--sf2);
  border: 1px solid var(--line-lt);
  border-left: 3px solid var(--brand);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
}
.period-banner strong { font-weight: 600; }
.period-banner svg {
  color: var(--brand);
  margin-top: 3px;
  flex-shrink: 0;
}
.period-banner-text {
  flex: 1;
  min-width: 0;
  text-align: left;
}

/* ── Link CADE Simples no rodapé ── */
.cade-simples-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
  white-space: nowrap;
}
.cade-simples-text { color: var(--muted); }
.cade-simples-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--brand);
  color: #fff;
  padding: 4px 11px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 12px;
  transition: background .15s, transform .15s;
}
.cade-simples-link:hover .cade-simples-btn {
  background: var(--brand-dk);
  transform: translateY(-1px);
}
@media (max-width: 768px), (pointer: coarse) {
  .cade-simples-text { display: none; }
  .cade-simples-link { font-size: 0; }
  .cade-simples-btn  { font-size: 12px; }
}

@media (max-width: 768px), (pointer: coarse) {
  .period-banner {
    font-size: 12.5px;
    padding: 9px 12px;
    line-height: 1.4;
    gap: 7px;
  }
  .period-banner svg {
    width: 13px !important;
    height: 13px !important;
    margin-top: 2px;
  }
}
/* ── KPI ROW ─────────────────────────────── */
/* Mobile-first: 1 coluna no mobile, expande em telas maiores */
.kpi-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: stretch;
}
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 14px 18px 12px;
  box-shadow: var(--sh-sm);
  transition: box-shadow 200ms, transform 200ms;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.kpi-card:hover {
  box-shadow: var(--sh);
  transform: translateY(-1px);
}
/* sem span — todos ocupam 1 coluna */
.kpi-card.main { grid-column: span 1; }
/* linha de acento — discreta */
.kpi-card::before {
  content: '';
  display: block;
  width: 24px;
  height: 2px;
  background: var(--line);
  border-radius: 2px;
  margin-bottom: 10px;
}
.kpi-card.main::before { background: var(--brand); opacity: .5; }
/* título — um pouco mais destacado */
.kpi-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: .01em;
  margin-bottom: 8px;
}
/* o qv-slot dentro de KPI — sem centralizar, altura fixa */
.kpi-card .qv-slot {
  min-height: 60px;
  height: 60px;
  position: relative;
  font-size: inherit;
  color: inherit;
  font-style: normal;
}
.kpi-card .qv-slot:empty::before {
  content: attr(data-label);
  font-size: 11px;
  color: var(--line);
  font-style: italic;
}
/* valor — mesmo tamanho em todos os cards */
.kpi-val {
  font-size: 28px;
  font-weight: 300;
  color: var(--text);
  letter-spacing: -.02em;
  line-height: 1.15;
}
.kpi-card.main .kpi-val {
  font-size: 28px;
  font-weight: 300;
  color: #2A527A;
}
.kpi-delta {
  margin-top: 5px;
  font-size: 11px;
  font-weight: 400;
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--subtle);
}
.delta-up   { color: #2A7A54; }
.delta-down { color: #8A3030; }
/* ── PERSPECTIVE TABS ───────────────────── */
.perspective-tabs {
  display: flex;
  gap: 0;
  background: var(--sf2);
  border: none;
  border-bottom: 2px solid var(--line);
  border-radius: 0;
  padding: 0;
}
.ptab {
  flex: none;
  padding: 14px 28px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  border: none;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  background: transparent;
  transition: all 150ms;
  text-align: center;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: -2px;
  cursor: pointer;
}
.ptab:hover { color: var(--brand); background: transparent; }
.ptab.active {
  background: transparent;
  border-bottom-color: var(--brand);
  color: var(--brand);
  font-weight: 600;
}
/* ── CHART CARDS ─────────────────────────── */
/* Wrapper das abas (Gráficos / Detalhamento) — mesmo gap que .content-area
   para uniformizar espaço vertical entre linhas de cards. */
.tab-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
/* Mobile-first: 1 coluna no mobile, expande em telas maiores */
.charts-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
.charts-side-by-side {
  grid-template-columns: 1fr;
}
.chart-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--sh-sm);
  overflow: hidden;
  transition: box-shadow 180ms;
}
.chart-card:hover { box-shadow: var(--sh); }
.chart-card.full { grid-column: span 1; }
.chart-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-lt);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.chart-titles { flex: 1; }
.chart-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -.01em;
}
.chart-sub {
  font-size: 12px;
  color: var(--subtle);
  margin-top: 2px;
}
.chart-actions { display: flex; gap: 5px; flex-shrink: 0; }
.chart-btn {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--sf2);
  color: var(--subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 130ms;
}
.chart-btn:hover {
  background: var(--brand-lt);
  color: var(--brand);
  border-color: #c0d4f0;
}
.chart-btn .ico { width: 13px; height: 13px; }
/* ── FOOTER NOTE ─────────────────────────── */
.footer-note {
  background: #FEFBF0;
  border: 1px solid #EDE0B0;
  border-left: 3px solid #C8A830;
  border-radius: var(--r-sm);
  padding: 12px 18px;
  font-size: 12.5px;
  color: #6A5520;
  line-height: 1.65;
}
.footer-note strong { font-weight: 600; }
/* ── SITE FOOTER ─────────────────────────── */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 12px 16px;
  font-size: 12px;
  color: var(--subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  flex-wrap: wrap;
  gap: 6px;
}
/* ── LOADER ─────────────────────────────── */
#loader {
  z-index: 999999;
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  text-align: center;
  background-color: #fff;
}
.loader {
  margin-top: calc(50vh - 45px);
  width: 90px;
  height: 90px;
  border-radius: 50%;
  display: inline-block;
  position: relative;
  background: linear-gradient(0deg, rgba(102,102,102,0.2) 33%, #666 100%);
  box-sizing: border-box;
  animation: rotation 1s linear infinite;
}
.loader::after {
  content: '';
  box-sizing: border-box;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: #fff;
}
@keyframes rotation {
  0% { transform: rotate(0deg) }
  100% { transform: rotate(360deg) }
}
/* ── ACESSIBILIDADE ─────────────────────── */
html.contraste {
  background-color: #000 !important;
  filter: invert(100%);
  -webkit-filter: invert(100%);
}
html.monotom {
  background-color: #000 !important;
  filter: invert(100%) grayscale(100%);
  -webkit-filter: invert(100%) grayscale(100%);
}
/* ── Qlik popups na frente ──────────────── */
.qv-listbox-popover,
.qv-listbox-backdrop,
.qv-modal,
.qv-popup,
.lui-popover,
.lui-dropdown,
[data-tid="popover"],
[role="dialog"],
[role="listbox"],
.qv-filterpane,
.qv-object-listbox {
  z-index: 999999 !important;
}
/* ── FULLSCREEN / EXPANDED ───────────────── */
.chart-card.expanded {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 99999 !important;
  background: #fff !important;
  border-radius: 0 !important;
  border: none !important;
  box-shadow: none !important;
  overflow: hidden;
  display: flex !important;
  flex-direction: column !important;
}
.chart-card.expanded .chart-head {
  flex-shrink: 0;
}
.chart-card.expanded .chart-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.chart-card.expanded .chart-body .qv-slot {
  flex: 1;
  height: 100% !important;
  min-height: 0 !important;
}
/* Wrappers internos do Qlik: forçar preencher 100% no fullscreen */
.chart-card.expanded .qv-slot > div,
.chart-card.expanded .qv-object-wrapper,
.chart-card.expanded .qv-object-content-container,
.chart-card.expanded .qv-object {
  width: 100% !important;
  height: 100% !important;
}
body.card-expanded-enabled {
  overflow: hidden !important;
}
body.card-expanded-enabled .header,
body.card-expanded-enabled .action-bar,
body.card-expanded-enabled .nav-tabs,
body.card-expanded-enabled .site-footer,
body.card-expanded-enabled [vw] {
  visibility: hidden !important;
}
/* ── RESPONSIVE (MOBILE-FIRST) ──────────────
   Estilos base = mobile (< 481px)
   Breakpoints crescentes usando min-width
   ──────────────────────────────────────────── */

/* Small tablet / mobile landscape (≥ 481px) */
@media (min-width: 481px) {
  .kpi-row { grid-template-columns: 1fr 1fr; gap: 12px; }
}

/* Tablet (≥ 769px) — paddings maiores, layout mais confortável */
@media (min-width: 769px) and (pointer: fine) {
  .header { padding: 0 28px; }
  .action-bar {
    padding: 10px 28px;
    overflow-x: visible;
    flex-wrap: wrap;
  }
  .nav-tabs { padding: 0 28px; top: 56px; }
  .content-area { padding: 24px 28px; gap: 20px; }
  .tab-panel    { gap: 20px; }
  .site-footer { padding: 12px 28px; }
  .charts-row { grid-template-columns: 1fr; }
}

/* Desktop (≥ 1101px) — grid completo com múltiplas colunas */
@media (min-width: 1101px) and (pointer: fine) {
  .kpi-row { grid-template-columns: repeat(4, 1fr); }
  .charts-row { grid-template-columns: 1.1fr .9fr; }
  .charts-side-by-side { grid-template-columns: 1fr 1fr 1fr; }
  .chart-card.full { grid-column: span 2; }
  .charts-row.cols-2 { grid-template-columns: 1fr 1fr; }
}

/* Variantes responsivas */
.charts-row.single,
.kpi-row.single { grid-template-columns: 1fr; }

/* ══════════════════════════════════════════════
   TOUR GUIADO
══════════════════════════════════════════════ */

/* Overlay escuro */
.tour-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 99990;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}
.tour-overlay.tour-active {
  opacity: 1;
  pointer-events: auto;
}

/* Spotlight — buraco no overlay */
.tour-spotlight {
  position: absolute;
  z-index: 99991;
  border-radius: 8px;
  box-shadow: 0 0 0 9999px rgba(0,0,0,.55);
  pointer-events: none;
  transition: top .35s ease, left .35s ease, width .35s ease, height .35s ease;
  display: none;
}

/* Tooltip */
.tour-tooltip {
  position: absolute;
  z-index: 99992;
  width: 380px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,.25), 0 2px 8px rgba(0,0,0,.1);
  padding: 24px 24px 18px;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity .3s ease, transform .3s ease;
  display: none;
  font-family: "Public Sans", system-ui, sans-serif;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 110px);
  overflow-y: auto;
}
.tour-tooltip.tour-active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Arrow */
.tour-tooltip-arrow {
  position: absolute;
  width: 14px;
  height: 14px;
  background: #fff;
  transform: rotate(45deg);
  border-radius: 2px;
}
.tour-tooltip[data-position="bottom"] .tour-tooltip-arrow {
  top: -7px;
  left: 50%;
  margin-left: -7px;
  box-shadow: -2px -2px 4px rgba(0,0,0,.06);
}
.tour-tooltip[data-position="top"] .tour-tooltip-arrow {
  bottom: -7px;
  left: 50%;
  margin-left: -7px;
  box-shadow: 2px 2px 4px rgba(0,0,0,.06);
}
.tour-tooltip[data-position="right"] .tour-tooltip-arrow {
  left: -7px;
  top: 50%;
  margin-top: -7px;
  box-shadow: -2px 2px 4px rgba(0,0,0,.06);
}
.tour-tooltip[data-position="left"] .tour-tooltip-arrow {
  right: -7px;
  top: 50%;
  margin-top: -7px;
  box-shadow: 2px -2px 4px rgba(0,0,0,.06);
}

/* Botão fechar */
.tour-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: none;
  font-size: 22px;
  color: #999;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  transition: color .15s;
}
.tour-close:hover { color: #333; }

/* Step indicator */
.tour-step-indicator {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--brand, #1351b4);
  margin-bottom: 6px;
}

/* Título */
.tour-title {
  font-size: 17px;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0 0 8px;
  line-height: 1.3;
}

/* Texto */
.tour-text {
  font-size: 13.5px;
  color: #555;
  line-height: 1.65;
  margin: 0 0 16px;
}

/* Footer com botões */
.tour-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

/* Botões do tour */
.tour-btn {
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 6px;
  border: 1.5px solid #ddd;
  background: #fff;
  color: #555;
  cursor: pointer;
  transition: all .15s ease;
}
.tour-btn:hover {
  background: #f5f5f5;
  border-color: #bbb;
}
.tour-btn-primary {
  background: var(--brand, #1351b4);
  color: #fff;
  border-color: var(--brand, #1351b4);
}
.tour-btn-primary:hover {
  background: #0d3f8f;
  border-color: #0d3f8f;
}
.tour-btn:disabled,
.tour-btn[disabled] {
  opacity: .35;
  cursor: default;
  pointer-events: none;
}

/* Dots indicadores de passo */
.tour-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}
.tour-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #d0d5dd;
  transition: background .2s;
}
.tour-dot.active {
  background: var(--brand, #1351b4);
}

/* Botão Tour no action-bar */
#btnTour {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-left: 8px;
  background: var(--brand, #1351b4);
  color: #fff;
  border: none;
  padding: 6px 16px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: background .15s;
  white-space: nowrap;
  flex-shrink: 0;
  min-height: 36px;
}
#btnTour:hover {
  background: #0d3f8f;
}
#btnTour .ico {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* Tour pulse on spotlight */
@keyframes tour-pulse {
  0%   { box-shadow: 0 0 0 9999px rgba(0,0,0,.55), 0 0 0 3px rgba(255,255,255,.8); }
  50%  { box-shadow: 0 0 0 9999px rgba(0,0,0,.55), 0 0 0 8px rgba(255,255,255,.3); }
  100% { box-shadow: 0 0 0 9999px rgba(0,0,0,.55), 0 0 0 3px rgba(255,255,255,.8); }
}
.tour-spotlight.pulse {
  animation: tour-pulse 1.8s ease-in-out infinite;
}

/* Tour content area */
.tour-content {
  overflow-y: auto;
  max-height: calc(100vh - 220px);
}

/* Tour fade-out animation */
.tour-fade-out {
  animation: tourFadeOut .25s forwards;
}
@keyframes tourFadeOut {
  to { opacity: 0; transform: translateY(-6px); }
}

/* Tour swipe hint on mobile */
.tour-swipe-hint {
  display: none;
  font-size: 11px;
  color: #aaa;
  text-align: center;
  margin-top: 8px;
}

/* ── HABILITAR INTERAÇÃO — bloqueia só os objetos Qlik ──────── */
/* .disableScroll mantido no HTML mas não usado — lógica migrou para pointer-events */
.disableScroll { display: none !important; }

/* Quando interação está desabilitada: bloqueia SOMENTE gráficos/tabelas na área de conteúdo.
   Filtros na sidebar (.sidebar .qv-slot) ficam sempre interativos.
   Só aplica no mobile — no desktop a interação é sempre livre (botão fica oculto). */
@media (max-width: 768px), (pointer: coarse) {
  body.qlik-interact-off .content-area .qv-slot {
    pointer-events: none;
  }
}

/* Botão habilitar interação */
.enable-interactive {
  display: none;
  align-items: center;
  gap: 6px;
  background: #f0f4fa;
  color: var(--brand, #1351b4);
  border: 1px solid #c0d4f0;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  min-height: 36px;
  flex-shrink: 0;
  transition: background .15s;
}
.enable-interactive:hover { background: #dce8f8; }
.enable-interactive.ativo {
  background: var(--brand, #1351b4);
  color: #fff;
  border-color: var(--brand, #1351b4);
}
@media (max-width: 768px), (pointer: coarse) {
  .enable-interactive { display: inline-flex; }
}

/* Tour tooltip — ajustes mobile */
@media (max-width: 768px), (pointer: coarse) {
  .tour-tooltip {
    width: calc(100vw - 32px) !important;
    left: 16px !important;
    padding: 18px 16px 14px;
  }
  .tour-tooltip-arrow { display: none; }
  .tour-swipe-hint { display: block; }
  .tour-footer { gap: 6px; }
}
@media (max-width: 420px) {
  .tour-footer {
    flex-direction: column-reverse;
    align-items: stretch;
  }
  .tour-btn { width: 100%; justify-content: center; }
  .tour-dots { justify-content: center; order: -1; }
}
