/* pmc.css — design system do Sistema PM&C
   Identidade TPFE (TEMA TPF do modelo Mkt&Com + logos oficiais):
     azul primário #0067FF · azul claro #0096FF · navy texto #00284D
     navy logo/topbar #001842 · coral (acento único quente) #FD6B3F
     apoio #92CAFF / #65A3FF · links #5ABDFE
   Tipografia: Aptos (Light/SemiBold) com fallback Roboto/Segoe UI. */
:root {
  --navy: #001842;          /* navy dos logos — topbar e blocos escuros   */
  --texto-escuro: #00284D;  /* dk1 do TEMA TPF — cor de texto             */
  --azul: #0067FF;          /* accent1 — cor primária da marca            */
  --azul-2: #0096FF;        /* accent2 — azul claro de apoio              */
  --azul-claro: #eaf3ff;
  --coral: #FD6B3F;         /* accent3 — único acento quente (destaques)  */
  --bg: #f4f7fa;
  --texto: #00284D;
  --borda: #dfe7f0;
  --muted: #64748b;
  --link: #5ABDFE;

  --verde: #6fbf73;
  --laranja: #FFA51F;       /* âmbar — bem distinto do vermelho nas faixas */
  --vermelho: #D9453D;      /* vermelho mais profundo (contraste c/ âmbar) */
  --surface: #ffffff;      /* cartoes/paineis (claro)                    */
  --surface-2: #f4f9ff;    /* superficie alternativa sutil               */
  --hover: #f4f9ff;        /* hover de linhas de tabela                  */
  --tint-info: #f7faff;    /* realce informativo                         */
  --tint-warn: #fff7e0;    /* realce de atencao                          */
  --tint-danger: #fff5f5;  /* realce de risco                            */
  --tint-ok: #f0faf1;      /* realce positivo                            */
  --titulo: #001842;       /* cor de TITULOS e numeros de KPI (nao e fundo) */
  --grad-card: linear-gradient(180deg, #ffffff 0%, #f5f9ff 100%);
  --sheen: inset 0 1px 0 rgba(255,255,255,.6);
}

/* ---------- TEMA ESCURO (mantem a identidade TPF) ----------
   So as SUPERFICIES e o texto mudam: a topbar segue navy, e o azul #0067FF e o
   coral #FD6B3F continuam como acentos. Ativado por data-theme="dark" no <html>
   (alternado pelo botao no topo; a escolha fica no localStorage). */
:root[data-theme="dark"] {
  /* Azul-ardósia SUAVE (não preto puro) — aspecto perolado, menos cansativo. */
  --bg: #101a2b;
  --surface: #18253d;       /* cartões nitidamente acima do fundo            */
  --surface-2: #1e2c47;
  --hover: #22345a;
  --texto: #eaf1fb;         /* texto claro de alto contraste                 */
  --texto-escuro: #eaf1fb;
  --borda: #2b3f60;         /* bordas visíveis, porém macias                 */
  --muted: #9fb3d2;
  --link: #8cc2ff;
  /* Acentos SUAVIZADOS (perolados): visíveis sem berrar. */
  --azul: #4b8ef2;
  --azul-2: #6aa8ff;
  --azul-claro: #1a2c4c;
  --coral: #ff8b66;
  --verde: #4cc98d;
  --laranja: #f2b455;
  --vermelho: #ef6f6b;
  /* Realces de status — escuros e DESSATURADOS (contraste confortável). */
  --tint-info: #17273f;
  --tint-warn: #2f2a18;
  --tint-danger: #342226;
  --tint-ok: #172f27;
  /* Títulos/números: claros no escuro (antes usavam --navy e sumiam). */
  --titulo: #eef4fd;
  /* Cartões com gradiente perolado (sheen no topo) para suavizar. */
  --grad-card: linear-gradient(180deg, #1d2c48 0%, #14203a 100%);
  --sheen: inset 0 1px 0 rgba(255,255,255,.05);
}


* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Aptos', 'Roboto', 'Segoe UI', Arial, sans-serif;
  font-weight: 300;         /* Aptos/Roboto Light — corpo, como no modelo */
  background: var(--bg);
  color: var(--texto);
}

strong, b, th, .kpi-valor, .kpi-label, h1, h2, h3 { font-weight: 600; }

/* ---------- Topbar ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--navy);
  color: white;
  padding: 0 20px;
  height: 58px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar .logo-img { height: 34px; }

.topbar nav {
  display: flex;
  gap: 4px;
  flex: 1;
  overflow-x: auto;
  /* Barra de rolagem VISÍVEL sobre o navy (a padrão era escura e sumia) */
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.45) rgba(255,255,255,.08);
  padding-bottom: 2px;
}

