/* DistribuiPro Dashboard Pro 1.0 */
.dpd .stat-card { position: relative; overflow: hidden; }
.dpd .stat-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: linear-gradient(90deg, var(--accent), transparent 70%); opacity: .55; }
.dpd .stat-change.dpd-flat { background: rgba(148, 163, 184, .12) !important; color: var(--text-muted) !important; }
.dpd .stat-change.down { background: rgba(239, 68, 68, .12) !important; color: #f87171 !important; }
.dpd .stat-change[hidden] { display: none !important; }
.dpd-spark { position: absolute; right: 12px; bottom: 12px; width: 44%; max-width: 150px; height: 34px; color: var(--accent); opacity: .9; pointer-events: none; }
.dpd-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 12px; font-weight: 600; color: var(--accent) !important; text-decoration: none; opacity: .85; transition: gap .2s, opacity .2s; }
.dpd-link:hover { opacity: 1; gap: 9px; }
.dpd-link i { font-size: 10px; }

/* Botão de atualização */
.dpd-stamp { display: inline-flex; align-items: center; gap: 7px; margin-left: 12px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--border-color); background: transparent; color: var(--text-muted); font-size: 12px; font-weight: 600; cursor: pointer; transition: color .2s, border-color .2s; }
.dpd-stamp:hover { color: var(--text-primary); border-color: var(--accent); }
.dpd-stamp .fa-rotate-right { font-size: 11px; }
.dpd-stamp.spin .fa-rotate-right { animation: dpdSpin .8s linear infinite; }
.dpd-live { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 0 rgba(34, 197, 94, .6); animation: dpdPulse 2s infinite; }
@keyframes dpdPulse { 70% { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }
@keyframes dpdSpin { to { transform: rotate(360deg); } }

/* Linha: meta + destaques */
.dpd-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: 16px; margin: 0 0 24px; }
.dpd-goal-body { display: flex; align-items: center; gap: 22px; }
.dpd-ring { position: relative; flex: 0 0 auto; width: 132px; height: 132px; }
.dpd-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.dpd-ring circle { fill: none; stroke-width: 11; }
.dpd-ring .bg { stroke: rgba(148, 163, 184, .14); }
.dpd-ring .fg { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset 1.1s cubic-bezier(.2, .8, .2, 1); filter: drop-shadow(0 0 6px color-mix(in srgb, var(--accent) 55%, transparent)); }
.dpd-ring > div { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.dpd-ring strong { font-size: 26px; font-weight: 800; letter-spacing: -.03em; color: var(--text-heading, var(--text-primary)); line-height: 1; }
.dpd-ring small { font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.dpd-goal-data { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin: 0; min-width: 0; }
.dpd-goal-data dt { font-size: 11px; font-weight: 600; letter-spacing: .02em; color: var(--text-muted); }
.dpd-goal-data dd { margin: 3px 0 0; font-size: 15px; font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.dpd-goal-data dd.pos { color: var(--success); }
.dpd-goal-data dd.neg { color: var(--warning); }
.dpd-goal-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border-color); }
.dpd-goal-form[hidden] { display: none; }
.dpd-goal-form label { flex: 1 1 200px; display: grid; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text-muted); }
.dpd-goal-form input { height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border-color); background: var(--bg-input); color: var(--text-primary); font-size: 15px; }
.dpd-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; color: var(--accent); background: color-mix(in srgb, var(--accent) 13%, transparent); white-space: nowrap; }
.dpd-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dpd-tile { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 14px; border: 1px solid var(--border-color); background: var(--bg-surface, transparent); min-width: 0; transition: transform .2s, border-color .2s; }
.dpd-tile:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 45%, var(--border-color)); }
.dpd-tile > div { min-width: 0; display: grid; gap: 2px; }
.dpd-tile small { font-size: 11px; font-weight: 600; color: var(--text-muted); }
.dpd-tile strong { font-size: 15px; font-weight: 800; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dpd-tile em { font-style: normal; font-size: 12px; color: var(--text-muted); }
.dpd-ti { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-size: 15px; }
.dpd-ti.green { color: #34d399; background: rgba(16, 185, 129, .14); }
.dpd-ti.blue { color: #60a5fa; background: rgba(59, 130, 246, .14); }
.dpd-ti.yellow { color: #fbbf24; background: rgba(245, 158, 11, .14); }
.dpd-ti.purple { color: #c084fc; background: rgba(168, 85, 247, .14); }
.dpd-empty-box { display: grid; place-items: center; gap: 10px; padding: 26px 12px; text-align: center; color: var(--text-muted); font-size: 13px; }
.dpd-empty-box i { font-size: 26px; opacity: .45; }
.dpd-empty-box p { margin: 0; max-width: 340px; }

/* Gráficos */
.dpd .chart-container { position: relative; }
.dpd-chart-empty { position: absolute; inset: 30px 0 24px 50px; display: grid; place-content: center; justify-items: center; gap: 6px; text-align: center; pointer-events: none; color: var(--text-muted); font-size: 12.5px; }
.dpd-chart-empty i { font-size: 22px; opacity: .5; }
.dpd-chart-empty b { font-size: 14px; color: var(--text-primary); }
.dpd-legend { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.dpd-legend li { display: grid; grid-template-columns: 10px 1fr auto 42px; align-items: center; gap: 10px; font-size: 13px; color: var(--text-primary); }
.dpd-legend li i { width: 10px; height: 10px; border-radius: 3px; }
.dpd-legend li b { font-weight: 700; font-variant-numeric: tabular-nums; }
.dpd-legend li em { font-style: normal; text-align: right; color: var(--text-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.dpd-legend .dpd-legend-empty { display: block; text-align: center; color: var(--text-muted); font-size: 12.5px; }

/* Textos pequenos demais nas tabelas do painel */
.dpd #recentSalesBody [style*="font-size:10px"], .dpd #topProductsBody [style*="font-size:10px"] { font-size: 11.5px !important; }
.dpd #recentSalesBody .badge { font-size: 11px !important; }

@media (max-width: 1100px) { .dpd-row { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .dpd-goal-body { flex-direction: column; align-items: stretch; gap: 16px; }
  .dpd-ring { align-self: center; width: 120px; height: 120px; }
  .dpd-tiles { grid-template-columns: 1fr; }
  .dpd-spark { width: 40%; height: 28px; bottom: 10px; }
  .dpd-stamp { margin: 8px 0 0; }
  .dpd-legend li { font-size: 12.5px; }
}
@media (prefers-reduced-motion: reduce) { .dpd-live, .dpd-stamp.spin .fa-rotate-right { animation: none; } .dpd-ring .fg { transition: none; } }
