/* ============================================================
   AUTEGRA — VIN History Report Styles
   Report header, freshness, spec grid, sections, timelines,
   tables, odometer chart, inspection grid
   ============================================================ */

/* --- REPORT CONTAINER --- */
.report-container {
  max-width: var(--container-narrow);
  margin: 0 auto;
  padding: calc(var(--nav-height) + 32px) var(--gutter) 80px;
}

/* --- BACK LINK --- */
.report-back {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--slate);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 28px;
  transition: color var(--transition-fast);
  animation: fadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}
.report-back:hover { color: var(--snow); }
.report-back i { font-size: 16px; }

/* --- REPORT HEADER --- */
.report-header {
  margin-bottom: 40px;
  animation: fadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both;
}

.report-meta-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.report-vehicle-info { flex: 1; min-width: 0; }

.report-vin {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 2.5px;
  color: var(--teal);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.report-vin-label {
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--slate);
}

.report-vehicle-name {
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--snow);
  margin-bottom: 6px;
  line-height: 1.15;
}

.report-vehicle-sub {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--slate);
  line-height: 1.5;
}

.report-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  align-items: flex-start;
  padding-top: 4px;
}

/* --- FRESHNESS BAR --- */
.freshness-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  background: var(--carbon);
  border: var(--border);
  border-radius: var(--radius);
  margin-bottom: 28px;
  flex-wrap: wrap;
  animation: fadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

.freshness-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
}

.freshness-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--verified);
  flex-shrink: 0;
  animation: pulseGlow 2.5s ease-in-out infinite;
}
.freshness-dot.stale {
  background: var(--warning);
  animation: none;
}

.freshness-status {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--snow);
  letter-spacing: 0.5px;
}

.freshness-date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--slate);
}

.freshness-refresh {
  margin-left: auto;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  color: var(--teal);
  transition: color var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 6px;
}
.freshness-refresh:hover { color: var(--teal-hover); }

/* --- SPEC GRID --- */
.spec-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  margin-bottom: 32px;
  animation: fadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.25s both;
}

.spec-item {
  background: var(--carbon);
  border: var(--border);
  padding: 20px;
  border-radius: var(--radius);
  transition: background var(--transition-fast);
}

.spec-item:hover {
  background: var(--carbon-hover);
}

.spec-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--slate);
  margin-bottom: 6px;
  display: block;
}

.spec-value {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 600;
  color: var(--snow);
}

/* --- REPORT SECTIONS --- */
.report-section {
  margin-bottom: 4px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--carbon);
  border: var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  cursor: pointer;
  transition: background var(--transition-fast);
  user-select: none;
}

.section-header:hover {
  background: var(--carbon-hover);
}

.section-header.collapsed {
  border-radius: var(--radius);
}

.section-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  flex-shrink: 0;
  font-size: 18px;
}

.section-icon.icon-teal {
  background: var(--teal-dim);
  color: var(--teal);
}

.section-icon.icon-danger {
  background: var(--danger-dim);
  color: var(--danger);
}

.section-icon.icon-warning {
  background: var(--warning-dim);
  color: var(--warning);
}

.section-icon.icon-info {
  background: var(--info-dim);
  color: var(--info);
}

.section-name {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 600;
  color: var(--snow);
}

.section-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-chevron {
  color: var(--slate);
  font-size: 18px;
  transition: transform var(--transition-med);
  display: flex;
  align-items: center;
}

.section-header.collapsed .section-chevron {
  transform: rotate(-90deg);
}

.source-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--slate);
  letter-spacing: 0.5px;
}

/* Section Body */
.section-body {
  padding: 24px 20px;
  background: var(--carbon);
  border: var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.3s ease,
              padding 0.3s ease;
}

.section-body.hidden {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
  border: none;
}

/* --- TIMELINE --- */
.timeline {
  list-style: none;
}

.timeline-item {
  display: flex;
  gap: 16px;
  padding-bottom: 24px;
  position: relative;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-item::before {
  content: '';
  position: absolute;
  left: 17px;
  top: 36px;
  bottom: 0;
  width: 1px;
  background: var(--pewter);
}

.timeline-item:last-child::before { display: none; }

.timeline-dot {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--pewter);
  background: var(--graphite);
}

.timeline-dot.dot-clean { border-color: var(--verified); }
.timeline-dot.dot-alert { border-color: var(--danger); background: var(--danger-dim); }
.timeline-dot.dot-info { border-color: var(--info); }

.timeline-dot-inner {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.timeline-dot.dot-clean .timeline-dot-inner { background: var(--verified); }
.timeline-dot.dot-alert .timeline-dot-inner { background: var(--danger); }
.timeline-dot.dot-info .timeline-dot-inner { background: var(--info); }

.timeline-content { flex: 1; min-width: 0; }

.timeline-date {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--slate);
  margin-bottom: 4px;
  display: block;
  letter-spacing: 0.5px;
}

