/**
 * Hero: статическая копия hero-band дашборда UNIT.
 * Данные — dashboard-demo-data.ts (демо, не клиенты).
 */

.hero-dash-live {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  font-family: var(--u-font);
  color: #212121;
  letter-spacing: -0.01em;
}

.hero-dash-live__app {
  background: #faf8f6;
  border: 0.5px solid #e6e1da;
  border-radius: 16px;
  overflow: hidden;
  padding: 1rem 1rem 0.75rem;
}

/* ── Hero band (3 колонки как в продукте) ── */
.hero-dash-live__band {
  display: grid;
  grid-template-columns: minmax(9.5rem, 0.92fr) minmax(0, 2.05fr) minmax(9.5rem, 1.08fr);
  gap: 0.625rem;
  align-items: stretch;
}

.hero-dash-live__col {
  display: grid;
  gap: 0.625rem;
  min-width: 0;
}

.hero-dash-live__col--left {
  grid-template-rows: auto auto;
  align-content: start;
}

.hero-dash-live__col--right {
  grid-template-rows: auto minmax(0, 1fr);
}

/* ── Модуль (dash-mod) ── */
.hdl-mod {
  min-width: 0;
  padding: 0.75rem 0.875rem 0.875rem;
  border: 0.5px solid #e6e1da;
  border-radius: 16px;
  background: #fdfbfa;
  display: flex;
  flex-direction: column;
}

.hdl-mod--dark {
  border-color: transparent;
  background: #212121;
  color: #faf8f6;
}

.hdl-mod__head {
  margin-bottom: 0.375rem;
}

.hdl-mod__head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 1.375rem;
}

.hdl-mod__title {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: #35322f;
}

.hdl-mod--dark .hdl-mod__title {
  color: #faf8f6;
}