.topbar nav::-webkit-scrollbar { height: 7px; }
.topbar nav::-webkit-scrollbar-track { background: rgba(255,255,255,.08); border-radius: 999px; }
.topbar nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.45); border-radius: 999px; }
.topbar nav::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.7); }

.topbar nav a {
  color: #cdd9ee;
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 8px;
  white-space: nowrap;
  transition: background .15s, color .15s;
}

.topbar nav a:hover { background: rgba(255,255,255,.08); color: white; }
.topbar nav a.ativa { background: var(--azul); color: white; }

/* ---------- Módulos GERAIS no menu (Prompt 6) ----------
   Clicar num grupo abre a BARRA DE SUBMÓDULOS (#subbarras) abaixo do menu
   — todos os submódulos permitidos visíveis de uma vez, sem dropdown. */
.nav-grupo-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #cdd9ee;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: .4px;
  padding: 8px 12px;
  border-radius: 8px;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.nav-grupo-btn:hover { background: rgba(255,255,255,.08); color: white; }
.nav-grupo-btn.ativa { background: var(--azul); color: white; }
.nav-grupo-btn .nav-seta { font-size: 9px; opacity: .7; }

#subbarras {
  position: sticky;
  top: 58px;              /* cola logo abaixo da topbar */
  z-index: 49;
}
.subbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  background: #00284D;    /* navy secundário TPFE */
  padding: 6px 20px;
  box-shadow: 0 2px 8px rgba(0,24,66,.18);
}
/* IMPORTANTE: display:flex acima sobrepõe o [hidden] nativo do navegador —
   sem esta regra TODAS as barras apareciam empilhadas na tela Início. Só a
   barra do módulo clicado (ou da tela atual) fica visível. */
.subbar[hidden] { display: none; }
.subbar-rotulo {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: rgba(255,255,255,.55);
  margin-right: 8px;
}
.subbar a {
  color: #cdd9ee;
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 700;
  padding: 7px 12px;
  border-radius: 8px;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.subbar a:hover { background: rgba(255,255,255,.1); color: white; }
.subbar a.ativa { background: var(--azul); color: white; }

/* Seletor de produto no topo — mesmo visual do chip */
.produto-topo select {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.18);
  color: #dce6f5;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 11.5px;
  font-weight: 700;
  max-width: 260px;
  min-width: 170px;
  text-overflow: ellipsis;
  cursor: pointer;
}
.produto-topo select:hover { border-color: var(--azul); color: white; }
.produto-topo select option { color: var(--texto, #17253a); background: var(--surface); }

.produto-chip {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.18);
  color: #dce6f5;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 11.5px;
  font-weight: 700;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: none;
}

.produto-chip:hover { border-color: var(--azul); color: white; }

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #dce6f5;
  white-space: nowrap;
}

.user-chip .perfil-badge {
  background: var(--azul);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
}

.user-chip a { color: #9fb8e6; font-size: 11.5px; }
.btn-tema {
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.25);
  color: #fff; width: 30px; height: 30px; border-radius: 50%; cursor: pointer;
  font-size: 15px; line-height: 1; padding: 0; display: inline-flex;
  align-items: center; justify-content: center; transition: background .15s;
}
.btn-tema:hover { background: rgba(255,255,255,.18); }

