:root {
  --brand: #e8503a;
  --brand-dark: #cf4029;
  --brand-soft: #fdeceA;
  --ink: #1d2733;
  --ink-2: #4a5663;
  --muted: #8a96a3;
  --line: #e7ebef;
  --bg: #f6f8fa;
  --card: #ffffff;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(20,30,40,.06), 0 8px 24px rgba(20,30,40,.06);
  --shadow-hover: 0 6px 16px rgba(20,30,40,.10), 0 16px 40px rgba(20,30,40,.10);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }

/* ───────── Header ───────── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1180px; margin: 0 auto; padding: 0 20px;
  height: 64px; display: flex; align-items: center; justify-content: space-between;
}
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.25rem; }
.logo-mark { font-size: 1.3rem; }
.logo-text { color: var(--ink); letter-spacing: -.02em; }
.nav { display: flex; align-items: center; gap: 6px; }
.nav-link {
  padding: 9px 14px; border-radius: 10px; font-weight: 600; font-size: .95rem;
  color: var(--ink-2); transition: background .15s, color .15s;
}
.nav-link:hover { background: var(--bg); color: var(--ink); }
.nav-cta { background: var(--brand); color: #fff; }
.nav-cta:hover { background: var(--brand-dark); color: #fff; }
.nav-fav { color: var(--brand-dark); }
.nav-login { border: 1px solid var(--line); }
.nav-toggle { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; }

/* menu de usuário */
.user-menu { position: relative; }
.user-btn {
  display: flex; align-items: center; gap: 8px; background: none; border: none;
  cursor: pointer; font-family: inherit; font-weight: 600; color: var(--ink); font-size: .92rem;
  padding: 6px 10px; border-radius: 10px;
}
.user-btn:hover { background: var(--bg); }
.user-avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem;
}
.user-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 190px; background: #fff;
  border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px;
  display: flex; flex-direction: column; z-index: 60;
}
.user-dropdown[hidden] { display: none; }
.dd-item {
  display: block; text-align: left; padding: 10px 12px; border-radius: 8px; font-weight: 600;
  font-size: .92rem; color: var(--ink-2); background: none; border: none; cursor: pointer; font-family: inherit;
}
.dd-item:hover { background: var(--bg); color: var(--ink); }
.dd-sair { color: var(--brand-dark); border-top: 1px solid var(--line); margin-top: 4px; }

