/* PCD Analytics — Compact Data Dashboard Styles */

*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;
  font-size: 13px;
  color: #374151;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

/* ── Nav links ── */
.nav-link {
  color: rgba(255,255,255,0.6);
  font-size: 12.5px;
  font-weight: 500;
  padding: 4px 9px;
  border-radius: 5px;
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.nav-link:hover,
.nav-link.active {
  color: #fff;
  background: rgba(255,255,255,0.1);
}

/* ── Spinner ── */
.spinner {
  width: 28px;
  height: 28px;
  border: 2.5px solid #e2e8f0;
  border-top-color: #293056;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.spinner-sm {
  width: 16px;
  height: 16px;
  border: 2px solid #e2e8f0;
  border-top-color: #293056;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Section headers ── */
.section-h2 {
  font-size: 22px;
  font-weight: 800;
  color: #293056;
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.section-h3 {
  font-size: 14px;
  font-weight: 700;
  color: #293056;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.05em;
}

/* ── KPI / Stat Cards — slim horizontal ── */
.stat-card {
  background: #fff;
  border-radius: 10px;
  padding: 12px 16px;
  border: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stat-card .stat-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94a3b8;
}
.stat-card .stat-value {
  font-size: 24px;
  font-weight: 800;
  color: #293056;
  letter-spacing: -0.04em;
  line-height: 1.1;
}
.stat-card .stat-sub {
  font-size: 11px;
  color: #94a3b8;
}

/* ── Building cards ── */
.building-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.15s;
}
.building-card:hover {
  box-shadow: 0 8px 24px -4px rgba(41,48,86,0.14);
  transform: translateY(-1px);
}
.building-card:hover .card-img {
  transform: scale(1.04);
}
.card-img-wrap {
  width: 100%;
  height: 150px;
  overflow: hidden;
  background: #e5e7eb;
}
.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.card-img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #EBECF5 0%, #d4d6e8 100%);
  color: #293056;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* ── Developer cards ── */
.developer-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.15s;
  display: flex;
  flex-direction: column;
}
.developer-card:hover {
  box-shadow: 0 8px 24px -4px rgba(41,48,86,0.14);
  transform: translateY(-1px);
}
.dev-logo-wrap {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #F8F9FC;
  border-bottom: 1px solid #f1f3f9;
  padding: 12px;
}
.dev-logo {
  max-height: 48px;
  max-width: 130px;
  object-fit: contain;
}

/* ── Price History rows ── */
.ph-row {
  background: #F8F9FC;
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: background 0.12s;
  margin-bottom: 3px;
  font-size: 12.5px;
}
.ph-row:hover { background: #eef0f8; }

/* ── Filter pills ── */
.filter-pill {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #fff;
  font-size: 12px;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
  transition: all 0.12s;
  white-space: nowrap;
}
.filter-pill:hover { border-color: #293056; color: #293056; }
.filter-pill.active {
  background: #293056;
  border-color: #293056;
  color: #fff;
}

/* ── Search box ── */
.search-wrap { position: relative; }
.search-input {
  width: 100%;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  padding: 7px 14px 7px 34px;
  font-size: 13px;
  color: #1e293b;
  background: #fff;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search-input:focus {
  border-color: #293056;
  box-shadow: 0 0 0 2px rgba(41,48,86,0.07);
}
.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
}
.autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 8px 24px -4px rgba(0,0,0,0.1);
  z-index: 100;
  max-height: 280px;
  overflow-y: auto;
}
.autocomplete-item {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 12.5px;
  color: #1e293b;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.1s;
}
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover { background: #F8F9FC; }
.autocomplete-item .ac-name { font-weight: 600; color: #293056; font-size: 13px; }
.autocomplete-item .ac-sub { color: #64748b; font-size: 11.5px; margin-top: 1px; }

/* ── Building Detail: compact header row ── */
.building-detail-header {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  gap: 20px;
  align-items: flex-start;
}
.building-detail-thumb {
  width: 180px;
  height: 130px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: #e5e7eb;
}
.building-detail-thumb-placeholder {
  width: 180px;
  height: 130px;
  border-radius: 8px;
  background: linear-gradient(135deg, #EBECF5 0%, #d4d6e8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 28px;
  font-weight: 800;
  color: #293056;
}
.building-detail-info {
  flex: 1;
  min-width: 0;
}
.building-detail-name {
  font-size: 20px;
  font-weight: 800;
  color: #293056;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 3px;
}
.building-detail-addr {
  font-size: 12.5px;
  color: #64748b;
  margin-bottom: 10px;
}
.info-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.info-chip {
  background: #F0F1F8;
  border: 1px solid #dde0ee;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 11.5px;
  color: #293056;
  font-weight: 500;
  white-space: nowrap;
}
.info-chip strong {
  font-weight: 700;
}

/* ── Price summary strip ── */
.price-strip {
  display: flex;
  gap: 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
}
.price-strip-item {
  flex: 1;
  padding: 10px 14px;
  border-right: 1px solid #f1f5f9;
}
.price-strip-item:last-child { border-right: none; }
.price-strip-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  margin-bottom: 2px;
}
.price-strip-value {
  font-size: 16px;
  font-weight: 800;
  color: #293056;
  letter-spacing: -0.03em;
}

/* ── Chart containers ── */
.chart-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px 14px;
  overflow: hidden;
}
.chart-title {
  font-size: 12px;
  font-weight: 700;
  color: #293056;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}
.chart-wrap,
.chart-wrap-sm,
.chart-wrap-analytics {
  position: relative;
  width: 100%;
}

/* ── Select / inputs ── */
.form-select, .form-input {
  border: 1.5px solid #e2e8f0;
  border-radius: 7px;
  padding: 6px 10px;
  font-size: 12.5px;
  color: #1e293b;
  background: #fff;
  outline: none;
  transition: border-color 0.15s;
}
.form-select:focus, .form-input:focus { border-color: #293056; }

/* ── Table ── */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94a3b8;
  padding: 7px 10px;
  border-bottom: 1.5px solid #f1f5f9;
  white-space: nowrap;
}
.data-table td {
  padding: 7px 10px;
  border-bottom: 1px solid #f8f9fc;
  font-size: 12.5px;
  color: #374151;
  vertical-align: middle;
}
.data-table tr:hover td { background: #F8F9FC; }
.data-table tr:last-child td { border-bottom: none; }

/* ── Badge ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-gray { background: #f1f5f9; color: #64748b; }
.badge-green { background: #d1fae5; color: #065f46; }
.badge-red { background: #ffe4e6; color: #9f1239; }
.badge-amber { background: #fef3c7; color: #92400e; }
.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-purple { background: #ede9fe; color: #5b21b6; }
.badge-navy { background: #EBECF5; color: #293056; }
.badge-teal { background: #d0f4f8; color: #0e6b77; }

/* ── Type badge on building card ── */
.type-badge {
  display: inline-block;
  background: #EBECF5;
  color: #293056;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Back button ── */
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 7px;
  transition: color 0.15s, background 0.15s;
  text-decoration: none;
}
.btn-back:hover { color: #293056; background: #EBECF5; }

/* ── Primary button ── */
.btn-primary {
  background: #293056;
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: 7px 16px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.btn-primary:hover { background: #1e2444; }

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 36px 24px;
  color: #94a3b8;
}
.empty-state p { font-size: 13px; }

/* ── Pagination ── */
.page-btn {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  background: #fff;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s;
}
.page-btn:hover { border-color: #293056; color: #293056; }
.page-btn.active { background: #293056; border-color: #293056; color: #fff; }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Tab buttons ── */
.tab-btn {
  padding: 5px 11px;
  border-radius: 6px;
  border: none;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: all 0.12s;
  white-space: nowrap;
}
.tab-btn:hover { color: #293056; background: #EBECF5; }
.tab-btn.active { background: #293056; color: #fff; }

/* ── Quick links (text-only row) ── */
.quick-links {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.quick-link-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 600;
  color: #293056;
  text-decoration: none;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid #dde0ee;
  background: #fff;
  transition: background 0.12s, border-color 0.12s;
}
.quick-link-item:hover {
  background: #EBECF5;
  border-color: #293056;
}
.quick-link-icon {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  fill: none;
  flex-shrink: 0;
}

/* ── Recent Sold table wrapper ── */
.recent-sold-table-wrap {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
}

/* ── Dev count badge ── */
.dev-count-badge {
  background: #293056;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  display: inline-block;
  margin-left: 4px;
  vertical-align: middle;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* ── Status colors ── */
.status-sold, .status-leased { color: #059669; font-weight: 600; }
.status-expired, .status-terminated { color: #e11d48; font-weight: 600; }
.status-suspended { color: #d97706; font-weight: 600; }
.status-price-change { color: #2563eb; font-weight: 600; }
.status-new-listing { color: #7c3aed; font-weight: 600; }
.status-default { color: #64748b; }

/* ── Utility ── */
.line-clamp-1 { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
.line-clamp-2 { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* ── Transitions ── */
.fade-in { animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* ── Divider ── */
.section-divider {
  height: 1px;
  background: #f1f5f9;
  margin: 4px 0;
}

/* ── Mobile ── */
@media (max-width: 640px) {
  .building-detail-header {
    flex-direction: column;
  }
  .building-detail-thumb,
  .building-detail-thumb-placeholder {
    width: 100%;
    height: 160px;
  }
  .stat-card .stat-value { font-size: 20px; }
  .chart-wrap { height: 220px; }
  .chart-wrap-analytics { height: 240px; }
  .price-strip { flex-wrap: wrap; }
  .price-strip-item { flex: 1 1 50%; border-right: none; border-bottom: 1px solid #f1f5f9; }
  .price-strip-item:last-child,
  .price-strip-item:nth-last-child(2):nth-child(odd) { border-bottom: none; }
}
