/* Painel IBTAUÁ — tema e layout (1.7) */
:root {
  --ouro: #ffc600;
  --ouro-texto: #ffc600;
  --ouro-escuro: #2b2400;
  --preto: #000000;
  --superficie: #111111;
  --superficie-2: #1c1c1c;
  --linha: #2a2a2a;
  --texto: #ffffff;
  --texto-suave: #b9b9b9;
  --alerta: #ff7a6b;
  --raio-pequeno: 8px;
  --raio-grande: 16px;
  --topo-altura: 3.25rem;
  color-scheme: dark;
  font-size: 16px;
}
:root[data-theme="light"] {
  --ouro: #ffc600;
  --ouro-texto: #000000;
  --ouro-escuro: #fff3b3;
  --preto: #e8e8e8;
  --superficie: #ffffff;
  --superficie-2: #f3f3f3;
  --linha: #d9d9d9;
  --texto: #000000;
  --texto-suave: #4d4d4d;
  --alerta: #b3261e;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--preto); color: var(--texto); transition: background 0.25s ease, color 0.25s ease; }
body { font-family: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif; line-height: 1.5; }
h1, h2, h3, .marca-texto strong, .grupo-cabecalho, .entrada h1 {
  font-family: "Barlow Condensed", "Barlow", system-ui, sans-serif;
}
a { color: var(--ouro-texto); }
:focus-visible { outline: 3px solid var(--ouro); outline-offset: 2px; }
.carregando { text-align: center; color: var(--texto-suave); padding: 4rem 1rem; }

/* Botões */
.botao {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 2.75rem; padding: 0 1.25rem; border-radius: 999px; border: 0;
  font: inherit; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em;
  cursor: pointer; background: var(--ouro); color: #000000;
  transition: filter 0.15s ease, transform 0.1s ease;
}
.botao:hover { filter: brightness(1.05); }
.botao:active { transform: scale(0.98); }
.botao[disabled] { opacity: 0.6; cursor: wait; }
.botao-secundario { background: transparent; color: var(--texto); border: 1px solid var(--linha); }
.botao-pequeno { min-height: 2.25rem; padding: 0 0.9rem; font-size: 0.9rem; }
.botao-largo { width: 100%; }

.botao-tema {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.25rem; height: 2.25rem; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--linha); background: var(--superficie); color: var(--texto);
  font-size: 1.05rem; transition: background 0.15s ease;
}
.botao-tema:hover { background: var(--superficie-2); }
.botao-tema.flutuante { position: fixed; top: 0.75rem; right: 0.75rem; z-index: 20; box-shadow: 0 2px 8px rgba(0,0,0,0.12); }

