/*--------------------------------------------------------------
# Página inicial "Mercado Hoje" (wizard_welcome.php)
# Cards com entrada animada e gráfico do histórico das carteiras.
# Usa as variáveis de cor do dracar-app.css.
--------------------------------------------------------------*/

.dm-hero,
.dm-painel {
  position: relative;
  background: #fff;
  border-radius: var(--radius, 12px);
  box-shadow: var(--shadow, 0 4px 16px rgba(13, 74, 77, .08));
  padding: 22px 22px 18px;
  margin: 0 0 20px;
  overflow: hidden;
}

/* Faixa de destaque do topo */
.dm-hero {
  background:
    radial-gradient(1200px 260px at 100% -40%, rgba(126, 234, 234, .28), transparent 60%),
    linear-gradient(135deg, var(--teal-deeper, #0D4A4D) 0%, var(--teal-dark, #12666A) 55%, var(--teal, #1A8C8C) 100%);
  color: #fff;
  padding-bottom: 22px;
}
.dm-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .07) 45%, transparent 60%);
  background-size: 250% 100%;
  animation: dm-brilho 7s ease-in-out infinite;
  pointer-events: none;
}
@keyframes dm-brilho {
  0%, 100% { background-position: 120% 0; }
  50% { background-position: -20% 0; }
}

.dm-hero__topo {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}
.dm-hero__selo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--teal-glow, #7EEAEA);
}
.dm-hero__titulo {
  margin: 4px 0 0;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
}
.dm-hero__hora {
  font-size: 12px;
  color: rgba(255, 255, 255, .75);
}
.dm-pulso {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal-glow, #7EEAEA);
  box-shadow: 0 0 0 0 rgba(126, 234, 234, .7);
  animation: dm-pulso 2s infinite;
}
@keyframes dm-pulso {
  0% { box-shadow: 0 0 0 0 rgba(126, 234, 234, .65); }
  70% { box-shadow: 0 0 0 9px rgba(126, 234, 234, 0); }
  100% { box-shadow: 0 0 0 0 rgba(126, 234, 234, 0); }
}

/* Cards */
.dm-cards {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 12px;
}
.dm-card {
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: var(--radius-sm, 8px);
  padding: 12px 12px 8px;
  min-width: 0;
  backdrop-filter: blur(4px);
  transition: background .25s var(--ease, ease), border-color .25s var(--ease, ease), box-shadow .25s var(--ease, ease);
  animation: dm-entra .7s var(--ease, ease) both;
  animation-delay: calc(var(--i, 0) * 70ms);
}
.dm-card:hover {
  background: rgba(255, 255, 255, .16);
  border-color: rgba(126, 234, 234, .5);
  box-shadow: 0 10px 26px rgba(4, 30, 32, .3);
}
@keyframes dm-entra {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
.dm-card__nome {
  display: block;
  font-size: 11.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, .78);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dm-card__nome i { color: var(--teal-glow, #7EEAEA); margin-right: 3px; }
.dm-card__valor {
  margin: 6px 0 4px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.02em;
  color: #fff;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.dm-vazio { color: rgba(255, 255, 255, .5); }
.dm-card__rodape {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-height: 24px;
}
.dm-pill {
  flex: none;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .14);
  color: #fff;
}
.dm-up .dm-pill { background: rgba(52, 211, 153, .22); color: #A7F3D0; }
.dm-down .dm-pill { background: rgba(248, 113, 113, .22); color: #FECACA; }
.dm-nota { font-size: 11px; color: rgba(255, 255, 255, .6); white-space: nowrap; }
.dm-spark {
  flex: 1;
  min-width: 0;
  max-width: 70px;
  height: 24px;
  overflow: visible;
}
.dm-spark path.dm-linha {
  fill: none;
  stroke: var(--teal-glow, #7EEAEA);
  stroke-width: 1.6;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.dm-up .dm-spark path.dm-linha { stroke: #6EE7B7; }
.dm-down .dm-spark path.dm-linha { stroke: #FCA5A5; }
.dm-spark path.dm-area { fill: rgba(255, 255, 255, .08); stroke: none; }

/* Painel do gráfico */
.dm-painel { animation: dm-entra .8s var(--ease, ease) .25s both; }
.dm-painel__topo {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}
.dm-painel__titulo { margin: 0; font-size: 17px; font-weight: 700; color: var(--dark, #111827); }
.dm-painel__sub { margin: 4px 0 0; font-size: 12.5px; color: var(--gray-500, #6B7280); }
.dm-painel__nota { margin: 6px 0 0; font-size: 11.5px; color: var(--gray-500, #6B7280); }

.dm-periodos {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: var(--gray-100, #F3F4F6);
}
.dm-periodos button {
  border: 0;
  background: transparent;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-500, #6B7280);
  transition: background .2s var(--ease, ease), color .2s var(--ease, ease), box-shadow .2s var(--ease, ease);
}
.dm-periodos button:hover { color: var(--teal-dark, #12666A); }
.dm-periodos button.ativo {
  background: #fff;
  color: var(--teal-deeper, #0D4A4D);
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, .1));
}

.dm-resumo {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.dm-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--gray-200, #E5E7EB);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font-size: 12px;
  color: var(--gray-700, #374151);
  transition: opacity .2s var(--ease, ease), border-color .2s var(--ease, ease), transform .2s var(--ease, ease);
  animation: dm-entra .5s var(--ease, ease) both;
  animation-delay: calc(var(--i, 0) * 60ms + .35s);
}
.dm-chip:hover { border-color: var(--teal-mid, #C2E6E6); }
.dm-chip.desligado { opacity: .45; }
.dm-chip__cor { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.dm-chip__cor.tracejado { height: 0; border-top: 2px dashed; border-radius: 0; width: 14px; }
.dm-chip strong { font-size: 13px; font-variant-numeric: tabular-nums; }
.dm-chip strong.dm-pos { color: var(--up, #0F9D74); }
.dm-chip strong.dm-neg { color: var(--down, #D94848); }

.dm-grafico { width: 100%; height: 380px; }

@media (max-width: 1400px) {
  .dm-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  .dm-hero, .dm-painel { padding: 16px; }
  .dm-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .dm-card__valor { font-size: 18px; }
  .dm-grafico { height: 300px; }
  .dm-periodos { width: 100%; justify-content: space-between; }
}

@media (prefers-reduced-motion: reduce) {
  .dm-hero::after, .dm-pulso { animation: none; }
  .dm-card, .dm-painel, .dm-chip { animation: none; }
}