.hdl-mod__corner {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  min-height: 1.25rem;
  padding: 0.125rem 0.5rem;
  border: 0.5px solid #e6e1da;
  border-radius: 4px;
  background: color-mix(in srgb, #f2f0ed 42%, #fdfbfa);
  font-size: 0.625rem;
  font-weight: 500;
  color: #6d6c65;
  text-decoration: none;
}

.hdl-mod--dark .hdl-mod__corner {
  border-color: rgba(250, 248, 246, 0.18);
  background: rgba(250, 248, 246, 0.06);
  color: rgba(250, 248, 246, 0.72);
}

.hdl-mod--time .hdl-mod__corner {
  border-color: color-mix(in srgb, #48749e 18%, transparent);
  background: color-mix(in srgb, #fdfbfa 55%, #dce6ee);
  color: #48749e;
}

.hdl-mod__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.hdl-mod__metric {
  margin: 0;
  font-size: 2.625rem;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: #212121;
}

.hdl-mod--dark .hdl-mod__metric {
  color: #faf8f6;
}

.hdl-mod__metric--hero {
  font-size: 5rem;
  letter-spacing: -0.03em;
}

.hdl-mod__caption {
  margin: 0.25rem 0 0;
  font-size: 0.75rem;
  line-height: 1.4;
  color: #626b75;
}

.hdl-mod--dark .hdl-mod__caption {
  color: rgba(250, 248, 246, 0.65);
}

.hdl-mod__caption--lead {
  color: #35322f;
}

.hdl-mod__caption--bridge {
  margin-top: 0.25rem;
  color: #626b75;
}

.hdl-mod__rule {
  margin: 0.75rem calc(-0.875rem) 0;
  border: none;
  border-top: 0.5px solid #e6e1da;
}

/* ── Входящий поток ── */
.hdl-inflow__metric-block {
  padding-bottom: 1rem;
  margin-bottom: 0;
  position: relative;
}

.hdl-inflow__metric-block::after {
  content: "";
  position: absolute;
  left: -0.875rem;
  right: -0.875rem;
  bottom: 0;
  border-bottom: 0.5px solid #e6e1da;
}

.hdl-inflow__detail {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.hdl-inflow__detail-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.hdl-inflow__detail-value {
  font-size: 1.25rem;
  font-weight: 400;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: #212121;
}

.hdl-inflow__detail-label {
  font-size: 1.25rem;
  color: #35322f;
  letter-spacing: -0.02em;
}

.hdl-inflow__detail-sub {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.625rem;
  color: #6d6c65;
}

.hdl-delta {
  display: inline-flex;
  align-items: center;
  gap: 0.125rem;
  padding: 0.0625rem 0.3125rem;
  border-radius: 999px;
  font-size: 0.625rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.hdl-delta--up {
  background: #e4f1ea;
  color: #3c865e;
}

.hdl-delta--down {
  background: #f1e5e4;
  color: #9a5537;
}

/* Segment track (канон dash-segment) */
.hdl-seg-track {
  display: flex;
  align-items: center;
  gap: 2px;
  width: 100%;
  height: 1.375rem;
}

.hdl-seg {
  flex: 1 1 0;
  min-width: 3px;
  height: 1.375rem;
  border-radius: 2px;
  background: #dce6ef;
}

.hdl-seg:first-child {
  border-radius: 8px 2px 2px 8px;
}

.hdl-seg:last-child {
  border-radius: 2px 8px 8px 2px;
}

.hdl-seg:only-child {
  border-radius: 8px;
}

.hdl-seg--on.hdl-seg--reviews { background: #afc0d0; }
.hdl-seg--on.hdl-seg--questions { background: #8da7be; }
.hdl-seg--on.hdl-seg--returns { background: #48749e; }
.hdl-seg--on.hdl-seg--chats { background: #3c6287; }
.hdl-seg--on.hdl-seg--q { background: #8da7be; }
.hdl-seg--on.hdl-seg--r { background: #afc0d0; }

/* ── Динамика потока ── */
.hdl-dynamics__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.375rem 0.5rem;
}

.hdl-dynamics__item {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.hdl-dynamics__head {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.hdl-dynamics__val {
  font-size: 1.375rem;
  font-weight: 400;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: #212121;
}

.hdl-dynamics__cap {
  margin: 0;
  font-size: 0.625rem;
  color: #6d6c65;
}

/* ── Automation hero (центр) ── */
.hdl-mod--automation {
  min-height: 14.5rem;
  padding-bottom: 1rem;
}

.hdl-auto__chart {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.hdl-auto__metric-block {
  position: relative;
  padding-bottom: 0.75rem;
}

.hdl-auto__metric-block::after {
  content: "";
  position: absolute;
  left: -0.875rem;
  right: -0.875rem;
  bottom: 0;
  border-bottom: 0.5px solid #e6e1da;
}

.hdl-auto__funnel {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  position: relative;
  padding-top: 0.5rem;
}

.hdl-auto__funnel::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: -1rem;
  left: calc(50% + 0.5rem);
  border-left: 0.5px solid #e6e1da;
  pointer-events: none;
}

.hdl-auto__funnel-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1rem;
}

.hdl-auto__funnel-row + .hdl-auto__funnel-row {
  padding-left: 1rem;
}

.hdl-auto__funnel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.hdl-auto__funnel-pct {
  font-size: 1.375rem;
  font-weight: 400;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: #212121;
}

.hdl-auto__funnel-cap {
  font-size: 0.75rem;
  color: #35322f;
}

.hdl-auto__funnel-meta {
  margin: 0.375rem 0 0;
  font-size: 0.625rem;
  line-height: 1.35;
  color: #6d6c65;
}

/* ── Очередь менеджера (тёмная карточка) ── */
.hdl-mod--manager .hdl-mod__body {
  flex: 0 0 auto;
}

.hdl-queue__nav {
  display: inline-flex;
  gap: 0.25rem;
}

.hdl-queue__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  padding: 0;
  border: 0.5px solid rgba(250, 248, 246, 0.18);
  border-radius: 4px;
  background: rgba(250, 248, 246, 0.06);
  color: rgba(250, 248, 246, 0.72);
}

.hdl-queue__btn svg {
  width: 0.625rem;
  height: 0.625rem;
}

/* ── Сэкономлено времени ── */
.hdl-mod--time {
  align-self: stretch;
  display: flex;
  flex-direction: column;
}

.hdl-time__compare {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.hdl-time__row {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.625rem;
}

.hdl-time__label {
  font-size: 0.75rem;
  color: #6d6c65;
}

.hdl-time__val {
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  color: #212121;
  white-space: nowrap;
}

.hdl-seg--on.hdl-seg--time-now { background: #48749e; }
.hdl-seg--on.hdl-seg--time-pot { background: #98adca; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .hero-dash-live__band {
    grid-template-columns: 1fr;
  }

  .hdl-mod--automation {
    min-height: 0;
  }

  .hdl-auto__funnel::before {
    display: none;
  }

  .hdl-auto__funnel-row + .hdl-auto__funnel-row {
    padding-left: 0;
    margin-top: 0.75rem;
  }

  .hdl-auto__funnel-split {
    grid-template-columns: 1fr;
  }

  .hdl-mod__metric--hero {
    font-size: 3.5rem;
  }
}
