body {
  font-family: Inter, Arial, sans-serif;
  margin: 0;
  background: #f5f7fb;
  color: #1f2937;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: white;
  border-bottom: 1px solid #e5e7eb;
}
.topbar h1 { margin: 0; font-size: 24px; }
.topbar .sub { color: #64748b; font-size: 13px; margin-top: 4px; }
.topbar nav a {
  margin-left: 16px;
  text-decoration: none;
  color: #2563eb;
}
.container {
  max-width: 1400px;
  margin: 24px auto;
  padding: 0 16px;
}
.card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 8px 24px rgba(15,23,42,.04);
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
}
label.check {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
}
input, button, select {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: white;
}
.actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}
button { cursor: pointer; }
button[type="submit"] {
  background: #16a34a;
  color: white;
  border-color: #16a34a;
  font-weight: 600;
}
.hint { color: #64748b; font-size: 13px; }
.table-scroll {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th, td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid #e5e7eb;
  vertical-align: top;
}
th {
  background: #f8fafc;
  font-weight: 600;
  white-space: nowrap;
  position: sticky;
  top: 0;
}
.nowrap { white-space: nowrap; }
.title-cell {
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.thumb-cell { width: 60px; padding: 4px; }
.thumb {
  width: 56px;
  height: 42px;
  object-fit: cover;
  border-radius: 6px;
}
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: #fef3c7;
  color: #92400e;
}
pre {
  white-space: pre-wrap;
  word-break: break-word;
  background: #0f172a;
  color: #e2e8f0;
  padding: 14px;
  border-radius: 12px;
  min-height: 240px;
  font-size: 13px;
}
.status-display {
  white-space: pre-wrap;
  word-break: break-word;
  background: #0f172a;
  color: #e2e8f0;
  padding: 14px;
  border-radius: 12px;
  min-height: 240px;
  font-family: monospace;
  font-size: 14px;
}
/* Area autocomplete */
.area-label {
  grid-column: span 2;
}
.area-search-wrap {
  position: relative;
}
.area-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(15,23,42,.12);
  max-height: 280px;
  overflow-y: auto;
  z-index: 100;
}
.hidden { display: none; }
.area-dropdown.hidden { display: none; }
.area-item {
  padding: 10px 14px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #f1f5f9;
}
.area-item:last-child { border-bottom: none; }
.area-item:hover { background: #f0f7ff; }
.area-name { font-weight: 500; }
.area-city { color: #64748b; font-size: 12px; }
.area-loading { color: #64748b; cursor: default; justify-content: center; }
.area-selected {
  font-size: 12px;
  color: #2563eb;
  margin-top: 2px;
  font-weight: 500;
}
.area-history {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  align-items: center;
}
.history-label {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 500;
}
.history-chip {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #334155;
  cursor: pointer;
  font-weight: 500;
  transition: all .15s;
}
.history-chip:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #2563eb;
}
/* Listing cards */
.listing-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  margin-bottom: 16px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 320px 1fr;
  box-shadow: 0 4px 16px rgba(15,23,42,.04);
  transition: box-shadow .2s;
}
.listing-card:hover {
  box-shadow: 0 8px 32px rgba(15,23,42,.1);
}
.listing-gallery {
  position: relative;
  min-height: 220px;
  background: #f1f5f9;
}
.listing-hero {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.listing-no-img {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 14px;
}
.img-count {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0,0,0,.7);
  color: white;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}
.listing-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: #fef3c7;
  color: #92400e;
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.listing-body {
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.listing-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.listing-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
}
.listing-location {
  color: #64748b;
  font-size: 13px;
  margin-top: 3px;
}
.listing-price {
  font-size: 18px;
  font-weight: 700;
  color: #2563eb;
  white-space: nowrap;
  flex-shrink: 0;
}
.listing-features {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.feat {
  background: #f1f5f9;
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  color: #334155;
}
.feat-type {
  background: #eff6ff;
  color: #2563eb;
}
.listing-desc {
  font-size: 13px;
  color: #64748b;
  line-height: 1.5;
}
.listing-footer {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
}
.listing-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.listing-agency {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: #475569;
}
.agency-logo {
  height: 20px;
  width: auto;
  max-width: 80px;
  object-fit: contain;
  border-radius: 3px;
}
.listing-mandate {
  font-size: 11px;
  color: #94a3b8;
}
.listing-date {
  font-size: 11px;
  color: #94a3b8;
}
.listing-link {
  font-size: 13px;
  font-weight: 600;
  color: #2563eb;
  text-decoration: none;
  padding: 6px 16px;
  border: 1px solid #2563eb;
  border-radius: 8px;
  transition: all .15s;
}
.listing-link:hover {
  background: #2563eb;
  color: white;
}
.listing-extras {
  font-size: 12px;
  color: #475569;
  line-height: 1.6;
}
.listing-details {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.detail-tag {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 6px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #475569;
}
@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; }
  .area-label { grid-column: span 1; }
  .listing-card { grid-template-columns: 1fr; }
  .listing-gallery { max-height: 240px; }
}
