/* Minimal placeholder stylesheet for the Bun/Elysia layouts (SPEC-004).
   The Tailwind CSS + daisyUI pipeline compiles this file properly in a later
   migration milestone; until then these hand-written rules keep the SSR
   layouts readable. Next.js does not load this file. */

* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  margin: 0;
  color: #1a1a1a;
  background: #f8fafc;
  line-height: 1.6;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem;
}

.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
}

.brand {
  font-weight: 700;
  text-decoration: none;
  color: #0f172a;
}

.nav-links {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.nav-links a,
.sidebar-links a {
  color: #2563eb;
  text-decoration: none;
}

.site-footer {
  padding: 1.5rem;
  color: #475569;
  font-size: 0.875rem;
}

.muted {
  color: #64748b;
  font-size: 0.875rem;
}

body.admin {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 220px;
  padding: 1.5rem;
  background: #0f172a;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.sidebar .brand {
  color: #fff;
}

.sidebar-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sidebar-links .muted {
  color: #94a3b8;
}

body.admin .container {
  flex: 1;
}

.login-card {
  max-width: 360px;
  margin: 3rem auto;
  padding: 1.5rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.login-card label {
  display: block;
  margin-bottom: 1rem;
}

.login-card input {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.5rem;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
}

.login-card button {
  padding: 0.5rem 1rem;
  background: #2563eb;
  color: #fff;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}

.alert {
  padding: 0.75rem 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.alert-error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.alert-success {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

/* ── Admin surface (SPEC-005) ─────────────────────────────────────────── */

.sidebar-links a.active {
  color: #fff;
  font-weight: 600;
}

.sidebar-links a.sidebar-logout {
  margin-top: auto;
  color: #94a3b8;
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.page-head h1 {
  margin: 0;
}

.page-head-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #fff;
  color: #0f172a;
  text-decoration: none;
  font-size: 0.875rem;
  cursor: pointer;
}

.btn-primary {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.btn-small {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.stat-label {
  color: #64748b;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #fff;
  color: #0f172a;
  text-decoration: none;
  font-size: 0.75rem;
}

.pill-count {
  font-weight: 700;
  color: #2563eb;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.75rem;
  padding: 0.75rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.filter-bar label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: #64748b;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.admin-table th,
.admin-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
  font-size: 0.875rem;
  vertical-align: top;
}

.admin-table thead th {
  background: #f1f5f9;
  color: #475569;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.admin-table tbody tr:hover {
  background: #f8fafc;
}

.admin-table a {
  color: #2563eb;
  text-decoration: none;
}

.actions-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.message-cell {
  max-width: 240px;
  overflow-wrap: anywhere;
}

.badge {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-gray {
  background: #f1f5f9;
  color: #475569;
}

.badge-gray-muted {
  background: #f8fafc;
  color: #94a3b8;
}

.badge-blue {
  background: #dbeafe;
  color: #1e40af;
}

.badge-amber {
  background: #fef3c7;
  color: #92400e;
}

.badge-orange {
  background: #ffedd5;
  color: #9a3412;
}

.badge-emerald {
  background: #d1fae5;
  color: #065f46;
}

.badge-red {
  background: #fee2e2;
  color: #991b1b;
}

.badge-purple {
  background: #f3e8ff;
  color: #6b21a8;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem 0;
}

.card {
  padding: 1.25rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

.card h2 {
  margin-top: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.875rem;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  padding: 0.5rem;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font: inherit;
}

.form-check {
  flex-direction: row !important;
  align-items: center;
  gap: 0.5rem !important;
}

.form-span {
  grid-column: 1 / -1;
}

.form-actions {
  margin-top: 1rem;
}

.inline-form {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.inline-form select {
  padding: 0.25rem;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 0.75rem;
}

.service-areas {
  margin: 1.25rem 0 0;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.75rem;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #f8fafc;
  font-size: 0.8125rem;
}

.photo-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.photo-thumb {
  width: 96px;
  margin: 0;
}

.photo-thumb img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  display: block;
}

.photo-thumb figcaption {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: #64748b;
  word-break: break-word;
}

.export-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.export-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Field-record review queue renders as stacked cards, not a table — the
   reviewer needs the notes and coordinates before approving evidence. */
.record-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.record-card {
  padding: 1rem 1.25rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.record-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.record-card-head h2 {
  margin: 0;
  font-size: 1rem;
}

.record-badges {
  display: flex;
  gap: 0.375rem;
}

.record-meta {
  margin: 0.25rem 0 0;
  font-size: 0.8125rem;
  color: #64748b;
}

.record-notes {
  margin: 0.5rem 0 0;
  font-size: 0.875rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.record-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
  margin-top: 0.75rem;
}

/* ── Public surface (SPEC-006) ────────────────────────────────────────── */

.capitalize {
  text-transform: capitalize;
}

.alert-warning {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.button {
  display: inline-block;
  padding: 0.5rem 1rem;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #fff;
  color: #0f172a;
  text-decoration: none;
  font: inherit;
  font-size: 0.875rem;
  cursor: pointer;
}

.button-primary {
  background: #059669;
  border-color: #059669;
  color: #fff;
}

.button-ghost {
  background: #fff;
  color: #0f172a;
}

/* Home (new — the Next home redirected to /admin) */
.hero {
  padding: 2.5rem 1.5rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

.hero h1 {
  margin: 0 0 0.5rem;
  font-size: 2rem;
}

.hero-lede {
  max-width: 42rem;
  color: #334155;
  margin-top: 0;
}

.hero-search {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.hero-search label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.875rem;
}

.hero-search select,
.search-filters select,
.search-filters input {
  padding: 0.5rem;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font: inherit;
  min-width: 10rem;
}

.trust-signals {
  margin-bottom: 1.5rem;
}

.trust-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.trust-card {
  padding: 1rem 1.25rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.trust-card h3 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}

.trust-card p {
  margin: 0;
  font-size: 0.875rem;
  color: #475569;
}

.neighborhood-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
}

.neighborhood-card {
  display: flex;
  flex-direction: column;
  padding: 0.75rem 1rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  text-decoration: none;
  color: #0f172a;
}

.neighborhood-card:hover {
  border-color: #059669;
}

.neighborhood-name {
  font-weight: 600;
}

/* Search */
.search-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.75rem;
  padding: 0.75rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.search-filters label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: #64748b;
}

.results-count {
  margin: 0.5rem 0;
}

.view-toggle {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.listing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.listing-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
}

.listing-card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: #0f172a;
}

.listing-card:hover {
  border-color: #94a3b8;
}

.listing-card-photo {
  aspect-ratio: 4 / 3;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
}

.listing-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.listing-card-no-photo {
  color: #94a3b8;
  font-size: 0.8125rem;
}

.listing-card-body {
  padding: 0.75rem 1rem;
}

.listing-card-title {
  margin: 0;
  font-size: 0.9375rem;
}

.listing-card-price {
  margin: 0.25rem 0 0;
  font-weight: 700;
  color: #059669;
}

.listing-card-meta,
.listing-card-agent {
  margin: 0.25rem 0 0;
}

.empty-state {
  padding: 2rem;
  border: 2px dashed #e2e8f0;
  border-radius: 8px;
  text-align: center;
}

/* Map island (criterion 1): hydration target + coordinate fallback */
.map-island {
  padding: 1rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  min-height: 240px;
}

.map-island-note {
  margin-top: 0;
}

.mapbox-canvas {
  width: 100%;
  height: 380px;
  border-radius: 6px;
}

.map-pin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.map-pin-fallback {
  display: flex;
  flex-direction: column;
  padding: 0.625rem 0.75rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  text-decoration: none;
  color: #0f172a;
}

.map-pin-fallback:hover {
  border-color: #059669;
}

.map-pin-title {
  font-weight: 600;
  font-size: 0.875rem;
}

.map-pin-price {
  font-size: 0.8125rem;
  color: #059669;
  font-weight: 600;
}

.map-pin-coords {
  font-size: 0.75rem;
  color: #64748b;
}

/* Listing detail (criterion 5) */
.gallery-main img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  background: #f1f5f9;
}

.gallery-strip {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
  overflow-x: auto;
}

.gallery-strip img {
  width: 96px;
  height: 72px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  display: block;
}

.gallery-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 9;
  background: #f1f5f9;
  border-radius: 8px;
}

.listing-columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 1.25rem;
}

@media (min-width: 720px) {
  .listing-columns {
    grid-template-columns: 2fr 1fr;
  }
}

.listing-price {
  font-size: 1.75rem;
  font-weight: 700;
  color: #059669;
  margin: 0.25rem 0 0.75rem;
}

.listing-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.disclaimer {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  border: 1px solid #fde68a;
  background: #fffbeb;
  border-radius: 8px;
  color: #92400e;
  font-size: 0.875rem;
}

.disclaimer-title {
  font-weight: 600;
  margin: 0 0 0.25rem;
}

.disclaimer p {
  margin: 0;
}

.listing-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.agent-card,
.doc-card {
  padding: 1rem 1.25rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.agent-card-heading {
  margin: 0 0 0.25rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.agent-card-name {
  display: inline-block;
  color: #059669;
  text-decoration: none;
  font-weight: 600;
}

.agent-card-contact {
  margin-top: 0.5rem;
  font-size: 0.875rem;
}

.agent-card-contact p,
.agent-card .muted {
  margin: 0.125rem 0;
}

.agent-card .button {
  margin-top: 0.75rem;
}

.doc-card p {
  margin: 0.25rem 0 0;
}

/* Inquiry form (criterion 8) */
.inquiry {
  margin-top: 2rem;
  padding: 1.25rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  max-width: 560px;
}

.inquiry h2 {
  margin-top: 0;
}

.inquiry-form {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.inquiry-form label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.875rem;
}

.inquiry-form input,
.inquiry-form textarea {
  padding: 0.5rem;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font: inherit;
}

.inquiry-consent {
  flex-direction: row !important;
  align-items: center;
  gap: 0.5rem !important;
}

/* Honeypot: present in markup, invisible and unreachable for humans. */
.hp-wrap {
  position: absolute;
  left: -9999px;
  top: -9999px;
  height: 1px;
  width: 1px;
  overflow: hidden;
}

.inquiry-form .button {
  align-self: flex-start;
}

.inquiry-form .muted {
  margin: 0;
}

/* Agent profile (criterion 6) */
.agent-profile {
  padding: 1.25rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.agent-profile-header {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.agent-profile-header h1 {
  margin: 0;
  font-size: 1.5rem;
}

.agent-profile-header p {
  margin: 0.125rem 0;
}

.agent-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 999px;
  background: #d1fae5;
  color: #065f46;
  font-size: 1.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.agent-service-areas {
  margin-top: 1rem;
}

.agent-description {
  margin-top: 1rem;
  color: #334155;
}

.agent-contact {
  margin-top: 1rem;
  font-size: 0.875rem;
}

.agent-contact p {
  margin: 0.125rem 0;
}

.agent-listings {
  margin-top: 1.5rem;
}

/* Neighborhood (criterion 7) */
.market-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1.25rem 0 1.5rem;
}

.market-stat {
  padding: 1rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  text-align: center;
}

.market-stat-value {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
}

.market-stat .muted {
  margin: 0.125rem 0 0;
}

.not-found {
  padding: 3rem 1rem;
  text-align: center;
}

.not-found .button {
  margin-top: 1rem;
}

/* ── Pro surface (SPEC-007) ─────────────────────────────────────────────── */
/* The pro pages reuse the admin layout machinery (body.admin.pro); only the
   Pro-specific pieces live here. */

.stat-hint {
  margin: 0.25rem 0 0;
  font-size: 0.75rem;
  color: #64748b;
}

.sidebar-muted {
  color: #94a3b8;
}

.pro-note {
  margin: 0.75rem 0 0;
  font-size: 0.875rem;
  color: #64748b;
}

.pro-muted {
  margin: 0.25rem 0 0;
  font-size: 0.8125rem;
  color: #64748b;
}

.pro-inquiries {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.pro-inquiries .stat-card {
  gap: 0.25rem;
}

.pro-form {
  max-width: 720px;
}

.pro-form form > label:not(.checkbox-label) {
  display: block;
  margin-top: 0.75rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.checkbox-label input[type='checkbox'] {
  width: auto;
}
