:root {
  --olive: #6b8e23;
  --olive-dark: #556e1c;
  --cream: #f7f5e8;
  --cream-border: #e6e2c8;
  --text: #2a2a2a;
  --text-muted: #6b6b6b;
  --shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 18px;
  color: var(--text);
  background: #fff;
  line-height: 1.5;
}

h1, h2, h3 {
  font-family: "Roboto Slab", Georgia, serif;
  font-weight: 700;
  margin: 0;
}

.loading, .error {
  max-width: 600px;
  margin: 80px auto;
  padding: 32px;
  text-align: center;
  color: var(--text-muted);
}

.error h1 {
  color: var(--olive);
  margin-bottom: 12px;
}

/* ---------- Olive bands ---------- */

.olive-band {
  background: var(--olive);
}

.altos-band {
  padding: 8px 0;
}

/* ---------- Header ---------- */

.page-header {
  padding: 32px 48px 16px 48px;
}

.page-header h1 {
  color: #fff;
  font-size: 1.6rem;
  letter-spacing: 0.01em;
}

/* ---------- Hero card ---------- */

.hero-card {
  background: var(--cream);
  border: 1px solid var(--cream-border);
  border-radius: 8px;
  padding: 20px;
  margin: 0 48px;
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
  align-items: center;
  box-shadow: var(--shadow);
  transform: translateY(32px);
  margin-bottom: 32px;
}

.hero-photo {
  width: 200px;
  height: 140px;
  object-fit: cover;
  border-radius: 6px;
  background: #ddd;
}

.hero-photo-empty {
  width: 200px;
  height: 140px;
  background: #ddd;
  border-radius: 6px;
}

.hero-details {
  font-size: 0.95rem;
  line-height: 1.7;
}

/* ---------- Section titles ---------- */

.section-title {
  font-size: 1.4rem;
  color: var(--text);
  text-align: center;
  margin-bottom: 24px;
}

.section-title.left {
  text-align: left;
  margin-bottom: 16px;
}

/* ---------- Stats ---------- */

.stats-section {
  padding: 32px 48px;
}

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

.stat-box {
  background: var(--cream);
  border: 2px solid var(--olive);
  border-radius: 8px;
  padding: 24px 16px;
  text-align: center;
  box-shadow: var(--shadow);
}

.stat-number {
  font-family: "Roboto Slab", Georgia, serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ---------- Altos hyperlinks bar ---------- */

.altos-section {
  padding: 28px 48px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.altos-link {
  display: flex;
  flex-direction: column;
  background: var(--cream);
  border: 1px solid var(--cream-border);
  border-radius: 8px;
  padding: 16px 20px;
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: background 0.15s ease, transform 0.05s ease;
}

.altos-link:hover {
  background: #fff;
  transform: translateY(-1px);
}

.altos-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: var(--olive-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: 1rem;
}

.altos-icon {
  font-size: 0.9rem;
  font-weight: 400;
  display: inline-block;
}

.altos-url {
  margin-top: 4px;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

/* ---------- Showings section ---------- */

.showings-section {
  padding: 48px;
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 48px;
}

.showings-narrative h2 {
  text-align: left;
  margin-bottom: 8px;
}

.last-updated {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 0 0 16px 0;
}

.stale-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  background: #b85c00;
  color: #fff;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}

.ai-summary {
  font-size: 0.95rem;
}

.ai-summary p { margin: 0 0 12px 0; }
.ai-summary ul { margin: 0 0 12px 0; padding-left: 20px; }
.ai-summary li { margin-bottom: 4px; }
.ai-summary strong { color: var(--text); }

.ai-empty {
  color: var(--text-muted);
  font-style: italic;
}

/* ---------- Tables ---------- */

.report-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--cream-border);
  border-radius: 8px;
  overflow: hidden;
}

.report-table thead {
  background: var(--cream);
}

.report-table th {
  text-align: left;
  padding: 12px 16px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  border-bottom: 1px solid var(--cream-border);
}

.report-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #f0eee0;
  font-size: 0.92rem;
  vertical-align: top;
}

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

.col-status {
  width: 30%;
  min-width: 180px;
  white-space: nowrap;
  font-weight: 600;
  color: var(--text);
}

.col-notes {
  width: 70%;
}

.col-notes p { margin: 0 0 8px 0; }
.col-notes p:last-child { margin-bottom: 0; }
.col-notes ul { margin: 0; padding-left: 18px; }
.col-notes li { margin-bottom: 2px; }
.col-notes strong { color: var(--text); }

.empty-row {
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
}

/* ---------- Pagination ---------- */

.table-wrap {
  display: flex;
  flex-direction: column;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.pager-info {
  font-variant-numeric: tabular-nums;
}

.pager-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid var(--cream-border);
  background: var(--cream);
  color: var(--text);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease;
}

.pager-btn:hover:not(:disabled) {
  background: #fff;
}

.pager-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ---------- Open houses ---------- */

.open-houses-section {
  padding: 0 48px 48px 48px;
}

.open-houses-section h2 {
  text-align: left;
  margin-bottom: 16px;
}

/* ---------- Online views ---------- */

.online-views-section {
  padding: 0 48px 64px 48px;
}

.online-views-section h2 {
  text-align: left;
  margin-bottom: 4px;
}

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

.platform-card {
  background: var(--cream);
  border: 2px solid var(--olive);
  border-radius: 8px;
  padding: 20px 16px;
  text-align: center;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.platform-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--olive-dark);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.platform-number {
  font-family: "Roboto Slab", Georgia, serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* ---------- Responsive ---------- */

@media (max-width: 800px) {
  .page-header { padding: 24px; }
  .page-header h1 { font-size: 1.2rem; }
  .hero-card,
  .stats-section,
  .altos-section,
  .showings-section,
  .open-houses-section,
  .online-views-section {
    padding-left: 20px;
    padding-right: 20px;
    margin-left: 0;
    margin-right: 0;
  }
  .hero-card { grid-template-columns: 1fr; gap: 16px; }
  .hero-photo, .hero-photo-empty { width: 100%; }
  .stats-grid { grid-template-columns: 1fr; }
  .altos-section { grid-template-columns: 1fr; }
  .showings-section { grid-template-columns: 1fr; gap: 32px; padding: 32px 20px; }
  .platform-grid { grid-template-columns: repeat(2, 1fr); }
  .col-status { min-width: 140px; }
}
