/* ==========================================================
   Dashboard del hero — construido desde Figma
   ("Dashboard - Scroll View", 888:5763 · 1440×960)
   Se maqueta a tamaño real y se escala con --dash-scale (script.js).
   ========================================================== */
.dash {
  position: relative;
  aspect-ratio: 1440 / 960;
  overflow: hidden;
  border-radius: 12px;
  --dash-scale: 0.77;
}
.dash__canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 1440px;
  height: 960px;
  transform: scale(var(--dash-scale));
  transform-origin: 0 0;
  display: flex;
  gap: 14px;
  padding: 20px;
  background: #fafafa;
  font-family: var(--font-secondary);
  color: var(--grey-950);
  text-align: left;
  -webkit-font-smoothing: antialiased;
}
.dash p { margin: 0; }
.dash img { display: block; }

/* Utilidades de texto (tokens del Figma) */
.d-h4  { font-family: var(--font-primary); font-weight: 600; font-size: 40px; line-height: 48px; color: #000; }
.d-h6  { font-family: var(--font-primary); font-weight: 600; font-size: 24px; line-height: 32px; color: #000; }
.d-b1  { font-weight: 500; font-size: 20px; line-height: 28px; color: var(--grey-950); }
.d-b3  { font-weight: 500; font-size: 16px; line-height: 24px; color: var(--grey-950); }
.d-b4  { font-size: 14px; line-height: 20px; color: #404040; }
.d-c1  { font-size: 12px; line-height: 16px; color: #404040; }
.d-c2  { font-size: 10px; line-height: 14px; color: #737373; }

/* ---------- Sidebar ---------- */
.d-side {
  position: relative;
  flex: none;
  width: 240px;
  height: 920px;
  display: flex;
  flex-direction: column;
  background: var(--white);
  border-bottom: 1px solid var(--grey-200);
  border-radius: 18px;
}
.d-side__brand {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 14px;
  border-bottom: 1px solid var(--grey-200);
}
.d-side__brand > span { display: grid; place-items: center; width: 40px; height: 40px; }
.d-side__mark { width: 34px; height: 34px; }
.d-side__word { width: 60.573px; height: 20px; }
.d-side__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px 12px 12px;
}
.d-side__menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.d-side__menu:first-child { flex: 1; }
.d-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 16px;
  color: var(--grey-600);
}
.d-tab img { width: 20px; height: 20px; flex: none; }
.d-tab.is-active { background: var(--primary-500); color: var(--white); font-weight: 500; }
.d-side__collapse {
  position: absolute;
  top: 60px;
  right: -6px;
  width: 12px;
  height: 16px;
  border-radius: 4px;
  background: var(--white);
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.12);
  overflow: hidden;
}
.d-side__collapse img { position: absolute; left: -2px; top: 0; width: 16px; height: 16px; }

/* ---------- Contenido ---------- */
.d-main {
  flex: none;
  width: 1146px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.d-main > * { flex-shrink: 0; }
.d-panel {
  background: var(--white);
  border: 1px solid var(--grey-200);
  border-radius: 16px;
  overflow: hidden;
}
.d-panel__head {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 60px;
  padding: 14px 12px 14px 18px;
  border-bottom: 1px solid var(--grey-200);
}
.d-panel__head > .d-b1 { flex: 1; }

/* Header */
.d-header {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 70px;
  padding: 16px 16px 16px 24px;
  background: var(--white);
  border: 1px solid var(--grey-200);
  border-radius: 16px;
}
.d-header__greet {
  flex: 1;
  font-family: var(--font-primary);
  font-weight: 500;
  font-size: 24px;
  line-height: 32px;
  color: #000;
}
.d-header__greet span { color: #404040; }
.d-header__tools { display: flex; align-items: center; gap: 8px; }
.d-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 220px;
  padding: 10px 12px;
  border: 1px solid var(--grey-200);
  border-radius: 8px;
  font-size: 12px;
  line-height: 16px;
  color: #737373;
}
.d-search img { width: 16px; height: 16px; }
.d-iconbtn {
  display: grid;
  place-items: center;
  padding: 8px;
  border: 1px solid var(--grey-200);
  border-radius: 8px;
}
.d-iconbtn img { width: 20px; height: 20px; }
.d-avatar { width: 36px; height: 36px; border-radius: 6px; object-fit: cover; }

/* Selects */
.d-selects { display: flex; gap: 8px; }
.d-select {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #fafafa;
  border: 1px solid var(--grey-200);
  border-radius: 8px;
  font-weight: 500;
  font-size: 12px;
  line-height: 16px;
  color: #404040;
  white-space: nowrap;
}
.d-select--muted { color: var(--grey-600); }
.d-select img { width: 16px; height: 16px; }
.d-select .d-meta { width: 16px; height: 10.6264px; }

/* Rendimiento de adquisición */
.d-acq { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.d-acq__top { display: flex; align-items: center; gap: 20px; }
.d-acq__label { flex: 1; display: flex; align-items: center; gap: 12px; }
.d-acq__icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  background: #fef7ec;
  border: 1px solid #f9d28e;
  border-radius: 8px;
}
.d-acq__icon img { width: 24px; height: 24px; }
.d-value { display: flex; align-items: baseline; gap: 8px; padding: 6px 0 6px 4px; white-space: nowrap; }
.d-value--sm { gap: 4px; padding: 0; }

.d-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px 2px 6px;
  border-radius: 64px;
  font-size: 12px;
  line-height: 16px;
  white-space: nowrap;
}
.d-badge img { width: 12px; height: 12px; }
.d-badge--info { padding: 2px 8px; background: #e0f2fe; color: #0284c7; }
.d-badge--up { background: #f0fdf4; color: #16a34a; }

.d-kpis { display: flex; gap: 8px; }
.d-kpi {
  flex: 1 1 0;
  min-width: 0;
  height: 152px;
  display: flex;
  flex-direction: column;
  padding: 2px;
  background: #fef7ec;
  border: 1px solid #fceac9;
  border-radius: 12px;
  overflow: hidden;
}
.d-kpi__top {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 12px;
  margin-bottom: -2px;
  background: var(--white);
  border-radius: 10px;
  position: relative;
  z-index: 1;
}
.d-kpi__head { display: flex; align-items: center; gap: 8px; }
.d-kpi__head .d-b4 { flex: 1; }
.d-kpi__icon {
  display: grid;
  place-items: center;
  padding: 6px;
  background: rgba(254, 247, 236, 0.5);
  border: 1px solid #fceac9;
  border-radius: 6px;
}
.d-kpi__icon img { width: 20px; height: 20px; }
.d-kpi__num { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.d-kpi__foot {
  display: flex;
  gap: 8px;
  padding: 12px;
  font-size: 12px;
  line-height: 16px;
}
.d-kpi__foot span:first-child { flex: 1; color: var(--grey-600); }
.d-kpi__foot span:last-child { font-weight: 500; color: var(--grey-800); }

.d-summary {
  display: flex;
  gap: 30px;
  padding: 16px 20px;
  border-top: 1px solid var(--grey-200);
}
.d-summary__item { flex: 1 1 0; min-width: 0; display: flex; gap: 16px; }
.d-summary__item > div:last-child { display: flex; flex-direction: column; gap: 4px; }
.d-summary__sep { width: 1px; align-self: stretch; background: var(--grey-200); }
.d-summary__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 1px solid var(--grey-200);
  border-radius: 6px;
}
.d-summary__icon img { width: 28px; height: 28px; }

/* Fila: remarketing + clientes recuperados */
.d-row { display: flex; gap: 12px; }
.d-rm { width: 640px; height: 392px; flex: none; }
.d-rec { width: 494px; height: 392px; flex: none; display: flex; flex-direction: column; }

.d-rm__body { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.d-rm__track { position: relative; height: 13px; }
.d-rm__track::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 6px;
  height: 1px;
  background: var(--grey-200);
}
.d-rm__dot {
  position: absolute;
  top: 2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 20%, transparent);
}
.d-rm__cards { display: flex; gap: 12px; }
.d-rm__card {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 20px 12px 12px;
  background: rgba(250, 250, 250, 0.6);
  border: 1px solid #f5f5f5;
  border-top: 0;
  border-radius: 8px;
  box-shadow: inset 0 3px 0 var(--c);
  text-align: center;
}
.d-rm__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  background: var(--bg);
  border: 1px solid var(--bd);
  border-radius: 6px;
}
.d-rm__icon img { width: 20px; height: 20px; }
.d-rm__icon .d-wa { width: 18.1665px; height: 18.1666px; }
.d-rm__stat { display: flex; flex-direction: column; gap: 2px; margin-top: -2px; }
.d-rm__num { font-family: var(--font-primary); font-weight: 500; font-size: 18px; line-height: 26px; color: #000; }
.d-rm__line { width: 100%; height: 1px; background: var(--grey-200); }
.d-rm__ch { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.d-rm__ch .d-b4 { color: var(--ch); }

/* Clientes recuperados */
.d-rec__body { flex: 1; display: flex; flex-direction: column; gap: 16px; padding: 20px; }
.d-rec__top { display: flex; gap: 20px; }
.d-rec__top > div:first-child { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.d-rec__top > div:last-child { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.d-graph { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.d-chart { position: relative; flex: 1; display: flex; flex-direction: column; justify-content: space-between; }
.d-axis {
  font-family: var(--font-primary);
  font-size: 12px;
  line-height: 18px;
  letter-spacing: 0.4px;
  color: #737373;
}
.d-chart__row { display: flex; align-items: center; gap: 12px; }
.d-chart__row .d-axis { width: 21px; }
.d-chart__row i { flex: 1; height: 0; border-top: 1px dashed var(--grey-200); }
.d-chart__line { position: absolute; left: 31.5px; top: 33.5px; width: 420px; height: 158px; }
.d-chart__tip { position: absolute; left: 329px; top: 51px; width: 64px; height: 35px; }
.d-chart__tip img { position: absolute; left: -12px; top: -12px; width: 96px; height: 67.0048px; max-width: none; }
.d-chart__tip span {
  position: absolute;
  left: 33.5px;
  top: 13px;
  transform: translate(-50%, -50%);
  font-size: 12px;
  line-height: 16px;
  color: var(--grey-600);
}
.d-chart__dot {
  position: absolute;
  left: 356px;
  top: 88px;
  width: 12px;
  height: 12px;
  border-radius: 90px;
  background: rgba(255, 255, 255, 0.03);
  box-shadow: 0 0 37.7px rgba(0, 0, 0, 0.2);
}
.d-chart__dot::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: linear-gradient(#f49c2b, #e57411);
}
.d-dates { display: flex; justify-content: space-between; padding-left: 33px; white-space: nowrap; }

/* Última fila (asoma por abajo) */
.d-sources { width: 708px; height: 362px; flex: none; }
.d-activity { width: 426px; height: 362px; flex: none; }
.d-viewall {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  font-weight: 500;
  font-size: 14px;
  line-height: 20px;
  color: #737373;
}
.d-viewall img { width: 20px; height: 20px; }

@media (max-width: 600px) {
  .dash { border-radius: 8px; }
}
