/* ═══════════════════════════════════════════════════════
   REPORTS REVAMP v2.0
   Tabbed UI · Quick Stats · Trends · Comparison · Preview
   ═══════════════════════════════════════════════════════ */

/* ── hero override ─────────────────────────────────── */
.reports-hero-new {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4338ca 100%) !important;
}
.reports-hero-new .hero-bg-effects .hero-orb:nth-child(1) { background: rgba(99, 102, 241, .35); }
.reports-hero-new .hero-bg-effects .hero-orb:nth-child(2) { background: rgba(139, 92, 246, .25); }

/* ── quick-stats strip ─────────────────────────────── */
.rpt-quick-stats,
.rpt-qs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 0 12px;
  margin-bottom: 4px;
  scrollbar-width: none;
}
.rpt-quick-stats::-webkit-scrollbar { display: none; }

.rpt-qs__card {
  flex: 1;
  min-width: 100px;
  background: var(--bg-surface, #1e1e2e);
  border: 1px solid var(--border, rgba(255,255,255,.08));
  border-radius: 14px;
  padding: 14px 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color .2s, transform .2s;
}
.rpt-qs__card:hover {
  border-color: var(--accent, #6366f1);
  transform: translateY(-2px);
}
.rpt-qs__val {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary, #fff);
  line-height: 1.2;
}
.rpt-qs__lbl {
  font-size: .7rem;
  color: var(--text-muted, rgba(255,255,255,.5));
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* ── tab bar ───────────────────────────────────────── */
.rpt-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-surface, #1e1e2e);
  border-radius: 14px;
  padding: 5px;
  margin-bottom: 16px;
  border: 1px solid var(--border, rgba(255,255,255,.08));
}
.rpt-tab {
  flex: 1;
  padding: 10px 8px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted, rgba(255,255,255,.5));
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .25s;
  white-space: nowrap;
}
.rpt-tab:hover {
  color: var(--text-primary, #fff);
  background: rgba(255,255,255,.04);
}
.rpt-tab.active {
  background: var(--accent, #6366f1);
  color: #fff;
  box-shadow: 0 2px 8px rgba(99,102,241,.35);
}

/* ── panels ────────────────────────────────────────── */
.rpt-panels { position: relative; }
.rpt-panel {
  display: none;
  animation: rptFadeIn .3s ease;
}
.rpt-panel.active { display: block; }
@keyframes rptFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── generate grid ─────────────────────────────────── */
.rpt-gen-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.rpt-gen-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-surface, #1e1e2e);
  border: 1px solid var(--border, rgba(255,255,255,.08));
  border-radius: 14px;
  padding: 18px 16px;
  cursor: pointer;
  transition: all .25s;
  text-align: left;
  width: 100%;
  color: inherit;
  font: inherit;
  position: relative;
  overflow: hidden;
}
.rpt-gen-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px; height: 100%;
  background: var(--card-accent, #6366f1);
  border-radius: 14px 0 0 14px;
  opacity: 0;
  transition: opacity .25s;
}
.rpt-gen-card:hover {
  border-color: var(--card-accent, #6366f1);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(99,102,241,.15);
}
.rpt-gen-card:hover::before { opacity: 1; }

.rpt-gen-card__icon {
  font-size: 1.8rem;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(99,102,241,.1);
  border-radius: 12px;
  flex-shrink: 0;
}
.rpt-gen-card__body h4 {
  margin: 0 0 4px;
  font-size: .95rem;
  font-weight: 600;
  color: var(--text-primary, #fff);
}
.rpt-gen-card__body p {
  margin: 0;
  font-size: .78rem;
  color: var(--text-muted, rgba(255,255,255,.5));
  line-height: 1.4;
}
.rpt-gen-card__arrow {
  margin-left: auto;
  color: var(--text-muted, rgba(255,255,255,.3));
  transition: color .2s, transform .2s;
  flex-shrink: 0;
}
.rpt-gen-card:hover .rpt-gen-card__arrow {
  color: var(--card-accent, #6366f1);
  transform: translateX(3px);
}

/* ── history list ──────────────────────────────────── */
.rpt-hist-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rpt-hist-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-surface, #1e1e2e);
  border: 1px solid var(--border, rgba(255,255,255,.08));
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
  transition: all .2s;
}
.rpt-hist-item:hover {
  border-color: var(--accent, #6366f1);
  background: var(--bg-hover, rgba(255,255,255,.03));
}
.rpt-hist-item__icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 1.3rem;
  background: color-mix(in srgb, var(--hi-color, #6366f1) 15%, transparent);
  flex-shrink: 0;
}
.rpt-hist-item__info {
  flex: 1;
  min-width: 0;
}
.rpt-hist-item__title {
  display: block;
  font-weight: 600;
  font-size: .88rem;
  color: var(--text-primary, #fff);
}
.rpt-hist-item__date {
  display: block;
  font-size: .72rem;
  color: var(--text-muted, rgba(255,255,255,.45));
  margin-top: 2px;
}
.rpt-hist-item__actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

/* ── shared buttons ────────────────────────────────── */
.rpt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 8px;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 16px;
  transition: all .2s;
  color: #fff;
  background: var(--accent, #6366f1);
}
.rpt-btn:hover { filter: brightness(1.15); }
.rpt-btn--sm { padding: 6px 8px; font-size: .75rem; }
.rpt-btn--ghost {
  background: transparent;
  color: var(--text-muted, rgba(255,255,255,.5));
}
.rpt-btn--ghost:hover {
  background: rgba(255,255,255,.06);
  color: var(--text-primary, #fff);
}

/* ── empty state ───────────────────────────────────── */
.rpt-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted, rgba(255,255,255,.5));
}
.rpt-empty__icon {
  font-size: 2.8rem;
  display: block;
  margin-bottom: 12px;
  opacity: .6;
}
.rpt-empty p {
  margin: 0 0 6px;
  font-size: .95rem;
  color: var(--text-primary, #fff);
  font-weight: 600;
}
.rpt-empty__sub {
  font-size: .8rem !important;
  color: var(--text-muted, rgba(255,255,255,.45)) !important;
  font-weight: 400 !important;
}

/* ── trends ────────────────────────────────────────── */
.rpt-trends {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.rpt-trends__chart-card {
  background: var(--bg-surface, #1e1e2e);
  border: 1px solid var(--border, rgba(255,255,255,.08));
  border-radius: 14px;
  padding: 20px;
}
.rpt-trends__chart-card h4 {
  margin: 0 0 16px;
  font-size: .88rem;
  font-weight: 600;
  color: var(--text-primary, #fff);
}
.rpt-bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 140px;
  padding-bottom: 28px;
  position: relative;
}
.rpt-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  position: relative;
}
.rpt-bar {
  width: 100%;
  max-width: 28px;
  border-radius: 6px 6px 2px 2px;
  min-height: 4px;
  transition: height .4s ease;
  position: relative;
}
.rpt-bar:hover { filter: brightness(1.2); }
.rpt-bar::after {
  content: attr(title);
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  font-size: .65rem;
  color: var(--text-muted, rgba(255,255,255,.5));
  opacity: 0;
  transition: opacity .2s;
  white-space: nowrap;
}
.rpt-bar:hover::after { opacity: 1; }
.rpt-bar-lbl {
  position: absolute;
  bottom: -24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: .58rem;
  color: var(--text-muted, rgba(255,255,255,.4));
  white-space: nowrap;
}

.rpt-trends__stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}
.rpt-trend-stat {
  background: var(--bg-surface, #1e1e2e);
  border: 1px solid var(--border, rgba(255,255,255,.08));
  border-radius: 14px;
  padding: 18px 14px;
  text-align: center;
}
.rpt-trend-stat__val {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary, #fff);
}
.rpt-trend-stat__lbl {
  font-size: .7rem;
  color: var(--text-muted, rgba(255,255,255,.45));
  text-transform: uppercase;
  letter-spacing: .03em;
  margin-top: 4px;
  display: block;
}

/* ── comparison table ──────────────────────────────── */
.rpt-cmp { overflow-x: auto; }
.rpt-cmp-table-wrap { min-width: 480px; }
.rpt-cmp-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--bg-surface, #1e1e2e);
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border, rgba(255,255,255,.08));
}
.rpt-cmp-table th,
.rpt-cmp-table td {
  padding: 12px 16px;
  text-align: left;
  font-size: .82rem;
  border-bottom: 1px solid var(--border, rgba(255,255,255,.06));
}
.rpt-cmp-table thead th {
  background: rgba(255,255,255,.03);
  color: var(--text-muted, rgba(255,255,255,.5));
  font-weight: 600;
  text-transform: uppercase;
  font-size: .7rem;
  letter-spacing: .04em;
}
.rpt-cmp-table tbody td:first-child {
  font-weight: 600;
  color: var(--text-primary, #fff);
}
.rpt-cmp-table tbody td {
  color: var(--text-secondary, rgba(255,255,255,.7));
}
.rpt-cmp-table tbody tr:last-child td { border-bottom: none; }
.rpt-cmp-table tbody tr:hover td {
  background: rgba(255,255,255,.02);
}
.rpt-cmp-table__highlight td {
  background: rgba(99,102,241,.06) !important;
  font-weight: 600;
}

/* ── grades ────────────────────────────────────────── */
.rpt-grade {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  border-radius: 8px;
  padding: 2px 10px;
  font-size: .85rem;
}
.rpt-grade--a { background: rgba(34,197,94,.15); color: #22c55e; }
.rpt-grade--b { background: rgba(59,130,246,.15); color: #3b82f6; }
.rpt-grade--c { background: rgba(245,158,11,.15); color: #f59e0b; }
.rpt-grade--d { background: rgba(239,68,68,.15);  color: #ef4444; }

/* ── preview pane ──────────────────────────────────── */
.rpt-preview {
  background: var(--bg-surface, #1e1e2e);
  border: 1px solid var(--border, rgba(255,255,255,.08));
  border-radius: 16px;
  margin-top: 16px;
  overflow: hidden;
}
.rpt-preview__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(255,255,255,.03);
  border-bottom: 1px solid var(--border, rgba(255,255,255,.06));
}
.rpt-preview__bar h3 {
  margin: 0;
  font-size: .88rem;
  font-weight: 600;
  color: var(--text-primary, #fff);
}
.rpt-preview__actions {
  display: flex;
  gap: 6px;
  align-items: center;
}
.rpt-btn--primary {
  background: var(--accent, #6366f1);
  color: #fff;
}
.rpt-preview__body {
  padding: 24px;
  overflow-y: auto;
  max-height: 75vh;
}

/* ── report document styles ────────────────────────── */
.rpt-doc {
  color: var(--text-primary, #fff);
}
.rpt-doc__head {
  text-align: center;
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border, rgba(255,255,255,.08));
}
.rpt-doc__logo {
  font-size: .8rem;
  color: var(--text-muted, rgba(255,255,255,.45));
  margin-bottom: 8px;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.rpt-doc__head h1 {
  font-size: 1.5rem;
  margin: 0 0 6px;
  font-weight: 700;
}
.rpt-doc__sub {
  font-size: .9rem;
  color: var(--text-muted, rgba(255,255,255,.55));
  margin: 0 0 10px;
}
.rpt-doc__meta {
  display: flex;
  gap: 20px;
  justify-content: center;
  font-size: .78rem;
  color: var(--text-muted, rgba(255,255,255,.45));
}
.rpt-doc__grade-section {
  text-align: center;
  padding: 20px 0;
  margin-bottom: 16px;
}
.rpt-doc__grade {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.5rem;
  margin: 0 auto 10px;
  border: 3px solid;
}
.rpt-doc__grade.rpt-grade--a { border-color: #22c55e; color: #22c55e; }
.rpt-doc__grade.rpt-grade--b { border-color: #3b82f6; color: #3b82f6; }
.rpt-doc__grade.rpt-grade--c { border-color: #f59e0b; color: #f59e0b; }
.rpt-doc__grade.rpt-grade--d { border-color: #ef4444; color: #ef4444; }

.rpt-doc__score-bar {
  max-width: 260px;
  height: 8px;
  background: rgba(255,255,255,.08);
  border-radius: 4px;
  margin: 10px auto;
  overflow: hidden;
}
.rpt-doc__score-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  transition: width .5s ease;
}
.rpt-doc__score-lbl {
  font-size: .78rem;
  color: var(--text-muted, rgba(255,255,255,.5));
  margin: 0;
}

.rpt-doc__section {
  margin: 24px 0;
}
.rpt-doc__section h2 {
  font-size: .95rem;
  font-weight: 700;
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border, rgba(255,255,255,.06));
}
.rpt-doc__stat-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.rpt-doc__stat {
  flex: 1;
  min-width: 80px;
  background: rgba(255,255,255,.03);
  border-radius: 12px;
  padding: 14px 10px;
  text-align: center;
}
.rpt-doc__stat strong {
  display: block;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent, #6366f1);
}
.rpt-doc__stat span {
  font-size: .7rem;
  color: var(--text-muted, rgba(255,255,255,.45));
  text-transform: uppercase;
  letter-spacing: .03em;
}
.rpt-doc__kv {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,.04);
  font-size: .85rem;
}
.rpt-doc__kv span:first-child { color: var(--text-muted, rgba(255,255,255,.5)); }
.rpt-doc__kv span:last-child  { color: var(--text-primary, #fff); font-weight: 600; }

.rpt-doc__highlights {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rpt-doc__hl {
  background: rgba(99,102,241,.08);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: .85rem;
  color: var(--text-primary, #fff);
  border-left: 3px solid var(--accent, #6366f1);
}
.rpt-doc__footer {
  text-align: center;
  color: var(--text-muted, rgba(255,255,255,.3));
  font-size: .72rem;
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,.06);
}

/* ── scouting variant ──────────────────────────────── */
.rpt-doc--scout .rpt-doc__head {
  background: linear-gradient(135deg, rgba(245,158,11,.06), rgba(234,179,8,.03));
  border-radius: 12px;
  padding: 24px 20px;
  margin-bottom: 20px;
  border-bottom: none;
}
.rpt-doc__profile-row {
  display: flex;
  gap: 24px;
  align-items: center;
  padding: 20px;
  background: rgba(255,255,255,.02);
  border-radius: 14px;
  margin-bottom: 20px;
  border: 1px solid var(--border, rgba(255,255,255,.06));
}
.rpt-doc__profile-grade { text-align: center; flex-shrink: 0; }
.rpt-doc__score-big {
  display: block;
  margin-top: 8px;
  font-weight: 700;
  font-size: .9rem;
  color: var(--text-muted, rgba(255,255,255,.55));
}
.rpt-doc__profile-info { flex: 1; min-width: 0; }
.rpt-doc__notes {
  line-height: 1.8;
  font-size: .88rem;
  color: var(--text-secondary, rgba(255,255,255,.7));
  padding: 16px;
  background: rgba(255,255,255,.02);
  border-radius: 12px;
  border: 1px solid var(--border, rgba(255,255,255,.06));
}

/* ── responsive ────────────────────────────────────── */
@media (max-width: 600px) {
  .rpt-gen-grid { grid-template-columns: 1fr; }
  .rpt-tabs { flex-wrap: wrap; }
  .rpt-tab { min-width: 0; padding: 8px 6px; font-size: .75rem; }
  .rpt-bar-chart { height: 100px; }
  .rpt-bar-lbl { font-size: .5rem; }
  .rpt-doc__stat-row { gap: 8px; }
  .rpt-doc__stat { min-width: 60px; padding: 10px 6px; }
  .rpt-doc__stat strong { font-size: 1.1rem; }
  .rpt-doc__profile-row { flex-direction: column; text-align: center; }
  .rpt-cmp-table th, .rpt-cmp-table td { padding: 8px 10px; font-size: .75rem; }
  .rpt-preview__body { padding: 16px; }
  .rpt-qs__card { min-width: 80px; padding: 10px 8px; }
  .rpt-qs__val { font-size: 1.1rem; }
}