/* Entrada */
.entrada { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.entrada-caixa { max-width: 26rem; width: 100%; }
.entrada h1 { font-size: 2.8rem; line-height: 1; margin: 0 0 0.75rem; font-weight: 800; text-transform: uppercase; color: var(--texto); }
.entrada p { color: var(--texto-suave); margin: 0 0 1.75rem; }

.aviso { border-left: 4px solid var(--ouro); background: var(--superficie); padding: 1rem 1.1rem; border-radius: var(--raio-pequeno); margin: 1rem 0; }
.aviso.erro { border-left-color: var(--alerta); }

/* Topo */
.topo {
  height: var(--topo-altura); display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  padding: 0 1rem; background: var(--preto); border-bottom: 3px solid var(--ouro);
  position: sticky; top: 0; z-index: 10;
}
.marca { display: flex; align-items: center; gap: 0.6rem; min-width: 0; }
.logo { height: 1.9rem; width: auto; flex: none; }
:root[data-theme="light"] .logo { filter: invert(1) brightness(0.2); }
.marca-texto { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.marca-texto strong { font-size: 1.1rem; font-weight: 800; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.marca-texto small { font-size: 0.72rem; color: var(--ouro); font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; }
.conta { display: flex; align-items: center; gap: 0.6rem; color: var(--texto-suave); font-size: 0.85rem; }
.menu-btn {
  display: none; width: 2.25rem; height: 2.25rem; border-radius: var(--raio-pequeno);
  border: 1px solid var(--linha); background: transparent; color: var(--texto); font-size: 1.1rem; cursor: pointer;
}

/* Casca */
.casca { display: grid; grid-template-columns: 15.5rem minmax(0, 1fr); min-height: 100vh; }
.casca > .topo { grid-column: 1 / -1; }

/* Menu lateral */
.menu {
  border-right: 1px solid var(--linha); background: var(--superficie);
  padding: 1rem 0.75rem 3rem; position: sticky; top: var(--topo-altura); align-self: start;
  max-height: calc(100vh - var(--topo-altura)); overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: var(--linha) transparent;
}
.grupo { margin-bottom: 0.5rem; }
.grupo-cabecalho {
  display: flex; align-items: center; gap: 0.5rem; width: 100%; background: transparent; border: 0;
  cursor: pointer; font: inherit; padding: 0.55rem 0.6rem; border-radius: var(--raio-pequeno);
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--texto-suave); text-align: left; transition: background 0.15s ease, color 0.15s ease;
}
.grupo-cabecalho:hover { color: var(--texto); background: var(--superficie-2); }
.grupo-icone { color: var(--ouro); font-size: 0.95rem; width: 1rem; text-align: center; }
.grupo-nome { flex: 1; }
.grupo-seta { font-size: 1.1rem; line-height: 1; color: var(--texto-suave); transition: transform 0.3s ease, color 0.3s ease; }
.grupo.aberto .grupo-seta { transform: rotate(90deg); color: var(--ouro); }

/* Expansão suave: altura por grid + fade */
.grupo-itens {
  display: grid; grid-template-rows: 0fr; visibility: hidden;
  transition: grid-template-rows 0.32s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.32s;
}
.grupo.aberto .grupo-itens { grid-template-rows: 1fr; visibility: visible; }
.grupo-lista {
  min-height: 0; overflow: hidden; padding-left: 0.4rem;
  opacity: 0; transform: translateY(-6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.grupo.aberto .grupo-lista { opacity: 1; transform: none; transition-delay: 0.05s; }

.item {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; width: 100%;
  text-align: left; background: transparent; border: 0; border-left: 3px solid transparent;
  color: var(--texto-suave); font: inherit; font-size: 0.93rem; padding: 0.45rem 0.65rem;
  border-radius: 0 var(--raio-pequeno) var(--raio-pequeno) 0; cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.item:hover { background: var(--superficie-2); color: var(--texto); }
.item.ativo { background: var(--ouro); border-left-color: #000000; color: #000000; font-weight: 700; }
.ponto { width: 6px; height: 6px; border-radius: 50%; background: var(--texto-suave); opacity: 0.5; flex: none; }
.item.ativo .ponto { background: #000000; }

/* Conteúdo */
.principal { max-width: 70rem; margin: 0; padding: 1.75rem 1.75rem 2rem; min-width: 0; }
.trilha { margin: 0 0 0.35rem; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ouro); }
.cabecalho h2 { font-size: 2.6rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0; line-height: 1; margin: 0; }
.sub { color: var(--texto-suave); font-size: 0.95rem; margin: 0.4rem 0 0; max-width: 46rem; }
.vazio { margin-top: 1.75rem; border: 1px dashed var(--linha); background: var(--superficie); border-radius: var(--raio-grande); padding: 2.5rem 1rem; text-align: center; }
.vazio-icone { font-size: 2rem; color: var(--ouro-texto); opacity: 0.6; margin-bottom: 0.5rem; }
.vazio h3 { margin: 0 0 0.4rem; font-size: 1.2rem; }
.vazio p { color: var(--texto-suave); margin: 0 auto; max-width: 34rem; }
.principal .rodape { text-align: left; padding: 2.5rem 0 0; }

/* Lista de membros */
.ferramentas { display: grid; gap: 0.9rem; margin: 1.5rem 0 1rem; }
.busca {
  width: 100%; min-height: 2.9rem; padding: 0 1rem; border-radius: var(--raio-pequeno);
  border: 1px solid var(--linha); background: var(--superficie); color: var(--texto); font: inherit;
}
.filtros { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.filtro {
  min-height: 2.4rem; padding: 0 1rem; border-radius: 999px; font: inherit; font-size: 0.93rem;
  border: 1px solid var(--linha); background: transparent; color: var(--texto); cursor: pointer;
}
.filtro[aria-pressed="true"] { background: var(--ouro); border-color: var(--ouro); color: #000000; font-weight: 600; }
.filtro .n { opacity: 0.75; margin-left: 0.35rem; }
.resumo { color: var(--texto-suave); font-size: 0.93rem; margin: 0.5rem 0 1rem; }
.lista { width: 100%; border-collapse: collapse; background: var(--superficie); border-radius: var(--raio-grande); overflow: hidden; }
.lista th { text-align: left; font-weight: 600; font-size: 0.85rem; color: var(--texto-suave); padding: 0.7rem 0.85rem; border-bottom: 1px solid var(--linha); }
.lista td { padding: 0.8rem 0.85rem; border-bottom: 1px solid var(--superficie-2); vertical-align: top; }
.lista .nome { font-weight: 600; }
.vazio-campo { color: var(--texto-suave); }
.etiqueta { white-space: nowrap; display: inline-block; font-size: 0.78rem; padding: 0.1rem 0.55rem; border-radius: 999px; background: var(--superficie-2); color: var(--texto-suave); }
.etiqueta.pendente { background: var(--ouro); color: #000000; font-weight: 600; }

/* Perfil e formulários */
.formulario { display: grid; gap: 0.6rem; max-width: 30rem; margin-top: 1.5rem; }
.rotulo { font-weight: 600; font-size: 0.95rem; margin-top: 0.6rem; }
.acoes { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.25rem; }
.perfil { margin-top: 1.5rem; background: var(--superficie); border-radius: var(--raio-grande); padding: 1.25rem; }
.campos { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.campo span { display: block; color: var(--texto-suave); font-size: 0.85rem; }
.campo strong { font-weight: 600; word-break: break-word; }
.rodape { text-align: center; font-size: 0.8rem; color: var(--texto-suave); padding: 1.5rem 1rem 2rem; opacity: 0.8; }

/* Celular */
@media (max-width: 860px) {
  .casca { grid-template-columns: 1fr; }
  .menu-btn { display: inline-flex; align-items: center; justify-content: center; }
  .menu {
    display: none; position: fixed; top: var(--topo-altura); left: 0; right: 0; bottom: 0;
    max-height: none; z-index: 9; border-right: 0;
  }
  .casca.menu-aberto .menu { display: block; }
  .principal { padding: 1.25rem 1rem 2rem; }
  .cabecalho h2 { font-size: 1.6rem; }
  .conta .email { display: none; }
}

/* Membros: ficha, edição e ordenação (1.8) */
.coluna-cadastro { white-space: nowrap; min-width: 9.5rem; }
.coluna-cadastro .etiqueta { padding: 0.25rem 0.75rem; font-size: 0.85rem; }
.link-nome {
  background: none; border: 0; padding: 0; font: inherit; font-weight: 600; cursor: pointer;
  color: var(--texto); text-align: left; text-decoration: underline; text-decoration-color: var(--ouro);
  text-underline-offset: 3px;
}
.link-nome:hover { color: var(--ouro); }
.linha-controles { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; }
.ordenacao { display: flex; align-items: center; gap: 0.5rem; color: var(--texto-suave); font-size: 0.9rem; }
.ordenacao .busca { min-width: 14rem; min-height: 2.4rem; }
.ficha { margin-top: 1rem; }
.ficha-topo { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.ficha-nome { font-size: 1.6rem; margin: 1rem 0 0.25rem; }
.ficha-campos { margin-top: 1.25rem; background: var(--superficie); border-radius: var(--raio-grande); padding: 1.25rem; }
.ficha-form { background: var(--superficie); border-radius: var(--raio-grande); padding: 1.25rem; max-width: 36rem; }
select.busca { appearance: auto; }

/* Pessoas: métricas, painéis e blocos (1.10) */
.bloco { background: var(--superficie); border-radius: var(--raio-grande); padding: 1.25rem; }
.bloco h3 { margin: 0 0 0.5rem; font-size: 1.35rem; font-weight: 800; text-transform: uppercase; }
.cards-metricas { display: grid; gap: 0.9rem; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); margin-bottom: 1.25rem; }
.card-metrica { background: var(--superficie); border-radius: var(--raio-grande); padding: 1rem 1.1rem; border-top: 3px solid var(--ouro); }
.card-metrica span { display: block; color: var(--texto-suave); font-size: 0.85rem; }
.card-metrica strong { font-family: "Barlow Condensed", sans-serif; font-size: 2rem; font-weight: 800; }
.painel-duplo { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); }
.barra-linha { display: grid; grid-template-columns: 5.5rem 1fr 3.5rem; align-items: center; gap: 0.75rem; margin: 0.55rem 0; }
.barra-rot { color: var(--texto-suave); font-size: 0.9rem; }
.barra-trilha { height: 0.7rem; background: var(--superficie-2); border-radius: 999px; overflow: hidden; }
.barra-cheia { height: 100%; background: var(--ouro); border-radius: 999px; transition: width 0.4s ease; }
.barra-n { text-align: right; font-weight: 700; font-size: 0.9rem; }
.codigo { font-family: ui-monospace, Consolas, monospace; font-size: 0.8rem; word-break: break-all; color: var(--texto-suave); }
.filtro[role="tab"] { border-radius: 0; border: 0; border-bottom: 3px solid transparent; background: transparent; }
.filtro[role="tab"][aria-selected="true"] { border-bottom-color: var(--ouro); color: var(--texto); background: transparent; font-weight: 700; }

/* Aniversários (1.11) */
.etiqueta.destaque { background: var(--ouro); color: #000; font-weight: 600; }
.lista a.botao { text-decoration: none; white-space: nowrap; }

/* Início: painel (1.12) */
.destaque-hoje { border-top: 3px solid var(--ouro); }
.aniv-lista { list-style: none; margin: 0.5rem 0 0; padding: 0; }
.aniv-item {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  padding: 0.7rem 0; border-bottom: 1px solid var(--linha);
}
.aniv-item:last-child { border-bottom: 0; }
.aniv-item .sub { display: block; margin: 0.15rem 0 0; font-size: 0.85rem; }
.aniv-item .botao { white-space: nowrap; }

/* Utilitários de espaçamento (1.13) */
.margem-topo-grande { margin-top: 1.5rem; }
.margem-topo-media { margin-top: 1.25rem; }

/* Dashboards e links (1.15) */
.card-link { text-decoration: none; color: inherit; display: block; transition: transform 0.12s ease, background 0.12s ease; }
.card-link:hover { transform: translateY(-2px); background: var(--superficie-2); }
.secao-titulo { font-size: 1.6rem; text-transform: uppercase; font-weight: 800; margin: 1.75rem 0 0.25rem; }
.barra-link { text-decoration: none; color: inherit; border-radius: var(--raio-pequeno); padding: 0.15rem 0.35rem; margin: 0.4rem -0.35rem; }
.barra-link:hover { background: var(--superficie-2); }
.sem-quebra { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 16rem; }
.colunas-fixas th, .colunas-fixas td { white-space: nowrap; }
.colunas-fixas td.nome .link-nome { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 18rem; display: inline-block; vertical-align: bottom; }

/* Ícones do menu (1.16) */
.icone { display: inline-block; vertical-align: middle; flex: none; }
.grupo-icone { display: inline-flex; align-items: center; justify-content: center; width: 1.25rem; color: var(--ouro); }
.trilha .icone { margin-right: 0.35rem; }

/* Dashboards de membros e início (1.17) */
.grade-dash { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); margin: 1rem 0 1.25rem; }
.donut-wrap { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; justify-content: center; padding-top: 0.5rem; }
.donut { position: relative; width: 11rem; height: 11rem; border-radius: 50%; flex: none; }
.donut-furo {
  position: absolute; inset: 22%; border-radius: 50%; background: var(--superficie);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.donut-furo strong { font-family: "Barlow Condensed", sans-serif; font-size: 1.8rem; font-weight: 800; line-height: 1; }
.donut-furo span { font-size: 0.75rem; color: var(--texto-suave); }
.legenda { list-style: none; margin: 0; padding: 0; font-size: 0.9rem; }
.legenda li { display: flex; align-items: center; gap: 0.5rem; margin: 0.35rem 0; }
.ponto-cor { width: 0.75rem; height: 0.75rem; border-radius: 3px; display: inline-block; flex: none; }
.barra-acoes { display: flex; justify-content: flex-end; margin: 0.5rem 0 0; }

/* Tema escuro (1.20): fundo preto, blocos brancos com texto preto, barra e menu pretos com texto branco */
:root[data-theme="dark"] {
  --preto: #000000;
  --superficie: #ffffff;
  --superficie-2: #f2f2f2;
  --linha: #dcdcdc;
  --texto: #000000;
  --texto-suave: #555555;
  --ouro-escuro: #fff3b3;
  --ouro-texto: #000000;
  --chrome-texto: #ffffff;
  --chrome-suave: #bdbdbd;
  --chrome-linha: #262626;
  --chrome-hover: #1a1a1a;
}
:root[data-theme="dark"] .topo { color: var(--chrome-texto); background: #000; }
:root[data-theme="dark"] .topo .marca-texto strong { color: #ffffff; }
:root[data-theme="dark"] .topo .email,
:root[data-theme="dark"] .topo .conta { color: var(--chrome-suave); }
:root[data-theme="dark"] .topo .botao-secundario { color: #ffffff; border-color: #444; }
:root[data-theme="dark"] .menu-btn,
:root[data-theme="dark"] .botao-tema { color: #ffffff; border-color: #444; background: transparent; }
:root[data-theme="dark"] .botao-tema:hover { background: var(--chrome-hover); }
:root[data-theme="dark"] .menu { background: #000; border-right-color: var(--chrome-linha); color: var(--chrome-texto); }
:root[data-theme="dark"] .grupo-cabecalho { color: var(--chrome-suave); }
:root[data-theme="dark"] .grupo-cabecalho:hover { color: #ffffff; background: var(--chrome-hover); }
:root[data-theme="dark"] .item { color: var(--chrome-suave); }
:root[data-theme="dark"] .item:hover { color: #ffffff; background: var(--chrome-hover); }
:root[data-theme="dark"] .item.ativo { color: #000000; background: var(--ouro); }
:root[data-theme="dark"] .grupo-seta { color: var(--chrome-suave); }
:root[data-theme="dark"] .entrada h1,
:root[data-theme="dark"] .cabecalho h2 { color: #ffffff; }
:root[data-theme="dark"] .entrada p,
:root[data-theme="dark"] .cabecalho .sub,
:root[data-theme="dark"] .resumo,
:root[data-theme="dark"] .carregando,
:root[data-theme="dark"] .rodape { color: var(--chrome-suave); }
:root[data-theme="dark"] .carregando { color: var(--chrome-suave); }

/* Melhorias pendentes (1.21) */
.topo { background: #000000 !important; }
.topo .marca-texto strong { color: #ffffff; }
.topo .conta, .topo .email { color: #bdbdbd; }
.topo .logo, :root[data-theme="light"] .logo { filter: none !important; }
.topo .botao-secundario { color: #ffffff; border-color: #444; }
.botao-voltar {
  display: inline-flex; align-items: center; min-height: 2.25rem; padding: 0 0.9rem;
  border-radius: 999px; border: 1px solid #444; background: transparent; color: #ffffff;
  font: inherit; font-size: 0.9rem; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.botao-voltar:hover { background: #1a1a1a; }
/* Barras com o nome completo sempre visível */
.barra-linha { grid-template-columns: 15rem minmax(0, 1fr) 3rem !important; }
.barra-rot { white-space: nowrap; overflow: visible; }

/* Sem quebra de linha em tabelas e quadros (1.23) */
.principal { min-width: 0; overflow-x: auto; }
.lista { white-space: nowrap; }
.lista th, .lista td { white-space: nowrap; }
.lista td .etiqueta, .lista td .link-nome { white-space: nowrap; }
.card-metrica span, .card-metrica strong, .campo span, .campo strong,
.aniv-item, .aniv-item > div, .legenda li, .barra-linha, .barra-rot, .barra-n,
.grupo-cabecalho, .item, .filtro, .etiqueta, .botao, .botao-voltar, .botao-tema {
  white-space: nowrap;
}

/* Janela inteira e tabelas sem corte (1.24) */
.principal { max-width: none; width: 100%; padding: 1.25rem 1.25rem 2rem; overflow-x: auto; }
.lista { width: 100%; overflow: visible; border-radius: var(--raio-grande); }
.lista th, .lista td { padding: 0.6rem 0.7rem; }

/* Nomes clicáveis sem sublinhado (1.25) */
.link-nome, .link-nome:hover, .link-nome:focus-visible {
  text-decoration: none !important;
  border-bottom: 0 !important;
  background-image: none !important;
}
.link-nome:hover { color: var(--ouro-texto); }
.link-nome:focus-visible { outline: 2px solid var(--ouro); outline-offset: 2px; }

/* Dashboard clicável de membros (1.26) */
.barra-botao { background: none; border: 0; width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; padding: 0.15rem 0.35rem; margin: 0.4rem -0.35rem; border-radius: var(--raio-pequeno); }
.barra-botao:hover, .barra-botao.ativo { background: var(--ouro-escuro); }
.legenda-botao { display: inline-flex; align-items: center; gap: 0.5rem; background: none; border: 0; font: inherit; color: inherit; cursor: pointer; padding: 0.2rem 0.35rem; border-radius: var(--raio-pequeno); white-space: nowrap; }
.legenda-botao:hover, .legenda-botao.ativo { background: var(--ouro-escuro); }
.legenda-botao.ativo { font-weight: 700; }
.opcoes-sexo { display: inline-flex; gap: 0.9rem; flex-wrap: nowrap; }
.opcoes-sexo label { display: inline-flex; align-items: center; gap: 0.35rem; white-space: nowrap; cursor: pointer; }
.opcoes-sexo input { accent-color: var(--ouro); width: 1rem; height: 1rem; cursor: pointer; }

/* Início com tamanho contido (1.27) */
.painel-inicio { max-width: 60rem; }
.painel-inicio .cards-metricas { grid-template-columns: repeat(auto-fill, minmax(10.5rem, 13rem)); justify-content: start; gap: 0.75rem; }
.painel-inicio .card-metrica { padding: 0.8rem 0.9rem; }
.painel-inicio .card-metrica strong { font-size: 1.7rem; }
.painel-inicio .painel-duplo { grid-template-columns: repeat(auto-fit, minmax(16rem, 26rem)); justify-content: start; }
.painel-inicio .bloco { padding: 1rem 1.1rem; }
.painel-inicio .secao-titulo { font-size: 1.3rem; }
.painel-inicio .barra-linha { grid-template-columns: 12rem minmax(0, 24rem) 2.5rem !important; max-width: 40rem; gap: 0.6rem; }
.painel-inicio .bloco:has(.barra-linha) { max-width: 46rem; }

/* ===== Padrão único para dashboards (1.29) ===== */
:root {
  --dash-pizza: 8.5rem;          /* diâmetro das rosquinhas */
  --dash-barra-altura: 0.6rem;   /* espessura das barras */
  --dash-titulo: 1.2rem;         /* título dos blocos */
  --dash-gap: 1rem;              /* espaço entre blocos */
}

.grade-dash {
  display: grid;
  gap: var(--dash-gap);
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  margin: 0.5rem 0 1.25rem;
}
@media (max-width: 900px) {
  .grade-dash { grid-template-columns: 1fr; }
}

.dash-bloco, .grade-dash > .bloco { padding: 1rem 1.1rem; }
.dash-bloco h3, .grade-dash > .bloco h3 { font-size: var(--dash-titulo); margin: 0 0 0.5rem; }

/* Rosquinha pequena com legenda à direita */
.donut-wrap {
  display: flex; flex-direction: row; align-items: center; justify-content: flex-start;
  gap: 1rem; flex-wrap: nowrap; padding-top: 0.25rem;
}
.donut {
  width: var(--dash-pizza); height: var(--dash-pizza); flex: none;
}
.donut-furo { inset: 24%; }
.donut-furo strong { font-size: 1.3rem; }
.legenda { flex: 1; min-width: 0; }
.legenda li { margin: 0.25rem 0; }

/* Barras retas, como linhas que partem do início */
.barra-linha { grid-template-columns: 6.5rem minmax(0, 1fr) 2.5rem; gap: 0.6rem; margin: 0.45rem 0; }
.barra-trilha { height: var(--dash-barra-altura); border-radius: 0; background: var(--superficie-2); }
.barra-cheia { height: 100%; border-radius: 0; background: var(--ouro); transition: width 0.4s ease; }
.barra-n { font-size: 0.9rem; }

/* Selo do WhatsApp e alinhamento de mensagem (1.30) */
.selo-wa {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 1.7rem; height: 1.7rem; border-radius: 50%; background: #25D366; color: #ffffff;
}
.linha-mensagem { display: inline-flex; align-items: center; gap: 0.5rem; white-space: nowrap; }

/* Idade em colunas verticais e blocos mais largos (1.31) */
.grade-dash { grid-template-columns: minmax(14rem, 0.9fr) minmax(19rem, 1.1fr) minmax(19rem, 1.1fr); }
.donut { width: 7.5rem; height: 7.5rem; }
.donut-wrap { gap: 0.75rem; }
.legenda li { font-size: 0.9rem; }
.colunas-idade {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0.35rem;
  align-items: stretch; height: 14rem; margin-top: 0.5rem;
}
.coluna-idade {
  display: flex; flex-direction: column; align-items: center; min-width: 0; height: 100%;
  background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer;
}
.coluna-valor { font-weight: 700; font-size: 0.9rem; line-height: 1.2; margin-bottom: 0.3rem; }
.coluna-barra { position: relative; flex: 1; width: 100%; min-height: 0; }
.coluna-cheia {
  position: absolute; bottom: 0; left: 18%; width: 64%; border-radius: 0;
  background: var(--ouro); transition: height 0.4s ease;
}
.coluna-idade.ativo .coluna-cheia { background: #000; }
.coluna-idade.ativo .coluna-valor { color: var(--ouro-texto); }
.coluna-rot { font-size: 0.8rem; color: var(--texto-suave); margin-top: 0.35rem; white-space: nowrap; }
.coluna-idade.ativo .coluna-rot { font-weight: 700; color: var(--texto); }

/* Participantes: ajuste de vínculo e pedido de cadastro (1.32) */
.painel-vinculo { background: var(--superficie-2); border-radius: var(--raio-pequeno); padding: 0.85rem 1rem; display: grid; gap: 0.6rem; }
.lista-candidatos { list-style: none; margin: 0; padding: 0; }
.lista-candidatos li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.4rem 0; white-space: nowrap; border-bottom: 1px solid var(--linha); }
.lista-candidatos li:last-child { border-bottom: 0; }
.linha-painel td { background: var(--superficie-2); }

/* ===== Dashboards padronizados (1.33) ===== */
:root {
  --dash-altura-cartao: 19rem;   /* altura fixa de cada cartão */
  --dash-altura-grafico: 11.5rem; /* área fixa de cada gráfico */
  --dash-rosquinha: 9rem;        /* diâmetro fixo das rosquinhas */
}
.painel-inicio { max-width: 68rem; }

.grade-dash {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  align-items: stretch;
  margin: 0.5rem 0 1.25rem;
}
@media (max-width: 900px) { .grade-dash { grid-template-columns: 1fr; } }

.grade-dash > .bloco {
  display: flex; flex-direction: column;
  min-height: var(--dash-altura-cartao);
  padding: 1rem 1.1rem;
}
.grade-dash .bloco h3 { font-size: 1.15rem; margin: 0 0 0.35rem; }
.grade-dash .bloco > .sub { min-height: 2.6rem; margin: 0 0 0.5rem; }

/* Rosquinha centralizada, legenda embaixo, ocupando a mesma área em todos os cartões */
.grade-dash .donut-wrap {
  flex-direction: column; align-items: center; justify-content: flex-start;
  gap: 0.75rem; flex: 1;
}
.grade-dash .donut {
  width: var(--dash-rosquinha); height: var(--dash-rosquinha); flex: none;
}
.grade-dash .donut-furo { inset: 24%; }
.grade-dash .legenda { width: 100%; margin: 0; padding: 0; list-style: none; }
.grade-dash .legenda li { display: flex; width: 100%; }
.grade-dash .legenda-botao {
  display: flex; width: 100%; justify-content: flex-start; font-size: 0.92rem;
}

/* Idade: colunas com altura fixa */
.grade-dash .colunas-idade {
  height: var(--dash-altura-grafico);
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.3rem;
  margin-top: auto;
}
.grade-dash .coluna-valor { font-size: 0.8rem; }
.grade-dash .coluna-rot { font-size: 0.72rem; }

/* Ficha com campos editáveis diretamente (1.34) */
.campo-editavel { cursor: text; }
.campo-input {
  display: block; width: 100%; min-width: 0; border: 0; border-bottom: 1px dashed transparent;
  background: transparent; font: inherit; font-weight: 600; color: var(--texto);
  padding: 0.1rem 0; margin-top: 0.1rem; white-space: nowrap; border-radius: 0;
}
.campo-input:hover:not(:disabled) { border-bottom-color: var(--linha); }
.campo-input:focus { outline: none; border-bottom: 2px solid var(--ouro); }
.campo-input:disabled { color: var(--texto); opacity: 1; }
select.campo-input { cursor: pointer; }

/* ===== Organização em grade de 12 colunas no Início (1.35) ===== */
.painel-inicio {
  max-width: 72rem;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1rem;
  align-items: stretch;
}
.painel-inicio > * { min-width: 0; margin: 0 !important; }
.painel-inicio > .secao-titulo { grid-column: 1 / -1; margin: 0.25rem 0 0; }

/* Membros: três cartões de 4 colunas, mesma altura */
.painel-inicio .grade-dash {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1rem;
  margin: 0;
}
.painel-inicio .grade-dash > .bloco { grid-column: span 4; }

/* Métricas: quatro cartões de 3 colunas */
.painel-inicio .cards-metricas {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1rem;
  margin: 0;
  justify-content: stretch;
}
.painel-inicio .cards-metricas > .card-metrica { grid-column: span 3; }

/* Células por rede (metade) + aniversariantes (metade) */
.painel-inicio > section.bloco:not(.margem-topo-grande) { grid-column: span 6; }
.painel-inicio .painel-duplo {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1rem;
  margin: 0;
}
.painel-inicio .painel-duplo > .bloco { grid-column: span 6; }

/* Atividades: largura total */
.painel-inicio > section.bloco.margem-topo-grande { grid-column: 1 / -1; }

.painel-inicio .bloco { padding: 1rem 1.1rem; }
.painel-inicio .barra-linha { grid-template-columns: 12rem minmax(0, 1fr) 2.5rem !important; max-width: none; }

@media (max-width: 900px) {
  .painel-inicio, .painel-inicio .grade-dash, .painel-inicio .cards-metricas, .painel-inicio .painel-duplo { grid-template-columns: 1fr; }
  .painel-inicio > *, .painel-inicio .grade-dash > .bloco, .painel-inicio .cards-metricas > .card-metrica, .painel-inicio .painel-duplo > .bloco { grid-column: 1 / -1; }
}

/* Voltar na linha do título; logo à direita do topo (1.37) */
.cabecalho-linha { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.botao-voltar {
  display: inline-flex; align-items: center; min-height: 2.25rem; padding: 0 0.9rem; flex: none;
  border-radius: 999px; border: 1px solid var(--linha); background: transparent; color: var(--texto);
  font: inherit; font-size: 0.9rem; font-weight: 600; cursor: pointer; white-space: nowrap; margin-top: 0.35rem;
}
.botao-voltar:hover { background: var(--superficie-2); }
.topo { justify-content: space-between; }
.topo-direita { display: flex; align-items: center; gap: 1.25rem; margin-left: auto; }
.topo .marca { order: 2; }
.topo .conta { order: 1; }

/* Agenda da igreja (1.38) */
.ag-topo-mes { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 0.5rem 0 1rem; }
.ag-titulo-mes { font-family: "Barlow Condensed", sans-serif; font-size: 1.6rem; font-weight: 800; text-transform: uppercase; }
.ag-grade-calendario { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0.35rem; max-width: 34rem; background: var(--superficie); border-radius: var(--raio-grande); padding: 0.9rem; }
.ag-sem { text-align: center; font-size: 0.8rem; font-weight: 700; color: var(--texto-suave); }
.ag-dia {
  position: relative; aspect-ratio: 1 / 1; border: 1px solid var(--linha); border-radius: var(--raio-pequeno);
  background: var(--superficie); color: var(--texto); font: inherit; font-weight: 600; cursor: pointer;
}
.ag-dia:hover { background: var(--superficie-2); }
.ag-dia.hoje { border-color: var(--ouro); border-width: 2px; }
.ag-dia.sel { background: #000; color: #fff; border-color: #000; }
.ag-ponto { position: absolute; bottom: 0.3rem; left: 50%; transform: translateX(-50%); width: 0.4rem; height: 0.4rem; border-radius: 50%; background: var(--ouro); }
.ag-lista { list-style: none; margin: 0.5rem 0 0; padding: 0; }
.ag-item { display: flex; align-items: center; gap: 0.9rem; padding: 0.7rem 0; border-bottom: 1px solid var(--linha); }
.ag-item:last-child { border-bottom: 0; }
.ag-texto { display: flex; flex-direction: column; min-width: 0; }
.ag-selo { display: inline-flex; flex-direction: column; align-items: center; width: 3.2rem; border-radius: var(--raio-pequeno); overflow: hidden; border: 1px solid #000; flex: none; }
.ag-selo-mes { width: 100%; text-align: center; background: var(--ouro); color: #000; font-size: 0.72rem; font-weight: 800; padding: 0.15rem 0; }
.ag-selo-dia { width: 100%; text-align: center; background: #fff; color: #000; font-family: "Barlow Condensed", sans-serif; font-size: 1.4rem; font-weight: 800; line-height: 1.3; }

/* Hierarquia em níveis, supervisores e administradores (1.40) */
.hierarquia { display: grid; gap: 0.35rem; }
.h-no { display: grid; gap: 0.35rem; }
.h-linha {
  display: flex; align-items: center; gap: 0.75rem; min-height: 2.6rem; padding: 0.35rem 0.75rem;
  background: var(--superficie); border-radius: var(--raio-pequeno); white-space: nowrap;
}
.h-rede { font-weight: 700; }
.h-sup { background: var(--superficie-2); }
.h-celula { background: var(--superficie); }
.h-participante { background: var(--superficie-2); font-size: 0.95rem; }
.h-seta-btn { background: none; border: 0; cursor: pointer; padding: 0 0.25rem; color: inherit; }
.seta-h { display: inline-block; font-size: 1.25rem; line-height: 1; transition: transform 0.25s ease; }
.seta-h.aberta { transform: rotate(90deg); }
.h-texto { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.h-texto small { color: var(--texto-suave); }
.h-nome-sup { font-weight: 700; }
.h-dir { color: var(--texto-suave); font-size: 0.9rem; }
.h-filhos { display: grid; gap: 0.35rem; margin-left: 1.25rem; padding-left: 0.75rem; border-left: 2px solid var(--linha); }

/* Quadro da célula com líder e integrantes (1.41) */
.h-lider { background: var(--ouro-escuro); font-size: 0.95rem; }
.h-lider .h-texto strong { font-weight: 700; }

/* Topo: logo e nome à esquerda; e-mail, tema e Sair à direita (1.42) */
.topo .marca { order: 0; }
.topo .conta { order: 0; margin-left: auto; }

/* Aviso de novo usuário no Início (1.44) */
.aviso-novo {
  grid-column: 1 / -1; display: block; padding: 0.8rem 1rem; border-radius: var(--raio-pequeno);
  background: var(--ouro); color: #000; text-decoration: none; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.aviso-novo:hover { filter: brightness(1.05); }

/* Aprovação direto no aviso do Início (1.45) */
.aviso-novo { white-space: normal; }
.aviso-linha { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.4rem 0; border-top: 1px solid rgba(0,0,0,0.15); white-space: nowrap; }
.aviso-link { display: inline-block; margin-top: 0.5rem; color: #000; text-decoration: underline; }

/* Pessoas na igreja (1.46) */
.painel-inicio > section.bloco.bloco-largo { grid-column: 1 / -1; }
.pn-grupo { margin-top: 1rem; }
.pn-cabecalho { display: flex; justify-content: space-between; gap: 1rem; font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--texto-suave); border-bottom: 1px solid var(--linha); padding-bottom: 0.35rem; }
.pn-linha { margin: 0.6rem 0; display: grid; grid-template-columns: 1fr auto; gap: 0.2rem 1rem; align-items: center; }
.pn-linha .barra-trilha { grid-column: 1 / -1; height: 0.55rem; }
.pn-linha .sub { grid-column: 1 / -1; font-size: 0.8rem; }
.pn-topo { display: flex; justify-content: space-between; font-weight: 600; grid-column: 1 / -1; }
.pn-topo strong { font-family: "Barlow Condensed", sans-serif; font-size: 1.1rem; }

/* Usuários do painel (1.47) */
.usr-grade { display: grid; grid-template-columns: minmax(0,1.1fr) minmax(0,1fr); gap: 1.5rem; margin-top: 0.75rem; }
.usr-total { margin: 0 0 0.5rem; font-size: 1.05rem; }
.usr-total strong { font-family: "Barlow Condensed", sans-serif; font-size: 1.6rem; color: var(--texto); }
.usr-svg { width: 100%; height: auto; display: block; }
.usr-eixo { stroke: var(--linha); stroke-width: 1; }
.usr-linha { stroke: var(--ouro); stroke-width: 3; }
.usr-ponto { fill: var(--ouro); stroke: #000; stroke-width: 1; }
.usr-eixo-x { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--texto-suave); margin-top: 0.3rem; }
.usr-demo h4 { margin: 0.25rem 0 0.5rem; font-size: 1rem; font-weight: 700; text-transform: uppercase; }
.usr-demo-grade { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; align-items: start; }
@media (max-width: 900px) { .usr-grade, .usr-demo-grade { grid-template-columns: 1fr; } }

/* Usuários do painel: colunas e barras dentro do cartão (1.48) */
.painel-inicio .bloco.bloco-largo { overflow: hidden; }
.usr-grade { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 1.25rem; }
.usr-demo { min-width: 0; }
.usr-demo-grade { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; }
.usr-demo-grade > div { min-width: 0; }
.usr-demo .barra-linha { grid-template-columns: 10rem minmax(0, 1fr) 2.2rem !important; max-width: none; gap: 0.5rem; }
.usr-demo .barra-rot { font-size: 0.85rem; }
@media (max-width: 900px) {
  .usr-grade, .usr-demo-grade { grid-template-columns: 1fr; }
  .usr-demo .barra-linha { grid-template-columns: 8rem minmax(0, 1fr) 2rem !important; }
}

/* Ícones do menu em preto no tema claro (1.50) */
:root[data-theme="light"] .grupo-icone,
:root[data-theme="light"] .grupo-icone .icone { color: #000000; }