.timeline-title {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 600;
  color: var(--snow);
  margin-bottom: 4px;
}

.timeline-desc {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--slate);
  line-height: 1.65;
}

.timeline-severity {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: var(--radius);
  margin-top: 8px;
}

.severity-minor { color: var(--warning); border: 1px solid var(--warning); }
.severity-moderate { color: #E67E22; border: 1px solid #E67E22; }

/* --- DATA TABLE --- */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--slate);
  text-align: left;
  padding: 10px 16px;
  border-bottom: var(--border);
}

.data-table td {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--snow);
  padding: 12px 16px;
  border-bottom: var(--border-half);
  transition: background var(--transition-fast);
}

.data-table tr:hover td {
  background: rgba(12, 107, 92, 0.03);
}

.data-table td.mono {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.5px;
}

.data-table tr:last-child td { border-bottom: none; }

.td-status-active { color: var(--verified); }
.td-status-transferred { color: var(--slate); }
.td-status-open { color: var(--warning); }

/* --- ODOMETER CHART --- */
.odo-chart-container {
  padding: 0 0 8px;
}

.odo-chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 140px;
  padding: 0 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--pewter-half);
}

.odo-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
  justify-content: flex-end;
}

.odo-bar-value {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--snow);
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.odo-bar {
  width: 100%;
  max-width: 48px;
  min-height: 3px;
  background: linear-gradient(to top, var(--teal), var(--teal-hover));
  border-radius: 1px 1px 0 0;
  transition: height 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.odo-bar-date {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--slate);
  padding-top: 8px;
  text-align: center;
  white-space: nowrap;
}

.odo-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 8px 0;
}

.odo-summary-item {
  text-align: center;
}

.odo-summary-value {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 600;
  color: var(--snow);
  display: block;
}

.odo-summary-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--slate);
  letter-spacing: 1px;
  text-transform: uppercase;
  display: block;
  margin-top: 2px;
}

/* --- INSPECTION GRID --- */
.inspection-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.inspection-by-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--slate);
}

.inspection-by-name {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--snow);
}

.inspection-by-date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--slate);
}

.inspection-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
}

.inspection-item {
  background: var(--graphite);
  border: var(--border-half);
  padding: 16px;
  border-radius: var(--radius);
  transition: background var(--transition-fast);
}

.inspection-item:hover {
  background: rgba(17, 21, 24, 0.8);
}

.inspection-item-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--slate);
  margin-bottom: 8px;
  display: block;
}

.inspection-item-score {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.5px;
}

.inspection-item-score .score-of {
  font-size: 14px;
  color: var(--slate);
  font-weight: 400;
}

.score-good { color: var(--verified); }
.score-fair { color: var(--warning); }
.score-poor { color: var(--danger); }

.inspection-notes {
  margin-top: 16px;
  padding: 16px;
  background: var(--graphite);
  border: var(--border-half);
  border-radius: var(--radius);
}

.inspection-notes-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--slate);
  display: block;
  margin-bottom: 8px;
}

.inspection-notes-text {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--snow);
  line-height: 1.65;
}

/* --- SECTION SOURCE FOOTER --- */
.section-source {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 16px;
  margin-top: 16px;
  border-top: var(--border-half);
}

.source-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.source-dot.src-third-party { background: var(--info); }
.source-dot.src-platform { background: var(--teal); }
.source-dot.src-owner { background: var(--slate); }

.source-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--slate);
  letter-spacing: 0.5px;
}

.source-date {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--slate);
  margin-left: auto;
}

/* --- REPORT FOOTER --- */
.report-footer {
  margin-top: 48px;
  padding-top: 32px;
  border-top: var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  animation: fadeIn 0.5s ease 0.6s both;
}

.report-id {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--slate);
  letter-spacing: 0.5px;
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
  .report-container {
    padding: calc(var(--nav-height) + 20px) var(--gutter) 60px;
  }

  .report-meta-row { flex-direction: column; }
  .report-vehicle-name { font-size: 24px; }
  .report-actions { width: 100%; }
  .spec-grid { grid-template-columns: repeat(2, 1fr); }
  .inspection-grid { grid-template-columns: 1fr; }
  .report-footer { flex-direction: column; gap: 16px; }

  .section-header {
    flex-wrap: wrap;
    gap: 8px;
  }

  .section-header-right {
    width: 100%;
    padding-left: 48px;
  }

  .odo-chart {
    height: 100px;
  }

  .odo-bar-value {
    font-size: 9px;
  }

  .freshness-bar {
    gap: 8px;
  }

  .freshness-refresh {
    margin-left: 0;
    width: 100%;
    justify-content: flex-start;
    padding-top: 8px;
    border-top: var(--border-half);
  }
}

@media (max-width: 480px) {
  .spec-grid { grid-template-columns: 1fr 1fr; }
  .odo-chart { gap: 4px; }
}
