/* ==========================================================
   DOVYR DASHBOARD V2 — TOP CARDS POLISH / PHASE 13C
   Escopo: somente KPIs superiores + avatar/topbar.
   ========================================================== */

.dashboard-shell.dv2-dashboard .dv2-kpi{
  height:118px;
  padding:15px 17px 14px;
}

.dashboard-shell.dv2-dashboard .dv2-kpi-copy{
  max-width:64%;
}

.dashboard-shell.dv2-dashboard .dv2-kpi-copy>strong{
  margin-top:10px;
  font-size:27px;
  line-height:.98;
}

.dashboard-shell.dv2-dashboard .dv2-kpi-copy>small{
  margin-top:8px;
  font-size:8px;
}

/* Ícones — mesma caixa, mesma posição nos quatro cards */
.dashboard-shell.dv2-dashboard .dv2-kpi-icon{
  right:13px;
  top:13px;
  width:34px;
  height:34px;
  border-radius:9px;
  background:linear-gradient(180deg,rgba(255,255,255,.030),rgba(255,255,255,.014));
  border-color:rgba(255,255,255,.085);
}
.dashboard-shell.dv2-dashboard .dv2-kpi-icon svg{
  width:16px;
  height:16px;
  stroke-width:1.6;
}

/* P/L e Risco — sparklines menores, mais discretos e com preenchimento suave */
.dashboard-shell.dv2-dashboard .dv2-kpi.pl .dv2-kpi-visual,
.dashboard-shell.dv2-dashboard .dv2-kpi.risk .dv2-kpi-visual{
  right:16px;
  bottom:13px;
  width:36%;
  height:48px;
  align-items:flex-end;
}
.dashboard-shell.dv2-dashboard .dv2-kpi.pl .dv2-spark,
.dashboard-shell.dv2-dashboard .dv2-kpi.risk .dv2-spark{
  height:43px;
  overflow:visible;
}
.dashboard-shell.dv2-dashboard .dv2-kpi.pl .dv2-spark polygon,
.dashboard-shell.dv2-dashboard .dv2-kpi.risk .dv2-spark polygon{
  opacity:.045!important;
}
.dashboard-shell.dv2-dashboard .dv2-kpi.pl .dv2-spark polyline,
.dashboard-shell.dv2-dashboard .dv2-kpi.risk .dv2-spark polyline{
  stroke-width:1.25!important;
}
.dashboard-shell.dv2-dashboard .dv2-smooth-area{opacity:.075}
.dashboard-shell.dv2-dashboard .dv2-smooth-line{
  fill:none;
  stroke:currentColor;
  stroke-width:1.35;
  stroke-linecap:round;
  stroke-linejoin:round;
  vector-effect:non-scaling-stroke;
}
.dashboard-shell.dv2-dashboard .dv2-kpi.pl .dv2-smooth-line{
  filter:drop-shadow(0 2px 4px rgba(255,94,104,.10));
}
.dashboard-shell.dv2-dashboard .dv2-kpi.risk .dv2-smooth-line{
  filter:drop-shadow(0 2px 4px rgba(190,231,76,.10));
}

/* Aderência — barra atravessa a base do card, como na referência */
.dashboard-shell.dv2-dashboard .dv2-kpi.adh .dv2-kpi-copy{
  max-width:100%;
  padding-right:52px;
}
.dashboard-shell.dv2-dashboard .dv2-kpi.adh .dv2-kpi-visual{
  left:17px;
  right:17px;
  bottom:14px;
  width:auto;
  height:14px;
  display:block;
}
.dashboard-shell.dv2-dashboard .dv2-kpi.adh .dv2-adh-visual{
  width:100%;
  height:14px;
  display:grid;
  grid-template-columns:minmax(0,1fr) 48px;
  align-items:center;
  gap:10px;
}
.dashboard-shell.dv2-dashboard .dv2-kpi.adh .dv2-adh-visual>div{
  width:100%;
  height:6px;
  background:#222c2f;
  border:1px solid rgba(255,255,255,.012);
  box-shadow:inset 0 1px 2px rgba(0,0,0,.18);
}
.dashboard-shell.dv2-dashboard .dv2-kpi.adh .dv2-adh-visual i{
  height:100%;
  background:linear-gradient(90deg,#d8ff3e 0%,#c5ef31 70%,#abd725 100%);
  box-shadow:0 0 10px rgba(216,255,62,.10);
}
.dashboard-shell.dv2-dashboard .dv2-kpi.adh .dv2-adh-visual span{
  text-align:right;
  font-size:7px;
  letter-spacing:.02em;
  color:rgba(235,239,236,.52);
}

/* Win rate — donut um pouco maior e melhor posicionado */
.dashboard-shell.dv2-dashboard .dv2-kpi.win .dv2-kpi-copy{
  max-width:66%;
}
.dashboard-shell.dv2-dashboard .dv2-kpi.win .dv2-kpi-visual{
  right:24px;
  bottom:15px;
  width:62px;
  height:62px;
  align-items:center;
  justify-content:center;
}
.dashboard-shell.dv2-dashboard .dv2-ring{
  width:60px;
  height:60px;
  background:conic-gradient(from 0deg,var(--dv2-acid) calc(var(--pct)*1%),#2d373a 0);
  box-shadow:0 0 20px rgba(216,255,62,.04),inset 0 0 0 1px rgba(255,255,255,.015);
}
.dashboard-shell.dv2-dashboard .dv2-ring span{
  width:45px;
  height:45px;
  background:#111719;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.035);
}

/* Topbar — garante espaço correto para período + avatar */
.dashboard-shell.dv2-dashboard .dv2-top-actions{
  gap:10px;
  flex:0 0 auto;
}
.dashboard-shell.dv2-dashboard .dv2-period{
  min-width:180px;
  white-space:nowrap;
}
.dashboard-shell.dv2-dashboard .dv2-profile{
  display:flex!important;
  width:54px;
  min-width:54px;
  opacity:1!important;
  visibility:visible!important;
}
.dashboard-shell.dv2-dashboard .dv2-profile span{
  width:29px;
  height:29px;
  font-size:12px;
}

/* Light mode mantém o mesmo refinamento */
html[data-dovyr-theme="light"] .dashboard-shell.dv2-dashboard .dv2-kpi.adh .dv2-adh-visual>div{
  background:#e3e8e9;
  border-color:rgba(17,27,34,.025);
}
html[data-dovyr-theme="light"] .dashboard-shell.dv2-dashboard .dv2-ring{
  background:conic-gradient(from 0deg,#7cc800 calc(var(--pct)*1%),#d9dfe1 0);
}
html[data-dovyr-theme="light"] .dashboard-shell.dv2-dashboard .dv2-ring span{
  background:#fbfcfc;
}

@media(max-width:1320px){
  .dashboard-shell.dv2-dashboard .dv2-kpi-copy>strong{font-size:24px}
  .dashboard-shell.dv2-dashboard .dv2-kpi.pl .dv2-kpi-visual,
  .dashboard-shell.dv2-dashboard .dv2-kpi.risk .dv2-kpi-visual{width:34%}
  .dashboard-shell.dv2-dashboard .dv2-period{min-width:165px}
}