/* Avatar do usuario + menu suspenso (substitui badge/nome/links repetidos) */
.user-menu { position: relative; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--azul); color: #fff; font-weight: 700; font-size: 12.5px;
  letter-spacing: .5px; display: inline-flex; align-items: center;
  justify-content: center; line-height: 1; transition: filter .15s;
}
.avatar:hover { filter: brightness(1.08); }
.avatar-lg { width: 40px; height: 40px; font-size: 14px; }
.user-drop {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60;
  min-width: 230px; background: var(--surface); color: var(--texto);
  border: 1px solid var(--borda); border-radius: 12px; padding: 8px;
  box-shadow: 0 14px 40px rgba(0,0,0,.28);
}
.user-drop-cab {
  display: flex; align-items: center; gap: 10px; padding: 6px 8px 10px;
  border-bottom: 1px solid var(--borda); margin-bottom: 6px;
}
.user-drop-nome { font-weight: 700; font-size: 13.5px; color: var(--texto); }
.user-drop-perfil { font-size: 11.5px; color: var(--muted); }
.user-drop a {
  display: block; padding: 9px 10px; border-radius: 8px; text-decoration: none;
  color: var(--texto); font-size: 13px;
}
.user-drop a:hover { background: var(--hover); }
.sair-btn {
  width: 34px; height: 34px; border-radius: 50%; text-decoration: none;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.25);
  color: #fff; font-size: 15px; display: inline-flex; align-items: center;
  justify-content: center; transition: background .15s;
}
.sair-btn:hover { background: rgba(217,69,61,.55); }

.produto-limpar {
  color: #ffb3a0;
  text-decoration: none;
  font-size: 17px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  line-height: 1;
}
.produto-limpar:hover { background: rgba(255,255,255,.12); color: white; }

/* ---------- Menu hambúrguer (zoom alto / telas estreitas / celular) ---------- */
.menu-hamburguer {
  display: none;
  background: none;
  border: 1px solid rgba(255,255,255,.3);
  color: white;
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.menu-hamburguer:hover { background: rgba(255,255,255,.1); }

@media (max-width: 1180px) {
  .topbar { flex-wrap: wrap; height: auto; min-height: 58px; padding: 9px 14px; }
  .menu-hamburguer { display: inline-block; }
  .topbar nav {
    display: none;
    flex-basis: 100%;
    flex-direction: column;
    order: 10;
    overflow: visible;
    padding: 6px 0 4px;
    border-top: 1px solid rgba(255,255,255,.15);
    margin-top: 6px;
  }
  .topbar nav.aberto { display: flex; }
  .topbar nav a { font-size: 14px; padding: 12px 12px; }
  /* Menu estreito: botões de grupo empilhados; a barra de submódulos vira
     bloco normal (a topbar tem altura variável, sticky fixo não serve) */
  .nav-grupo-btn { width: 100%; text-align: left; font-size: 14px; padding: 12px; }
  #subbarras { position: static; }
  .subbar { padding: 6px 12px; }
  .produto-chip { max-width: 38vw; }
  .produto-topo select { max-width: 38vw; min-width: 120px; }
  .user-chip span:not(.perfil-badge) { display: none; } /* só o badge no estreito */
  .conteudo { padding: 12px; }
  .export-bar { bottom: 12px; right: 12px; }
}

@media (max-width: 640px) {
  .kpi-row { grid-template-columns: repeat(auto-fit, minmax(105px, 1fr)); }
  .kpi .kpi-valor { font-size: 19px; }
  .filtro input, .filtro select { min-width: 105px; }
  .modulo-grid { grid-template-columns: 1fr; }
  .chart-wrap { height: 260px; }
}

/* ---------- Selects pesquisáveis (listas grandes) ---------- */
.select-busca-painel {
  position: absolute;
  z-index: 90;
  background: var(--surface);
  border: 1px solid var(--borda);
  border-radius: 10px;
  box-shadow: 0 12px 34px rgba(0,24,66,.22);
  max-height: 300px;
  overflow-y: auto;
  min-width: 240px;
}

.select-busca-painel .busca-caixa {
  position: sticky;
  top: 0;
  background: var(--surface);
  padding: 8px;
  border-bottom: 1px solid var(--borda);
}

.select-busca-painel .busca-caixa input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--borda);
  border-radius: 7px;
  font-size: 12.5px;
}

