/* Painel do grupo - visual v2 (09/11). Carregado depois do estiloBase de
   server.ts: mesmas classes (card, stat-card, table, campo-sel, podio, premio...),
   so a aparencia muda. --v2-cor / --v2-rgb = cor do grupo. */
:root {
  --v2-borda: rgba(150, 222, 255, 0.12);
  --v2-linha: rgba(150, 222, 255, 0.07);
  --v2-vidro: rgba(var(--v2-rgb), 0.05);
  --v2-texto: #E8F4F8;
  --v2-fraco: #93ABB6;
  --v2-verde: #3EE6A8;
  --v2-ambar: #F7B955;
  --v2-coral: #FF8A8A;
  color-scheme: dark;
}
body.v2 {
  font-family: "Inter", "Segoe UI", system-ui, sans-serif !important;
  background: var(--v2-fundo, #04090D) !important; color: var(--v2-texto) !important;
  -webkit-font-smoothing: antialiased;
}
body.v2::before {
  content: ""; position: fixed; inset: -20%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(36% 30% at 14% 6%, rgba(var(--v2-rgb), 0.18), transparent 70%),
    radial-gradient(30% 26% at 90% 20%, rgba(62, 230, 168, 0.07), transparent 70%),
    radial-gradient(42% 36% at 60% 100%, rgba(var(--v2-rgb), 0.09), transparent 70%);
  animation: v2-aurora 28s ease-in-out infinite alternate;
}
@keyframes v2-aurora { to { transform: translate3d(3%, -3%, 0) scale(1.06); } }
.v2 h1, .v2 h2, .v2 h3, .v2 .stat-card .valor, .v2 .podio-valor, .v2 .pessoa-total { font-family: "Sora", "Segoe UI", system-ui, sans-serif !important; letter-spacing: -0.01em; }
.v2 a { color: var(--v2-cor); }
.v2-ic { width: 19px; height: 19px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ===== layout + menu lateral de vidro ===== */
.v2 .v2-layout { display: flex; min-height: 100vh; gap: 0; }
.v2 .v2-lateral {
  display: flex !important; flex-direction: column; gap: 14px; width: 262px; flex-shrink: 0;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 20px 14px 18px !important;
  background: rgba(6, 16, 22, 0.72) !important; border-right: 1px solid var(--v2-borda) !important;
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); scrollbar-width: thin;
}
.v2 .v2-grupo { display: flex; align-items: center; gap: 12px; padding: 0 6px 4px; }
.v2 .v2-grupo img { width: 44px; height: 44px; border-radius: 14px; object-fit: cover; border: 1px solid var(--v2-borda); box-shadow: 0 6px 20px rgba(var(--v2-rgb), 0.3); }
.v2 .v2-grupo strong { display: block; font-family: "Sora", system-ui, sans-serif; font-size: 14.5px; line-height: 1.25; }
.v2 .v2-grupo small { color: var(--v2-fraco); font-size: 12px; }
.v2 .v2-voltar { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 12px; font-size: 13.5px; font-weight: 600; color: var(--v2-texto); text-decoration: none; border: 1px solid var(--v2-borda); background: rgba(150, 222, 255, 0.04); }
.v2 .v2-bloco { display: flex; flex-direction: column; gap: 2px; }
.v2 .v2-bloco > span { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--v2-fraco); font-weight: 600; padding: 0 10px 4px; }
.v2 .v2-bloco a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 12px; color: var(--v2-texto); text-decoration: none; font-size: 14px; transition: background .15s; }
.v2 .v2-bloco a em { font-style: normal; }
.v2 .v2-bloco a .v2-ic { color: var(--v2-fraco); }
.v2 .v2-bloco a:hover { background: rgba(150, 222, 255, 0.06); }
.v2 .v2-bloco a[aria-current="page"] { background: rgba(var(--v2-rgb), 0.14); box-shadow: inset 0 0 0 1px rgba(var(--v2-rgb), 0.35); font-weight: 600; }
.v2 .v2-bloco a[aria-current="page"] .v2-ic { color: var(--v2-cor); }
.v2 .v2-rodape { margin-top: auto; border-top: 1px solid var(--v2-linha); padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.v2 .v2-rodape form { margin: 0; }
.v2 .link-trocar-logo { display: flex !important; align-items: center; gap: 8px; color: var(--v2-fraco) !important; font-size: 12.5px !important; padding: 4px 10px; cursor: pointer; margin: 0 !important; }
.v2 .v2-usuario { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12.5px; color: var(--v2-fraco); padding: 0 10px; }
.v2 .v2-usuario strong { color: var(--v2-texto); }
.v2 .v2-usuario a { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--v2-texto); text-decoration: none; }

/* conteudo */
.v2 .v2-conteudo { flex: 1; min-width: 0; padding: 30px 36px 130px !important; overflow-x: hidden !important; }
.v2 .cabecalho-pagina { margin-bottom: 22px !important; }
.v2 .v2-trilha { display: inline-block; font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--v2-cor); font-weight: 700; margin-bottom: 4px; }
.v2 .cabecalho-pagina h1 { font-size: 30px !important; font-weight: 700 !important; letter-spacing: -0.02em !important; }
.v2 .cabecalho-pagina p { color: var(--v2-fraco) !important; }

