.dash-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 28px 24px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
}

.dash-hero-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dash-hero-figure {
  font-size: 52px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text);
  font-variant-numeric: proportional-nums;
}

.dash-hero-sub {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.dash-hero-cta {
  font-size: 14px;
  padding: 12px 22px;
  white-space: nowrap;
}

.dash-hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.dash-search-form {
  display: flex;
  gap: 0;
}

.dash-search-form input {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-right: none;
  font-size: 13px;
  width: 220px;
  max-width: 100%;
  font-family: inherit;
}

.dash-search-form .btn {
  border-radius: 0;
}

.dash-priority {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 16px;
  padding: 20px 24px 0;
}

.dash-priority-card {
  padding: 18px 20px 20px;
}

.followup-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.followup-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 4px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
}

.followup-row:last-child { border-bottom: none; }

.followup-row:hover .followup-name { text-decoration: underline; }

.followup-name {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.followup-days {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.status-pill {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 2px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.pipeline-value-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pv-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.pv-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 720px) {
  .dash-priority {
    grid-template-columns: 1fr;
  }
}

.dash-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  margin: 20px 24px 0;
}

.kpi-tile {
  background: var(--card);
  padding: 14px 18px;
  border-top: 3px solid var(--accent1);
}

.kpi-tile:nth-child(4n+1) { border-top-color: var(--accent1); }
.kpi-tile:nth-child(4n+2) { border-top-color: var(--accent4); }
.kpi-tile:nth-child(4n+3) { border-top-color: var(--accent2); }
.kpi-tile:nth-child(4n+4) { border-top-color: var(--accent5); }

.kpi-tile .num {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: proportional-nums;
}

.kpi-tile .label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-top: 2px;
}

.dash-charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  padding: 20px 24px 48px;
}

.chart-card {
  background: var(--card);
  border: 1px solid var(--border-strong);
  padding: 18px 20px 20px;
}

.chart-card h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.chart-sub {
  margin: 2px 0 16px;
  font-size: 12px;
  color: var(--muted);
}

/* Donut */
.donut-wrap {
  position: relative;
  width: 200px;
  max-width: 100%;
  margin: 0 auto;
}

.donut-svg {
  width: 100%;
  height: auto;
  display: block;
}

.donut-svg circle {
  fill: none;
  stroke-width: 28;
  stroke-linecap: butt;
  transition: stroke-dashoffset 1s cubic-bezier(0.22, 1, 0.36, 1);
}

.donut-svg circle.track {
  stroke: var(--ribbon);
  transition: none;
}

.donut-svg circle.seg {
  cursor: pointer;
}

.donut-svg circle.seg:hover,
.donut-svg circle.seg:focus {
  filter: brightness(0.92);
  outline: none;
}

.donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.donut-center .num {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: proportional-nums;
}

.donut-center .label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}

.chart-legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 18px;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

.legend-name {
  color: var(--text);
  flex: 1;
}

.legend-value {
  color: var(--muted);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Horizontal bar chart */
.hbar-chart {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hbar-row .hbar-top {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 4px;
}

.hbar-row .hbar-label {
  color: var(--text);
  font-weight: 600;
}

.hbar-row .hbar-value {
  color: var(--muted);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.hbar-track {
  height: 14px;
  background: var(--ribbon);
  position: relative;
  overflow: hidden;
}

.hbar-fill {
  height: 100%;
  width: 0;
  background: var(--accent1);
  border-radius: 0 4px 4px 0;
  transition: width 1s cubic-bezier(0.22, 1, 0.36, 1);
  cursor: pointer;
}

.chart-card.in-view .hbar-fill {
  width: var(--target-width);
}

/* Shared tooltip */
.chart-tooltip {
  position: fixed;
  z-index: 50;
  pointer-events: none;
  background: var(--text);
  color: #fff;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 2px;
  opacity: 0;
  transform: translate(-50%, calc(-100% - 10px));
  transition: opacity 0.1s ease;
  white-space: nowrap;
}

.chart-tooltip strong {
  font-weight: 700;
  margin-right: 4px;
}

.chart-tooltip.visible { opacity: 1; }

.empty-chart-note {
  font-size: 12px;
  color: var(--muted);
  padding: 20px 0;
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .donut-svg circle,
  .hbar-fill {
    transition: none !important;
  }
}