.select-busca-painel .busca-opcao {
  padding: 8px 12px;
  font-size: 12.5px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.select-busca-painel .busca-opcao:hover,
.select-busca-painel .busca-opcao.ativa { background: var(--azul-claro); }
.select-busca-painel .busca-opcao.selecionada { font-weight: 700; color: var(--azul); }
.select-busca-painel .busca-vazio { padding: 12px; font-size: 12px; color: var(--muted); }

/* Proxy visual dos selects MÚLTIPLOS (colaboradores, classificações…) */
.multi-proxy {
  padding: 8px 26px 8px 10px;
  border-radius: 7px;
  border: 1px solid var(--borda);
  font-size: 12px;
  background: var(--surface) url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2364748b'/%3E%3C/svg%3E") no-repeat right 9px center;
  color: var(--texto);
  min-width: 150px;
  max-width: 240px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.multi-proxy:hover { border-color: var(--azul); }

/* ---------- Layout ---------- */
.conteudo {
  padding: 20px;
  max-width: 1500px;
  margin: 0 auto;
}

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 1000px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

.card {
  background: var(--grad-card);
  border-radius: 12px;
  border: 1px solid var(--borda);
  border-top: 3px solid var(--azul);
  box-shadow: 0 4px 14px rgba(0,0,0,.10), var(--sheen);
  padding: 18px 20px;
}

.card h1, .card h2 {
  margin: 0 0 4px 0;
  color: var(--titulo);
  font-weight: 800;
}
.card h1 { font-size: 22px; }
.card h2 { font-size: 16px; }
.card .sub { margin: 0 0 14px 0; color: var(--muted); font-size: 13px; }

/* ---------- "i" informativo (em todos os visuais) ----------
   Uso: <span class="info-i" title="O que é, como é calculado e exemplo de
   decisão que apoia.">i</span> — o navegador mostra o texto ao passar o
   mouse; em telas touch, ao tocar e segurar. */
.info-i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--azul);
  color: white;
  font-size: 10px;
  font-weight: 800;
  font-style: normal;
  cursor: help;
  vertical-align: 2px;
  margin-left: 6px;
  user-select: none;
}
.info-i:hover { background: var(--navy); }

/* ---------- KPIs ---------- */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.kpi {
  background: var(--grad-card);
  border: 1px solid var(--borda);
  border-radius: 12px;
  padding: 12px 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,.08), var(--sheen);
}

.kpi .kpi-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: .4px;
}

.kpi .kpi-valor {
  font-size: 26px;
  font-weight: 800;
  color: var(--titulo);
  margin-top: 2px;
}

