/* === Reports & Analytics page === */

/* Hero */
.ra-hero { padding-top: 32px; padding-bottom: 64px; position: relative; overflow: hidden; }
.ra-hero::before {
  content: "";
  position: absolute; inset: -10% -20% auto -20%; height: 700px;
  background:
    radial-gradient(50% 60% at 70% 20%, rgba(64,204,191,0.13), transparent 60%),
    radial-gradient(40% 50% at 20% 40%, rgba(99,102,241,0.08), transparent 60%),
    radial-gradient(60% 60% at 50% 0%, rgba(64,204,191,0.08), transparent 60%);
  pointer-events: none; z-index: 0;
}
.ra-hero .container {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1fr 1.15fr;
  gap: 64px; align-items: center;
}
.ra-hero h1 { font-size: clamp(38px, 4.5vw, 60px); line-height: 1.06; letter-spacing: -0.025em; text-wrap: balance; margin-top: 16px; }
.ra-hero h1 .accent { color: var(--teal-600); }
.ra-hero .lede { color: var(--muted); font-size: 18px; margin-top: 20px; max-width: 50ch; text-wrap: pretty; }
.ra-hero-actions { display: flex; gap: 12px; margin-top: 32px; flex-wrap: wrap; }
.ra-hero .benefits-row { justify-content: flex-start; margin-top: 24px; }

/* Dashboard mock */
.ra-dash-mock {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-xl); overflow: hidden;
  box-shadow: var(--shadow-lg), 0 0 0 6px rgba(255,255,255,0.7);
}
.mock-bar {
  padding: 10px 14px; background: var(--bg); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
}
.mock-bar .traf { display: flex; gap: 5px; flex-shrink: 0; }
.mock-bar .traf i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); display: block; }
.mock-bar .crumbs { font-size: 12px; font-weight: 500; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mock-bar .crumbs b { color: var(--ink); font-weight: 700; }
.ra-kpi-strip {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1px; background: var(--line);
  border-bottom: 1px solid var(--line);
}
.ra-kpi { background: var(--bg); padding: 14px 16px; }
.ra-kpi-val { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); }
.ra-kpi-lbl { font-size: 11px; color: var(--muted); margin-top: 2px; }
.ra-kpi-delta { display: inline-block; font-size: 11px; font-weight: 700; margin-top: 4px; padding: 1px 6px; border-radius: 999px; }
.ra-kpi-delta.up { background: var(--teal-50); color: var(--teal-700); }
.ra-kpi-delta.down { background: #FEF2F2; color: #B91C1C; }
.ra-dash-inner { padding: 16px; }

/* Rep performance visual */
.ra-rep-table { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.ra-rep-table .rh { display: grid; grid-template-columns: 1fr 56px 56px 56px; gap: 8px; padding: 8px 14px; background: var(--surface); border-bottom: 1px solid var(--line); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.ra-rep-row { display: grid; grid-template-columns: 1fr 56px 56px 56px; gap: 8px; padding: 10px 14px; border-bottom: 1px dashed var(--line-2); align-items: center; font-size: 13px; }
.ra-rep-row:last-child { border-bottom: none; }
.ra-rep-row .rep { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ink); }
.ra-rep-row .av-sm { width: 26px; height: 26px; border-radius: 999px; background: var(--teal-100); color: var(--teal-700); font-size: 10px; font-weight: 700; display: grid; place-items: center; flex-shrink: 0; }
.ra-rep-row .num { font-feature-settings: "tnum"; color: var(--ink-2); font-size: 12px; }
.ra-rep-row .rate { font-weight: 700; color: var(--teal-700); font-size: 12px; }
.ra-rep-row .medal { font-size: 14px; }

/* Funnel visual */
.ra-funnel { display: flex; flex-direction: column; gap: 6px; }
.ra-funnel-row { display: grid; grid-template-columns: 100px 1fr 52px; gap: 10px; align-items: center; font-size: 13px; }
.ra-funnel-row .stage-lbl { font-weight: 600; color: var(--ink); font-size: 12px; }
.ra-funnel-bar { height: 28px; border-radius: 6px; background: var(--line-2); position: relative; overflow: hidden; }
.ra-funnel-bar .fill { position: absolute; inset: 0 auto 0 0; border-radius: 6px; background: linear-gradient(90deg, var(--teal-500), var(--teal-400)); }
.ra-funnel-row .count { font-size: 12px; font-weight: 700; color: var(--ink); text-align: right; font-feature-settings: "tnum"; }
.ra-funnel-pct { font-size: 10px; color: var(--muted); text-align: right; }

/* Custom report visual */
.ra-report-builder { background: white; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.ra-report-builder .rb-head { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.ra-report-builder .rb-head .ttl { font-weight: 700; font-size: 13px; }
.ra-report-builder .rb-head .badge { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--teal-50); color: var(--teal-700); }
.ra-report-builder .rb-body { padding: 14px 16px; display: grid; gap: 10px; }
.ra-report-builder .rb-row { display: flex; align-items: center; justify-content: space-between; font-size: 12px; }
.ra-report-builder .rb-row .lbl { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.ra-report-builder .rb-row .val { font-weight: 600; color: var(--ink); font-size: 12px; }
.ra-report-builder .rb-row .pill { background: var(--line-2); border-radius: 6px; padding: 3px 8px; font-size: 11px; font-weight: 600; color: var(--ink-2); }
.ra-report-builder .rb-metrics { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.ra-report-builder .rb-metric { display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; padding: 4px 8px; border-radius: 6px; }
.ra-report-builder .rb-metric.on { background: var(--teal-50); color: var(--teal-700); }
.ra-report-builder .rb-metric.off { background: var(--line-2); color: var(--muted); }

/* Scheduled report cards */
.ra-schedule-list { display: flex; flex-direction: column; gap: 8px; }
.ra-schedule-card { background: white; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: start; }
.ra-schedule-card .name { font-weight: 700; font-size: 13px; color: var(--ink); }
.ra-schedule-card .meta { font-size: 11px; color: var(--muted); margin-top: 3px; }
.ra-schedule-card .badge { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.ra-schedule-card .badge.weekly { background: #EEF2FF; color: #4F46E5; }
.ra-schedule-card .badge.daily { background: var(--teal-50); color: var(--teal-700); }
.ra-schedule-card .badge.monthly { background: #FEF3C7; color: #92400E; }
.ra-schedule-card .recipients { display: flex; gap: 4px; margin-top: 8px; flex-wrap: wrap; }
.ra-schedule-card .chip { font-size: 10px; background: var(--line-2); color: var(--ink-2); padding: 2px 6px; border-radius: 4px; font-weight: 600; }

/* Responsive */
@media (max-width: 980px) {
  .ra-hero .container { grid-template-columns: 1fr; gap: 40px; }
  .ra-kpi-strip { grid-template-columns: repeat(2, 1fr); }
  .ra-rep-table .rh,
  .ra-rep-row { grid-template-columns: 1fr 56px 56px; }
  .ra-rep-row .num:nth-child(2) { display: none; }
  .ra-rep-table .rh div:nth-child(2) { display: none; }
}