/* barra do topo no celular (menu) */
.v2-menu-check { position: absolute; opacity: 0; pointer-events: none; }
.v2 .v2-barra-topo, .v2 .v2-fundo-menu { display: none; }

/* ===== cartoes de vidro com brilho que segue o mouse ===== */
.v2 .card, .v2 .stat-card, .v2 .premio-card, .v2 .pessoa-card, .v2 .hall, .v2 .coluna-ranking {
  position: relative;
  background: radial-gradient(460px circle at var(--mx, 50%) var(--my, -60%), rgba(var(--v2-rgb), 0.10), transparent 45%), var(--v2-vidro) !important;
  border: 1px solid var(--v2-borda) !important; border-radius: 22px !important;
  box-shadow: none !important; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.v2 .card::after, .v2 .stat-card::after {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: radial-gradient(240px circle at var(--mx, 50%) var(--my, -60%), rgba(var(--v2-rgb), 0.55), transparent 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
.v2 .card { padding: 22px !important; overflow-x: auto; }
.v2 .grid-stats { gap: 14px !important; margin-bottom: 22px !important; }
.v2 .stat-card { padding: 18px 20px !important; }
.v2 .stat-card .label { text-transform: none !important; letter-spacing: 0 !important; font-size: 13px !important; color: var(--v2-fraco) !important; font-weight: 500 !important; }
.v2 .stat-card .valor { font-size: 27px !important; font-weight: 700 !important; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

/* tabelas */
.v2 table { font-variant-numeric: tabular-nums; }
.v2 th { font-size: 11.5px !important; letter-spacing: 0.08em !important; color: var(--v2-fraco) !important; font-weight: 600 !important; border-bottom-color: var(--v2-borda) !important; }
.v2 td { border-bottom-color: var(--v2-linha) !important; }
.v2 tbody tr:hover { background: rgba(var(--v2-rgb), 0.05) !important; }

/* campos e botoes */
.v2 input, .v2 textarea, .v2 select {
  background: rgba(2, 8, 12, 0.55) !important; border: 1px solid var(--v2-borda) !important; color: var(--v2-texto) !important;
  border-radius: 12px !important; font-family: inherit;
}
.v2 input:focus, .v2 textarea:focus, .v2 select:focus { border-color: rgba(var(--v2-rgb), 0.65) !important; box-shadow: 0 0 0 3px rgba(var(--v2-rgb), 0.15) !important; }
.v2 .campo-sel .rotulo { text-transform: none !important; letter-spacing: 0 !important; font-size: 11.5px !important; color: var(--v2-fraco) !important; font-weight: 600 !important; }
.v2 .campo-localizador select { border-color: rgba(96, 165, 250, 0.55) !important; }
.v2 .campo-suporte select { border-color: rgba(62, 230, 168, 0.5) !important; }
.v2 .campo-tripa select { border-color: rgba(247, 185, 85, 0.5) !important; }
.v2 button, .v2 .btn {
  border-radius: 12px !important; font-family: inherit; font-weight: 600 !important;
  background: linear-gradient(135deg, var(--v2-cor), rgba(var(--v2-rgb), 0.75)) !important; color: #031015 !important;
  box-shadow: 0 6px 18px rgba(var(--v2-rgb), 0.22) !important; border: 0 !important;
}
.v2 button:hover, .v2 .btn:hover { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(var(--v2-rgb), 0.32) !important; }
.v2 .btn-excluir, .v2 button.btn-excluir { background: transparent !important; color: var(--v2-coral) !important; border: 1px solid rgba(255, 138, 138, 0.4) !important; box-shadow: none !important; }
.v2 .btn-excluir:hover { background: rgba(255, 138, 138, 0.08) !important; }
.v2 label { color: #C9D8DF !important; }
.v2 .ajuda { color: var(--v2-fraco) !important; }
.v2 h2.secao { color: var(--v2-texto) !important; font-family: "Sora", system-ui, sans-serif !important; }
.v2 .mensagem-sucesso { border-radius: 14px !important; background: rgba(62, 230, 168, 0.09) !important; border-color: rgba(62, 230, 168, 0.35) !important; color: var(--v2-verde) !important; }
.v2 .faixa-leitura { border-radius: 14px !important; }
.v2 .abas-periodo a { border-radius: 12px !important; }
.v2 .abas-periodo a.ativo { background: rgba(var(--v2-rgb), 0.16) !important; box-shadow: inset 0 0 0 1px rgba(var(--v2-rgb), 0.4) !important; color: var(--v2-texto) !important; }

/* ranking e metas: mantem o podio, so com vidro */
.v2 .podio-item { border-radius: 16px !important; border: 1px solid var(--v2-borda) !important; }
.v2 .podio-item.ouro { box-shadow: 0 0 34px rgba(247, 185, 85, 0.22) !important; }

/* ===== barra flutuante (dock) ===== */
.v2-dock {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 40;
  display: flex; align-items: flex-end; gap: 5px; padding: 7px 8px; border-radius: 24px;
  background: rgba(10, 24, 31, 0.76); border: 1px solid var(--v2-borda);
  backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.v2-dock a {
  --s: 1; position: relative; width: calc(46px * var(--s)); height: calc(46px * var(--s)); border-radius: calc(15px * var(--s));
  display: grid; place-items: center; color: var(--v2-fraco) !important; text-decoration: none; background: rgba(150, 222, 255, 0.06);
  transition: width .12s ease-out, height .12s ease-out, background .2s, color .2s;
}
.v2-dock a .v2-ic { width: calc(21px * var(--s)); height: calc(21px * var(--s)); }
.v2-dock a[aria-current="page"] { color: #031015 !important; background: linear-gradient(135deg, var(--v2-cor), rgba(var(--v2-rgb), 0.7)); box-shadow: 0 6px 22px rgba(var(--v2-rgb), 0.45); }
.v2-dock a em {
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%) translateY(4px); font-style: normal; font-size: 12px; font-weight: 600;
  white-space: nowrap; padding: 4px 9px; border-radius: 8px; background: rgba(10, 24, 31, 0.94); border: 1px solid var(--v2-borda); color: var(--v2-texto);
  opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s;
}
.v2-dock a:hover em, .v2-dock a:focus-visible em { opacity: 1; transform: translateX(-50%) translateY(0); }
.v2 a:focus-visible, .v2 button:focus-visible, .v2 label:focus-visible { outline: 2px solid var(--v2-cor); outline-offset: 2px; }

/* ===== celular: menu abre por botao ===== */
@media (max-width: 900px) {
  .v2 .v2-barra-topo {
    display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 30;
    padding: calc(10px + env(safe-area-inset-top, 0px)) max(14px, env(safe-area-inset-right, 0px)) 10px max(14px, env(safe-area-inset-left, 0px));
    background: rgba(6, 16, 22, 0.86); border-bottom: 1px solid var(--v2-borda); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  }
  .v2 .v2-botao-menu { width: 44px; height: 44px; border-radius: 13px; border: 1px solid var(--v2-borda); display: grid; place-items: center; color: var(--v2-texto); cursor: pointer; margin: 0 !important; background: rgba(150, 222, 255, 0.05); }
  .v2 .v2-barra-nome { min-width: 0; }
  .v2 .v2-barra-nome strong { display: block; font-family: "Sora", system-ui, sans-serif; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .v2 .v2-barra-nome small { color: var(--v2-fraco); font-size: 12px; }
  .v2 .v2-lateral {
    position: fixed !important; top: 0; left: 0; bottom: 0; z-index: 50; height: 100% !important; width: min(300px, 86vw);
    transform: translateX(-105%); transition: transform .25s ease; background: rgba(6, 16, 22, 0.97) !important;
    padding-top: calc(20px + env(safe-area-inset-top, 0px)) !important;
  }
  .v2-menu-check:checked ~ .v2-layout .v2-lateral { transform: none; box-shadow: 20px 0 60px rgba(0, 0, 0, 0.6); }
  .v2-menu-check:checked ~ .v2-fundo-menu { display: block; position: fixed; inset: 0; z-index: 45; background: rgba(2, 6, 9, 0.6); margin: 0 !important; }
  .v2 .v2-conteudo { padding: 18px max(16px, env(safe-area-inset-right, 0px)) 120px max(16px, env(safe-area-inset-left, 0px)) !important; }
  .v2 .cabecalho-pagina h1 { font-size: 25px !important; }
  .v2 .stat-card .valor { font-size: 23px !important; }
  .v2 .card { padding: 16px !important; }
  .v2-dock { gap: 3px; padding: 6px; }
  .v2-dock a { width: calc(44px * var(--s)); height: calc(44px * var(--s)); }
}

/* ===== tela de login ===== */
.v2-login { min-height: 100vh; }
.v2-login .caixa {
  background: radial-gradient(420px circle at 50% -30%, rgba(var(--v2-rgb), 0.16), transparent 55%), rgba(10, 24, 31, 0.72) !important;
  border: 1px solid var(--v2-borda) !important; border-radius: 28px !important; box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55) !important;
  max-width: calc(100vw - 32px);
}
.v2-login h1 { font-family: "Sora", system-ui, sans-serif !important; letter-spacing: 0 !important; background: none !important; color: var(--v2-texto) !important; -webkit-text-fill-color: currentColor; }
.v2-login input { border-radius: 14px !important; min-height: 46px; }
.v2-login button { border-radius: 14px !important; min-height: 48px; }

@media (prefers-reduced-motion: reduce) {
  .v2 *, .v2 *::before, .v2 *::after, body.v2::before { animation: none !important; transition: none !important; }
}