.kpi.destaque { background: var(--navy); border-color: var(--navy); }
.kpi.destaque .kpi-label { color: #9fb8e6; }
.kpi.destaque .kpi-valor { color: white; }

.kpi.ok .kpi-valor { color: var(--verde); }
.kpi.ruim .kpi-valor { color: var(--vermelho); }

/* ---------- Tabelas ---------- */
.tabela-scroll { overflow: auto; border: 1px solid var(--borda); border-radius: 8px; }

table.pmc {
  border-collapse: collapse;
  width: 100%;
  font-size: 12.5px;
}

table.pmc thead th {
  position: sticky;
  top: 0;
  background: var(--navy);
  color: white;
  padding: 9px 10px;
  text-align: right;
  font-weight: 700;
  white-space: nowrap;
  z-index: 2;
}

table.pmc thead th:first-child { text-align: left; }

table.pmc td {
  padding: 7px 10px;
  border-bottom: 1px solid #eef2f6;
  text-align: right;
  white-space: nowrap;
}

table.pmc td:first-child { text-align: left; font-weight: 600; }
table.pmc tbody tr:hover td { background: var(--hover); }

tr.grupo td {
  background: var(--azul-claro);
  font-weight: 800;
  color: var(--titulo);
  cursor: pointer;
}

tr.grupo td:first-child::before { content: '▸ '; }
tr.grupo.aberto td:first-child::before { content: '▾ '; }
tr.detalhe { display: none; }
tr.detalhe.visivel { display: table-row; }
tr.detalhe td:first-child { padding-left: 26px; font-weight: 400; }

/* ---------- Formulários / filtros ---------- */
.filtros-linha {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 16px;
}

.filtro label {
  display: block;
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

.filtro input, .filtro select {
  padding: 8px 10px;
  border-radius: 7px;
  border: 1px solid var(--borda);
  font-size: 12px;
  background: var(--surface);
  color: var(--texto);
  min-width: 130px;
}

.filtro input:focus, .filtro select:focus {
  outline: none;
  border-color: var(--azul);
  box-shadow: 0 0 0 2px rgba(0,102,255,.15);
}

.btn {
  background: var(--azul);
  color: white;
  border: none;
  border-radius: 7px;
  padding: 9px 16px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.btn:hover { filter: brightness(1.1); }

.badge-escopo {
  background: var(--tint-warn);
  border: 1px solid #f0dfa8;
  color: #8a6d1a;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 700;
}

/* ---------- Gráficos ---------- */
.chart-wrap { position: relative; height: 320px; }
.chart-wrap.baixo { height: 260px; }

/* ---------- Skeleton (carregando) ---------- */
.skeleton {
  border-radius: 8px;
  min-height: 120px;
  background: linear-gradient(90deg, #eef2f6 25%, #f7fafc 50%, #eef2f6 75%);
  background-size: 400% 100%;
  animation: shimmer 1.2s infinite;
}

@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

/* ---------- Alertas ---------- */
.alerta {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid var(--borda);
  border-left: 4px solid var(--laranja);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: var(--surface-2);
}

.alerta.performance { border-left-color: var(--vermelho); background: var(--tint-danger); }
.alerta.recursos { border-left-color: var(--laranja); }
.alerta.prazo { border-left-color: var(--azul); background: var(--tint-info); }

.alerta .alerta-titulo { font-size: 12.5px; font-weight: 800; color: var(--titulo); }
.alerta .alerta-detalhe { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* ---------- Home: produtos e módulos ---------- */
.produto-lista { display: flex; flex-direction: column; gap: 8px; max-height: 55vh; overflow-y: auto; padding-right: 4px; }

.produto-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface-2);
  border: 1px solid #e0e8f5;
  border-left: 4px solid #d5e5ff;
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: background .15s, border-left-color .15s, transform .15s;
}

.produto-item:hover {
  background: var(--azul-claro);
  border-left-color: var(--azul);
  transform: translateY(-1px);
}

.produto-item.selecionado { border-left-color: var(--verde); background: var(--tint-ok); }

.produto-nome { font-size: 13px; font-weight: 700; color: var(--titulo); }
.produto-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }

.modulo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
  gap: 10px;
}

.modulo-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  text-align: center;
  background: var(--navy);
  color: white;
  border-radius: 10px;
  padding: 12px 10px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  transition: background .15s, transform .15s;
}

.modulo-btn:hover { background: var(--azul); transform: translateY(-1px); }
.modulo-btn.desabilitado { opacity: .35; pointer-events: none; }

/* Módulos GERAIS na Home (Prompt 6): grandes, com contagem; os submódulos
   abrem embaixo ao clicar (um grupo por vez). */
