/* Styles for the dating-buildings report/stats page */

* { box-sizing: border-box; margin: 0; padding: 0; }
.hidden { display: none !important; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  background: #0f172a;
  color: #e2e8f0;
  min-height: 100vh;
}

/* ── Header ──────────────────────────────────────────────────────────────────── */

.rpt-header {
  background: #16213e;
  border-bottom: 1px solid #1e3a5f;
  position: sticky;
  top: 0;
  z-index: 100;
}

.rpt-header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.rpt-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rpt-logo { font-size: 28px; line-height: 1; }

.rpt-title {
  font-size: 18px;
  font-weight: 700;
  color: #f1f5f9;
}

.rpt-subtitle {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}

.rpt-nav { display: flex; gap: 12px; }

.rpt-nav-link {
  color: #94a3b8;
  text-decoration: none;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}
.rpt-nav-link:hover { background: #1e293b; color: #e2e8f0; }

/* ── Main layout ─────────────────────────────────────────────────────────────── */

.rpt-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}

.rpt-loading {
  text-align: center;
  color: #475569;
  padding: 80px 0;
  font-size: 16px;
}

/* ── Overview cards ──────────────────────────────────────────────────────────── */

.rpt-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.rpt-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 20px 16px;
  text-align: center;
}

.rpt-card-value {
  font-size: 32px;
  font-weight: 800;
  color: #f1f5f9;
  line-height: 1;
  margin-bottom: 6px;
}

.rpt-card-label {
  font-size: 11px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── Sections ────────────────────────────────────────────────────────────────── */

.rpt-section {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 24px;
  margin-top: 24px;
}

.rpt-section-narrow { max-width: 480px; }

.rpt-section-title {
  font-size: 15px;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 6px;
}

.rpt-section-note {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 20px;
  line-height: 1.5;
}

.rpt-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 24px;
}

.rpt-two-col .rpt-section { margin-top: 0; }

/* ── Bar chart ───────────────────────────────────────────────────────────────── */

.rpt-chart { display: flex; flex-direction: column; gap: 6px; }

.bar-row {
  display: grid;
  grid-template-columns: 110px 1fr 48px;
  align-items: center;
  gap: 10px;
}

.bar-row.bar-row-sm {
  grid-template-columns: 70px 1fr 40px;
}

.bar-label {
  font-size: 12px;
  color: #94a3b8;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-track {
  height: 20px;
  background: #0f172a;
  border-radius: 3px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
  min-width: 2px;
}

.bar-count {
  font-size: 11px;
  color: #64748b;
  text-align: right;
  white-space: nowrap;
}

/* ── Depth section extras ────────────────────────────────────────────────────── */

.rpt-depth-summary {
  display: flex;
  gap: 24px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.depth-stat {
  text-align: center;
}

.depth-stat-val {
  font-size: 22px;
  font-weight: 700;
  color: #f1f5f9;
}

.depth-stat-label {
  font-size: 11px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

.rpt-threshold-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.threshold-chip {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid currentColor;
}

/* ── Responsive ──────────────────────────────────────────────────────────────── */

@media (max-width: 640px) {
  .rpt-cards { grid-template-columns: repeat(2, 1fr); }
  .rpt-two-col { grid-template-columns: 1fr; }
  .rpt-section-narrow { max-width: none; }
  .rpt-header-inner { flex-direction: column; align-items: flex-start; gap: 8px; }
}