/* ───────── Hero ───────── */
.hero {
  background: linear-gradient(135deg, #fff 0%, var(--brand-soft) 100%);
  padding: 56px 20px 40px;
}
.hero-content { max-width: 1180px; margin: 0 auto; }
.hero h1 { font-size: 2.6rem; font-weight: 800; letter-spacing: -.03em; }
.hero p { color: var(--ink-2); font-size: 1.1rem; margin-top: 8px; }

.search-card {
  background: var(--card); border-radius: 18px; box-shadow: var(--shadow);
  margin-top: 28px; padding: 8px; max-width: 860px;
}
.search-tabs { display: flex; gap: 4px; padding: 6px 6px 0; }
.tab {
  border: none; background: none; padding: 10px 18px; border-radius: 10px;
  font-weight: 600; color: var(--muted); cursor: pointer; font-size: .95rem;
}
.tab.active { background: var(--brand-soft); color: var(--brand-dark); }
.search-row {
  display: flex; gap: 8px; padding: 8px; align-items: flex-end; flex-wrap: wrap;
}
.search-field { display: flex; flex-direction: column; gap: 5px; }
.search-field.grow { flex: 1 1 280px; }
.search-field label { font-size: .78rem; font-weight: 600; color: var(--muted); padding-left: 4px; }
.search-field input, .search-field select {
  border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px;
  font-size: 1rem; font-family: inherit; background: #fff; min-height: 48px;
}
.search-btn { min-height: 48px; }

/* ───────── Botões ───────── */
.btn-primary {
  background: var(--brand); color: #fff; border: none; border-radius: 10px;
  padding: 12px 22px; font-weight: 700; font-size: .95rem; cursor: pointer;
  font-family: inherit; transition: background .15s, transform .05s;
}
.btn-primary:hover { background: var(--brand-dark); }
.btn-primary:active { transform: translateY(1px); }
.btn-lg { padding: 15px 28px; font-size: 1.05rem; }
.btn-ghost {
  background: #fff; color: var(--ink-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 11px 18px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.btn-ghost:hover { border-color: var(--muted); color: var(--ink); }

/* ───────── Resultados ───────── */
.results-section { max-width: 1180px; margin: 0 auto; padding: 36px 20px 60px; }
.results-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.results-head h2 { font-size: 1.5rem; letter-spacing: -.02em; }
.muted { color: var(--muted); font-size: .9rem; }
.results-controls { display: flex; gap: 8px; align-items: center; }
.filter-toggle {
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 16px; font-weight: 600; cursor: pointer; font-family: inherit; color: var(--ink-2);
}
.filter-toggle:hover { border-color: var(--muted); }
.select-sm {
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px;
  font-family: inherit; background: #fff; font-size: .9rem; color: var(--ink-2); cursor: pointer;
}

/* painel filtros */
.filters {
  display: none; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; margin-top: 18px;
}
.filters.open { display: grid; }
.filter-field { display: flex; flex-direction: column; gap: 6px; }
.filter-field label { font-size: .8rem; font-weight: 600; color: var(--ink-2); }
.filter-field input, .filter-field select {
  border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px;
  font-family: inherit; font-size: .95rem; background: #fff;
}
.filter-actions {
  grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px;
}

/* ───────── Grid de cards ───────── */
.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px; margin-top: 24px;
}
.card {
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); cursor: pointer; transition: transform .18s, box-shadow .18s;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.card-photo { position: relative; aspect-ratio: 4/3; background: #eef1f4; overflow: hidden; }
.card-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.card:hover .card-photo img { transform: scale(1.04); }
.badges { position: absolute; top: 12px; left: 12px; display: flex; gap: 6px; }
.badge {
  font-size: .72rem; font-weight: 700; padding: 5px 10px; border-radius: 20px;
  background: rgba(255,255,255,.95); color: var(--ink); text-transform: capitalize;
  backdrop-filter: blur(4px);
}
.badge.b-finalidade { background: var(--brand); color: #fff; }
.badge.b-destaque { background: #2c3e50; color: #fff; }
.fav-btn {
  position: absolute; top: 10px; right: 10px; width: 38px; height: 38px; border-radius: 50%;
  border: none; background: rgba(255,255,255,.92); cursor: pointer; font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center; color: #c2ccd6;
  backdrop-filter: blur(4px); transition: transform .12s, color .12s; z-index: 2;
}
.fav-btn:hover { transform: scale(1.12); }
.fav-btn.ativo { color: var(--brand); }
.card-actions {
  display: flex; gap: 8px; padding: 0 16px 16px;
}
.card-actions button {
  flex: 1; padding: 9px; border-radius: 9px; font-weight: 600; font-size: .85rem;
  cursor: pointer; font-family: inherit; border: 1px solid var(--line); background: #fff; color: var(--ink-2);
}
.card-actions .act-editar:hover { border-color: var(--brand); color: var(--brand-dark); }
.card-actions .act-excluir:hover { border-color: #e0b4b4; color: #c0392b; background: #fdf3f3; }
.card-body { padding: 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-price { font-size: 1.25rem; font-weight: 800; letter-spacing: -.02em; }
.card-price small { font-size: .8rem; font-weight: 600; color: var(--muted); }
.card-title { font-weight: 600; font-size: .98rem; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-loc { color: var(--muted); font-size: .85rem; display: flex; align-items: center; gap: 4px; }
.card-specs {
  display: flex; gap: 14px; margin-top: auto; padding-top: 12px;
  border-top: 1px solid var(--line); color: var(--ink-2); font-size: .85rem; font-weight: 500;
}
.card-specs span { display: flex; align-items: center; gap: 5px; }

/* ───────── Empty ───────── */
.empty { text-align: center; padding: 70px 20px; color: var(--muted); }
.empty span { font-size: 2.5rem; }
.empty p { margin: 12px 0 18px; font-size: 1.05rem; }

/* ───────── Detalhe ───────── */
.view { animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.back-link {
  display: inline-block; max-width: 1180px; margin: 24px auto 0; padding: 0 20px;
  width: 100%; background: none; border: none; cursor: pointer; font-family: inherit;
  font-weight: 600; color: var(--brand-dark); font-size: .95rem; text-align: left;
}
.detalhe { max-width: 1180px; margin: 16px auto 60px; padding: 0 20px; }
.gallery { display: grid; grid-template-columns: 2fr 1fr 1fr; grid-auto-rows: 200px; gap: 8px;
  border-radius: var(--radius); overflow: hidden; }
.gallery .g-main { grid-row: span 2; grid-column: 1; }
.gallery img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; background: #eef1f4; }
.gallery .g-more { position: relative; }
.gallery .g-more .more-overlay {
  position: absolute; inset: 0; background: rgba(20,30,40,.55); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.1rem;
}
.detalhe-grid { display: grid; grid-template-columns: 1fr 340px; gap: 32px; margin-top: 28px; }
.det-head h1 { font-size: 1.7rem; letter-spacing: -.02em; }
.det-loc { color: var(--ink-2); margin-top: 4px; }
.det-tags { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.det-tag { background: var(--bg); border: 1px solid var(--line); border-radius: 20px;
  padding: 6px 14px; font-size: .85rem; font-weight: 600; color: var(--ink-2); text-transform: capitalize; }
.det-specs { display: flex; gap: 28px; margin: 24px 0; padding: 20px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.det-spec { display: flex; flex-direction: column; }
.det-spec b { font-size: 1.25rem; }
.det-spec small { color: var(--muted); font-size: .82rem; }
.det-desc h3 { margin-bottom: 8px; font-size: 1.1rem; }
.det-desc p { color: var(--ink-2); white-space: pre-line; }
.det-side { position: sticky; top: 84px; align-self: start;
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.det-side .price { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; }
.det-side .price small { font-size: .85rem; font-weight: 600; color: var(--muted); }
.det-costs { margin: 16px 0; font-size: .9rem; color: var(--ink-2); }
.det-costs div { display: flex; justify-content: space-between; padding: 5px 0; }
.contact-box { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.contact-box .who { font-weight: 700; }
.contact-box .phone { color: var(--brand-dark); font-weight: 700; font-size: 1.05rem; margin-top: 4px; }
.btn-wpp { display: block; text-align: center; background: #25d366; color: #fff; border-radius: 10px;
  padding: 13px; font-weight: 700; margin-top: 14px; }
.btn-wpp:hover { background: #1ebe5b; color: #fff; }

/* ───────── Form anunciar ───────── */
.form-wrap { max-width: 720px; margin: 16px auto 60px; padding: 0 20px; }
.form-wrap > h2 { font-size: 1.7rem; letter-spacing: -.02em; }
.anuncio-form { margin-top: 24px; display: flex; flex-direction: column; gap: 20px; }
.form-section { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.form-section h3 { font-size: 1.05rem; margin-bottom: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field label { font-size: .85rem; font-weight: 600; color: var(--ink-2); }
.field input, .field textarea, .field select {
  border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px;
  font-family: inherit; font-size: 1rem; background: #fff; resize: vertical;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft);
}
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.choice-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.choice-row:last-child { margin-bottom: 0; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; }
.choice span {
  display: block; padding: 11px 20px; border: 1.5px solid var(--line); border-radius: 10px;
  font-weight: 600; color: var(--ink-2); cursor: pointer; transition: all .15s; user-select: none;
}
.choice input:checked + span { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); }

.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  border: 2px dashed var(--line); border-radius: var(--radius); padding: 32px;
  cursor: pointer; color: var(--muted); transition: border-color .15s, background .15s;
}
.dropzone:hover { border-color: var(--brand); background: var(--brand-soft); }
.dz-icon { font-size: 1.8rem; }
.thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.thumb { position: relative; width: 90px; height: 90px; border-radius: 10px; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb button { position: absolute; top: 3px; right: 3px; background: rgba(0,0,0,.6); color: #fff;
  border: none; border-radius: 50%; width: 22px; height: 22px; cursor: pointer; font-size: .8rem; }
.form-footer { display: flex; align-items: center; gap: 16px; }
.form-msg { font-weight: 600; font-size: .92rem; }
.form-msg.ok { color: #1a9d57; }
.form-msg.err { color: var(--brand-dark); }

/* ───────── Footer ───────── */
.footer { border-top: 1px solid var(--line); background: #fff; margin-top: 40px; }
.footer-inner { max-width: 1180px; margin: 0 auto; padding: 24px 20px; display: flex;
  justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }

/* ───────── Lightbox ───────── */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(15,20,28,.92);
  display: flex; align-items: center; justify-content: center; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 90vw; max-height: 86vh; border-radius: 8px; }
.lb-close, .lb-prev, .lb-next {
  position: absolute; background: rgba(255,255,255,.12); color: #fff; border: none;
  cursor: pointer; border-radius: 50%; width: 48px; height: 48px; font-size: 1.6rem;
  display: flex; align-items: center; justify-content: center; transition: background .15s;
}
.lb-close:hover, .lb-prev:hover, .lb-next:hover { background: rgba(255,255,255,.25); }
.lb-close { top: 22px; right: 22px; }
.lb-prev { left: 22px; }
.lb-next { right: 22px; }

/* ───────── Badge de não lidas ───────── */
.nav-msg { position: relative; }
.badge-count {
  display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px;
  padding: 0 5px; margin-left: 4px; border-radius: 9px; background: var(--brand); color: #fff;
  font-size: .7rem; font-weight: 700; vertical-align: middle;
}
.badge-count[hidden] { display: none; }
.user-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* ───────── Carregar mais ───────── */
.load-more { display: flex; justify-content: center; margin-top: 32px; }
.load-more[hidden] { display: none; }

/* ───────── Avatar (perfil) ───────── */
.avatar-edit { display: flex; align-items: center; gap: 18px; }
.avatar-preview {
  width: 84px; height: 84px; border-radius: 50%; background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 2rem; font-weight: 700;
  overflow: hidden; flex-shrink: 0;
}
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; }

/* ───────── Conversas ───────── */
.conversas { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.conv-item {
  display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px; cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
.conv-item:hover { border-color: var(--muted); box-shadow: var(--shadow); }
.conv-thumb { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; background: #eef1f4; flex-shrink: 0; }
.conv-main { flex: 1; min-width: 0; }
.conv-top { display: flex; justify-content: space-between; gap: 8px; }
.conv-nome { font-weight: 700; }
.conv-imovel { color: var(--brand-dark); font-size: .82rem; font-weight: 600; }
.conv-ultima { color: var(--muted); font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.conv-quando { color: var(--muted); font-size: .78rem; white-space: nowrap; }
.conv-badge {
  background: var(--brand); color: #fff; border-radius: 12px; padding: 2px 8px; font-size: .72rem;
  font-weight: 700; flex-shrink: 0; align-self: center;
}

/* ───────── Chat (thread) ───────── */
.chat-wrap {
  max-width: 720px; margin: 16px auto 60px; padding: 0 20px; display: flex; flex-direction: column;
}
.chat-head {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0;
  padding: 16px 18px; display: flex; align-items: center; gap: 12px;
}
.chat-head .avatar-sm {
  width: 42px; height: 42px; border-radius: 50%; background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; overflow: hidden; flex-shrink: 0;
}
.chat-head .avatar-sm img { width: 100%; height: 100%; object-fit: cover; }
.chat-head .ch-nome { font-weight: 700; }
.chat-head .ch-imovel { font-size: .85rem; color: var(--brand-dark); font-weight: 600; }
.chat-body {
  background: var(--bg); border-left: 1px solid var(--line); border-right: 1px solid var(--line);
  padding: 20px 18px; display: flex; flex-direction: column; gap: 10px; min-height: 320px; max-height: 52vh; overflow-y: auto;
}
.msg-bubble {
  max-width: 76%; padding: 10px 14px; border-radius: 16px; font-size: .95rem; line-height: 1.4; word-wrap: break-word;
}
.msg-bubble.minha { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.msg-bubble.dele { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg-hora { font-size: .68rem; opacity: .7; display: block; margin-top: 3px; }
.chat-input {
  display: flex; gap: 8px; background: var(--card); border: 1px solid var(--line);
  border-radius: 0 0 var(--radius) var(--radius); padding: 12px;
}
.chat-input input {
  flex: 1; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-family: inherit; font-size: 1rem;
}
.chat-input input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

/* caixa de contato no detalhe */
.msg-box { margin-top: 14px; padding-top: 18px; border-top: 1px solid var(--line); }
.msg-box textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px;
  font-family: inherit; font-size: .95rem; resize: vertical;
}
.msg-box textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.msg-box .btn-primary { width: 100%; margin-top: 10px; }

/* ───────── Agendar visita (detalhe) ───────── */
.visit-box { margin-top: 14px; padding-top: 18px; border-top: 1px solid var(--line); }
.visit-box .who { margin-bottom: 10px; }
.visit-box .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.visit-box input, .visit-box textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  font-family: inherit; font-size: .92rem; margin-top: 8px;
}
.visit-box input:focus, .visit-box textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.visit-box .btn-primary { width: 100%; margin-top: 10px; }

/* ───────── Estatísticas no card ───────── */
.card-stats {
  display: flex; gap: 16px; padding: 10px 16px 0; color: var(--ink-2); font-size: .82rem; font-weight: 600;
}
.card-stats span { display: flex; align-items: center; gap: 5px; }
.stats-summary {
  display: flex; gap: 14px; flex-wrap: wrap; margin-top: 16px;
}
.stat-pill {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 20px; display: flex; flex-direction: column; min-width: 120px;
}
.stat-pill b { font-size: 1.5rem; letter-spacing: -.02em; }
.stat-pill small { color: var(--muted); font-size: .8rem; }

/* ───────── Visitas ───────── */
.visit-tabs { display: flex; gap: 6px; margin: 18px 0 4px; border-bottom: 1px solid var(--line); }
.visit-tab {
  background: none; border: none; padding: 10px 16px; font-weight: 700; color: var(--muted);
  cursor: pointer; font-family: inherit; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.visit-tab.active { color: var(--brand-dark); border-bottom-color: var(--brand); }
.visit-list { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
.visit-list[hidden] { display: none; }
.visit-card {
  display: flex; gap: 14px; align-items: center; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow);
}
.visit-thumb { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; background: #eef1f4; flex-shrink: 0; cursor: pointer; }
.visit-info { flex: 1; min-width: 0; }
.visit-imovel { font-weight: 700; }
.visit-quem { color: var(--ink-2); font-size: .88rem; margin-top: 2px; }
.visit-quando { color: var(--brand-dark); font-weight: 600; font-size: .9rem; margin-top: 4px; }
.visit-msg { color: var(--muted); font-size: .85rem; margin-top: 4px; font-style: italic; }
.visit-side { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; flex-shrink: 0; }
.visit-status {
  padding: 5px 12px; border-radius: 20px; font-size: .78rem; font-weight: 700; white-space: nowrap;
}
.status-pendente   { background: #fff5e6; color: #b97400; }
.status-confirmada { background: #e6f7ee; color: #1a9d57; }
.status-recusada   { background: #fdecec; color: #c0392b; }
.status-cancelada  { background: var(--bg); color: var(--muted); }
.visit-acoes { display: flex; gap: 6px; }
.visit-acoes button {
  border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 7px 12px;
  font-weight: 600; font-size: .82rem; cursor: pointer; font-family: inherit;
}
.visit-acoes .v-ok:hover { border-color: #1a9d57; color: #1a9d57; background: #f3fbf6; }
.visit-acoes .v-no:hover { border-color: #c0392b; color: #c0392b; background: #fdf3f3; }

/* ───────── Modal auth ───────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 90; background: rgba(15,20,28,.55);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay[hidden] { display: none; }
.modal {
  position: relative; background: #fff; border-radius: 18px; box-shadow: var(--shadow-hover);
  width: 100%; max-width: 420px; padding: 28px; animation: fade .2s ease;
}
.modal-close {
  position: absolute; top: 16px; right: 16px; background: none; border: none; font-size: 1.2rem;
  cursor: pointer; color: var(--muted);
}
.auth-tabs { display: flex; gap: 6px; margin-bottom: 22px; border-bottom: 1px solid var(--line); }
.auth-tab {
  background: none; border: none; padding: 10px 14px; font-weight: 700; font-size: 1rem;
  color: var(--muted); cursor: pointer; font-family: inherit; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.auth-tab.active { color: var(--brand-dark); border-bottom-color: var(--brand); }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form[hidden] { display: none; }
.btn-block { width: 100%; }

/* ───────── Mapa ───────── */
.det-map { margin-top: 28px; }
.det-map h3 { margin-bottom: 10px; font-size: 1.1rem; }
.det-map-frame { width: 100%; height: 280px; border: 0; border-radius: var(--radius); }
.map-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  height: 180px; background: linear-gradient(135deg, #eef2f6, #f6f8fa); border: 1px solid var(--line);
  border-radius: var(--radius); color: var(--ink-2); font-weight: 600;
}

/* ───────── Responsivo ───────── */
@media (max-width: 860px) {
  .detalhe-grid { grid-template-columns: 1fr; }
  .det-side { position: static; }
}
@media (max-width: 680px) {
  .nav { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column;
    background: #fff; border-bottom: 1px solid var(--line); padding: 12px; gap: 4px; }
  .nav.open { display: flex; }
  .nav-link { width: 100%; }
  .nav-toggle { display: block; }
  .hero h1 { font-size: 2rem; }
  .gallery { grid-template-columns: 1fr 1fr; }
  .gallery .g-main { grid-column: 1 / -1; grid-row: auto; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
}

/* ═══════════ Painel de gestão ═══════════ */
.painel-wrap { max-width: 1180px; margin: 0 auto; padding: 24px 20px 60px; display: grid; grid-template-columns: 240px 1fr; gap: 24px; }
.painel-side { align-self: start; position: sticky; top: 84px; display: flex; flex-direction: column; gap: 16px; }
.painel-user { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.pu-nome { font-weight: 700; font-size: .95rem; }
.pu-papel { color: var(--muted); font-size: .8rem; text-transform: capitalize; }
.painel-nav { display: flex; flex-direction: column; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; }
.pnav-item { display: block; text-align: left; background: none; border: none; cursor: pointer; font-family: inherit; font-weight: 600; font-size: .92rem; color: var(--ink-2); padding: 11px 14px; border-radius: 10px; text-decoration: none; }
.pnav-item:hover { background: var(--bg); color: var(--ink); }
.pnav-item.active { background: var(--brand-soft); color: var(--brand-dark); }
.pnav-sair { color: var(--brand-dark); border-top: 1px solid var(--line); margin-top: 4px; border-radius: 0 0 8px 8px; }
.painel-main { min-width: 0; }
.painel-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.painel-head h2 { font-size: 1.5rem; letter-spacing: -.02em; }
body:not(.is-admin) .admin-only { display: none !important; }

/* Tabela */
.tbl { width: 100%; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; border-collapse: collapse; }
.tbl th, .tbl td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: .9rem; vertical-align: middle; }
.tbl th { background: var(--bg); font-weight: 700; color: var(--ink-2); font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: #fcfcfd; }
.tbl-thumb { width: 54px; height: 42px; border-radius: 8px; object-fit: cover; background: #eef1f4; }
.tbl-acoes { display: flex; gap: 6px; }
.icon-btn { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 6px 10px; cursor: pointer; font-family: inherit; font-size: .82rem; font-weight: 600; color: var(--ink-2); }
.icon-btn:hover { border-color: var(--muted); color: var(--ink); }
.icon-btn.danger:hover { border-color: #e0b4b4; color: #c0392b; background: #fdf3f3; }
.tag { display: inline-flex; padding: 3px 9px; border-radius: 20px; font-size: .74rem; font-weight: 700; }
.tag.on { background: #e6f7ee; color: #1a9d57; } .tag.off { background: var(--bg); color: var(--muted); }
.tag.novo { background: #fff5e6; color: #b97400; } .tag.em_contato { background: #e8f0fe; color: #1a56c4; }
.tag.concluido { background: #e6f7ee; color: #1a9d57; } .tag.descartado { background: #fdecec; color: #c0392b; }
.tag.papel-admin { background: var(--brand-soft); color: var(--brand-dark); } .tag.papel-funcionario { background: var(--bg); color: var(--ink-2); }

/* Stats painel */
.stats-summary { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.stat-pill { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 20px; display: flex; flex-direction: column; min-width: 120px; }
.stat-pill b { font-size: 1.5rem; letter-spacing: -.02em; } .stat-pill small { color: var(--muted); font-size: .8rem; }

/* Banner de coleção */
.colecao-banner { background: linear-gradient(135deg, var(--brand-soft), #fff); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; margin-top: 18px; }
.colecao-banner h3 { font-size: 1.2rem; } .colecao-banner p { color: var(--ink-2); margin-top: 4px; }

/* Toast */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 13px 22px; border-radius: 12px; font-weight: 600; font-size: .92rem; z-index: 200; box-shadow: var(--shadow-hover); animation: fade .2s ease; }
.toast[hidden] { display: none; } .toast.err { background: #c0392b; } .toast.ok { background: #1a9d57; }

.modal-lg { max-width: 640px; max-height: 88vh; overflow-y: auto; }
.btn-block { width: 100%; }
.auth-form[hidden] { display: none; }
.pick-list { display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
.pick-item { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; cursor: pointer; }
.pick-item:hover { background: var(--bg); } .pick-item img { width: 44px; height: 34px; border-radius: 6px; object-fit: cover; }
.pick-item .pi-info { flex: 1; min-width: 0; font-size: .88rem; }

@media (max-width: 820px) {
  .painel-wrap { grid-template-columns: 1fr; }
  .painel-side { position: static; }
  .painel-nav { flex-direction: row; flex-wrap: wrap; }
  .tbl thead { display: none; }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
  .tbl td { border: none; padding: 6px 14px; }
}
