/* ── Reset & base ─────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', sans-serif;
  background: #f9fafb;
  color: #111827;
  min-height: 100vh;
}

a { text-decoration: none; color: inherit; }

/* ── Layout ───────────────────────────────────── */
.container {
  max-width: 1152px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ── Header ───────────────────────────────────── */
.site-header {
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

.site-header .container {
  display: flex;
  align-items: center;
  padding-top: .75rem;
  padding-bottom: .75rem;
}

/* ── Logo ─────────────────────────────────────── */
.logo { display: flex; align-items: center; gap: .5rem; }
.logo-text { display: flex; flex-direction: column; line-height: 1; }

.logo-name {
  font-size: 1.125rem;
  font-weight: 800;
  letter-spacing: -.02em;
  color: #111827;
}

.logo-name span { color: #2563eb; }

.logo-tagline {
  font-size: .625rem;
  font-weight: 500;
  color: #9ca3af;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-top: 2px;
}

/* ── Hero ─────────────────────────────────────── */
.hero { background: #fff; border-bottom: 1px solid #f3f4f6; }
.hero .container { padding-top: 2rem; padding-bottom: 2rem; }

.hero h1 {
  font-size: clamp(1.4rem, 3vw, 1.875rem);
  font-weight: 700;
  letter-spacing: -.02em;
}

.hero p { margin-top: .25rem; color: #6b7280; font-size: .9375rem; }

/* ── Main ─────────────────────────────────────── */
main .container { padding-top: 1.5rem; padding-bottom: 2rem; }

/* ── Filter bar ───────────────────────────────── */
.filter-bar {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: .75rem;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: flex-end;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  flex: 1;
  min-width: 8rem;
}

.filter-group label {
  font-size: .6875rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: .07em;
}

.filter-group select {
  height: 2.25rem;
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: .5rem;
  background: #fff;
  padding: 0 2rem 0 .75rem;
  font-size: .875rem;
  color: #374151;
  font-family: inherit;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .5rem center;
  transition: border-color .15s, box-shadow .15s;
}

.filter-group select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}

.filter-clear {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

#btn-clear {
  height: 2.25rem;
  padding: 0 1rem;
  font-size: .875rem;
  font-weight: 500;
  color: #6b7280;
  background: none;
  border: 1px solid #d1d5db;
  border-radius: .5rem;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
}

#btn-clear:hover { color: #2563eb; border-color: #2563eb; }

.filter-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: .75rem;
  gap: .75rem;
}

.result-count { font-size: .75rem; color: #9ca3af; }

/* ── Cards grid ───────────────────────────────── */
.cards-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

/* ── Skeleton ─────────────────────────────────── */
.skeleton {
  height: 15rem;
  border-radius: .75rem;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Card ─────────────────────────────────────── */
.card {
  background: #fff;
  border-radius: .75rem;
  border: 1px solid #e5e7eb;
  box-shadow: 0 2px 8px rgba(0,0,0,.07);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: box-shadow .2s, transform .2s, border-color .2s;
}

.card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,.11);
  transform: translateY(-2px);
}

.card-selected {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,.12), 0 2px 8px rgba(0,0,0,.07);
}

.card-body {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .875rem;
}

/* Card header: categoria à esquerda, porte à direita */
.card-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .5rem;
}

.card-tags { display: flex; align-items: center; gap: .375rem; flex-wrap: wrap; }

/* ── Porte: indicador de sinal ──────────────────── */
.porte-signal {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .1rem 0;
  font-size: .75rem;
  font-weight: 400;
  color: #9ca3af;
  flex-shrink: 0;
}

.signal-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 11px; flex-shrink: 0; }
.signal-bars .bar   { width: 3px; border-radius: 1.5px; background: #d1d5db; }
.signal-bars .bar.active { background: #25d366; }
.signal-bars .bar-1 { height: 4px; }
.signal-bars .bar-2 { height: 7px; }
.signal-bars .bar-3 { height: 11px; }

/* ── Badge de categoria ──────────────────────── */
.categoria-badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .2rem .625rem;
  border-radius: 9999px;
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  background: #eff6ff;
  color: #1d4ed8;
  white-space: nowrap;
}

.categoria-dot {
  width: .375rem;
  height: .375rem;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.categoria-badge.empresa { background: #faf5ff; color: #6d28d9; }
.categoria-badge.outro   { background: #f9fafb; color: #4b5563; }

/* ── Badge de fase ───────────────────────────── */
.fase-badge {
  display: inline-flex;
  align-items: center;
  padding: .2rem .625rem;
  border-radius: 9999px;
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  white-space: nowrap;
}

.fase-badge.disponivel { background: #dcfce7; color: #16a34a; }
.fase-badge.negociacao { background: #fef9c3; color: #a16207; }

/* ── Card body ───────────────────────────────── */
.card-place { display: flex; flex-direction: column; gap: .2rem; }

.card-bairro {
  font-size: 1.125rem;
  font-weight: 700;
  color: #111827;
  line-height: 1.25;
}

.card-divider { border: none; border-top: 1px solid #f3f4f6; }

.card-contact {
  display: flex;
  align-items: center;
  gap: .375rem;
  font-size: .8rem;
  color: #9ca3af;
}

.card-contact svg { flex-shrink: 0; }
.card-contact strong { font-weight: 600; color: #6b7280; }

/* ── Card footer ─────────────────────────────── */
.card-footer { padding: 0 1.25rem 1.25rem; display: flex; flex-direction: column; gap: .5rem; }

.btn-wa {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  width: 100%;
  padding: .625rem 1rem;
  border-radius: .625rem;
  background: #25d366;
  color: #fff;
  font-size: .875rem;
  font-weight: 600;
  font-family: inherit;
  border: none;
  cursor: pointer;
  transition: background .15s;
}

.btn-wa:hover { background: #1ebe5d; }

.btn-add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  width: 100%;
  padding: .5rem 1rem;
  border-radius: .625rem;
  background: transparent;
  color: #9ca3af;
  font-size: .8125rem;
  font-weight: 500;
  font-family: inherit;
  border: 1px solid #e5e7eb;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}

.btn-add:hover       { border-color: #2563eb; color: #2563eb; background: #eff6ff; }
.btn-add.added       { background: #eff6ff; border-color: #2563eb; color: #2563eb; font-weight: 600; }
.btn-add.added:hover { background: #fef2f2; border-color: #fca5a5; color: #dc2626; }

/* ── Empty / Error states ─────────────────────── */
.empty-state, .error-state {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5rem 1rem;
  text-align: center;
}

.state-icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.state-icon.orange { background: #eff6ff; }
.state-icon.red    { background: #fef2f2; }

.state-title { font-size: .9375rem; font-weight: 600; color: #374151; }
.state-sub   { font-size: .8125rem; color: #9ca3af; margin-top: .25rem; }

.btn-retry {
  margin-top: 1rem;
  padding: .5rem 1.25rem;
  border-radius: .5rem;
  background: #2563eb;
  color: #fff;
  font-size: .875rem;
  font-weight: 500;
  font-family: inherit;
  border: none;
  cursor: pointer;
}

.btn-retry:hover { background: #1d4ed8; }

/* ── Paginação ────────────────────────────────── */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: 1.25rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: .75rem;
  padding: .75rem 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}

.pagination { display: flex; align-items: center; gap: .375rem; flex-wrap: wrap; }

.page-btn {
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 .625rem;
  border-radius: .5rem;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #374151;
  font-size: .875rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.page-btn:hover:not(:disabled) { background: #eff6ff; border-color: #2563eb; color: #2563eb; }
.page-btn.active  { background: #2563eb; border-color: #2563eb; color: #fff; font-weight: 700; }
.page-btn:disabled { opacity: .35; cursor: default; }

.page-ellipsis { color: #9ca3af; font-size: .875rem; padding: 0 .125rem; }

.per-page-group { display: flex; align-items: center; gap: .4rem; flex-shrink: 0; }

.per-page-group label {
  font-size: .6875rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: .07em;
  white-space: nowrap;
}

.per-page-group select {
  height: 2.25rem;
  border: 1px solid #d1d5db;
  border-radius: .5rem;
  background: #fff;
  padding: 0 1.875rem 0 .75rem;
  font-size: .875rem;
  color: #374151;
  font-family: inherit;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .45rem center;
  transition: border-color .15s, box-shadow .15s;
}

.per-page-group select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}

/* ── Footer ───────────────────────────────────── */
.site-footer { margin-top: 3rem; border-top: 1px solid #e5e7eb; background: #fff; }

.site-footer .container {
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .375rem;
  font-size: .75rem;
  color: #9ca3af;
}

.footer-brand { font-weight: 600; color: #6b7280; }
.footer-brand span { color: #2563eb; }

@media (min-width: 640px) {
  .site-footer .container { flex-direction: row; justify-content: space-between; }
}

/* ── Lista de seleção (barra flutuante) ──────────── */
.lista-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #1e293b;
  color: #fff;
  padding: .875rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  z-index: 200;
  transform: translateY(110%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 -4px 24px rgba(0,0,0,.25);
}

.lista-bar.visible { transform: translateY(0); }

.lista-bar-left { display: flex; align-items: center; gap: .75rem; }

.lista-count-badge {
  background: #2563eb;
  color: #fff;
  font-size: .875rem;
  font-weight: 700;
  min-width: 1.875rem;
  height: 1.875rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 .5rem;
}

.lista-bar-label { font-size: .875rem; color: #94a3b8; }
.lista-bar-actions { display: flex; align-items: center; gap: .625rem; }

.btn-lista-clear {
  background: none;
  border: 1px solid #334155;
  color: #64748b;
  padding: .5rem .875rem;
  border-radius: .5rem;
  font-size: .8125rem;
  font-family: inherit;
  cursor: pointer;
  transition: border-color .15s, color .15s;
  white-space: nowrap;
}

.btn-lista-clear:hover { border-color: #64748b; color: #cbd5e1; }

.btn-lista-send {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: #25d366;
  color: #fff;
  border: none;
  padding: .5rem 1.125rem;
  border-radius: .5rem;
  font-size: .875rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s;
  white-space: nowrap;
}

.btn-lista-send:hover { background: #1ebe5d; }

/* ── Combobox ─────────────────────────────────── */
.combobox { position: relative; width: 100%; }

.combobox-trigger {
  height: 2.25rem;
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: .5rem;
  background: #fff;
  padding: 0 .625rem 0 .75rem;
  font-size: .875rem;
  color: #374151;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .375rem;
  text-align: left;
  transition: border-color .15s, box-shadow .15s;
}

.combobox-trigger:hover { border-color: #9ca3af; }

.combobox.open .combobox-trigger {
  border-color: #2563eb;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}

.combobox-value { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combobox-value.placeholder { color: #9ca3af; }

.combobox-arrow {
  color: #6b7280;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  transition: transform .15s;
}

.combobox.open .combobox-arrow { transform: rotate(180deg); }

.combobox-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #2563eb;
  border-top: none;
  border-radius: 0 0 .5rem .5rem;
  z-index: 100;
  box-shadow: 0 6px 16px rgba(0,0,0,.1);
}

.combobox-search-wrap {
  display: flex;
  align-items: center;
  gap: .375rem;
  padding: .375rem .625rem;
  border-bottom: 1px solid #f0f4f8;
}

.combobox-search-ico { color: #c0c9d4; display: flex; flex-shrink: 0; }

.combobox-search {
  flex: 1;
  border: none;
  outline: none;
  font-size: .8125rem;
  font-family: inherit;
  color: #374151;
  background: transparent;
  padding: .15rem 0;
}

.combobox-search::placeholder { color: #c0c9d4; }

.combobox-options { max-height: 12rem; overflow-y: auto; }

.combobox-option {
  padding: .45rem .75rem;
  font-size: .875rem;
  color: #374151;
  cursor: pointer;
  transition: background .1s;
}

.combobox-option:hover    { background: #eff6ff; }
.combobox-option.selected { color: #2563eb; font-weight: 600; background: #f5f8ff; }
.combobox-option.focused  { background: #eff6ff; }
.combobox-option.cb-empty { color: #9ca3af; font-style: italic; cursor: default; padding: .6rem .75rem; }
.combobox-option.cb-empty:hover { background: none; }

/* ── Modal ─────────────────────────────────────── */
.modal-overlay[hidden] { display: none !important; }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  backdrop-filter: blur(3px);
}

.modal {
  background: #fff;
  border-radius: .875rem;
  padding: 1.75rem;
  width: min(440px, 92vw);
  box-shadow: 0 24px 64px rgba(0,0,0,.22);
}

.modal-title { font-size: 1.0625rem; font-weight: 700; color: #111827; }

.modal-sub {
  font-size: .875rem;
  color: #6b7280;
  margin-top: .25rem;
  margin-bottom: 1.375rem;
  line-height: 1.5;
}

.modal-field { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .875rem; }

.modal-field label {
  font-size: .6875rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: .07em;
}

.modal-field input {
  height: 2.5rem;
  border: 1px solid #d1d5db;
  border-radius: .5rem;
  padding: 0 .75rem;
  font-size: .9375rem;
  font-family: inherit;
  color: #111827;
  transition: border-color .15s, box-shadow .15s;
}

.modal-field input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}

.modal-field input.invalid { border-color: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,.12); }

.modal-error { font-size: .8125rem; color: #ef4444; margin-bottom: .5rem; }

.modal-actions { display: flex; gap: .625rem; justify-content: flex-end; margin-top: 1.25rem; }

.btn-modal-cancel {
  background: none;
  border: 1px solid #d1d5db;
  border-radius: .5rem;
  padding: .575rem 1rem;
  font-size: .875rem;
  font-family: inherit;
  cursor: pointer;
  color: #6b7280;
  transition: border-color .15s, color .15s;
}

.btn-modal-cancel:hover { border-color: #9ca3af; color: #374151; }

.btn-modal-confirm {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .575rem 1.125rem;
  border-radius: .5rem;
  background: #25d366;
  color: #fff;
  font-size: .875rem;
  font-weight: 600;
  font-family: inherit;
  border: none;
  cursor: pointer;
  transition: background .15s;
}

.btn-modal-confirm:hover { background: #1ebe5d; }