.modgeral-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.modgeral-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 68px;
  background: linear-gradient(135deg, var(--navy) 0%, #00284D 100%);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 12px 10px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: .5px;
  cursor: pointer;
  transition: background .15s, transform .12s;
}
.modgeral-btn:hover { background: var(--azul); transform: translateY(-1px); }
.modgeral-btn.aberto { background: var(--azul); }
.modgeral-btn .modgeral-conta {
  font-size: 10.5px;
  font-weight: 700;
  opacity: .75;
}
.submodulo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
  gap: 10px;
  margin-top: 10px;
  padding: 12px;
  background: rgba(0,103,255,.06);
  border: 1px solid rgba(0,103,255,.18);
  border-radius: 12px;
}
.submodulo-grid[hidden] { display: none; }

/* Assinatura PM&C abaixo dos módulos (destino do "voo" da animação) */
.home-logo-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 22px 20px; text-align: center;
}
.home-logo-card img { width: min(240px, 60%); height: auto; }
.home-logo-card .sub { margin: 0; letter-spacing: .3px; }
.home-logo-card img { transition: opacity .6s ease; }
.home-logo-card img.oculto-intro { opacity: 0; }  /* aparece no fim da animação */

/* ---------- Matriz de alocação (Gestão de Recursos) ---------- */
.matrix-scroll { overflow: auto; border: 1px solid var(--borda); border-radius: 8px; max-height: 60vh; }

table.matriz { border-collapse: collapse; width: 100%; font-size: 12px; }

table.matriz thead th {
  position: sticky; top: 0;
  background: var(--navy); color: white;
  padding: 9px 8px; text-align: center;
  font-weight: 700; white-space: nowrap; z-index: 2;
  text-transform: capitalize;
}

table.matriz th.col-nome, table.matriz td.col-nome {
  position: sticky; left: 0; z-index: 1;
  text-align: left; background: var(--surface);
  padding: 7px 12px; font-weight: 600;
  border-right: 2px solid var(--borda); white-space: nowrap;
}

table.matriz thead th.col-nome { z-index: 3; background: var(--navy); }

table.matriz td {
  padding: 6px 8px; text-align: center;
  border-bottom: 1px solid #eef2f6; color: var(--texto);
}

.cell.adequada, .cell.disponivel, .cell.superalocado { color: white; font-weight: 700; }
.cell.adequada { background: var(--verde); }
.cell.disponivel { background: var(--laranja); }
.cell.superalocado { background: var(--vermelho); }
.cell.vazio { background: transparent; }
.cell.nao-atende { opacity: .18; }

.legend { display: flex; gap: 16px; align-items: center; font-size: 11.5px; color: var(--muted); margin-top: 10px; flex-wrap: wrap; }
.legend .sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -2px; }
.sw.adequada { background: var(--verde); }
.sw.disponivel { background: var(--laranja); }
.sw.superalocado { background: var(--vermelho); }

.regulador-wrap { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.regulador-wrap input[type=range] { width: 180px; accent-color: var(--azul); }

/* ---------- Login ---------- */
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, var(--navy) 0%, #00284D 45%, var(--azul) 130%);
}

.login-card {
  background: var(--surface);
  border-radius: 16px;
  padding: 44px 52px;
  width: 480px;
  max-width: 94vw;
  box-shadow: 0 24px 60px rgba(0,0,0,.4);
}

.login-card .logo-img { display: block; margin: 0 auto 22px; max-height: 84px; max-width: 100%; }
.login-card h1 { font-size: 21px; text-align: center; color: var(--texto-escuro); margin: 0 0 22px; }

