/* visao-geral.css
   Visao Geral: periodo, quatro cartoes de resumo, grafico de lucro por festa, destaques
   e os cartoes das festas. Computador: resumo em 4 colunas, grafico e destaques lado a lado,
   festas em 3 colunas. Celular: resumo em 2 por 2 (todos visiveis) e uma coluna. */

/* ---------- Periodo ---------- */
.vg-filtro {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--e3);
  margin-bottom: var(--e5);
}

.vg-datas {
  display: flex;
  gap: var(--e3);
}

.vg-datas[hidden] {
  display: none;
}

.vg-data {
  display: flex;
  flex-direction: column;
  gap: var(--e1);
  font-size: 13px;
  font-weight: 600;
  color: var(--texto-suave);
}

.vg-data .campo {
  min-width: 150px;
}

/* ---------- Resumo ---------- */
.vg-resumos {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--e4);
  margin-bottom: var(--e4);
}

.vg-resumos .cartao {
  margin-bottom: 0;
}

.vg-resumo .cartao-valor {
  font-size: 26px;
}

.vg-sem-valor {
  color: var(--texto-fraco);
}

/* ---------- Grafico e destaques ---------- */
.vg-meio {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: var(--e4);
  align-items: stretch;
}

.vg-meio .cartao {
  margin-bottom: var(--e4);
}

.vg-grafico-rolagem {
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

.vg-grafico-caixa {
  height: 260px;
}

.vg-legenda {
  display: flex;
  flex-wrap: wrap;
  gap: var(--e2) var(--e4);
  margin-top: var(--e3);
  font-size: 12px;
  color: var(--texto-suave);
}

.vg-legenda-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.vg-legenda-cor {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.vg-cor-lucro { background: #16A34A; }
.vg-cor-prejuizo { background: #E11D48; }
.vg-cor-parcial { background: #9BD9B1; }

.vg-destaques-lista {
  margin: 0 0 var(--e3);
  padding: 0;
  list-style: none;
}

.vg-destaque + .vg-destaque {
  border-top: 1px solid var(--fundo-separacao);
}

.vg-destaque-botao {
  display: flex;
  align-items: center;
  gap: var(--e3);
  width: 100%;
  padding: var(--e3) 0;
  border: 0;
  background: none;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.vg-destaque-botao:disabled {
  cursor: default;
}

.vg-destaque-icone {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--laranja-suave);
  color: var(--laranja-escuro);
}

.vg-destaque-textos {
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin-right: auto;
}

.vg-destaque-textos strong {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.vg-destaque-rotulo {
  font-size: 12px;
  color: var(--texto-suave);
}

.vg-destaque-valor {
  flex: none;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

@media (hover: hover) {
  .vg-destaque-botao:not(:disabled):hover strong {
    color: var(--laranja-escuro);
  }
}

.vg-nota {
  margin: 0 0 var(--e5);
}

/* ---------- Festas ---------- */
.vg-lista-titulo {
  margin: 0 0 var(--e3);
  font-size: 18px;
}

.vg-festas {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--e4);
}

.vg-festa {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin-bottom: 0;
  padding: var(--e4) var(--e5);
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.vg-festa:focus-visible {
  outline: 2px solid var(--laranja);
  outline-offset: 2px;
}

.vg-festa-topo {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--e3);
}

.vg-festa-nome {
  margin: 0;
  font-size: 17px;
  line-height: 1.3;
}

.vg-festa-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: var(--e2) 0 var(--e3);
  font-size: 13px;
  color: var(--texto-suave);
}

.vg-festa-info p {
  display: flex;
  align-items: center;
  gap: var(--e2);
  margin: 0;
}

.vg-selo-breve {
  background: var(--fundo);
  border: 1px solid var(--laranja-borda);
  color: var(--laranja-escuro);
}

.vg-festa-dados {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr 1.3fr;
  gap: var(--e3);
  padding: var(--e3) 0;
  border-top: 1px solid var(--fundo-separacao);
  border-bottom: 1px solid var(--fundo-separacao);
}

.vg-dado {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
}

.vg-dado-rotulo {
  font-size: 12px;
  color: var(--texto-suave);
}

.vg-dado-valor {
  font-size: 15px;
  font-weight: 700;
}

.vg-saldo {
  display: flex;
  flex-direction: column;
}

.vg-saldo-sentido,
.vg-parcial {
  font-size: 11px;
  color: var(--texto-fraco);
}

.vg-festa-pe {
  padding-top: var(--e3);
}

/* Selo Hoje com ponto pulsante */
.selo-hoje-ponto {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--verde);
  animation: vg-pulsa 1.6s ease-in-out infinite;
}

@keyframes vg-pulsa {
  0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.5); }
  70% { box-shadow: 0 0 0 7px rgba(22, 163, 74, 0); }
  100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}

/* ---------- Tablet ---------- */
@media (max-width: 1023px) {
  .vg-resumos {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .vg-meio {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
}

/* ---------- Celular ---------- */
@media (max-width: 767px) {
  .vg-filtro {
    flex-direction: column;
    align-items: stretch;
    margin-bottom: var(--e4);
  }
  .vg-periodos .seletor-fase-item {
    white-space: normal;
    line-height: 1.15;
    font-size: 12px;
  }
  .vg-datas .vg-data {
    flex: 1;
  }
  .vg-data .campo {
    min-width: 0;
    width: 100%;
  }
  .vg-resumos {
    gap: var(--e3);
    margin-bottom: var(--e3);
  }
  .vg-resumos .cartao {
    padding: var(--e3) var(--e4);
  }
  .vg-resumo .cartao-rotulo {
    font-size: 12px;
    margin-bottom: var(--e1);
  }
  .vg-resumo .cartao-valor {
    font-size: 18px;
  }
  .vg-resumo .cartao-previsto {
    margin-top: 2px;
    font-size: 12px;
  }
  .vg-meio .cartao {
    margin-bottom: var(--e3);
  }
  .vg-grafico-caixa {
    height: 220px;
  }
  .vg-festas {
    grid-template-columns: 1fr;
    gap: var(--e3);
  }
  .vg-festa {
    padding: var(--e4);
  }
}

@media (prefers-reduced-motion: reduce) {
  .selo-hoje-ponto {
    animation: none !important;
  }
}
