/* ============================================================
   Reports section (car detail screen)
   ── Платформенный отчёт (источник аукциона) — бесплатно
   ── Velocity Inspection — наш собственный отчёт, платный
   ── История по VIN — мгновенный отчёт по госреестрам
   ============================================================ */

.reports-section { padding: 24px 24px 22px; }

/* Head: title + summary score ───────────────────────────────── */
.reports-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 0.5px solid var(--stroke-1);
}
.reports-summary { flex-shrink: 0; }
.rep-summary-score {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 14px 8px 8px;
  background: var(--glass-1);
  border: 0.5px solid var(--stroke-1);
  border-radius: var(--r-pill);
}

/* List of report cards ──────────────────────────────────────── */
.reports-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rep-card {
  border: 0.5px solid var(--stroke-2);
  border-radius: var(--r-lg);
  background: var(--glass-1);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.rep-card:hover { border-color: var(--stroke-3); }
.rep-card.is-open {
  border-color: var(--stroke-3);
  box-shadow: 0 8px 24px -12px rgba(0, 0, 0, 0.18);
}

/* Card head — clickable accordion trigger */
.rep-head {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 18px;
  background: transparent;
  border: 0;
  cursor: pointer;
  text-align: left;
  color: var(--fg);
}
.rep-head:hover { background: var(--glass-2); }

.rep-flag {
  width: 44px; height: 44px;
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  background: var(--glass-2);
  border: 0.5px solid var(--stroke-1);
  flex-shrink: 0;
}
.rep-flag-brand {
  background: linear-gradient(180deg, var(--brand-400), var(--brand-600));
  border-color: var(--brand-600);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.25), 0 4px 12px -6px var(--brand-500);
}
.rep-flag-vin {
  background: rgba(168, 132, 60, 0.16);
  border-color: rgba(168, 132, 60, 0.30);
  color: #c89a3c;
}
[data-theme="light"] .rep-flag-vin { color: #8b6a2a; }

.rep-head-info { flex: 1; min-width: 0; }
.rep-kind {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 4px;
}
.rep-tag {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: var(--r-pill);
  border: 0.5px solid var(--stroke-2);
}
.rep-tag-included {
  background: rgba(76, 145, 110, 0.14);
  border-color: rgba(76, 145, 110, 0.30);
  color: #4c916e;
}
[data-theme="light"] .rep-tag-included { color: #2f6b4d; }
.rep-tag-ours {
  background: linear-gradient(180deg, var(--brand-500), var(--brand-600));
  border-color: var(--brand-600);
  color: #fff;
}
.rep-tag-vin {
  background: rgba(168, 132, 60, 0.14);
  border-color: rgba(168, 132, 60, 0.30);
  color: #c89a3c;
}
[data-theme="light"] .rep-tag-vin { color: #8b6a2a; }

.rep-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-top: 2px;
}

.rep-head-meta {
  text-align: right;
  flex-shrink: 0;
  padding-left: 12px;
  border-left: 0.5px solid var(--stroke-1);
  min-width: 86px;
}
.rep-grade {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.rep-grade-num { color: var(--brand-500); }
.rep-grade-suffix { font-size: 11px; color: var(--fg-faint); font-weight: 500; }
.rep-price {
  font-size: 15px;
  font-weight: 600;
  color: var(--fg);
}

/* Body — expanded content ───────────────────────────────────── */
.rep-body {
  padding: 4px 18px 18px;
  border-top: 0.5px solid var(--stroke-1);
}
.rep-body > * + * { margin-top: 14px; }
.rep-divider {
  height: 0.5px;
  background: var(--stroke-1);
  margin: 14px 0;
}

/* Platform report — stat grid ───────────────────────────────── */
.rep-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 12px;
}
.rep-stat {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: var(--glass-2);
  border: 0.5px solid var(--stroke-1);
  border-radius: var(--r-md);
}
.rep-stat-ic {
  width: 28px; height: 28px;
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* Tone helpers ─────────────────────────────────────────────── */
.rep-tone-good { color: #4c916e; }
.rep-tone-good .rep-stat-ic,
.rep-tone-good .rep-vin-val { color: #4c916e; background: rgba(76, 145, 110, 0.14); }
[data-theme="light"] .rep-tone-good { color: #2f6b4d; }
[data-theme="light"] .rep-tone-good .rep-stat-ic,
[data-theme="light"] .rep-tone-good .rep-vin-val { color: #2f6b4d; background: rgba(76, 145, 110, 0.10); }

.rep-tone-warn { color: #c89a3c; }
.rep-tone-warn .rep-stat-ic,
.rep-tone-warn .rep-vin-val,
.rep-tone-warn .rep-flag-marker { color: #c89a3c; background: rgba(168, 132, 60, 0.18); }
[data-theme="light"] .rep-tone-warn { color: #8b6a2a; }

.rep-tone-bad { color: #cc4f4f; }
.rep-tone-bad .rep-stat-ic,
.rep-tone-bad .rep-flag-marker { color: #cc4f4f; background: rgba(204, 79, 79, 0.18); }

.rep-tone-neutral { color: var(--fg); }
.rep-tone-neutral .rep-stat-ic,
.rep-tone-neutral .rep-vin-val { color: var(--fg-muted); background: var(--glass-3); }

/* Stat info text uses default fg again, only icon coloured */
.rep-stat .flex-1 { color: var(--fg); }

/* Damage map ───────────────────────────────────────────────── */
.rep-damage-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 18px;
  align-items: flex-start;
}
.rep-diagram {
  background: var(--glass-2);
  border: 0.5px solid var(--stroke-1);
  border-radius: var(--r-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rep-diagram svg { width: 100%; max-height: 220px; }
.rep-flags { display: flex; flex-direction: column; gap: 8px; }
.rep-flag-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px;
  background: var(--glass-2);
  border: 0.5px solid var(--stroke-1);
  border-radius: var(--r-md);
  color: var(--fg);
}
.rep-flag-marker {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

/* Our report — categories ──────────────────────────────────── */
.rep-categories {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 12px;
}
.rep-cat {
  padding: 12px 14px;
  background: var(--glass-2);
  border: 0.5px solid var(--stroke-1);
  border-radius: var(--r-md);
}
.rep-cat-head {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px;
}
.rep-cat-score {
  font-size: 14px;
  font-weight: 700;
  color: var(--brand-500);
}
.rep-cat-bar {
  height: 4px;
  background: var(--stroke-1);
  border-radius: 999px;
  overflow: hidden;
}
.rep-cat-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-400), var(--brand-500));
  border-radius: 999px;
  transition: width 0.4s ease;
}

/* Our report — findings list ───────────────────────────────── */
.rep-findings { display: flex; flex-direction: column; gap: 6px; }
.rep-finding {
  display: flex;
  gap: 12px;
  padding: 10px 12px;
  background: var(--glass-2);
  border: 0.5px solid var(--stroke-1);
  border-radius: var(--r-md);
  color: var(--fg);
  position: relative;
}
.rep-finding-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 6px;
}
.rep-finding.rep-tone-good .rep-finding-dot { background: #4c916e; box-shadow: 0 0 0 3px rgba(76,145,110,0.18); }
.rep-finding.rep-tone-warn .rep-finding-dot { background: #c89a3c; box-shadow: 0 0 0 3px rgba(168,132,60,0.20); }
.rep-finding.rep-tone-bad  .rep-finding-dot { background: #cc4f4f; box-shadow: 0 0 0 3px rgba(204,79,79,0.20); }

/* Inspector strip ──────────────────────────────────────────── */
.rep-inspector {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--glass-2);
  border: 0.5px solid var(--stroke-1);
  border-radius: var(--r-md);
}
.rep-inspector-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--brand-400), var(--brand-600));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}
.rep-inspector-stamp {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #4c916e;
  background: rgba(76, 145, 110, 0.14);
  border: 0.5px solid rgba(76, 145, 110, 0.28);
  border-radius: var(--r-pill);
  flex-shrink: 0;
}
[data-theme="light"] .rep-inspector-stamp { color: #2f6b4d; }

/* VIN report — metric grid ─────────────────────────────────── */
.rep-vin-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 12px;
}
.rep-vin-stat {
  padding: 14px 16px;
  background: var(--glass-2);
  border: 0.5px solid var(--stroke-1);
  border-radius: var(--r-md);
  text-align: center;
}
.rep-vin-val {
  display: inline-block;
  min-width: 40px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  padding: 4px 0;
}

/* Card foot — meta + actions ──────────────────────────────── */
.rep-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 0.5px solid var(--stroke-1);
}

/* Bottom CTA — guarantee strip ────────────────────────────── */
.reports-cta {
  display: flex; align-items: center; gap: 14px;
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: var(--r-lg);
}
.rep-cta-ic {
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  background: rgba(76, 145, 110, 0.16);
  color: #4c916e;
  flex-shrink: 0;
}
[data-theme="light"] .rep-cta-ic { color: #2f6b4d; }

/* Responsive collapse ─────────────────────────────────────── */
/* ── Мобильная адаптация (≤768px) ────────────────────────── */
@media (max-width: 768px) {
  .reports-section { padding: 16px 14px; }

  .reports-head {
    flex-direction: column;
    gap: 12px;
    margin-bottom: 14px;
    padding-bottom: 12px;
  }
  .reports-head h3 { font-size: 17px !important; }
  .rep-summary-score { padding: 6px 12px 6px 6px; }
  .rep-score-circle { width: 38px !important; height: 38px !important; }
  .rep-score-num { font-size: 14px !important; }

  /* Card header — стекируем элементы по строкам */
  .rep-head {
    flex-wrap: wrap;
    gap: 10px 12px;
    padding: 12px 14px;
    align-items: center;
    position: relative;
  }
  .rep-flag { width: 38px; height: 38px; font-size: 18px; }
  .rep-head-info {
    flex: 1 1 calc(100% - 60px);
    min-width: 0;
    order: 1;
  }
  .rep-kind { gap: 6px; flex-wrap: wrap; }
  .rep-tag { font-size: 9px; padding: 2px 6px; }
  .rep-title { font-size: 14px; line-height: 1.25; }
  .rep-head-info .t-mute { font-size: 11px !important; line-height: 1.35; }
  /* Meta-блок (grade) — на отдельную строку под info, без вертикального бордера */
  .rep-head-meta {
    order: 3;
    flex: 0 0 100%;
    text-align: left;
    padding-left: 0;
    border-left: 0;
    border-top: 0.5px solid var(--stroke-1);
    padding-top: 10px;
    margin-top: 2px;
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
  }
  .rep-head-meta .rep-grade { font-size: 14px; }
  .rep-head-meta .t-faint { margin-top: 0 !important; font-size: 11px !important; }
  /* Chevron — абсолютно справа сверху, не занимает место в grid */
  .rep-head > svg:last-child {
    position: absolute;
    top: 14px; right: 14px;
  }

  /* Body */
  .rep-body { padding: 4px 14px 14px; }
  .rep-grid-2 { grid-template-columns: 1fr; gap: 8px; }
  .rep-stat { padding: 8px 10px; }
  .rep-stat-ic { width: 24px; height: 24px; }
  .rep-stat .flex-1 > div:nth-child(2) { font-size: 12px !important; }

  /* Damage diagram + flags — стек */
  .rep-damage-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .rep-diagram { padding: 10px; }
  .rep-diagram svg { max-height: 180px; }
  .rep-flag-row { padding: 8px 10px; font-size: 12px; }

  /* Categories grid */
  .rep-categories { grid-template-columns: 1fr; gap: 8px; margin-top: 10px; }
  .rep-cat { padding: 10px 12px; }

  /* Findings/inspector */
  .rep-finding { padding: 10px 12px; font-size: 12px; }
  .rep-inspector {
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    align-items: flex-start;
  }
  .rep-stamp { align-self: flex-start; }

  /* VIN grid */
  .rep-vin-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 10px; }
  .rep-vin-stat { padding: 10px; font-size: 12px; }
  .rep-vin-val { width: 24px; height: 24px; font-size: 11px; }
}

@media (max-width: 380px) {
  .rep-vin-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .reports-head { flex-direction: column; gap: 14px; }
  .rep-grid-2,
  .rep-categories { grid-template-columns: 1fr; }
  .rep-vin-grid { grid-template-columns: repeat(2, 1fr); }
  .rep-damage-row { grid-template-columns: 1fr; }
  .rep-diagram svg { max-height: 180px; }
  .rep-head-meta { padding-left: 8px; min-width: 70px; }
}