.login-card label { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--muted); margin: 14px 0 5px; }
.login-card input, .login-card textarea {
  width: 100%; padding: 13px 14px; border-radius: 9px;
  border: 1px solid var(--borda); font-size: 15px;
  font-family: inherit;
}
.login-card input:focus, .login-card textarea:focus {
  outline: none; border-color: var(--azul); box-shadow: 0 0 0 3px rgba(0,103,255,.15);
}
.login-card .btn { width: 100%; margin-top: 22px; padding: 14px; font-size: 14px; }

/* Campo de senha com botao "olho" (mostrar/ocultar) */
.senha-wrap { position: relative; }
.senha-wrap input { width: 100%; box-sizing: border-box; padding-right: 44px; }
.olho-btn {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; font-size: 17px; line-height: 1;
  padding: 6px; border-radius: 8px; opacity: .75;
}
.olho-btn:hover { opacity: 1; background: var(--azul-claro); }
.login-erro { background: var(--tint-danger); border: 1px solid #f2c4c4; color: #b23b3b; border-radius: 8px; padding: 10px 12px; font-size: 13px; margin-bottom: 8px; }
.login-ok { background: var(--tint-ok); border: 1px solid #bfe5c7; color: #256c31; border-radius: 8px; padding: 10px 12px; font-size: 13px; margin-bottom: 8px; }
.login-links { text-align: center; margin-top: 18px; font-size: 13px; }
.login-links a { color: var(--azul); font-weight: 600; text-decoration: none; }
.login-links a:hover { text-decoration: underline; }

/* ---------- Estado vazio ---------- */
.empty-state {
  min-height: 180px;
  border: 1px dashed #cbd5e1;
  background: var(--surface-2);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 12.5px;
}

/* ---------- Veredito / semáforo (Análise Prescritiva) ---------- */
.veredito {
  border-radius: 14px;
  padding: 26px 28px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 20px;
  color: white;
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
}
.veredito .vd-icone { font-size: 46px; line-height: 1; }
.veredito .vd-titulo { font-size: 26px; font-weight: 800; margin: 0; }
.veredito .vd-sub { font-size: 14px; opacity: .95; margin: 4px 0 0; }
.veredito.ok    { background: linear-gradient(135deg, #3f9d54 0%, #6fbf73 100%); }
.veredito.risco { background: linear-gradient(135deg, #b3261e 0%, #D9453D 100%); }
.veredito.alerta{ background: linear-gradient(135deg, #d98324 0%, #FFA51F 100%); }

.card.cenario-ok    { border-top-color: var(--verde); }
.card.cenario-risco { border-top-color: var(--vermelho); }

/* ---------- Exportação ---------- */
.export-bar {
  position: fixed;
  bottom: 18px;
  right: 18px;
  display: flex;
  gap: 8px;
  z-index: 60;
}

.export-bar button {
  background: var(--navy);
  color: white;
  border: none;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0,18,51,.35);
  transition: background .15s, transform .15s;
}

.export-bar button:hover { background: var(--azul); transform: translateY(-1px); }

.print-header { display: none; }

/* ---------- Impressão (Exportar PDF) ---------- */
@media print {
  .topbar, .export-bar, .filtros-linha, .btn, .login-body,
  .regulador-wrap { display: none !important; }

  .print-header {
    display: block;
    font-size: 16px;
    font-weight: 800;
    color: var(--navy);
    padding: 0 0 12px 0;
    border-bottom: 2px solid var(--navy);
    margin-bottom: 14px;
  }

  body { background: white; }
  .conteudo { max-width: none; padding: 0; }

  /* Solta os limites de rolagem: o PDF sai com o conteúdo completo */
  .tabela-scroll, .matrix-scroll, .produto-lista {
    max-height: none !important;
    overflow: visible !important;
    border: none;
  }

  .card, .kpi, .chart-wrap, .alerta { break-inside: avoid; }
  .card { box-shadow: none; }
  .kpi { box-shadow: none; }

  table.pmc thead th, table.matriz thead th { position: static; }

  /* Garante as cores de semáforo no PDF */
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- Scrollbars ---------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,18,51,.25); border-radius: 999px; }
