/* ==================== DASHBOARD LAYOUT ==================== */
.dash-body {
  display: flex;
  min-height: 100vh;
  background: var(--bg-deep);
  overflow-x: hidden;
}

/* ── Sidebar ── */
.dash-sidebar {
  width: 220px;
  min-height: 100vh;
  background: var(--bg-surface);
  border-right: 1px solid rgba(255,255,255,0.04);
  display: flex;
  flex-direction: column;
  padding: 1.75rem 1.25rem;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 10;
}

.dash-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}

.dash-logo__mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-violet));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff;
  flex-shrink: 0;
}

.dash-logo__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--fg-primary);
  letter-spacing: -0.01em;
}

.dash-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.dash-nav__link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--fg-secondary);
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.dash-nav__link:hover {
  background: rgba(255,255,255,0.04);
  color: var(--fg-primary);
}

.dash-nav__link--active {
  background: var(--accent-cyan-dim);
  color: var(--accent-cyan);
  border: 1px solid rgba(0,212,255,0.15);
}

.dash-nav__icon {
  font-size: 1rem;
  opacity: 0.7;
}

.dash-sidebar__footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,0.04);
}

.dash-badge {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-violet);
  background: var(--accent-violet-dim);
  padding: 0.25rem 0.75rem;
  border-radius: 100px;
  border: 1px solid rgba(167,139,250,0.2);
}

/* ── Main area ── */
.dash-main {
  flex: 1;
  margin-left: 220px;
  padding: 2rem 2.5rem;
  max-width: calc(100vw - 220px);
}

/* ── Header ── */
.dash-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.dash-header__title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
}

.dash-header__sub {
  font-size: 0.875rem;
  color: var(--fg-muted);
}

.dash-header__date {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--fg-muted);
  background: var(--bg-surface);
  padding: 0.4rem 1rem;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.04);
  white-space: nowrap;
}

/* ── KPI Cards ── */
.dash-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.kpi-card {
  background: var(--bg-surface);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s;
}

.kpi-card:hover { transform: translateY(-2px); }

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  border-radius: 14px 14px 0 0;
}

.kpi-card--cyan::before  { background: var(--accent-cyan); }
.kpi-card--violet::before { background: var(--accent-violet); }
.kpi-card--coral::before  { background: var(--accent-coral); }
.kpi-card--green::before  { background: #34d399; }

.kpi-card__label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 0.5rem;
}

.kpi-card__value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 0.4rem;
}

.kpi-card--cyan  .kpi-card__value { color: var(--accent-cyan); }
.kpi-card--violet .kpi-card__value { color: var(--accent-violet); }
.kpi-card--coral  .kpi-card__value { color: var(--accent-coral); }
.kpi-card--green  .kpi-card__value { color: #34d399; }

.kpi-card__sub {
  font-size: 0.78rem;
  color: var(--fg-muted);
}

/* ── Chart rows ── */
.dash-charts-row {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1rem;
  margin-bottom: 1rem;
}

.dash-card {
  background: var(--bg-surface);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 14px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

.dash-card--wide {
  /* spans full width when grid only has it */
}

.dash-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.dash-card__title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.dash-card__sub-label {
  font-size: 0.75rem;
  color: var(--fg-muted);
}

.dash-card__legend {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.75rem;
  color: var(--fg-secondary);
}

.legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
}

.legend-dot--cyan   { background: var(--accent-cyan); }
.legend-dot--violet { background: var(--accent-violet); }
.legend-dot--coral  { background: var(--accent-coral); }

.dash-card__body {
  flex: 1;
  position: relative;
}

.dash-card__body--center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

/* ── Format legend ── */
.format-legend {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.format-legend__item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
}

.format-legend__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.format-legend__label {
  flex: 1;
  color: var(--fg-secondary);
}

.format-legend__pct {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--fg-primary);
}

/* ── Conversion Funnel ── */
.funnel {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.5rem 0;
}

.funnel__stage {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 1rem;
}

.funnel__bar-wrap {
  flex: 1;
}

.funnel__bar {
  height: 32px;
  border-radius: 6px;
  border: 1px solid;
  position: relative;
  overflow: hidden;
  min-width: 20px;
  transition: width 0.6s ease;
}

.funnel__bar-fill {
  height: 100%;
  border-radius: 6px;
}

.funnel__meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 200px;
}

.funnel__label {
  font-size: 0.82rem;
  color: var(--fg-secondary);
  min-width: 70px;
}

.funnel__value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  min-width: 60px;
  text-align: right;
}

.funnel__pct {
  font-size: 0.75rem;
  color: var(--fg-muted);
  min-width: 35px;
}

.funnel__arrow {
  font-size: 0.75rem;
  color: var(--fg-muted);
  padding-left: 0.5rem;
  margin: -0.25rem 0;
}

.funnel__drop-pct {
  font-size: 0.7rem;
  color: var(--fg-muted);
}

/* ── Responsive ── */
@media (max-width: 1100px) {
  .dash-kpis { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .dash-sidebar { width: 60px; padding: 1.25rem 0.75rem; }
  .dash-logo__name, .dash-nav__link span:last-child, .dash-sidebar__footer { display: none; }
  .dash-main { margin-left: 60px; padding: 1.25rem; }
  .dash-charts-row { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .dash-kpis { grid-template-columns: 1fr; }
  .dash-main { max-width: 100vw; }
}
