/**
 * Customers route — compact KPI + analytics density.
 * Scope: body.use-new-ui.route-customers (desktop only; mobile unchanged).
 * Loads after typography-admin to override global .cards > .card KPI scale.
 */

@media (min-width: 769px) {
  body.use-new-ui.route-customers .customers-intelligence {
    gap: 12px !important;
  }

  body.use-new-ui.route-customers .customers-intelligence > .customers-toolbar {
    margin-bottom: 12px !important;
  }

  /* ---- Unified KPI grid (tier strip + summary cards) ---- */
  body.use-new-ui.route-customers .customer-kpi-compact-section {
    display: grid;
    gap: 12px;
    margin-bottom: 4px;
  }

  body.use-new-ui.route-customers .customer-kpi-compact-section > .cards {
    display: contents;
  }

  @media (min-width: 769px) and (max-width: 899px) {
    body.use-new-ui.route-customers .customer-kpi-compact-section {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
  }

  @media (min-width: 900px) and (max-width: 1099px) {
    body.use-new-ui.route-customers .customer-kpi-compact-section {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }
  }

  @media (min-width: 1100px) and (max-width: 1399px) {
    body.use-new-ui.route-customers .customer-kpi-compact-section {
      grid-template-columns: repeat(4, minmax(0, 1fr));
    }
  }

  @media (min-width: 1400px) {
    body.use-new-ui.route-customers .customer-kpi-compact-section {
      grid-template-columns: repeat(6, minmax(0, 1fr));
    }
  }

  body.use-new-ui.route-customers .customer-kpi-compact-section .card.customer-kpi-card {
    min-height: 102px !important;
    max-height: none !important;
    padding: 18px 20px !important;
    border-radius: 10px !important;
    border: 1px solid rgba(205, 214, 228, 0.72) !important;
    background: rgba(255, 255, 255, 0.94) !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    gap: 2px !important;
    box-sizing: border-box !important;
    transition: transform 140ms ease, box-shadow 140ms ease !important;
  }

  body.use-new-ui.route-customers .customer-kpi-compact-section .card.customer-kpi-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06) !important;
  }

  body.use-new-ui.route-customers .customer-kpi-compact-section .card-title {
    margin: 0 0 4px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    letter-spacing: 0.05em !important;
    text-transform: uppercase !important;
    color: #64748b !important;
    line-height: 1.25 !important;
  }

  body.use-new-ui.route-customers .customer-kpi-compact-section .card-value {
    margin: 0 !important;
    font-size: 28px !important;
    font-weight: 700 !important;
    line-height: 1.08 !important;
    color: #0f172a !important;
    font-variant-numeric: tabular-nums !important;
    font-feature-settings: "tnum" !important;
  }

  body.use-new-ui.route-customers .customer-kpi-compact-section .card-sub {
    margin-top: 4px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    line-height: 1.35 !important;
    color: #64748b !important;
  }

  body.use-new-ui.route-customers .customer-kpi-compact-section .customer-kpi-card--tier .card-value {
    font-size: 28px !important;
  }

  /* ---- Analytics panels (tighter vertical rhythm) ---- */
  body.use-new-ui.route-customers .customers-intelligence .customer-analytics-grid {
    gap: 12px !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
  }

  body.use-new-ui.route-customers .customers-intelligence .customer-analytics-grid.section-block {
    margin-top: 0 !important;
  }

  body.use-new-ui.route-customers .customers-intelligence .customer-source-summary-card,
  body.use-new-ui.route-customers .customers-intelligence .customer-tier-summary-card {
    padding: 14px 16px !important;
    border-radius: 10px !important;
    border: 1px solid rgba(205, 214, 228, 0.72) !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
  }

  body.use-new-ui.route-customers .customers-intelligence .customer-source-summary-card h3,
  body.use-new-ui.route-customers .customers-intelligence .customer-tier-summary-card h3 {
    margin: 0 0 4px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    color: #334155 !important;
  }

  body.use-new-ui.route-customers .customers-intelligence .customer-source-panel-note {
    margin: 0 0 8px !important;
    font-size: 12.5px !important;
    line-height: 1.4 !important;
    color: #64748b !important;
  }

  body.use-new-ui.route-customers .customers-intelligence .customer-source-head,
  body.use-new-ui.route-customers .customers-intelligence .customer-source-row {
    padding: 6px 10px !important;
    min-height: 28px !important;
  }

  body.use-new-ui.route-customers .customers-intelligence .customer-source-head {
    font-size: 11px !important;
  }

  body.use-new-ui.route-customers .customers-intelligence .customer-source-row .source-name,
  body.use-new-ui.route-customers .customers-intelligence .customer-source-row .source-count,
  body.use-new-ui.route-customers .customers-intelligence .customer-source-row .source-revenue {
    font-size: 13px !important;
  }

  body.use-new-ui.route-customers .customers-intelligence .customer-tier-layout {
    align-items: center !important;
    gap: 12px !important;
  }

  body.use-new-ui.route-customers .customers-intelligence .customer-tier-donut-wrap,
  body.use-new-ui.route-customers .customers-intelligence .customer-tier-donut {
    width: 88px !important;
    min-width: 88px !important;
    height: 88px !important;
  }

  body.use-new-ui.route-customers .customers-intelligence .customer-tier-donut::after {
    inset: 16px !important;
  }

  body.use-new-ui.route-customers .customers-intelligence .customer-tier-total {
    font-size: 14px !important;
  }

  body.use-new-ui.route-customers .customers-intelligence .customer-tier-row {
    min-height: 28px !important;
    padding: 5px 8px !important;
  }

  body.use-new-ui.route-customers .customers-intelligence .customer-tier-row .tier-count {
    font-size: 13px !important;
  }
}
