/* ============================================================
   OLHO MÁGICO — Estilos compartilhados
============================================================ */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; color: #1a1a1a; background:#f8fafc; }

/* ---------- Header ---------- */
.site-header {
  height: 64px; background: linear-gradient(90deg,#0f172a,#1e293b);
  color: #f8fafc; display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px; box-shadow: 0 2px 10px rgba(0,0,0,.15);
  position: relative; z-index: 1000;
}
.site-header .brand { display: flex; align-items: center; gap: 12px; }
.site-header .logo {
  width: 38px; height: 38px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fbbf24, #f59e0b 60%, #b45309);
  display:flex; align-items:center; justify-content:center;
  box-shadow: inset 0 0 6px rgba(0,0,0,.35), 0 2px 6px rgba(0,0,0,.4);
}
.site-header .logo::after {
  content:""; width: 14px; height: 14px; background: #0f172a; border-radius: 50%;
  box-shadow: inset 0 0 4px rgba(0,0,0,.8);
}
.site-header h1 { margin:0; font-size:18px; letter-spacing:.4px; }
.site-header h1 .sub { display:block; font-size:11px; font-weight:400; color:#94a3b8; letter-spacing:1.2px; text-transform:uppercase; }
.site-header .nav { display:flex; gap:14px; align-items:center; }
.site-header .nav a { color:#cbd5e1; text-decoration:none; font-size:13px; padding: 6px 10px; border-radius:6px; transition:.15s; }
.site-header .nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.site-header .whats-btn {
  background:#25D366; color:#fff; padding: 8px 14px; border-radius: 999px;
  font-size:13px; font-weight:600; text-decoration:none; display:inline-flex; align-items:center; gap:6px;
  transition: .15s;
}
.site-header .whats-btn:hover { background:#1ebe57; transform: translateY(-1px); }
.site-header .whats-btn svg { width:14px; height:14px; fill:#fff; }

/* ---------- App (map page) ---------- */
.app { display: grid; grid-template-columns: 340px 1fr; height: calc(100vh - 64px); }
.sidebar { background: linear-gradient(180deg,#0f172a 0%, #1e293b 100%); color: #f1f5f9; overflow-y: auto; padding: 18px 18px 28px; }
.sidebar h2 { font-size: 17px; margin: 0 0 4px; letter-spacing: -.2px; }
.sidebar .sub { color: #94a3b8; font-size: 12px; margin-bottom: 18px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 18px; }
.stat { background: rgba(255,255,255,.06); padding: 10px 12px; border-radius: 8px; }
.stat .v { font-size: 22px; font-weight: 700; }
.stat .l { font-size: 11px; color: #94a3b8; text-transform: uppercase; letter-spacing: .5px; }
.section-title { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: #94a3b8; margin: 18px 0 8px; }
.filter-group { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: rgba(255,255,255,.08); color: #e2e8f0; border: 1px solid transparent; padding: 5px 10px; font-size: 12px; border-radius: 999px; cursor: pointer; transition: .15s; user-select: none; }
.chip:hover { background: rgba(255,255,255,.14); }
.chip.active { background: #fff; color: #0f172a; border-color: #fff; font-weight: 600; }
.chip .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
#search { width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid rgba(255,255,255,.1); background: rgba(0,0,0,.25); color: #f1f5f9; font-size: 13px; }
#search::placeholder { color: #64748b; }
#list { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.card { background: rgba(255,255,255,.05); padding: 10px 12px; border-radius: 8px; cursor: pointer; border-left: 3px solid #475569; transition: .15s; }
.card:hover { background: rgba(255,255,255,.1); }
.card .name { font-size: 13px; font-weight: 600; color: #f8fafc; line-height: 1.25; }
.card .meta { font-size: 11px; color: #94a3b8; margin-top: 3px; }
.card .price { font-size: 11px; color: #fbbf24; margin-top: 4px; font-weight: 600; }
#map { height: 100%; }

/* ---------- Marker Popup ---------- */
.leaflet-popup-content-wrapper { border-radius: 10px; padding: 0; }
.leaflet-popup-content { margin: 0; width: 280px !important; }
.pop { padding: 14px 16px; }
.pop h3 { margin: 0 0 4px; font-size: 15px; color: #0f172a; }
.pop-bairro { display: inline-block; font-size: 10px; text-transform: uppercase; letter-spacing: .8px; padding: 2px 8px; border-radius: 999px; color: #fff; margin-bottom: 8px; }
.pop-row { display: flex; gap: 6px; font-size: 12px; margin: 3px 0; }
.pop-row b { color: #475569; font-weight: 600; min-width: 70px; }
.pop-row span { color: #1e293b; }
.pop-price { font-size: 14px; font-weight: 700; color: #059669; margin-top: 6px; }
.pop-construtora { font-size: 11px; color: #64748b; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 2px; }
.pop-whats { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: #fff; background: #25D366; text-decoration: none; margin-top: 10px; padding: 8px 12px; border-radius: 6px; transition: .15s; }
.pop-whats:hover { background: #1ebe57; }
.pop-whats svg { width: 14px; height: 14px; fill: #fff; }
.pop-extras { display: flex; gap: 6px; margin-top: 6px; }
.pop-extras a { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 5px; font-size: 11px; font-weight: 600; color: #475569; background: #f1f5f9; text-decoration: none; padding: 7px 10px; border-radius: 6px; transition: .15s; border: 1px solid #e2e8f0; }
.pop-extras a:hover { background: #e2e8f0; color: #0f172a; }

@media (max-width: 900px){
  .app { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .sidebar { max-height: 45vh; }
  #map { height: 55vh; }
  .site-header .nav a:not(.whats-btn) { display:none; }
}

/* ============================================================
   Admin page
============================================================ */
.admin-page { padding: 24px 22px; max-width: 1280px; margin: 0 auto; }
.admin-page h2 { margin-top: 0; font-size: 22px; }
.admin-page .help { color:#475569; font-size:13px; margin-bottom: 18px; line-height:1.5; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.btn { display:inline-flex; align-items:center; gap:6px; padding: 9px 14px; border-radius:8px; font-size:13px; font-weight:600; border:none; cursor:pointer; transition: .15s; }
.btn-primary { background: #0f172a; color:#fff; }
.btn-primary:hover { background: #1e293b; }
.btn-success { background: #059669; color:#fff; }
.btn-success:hover { background: #047857; }
.btn-danger { background: #dc2626; color:#fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-ghost { background: #e2e8f0; color: #0f172a; }
.btn-ghost:hover { background: #cbd5e1; }

table { width:100%; border-collapse: collapse; background:#fff; border-radius:10px; overflow:hidden; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
thead { background: #f1f5f9; }
th, td { padding: 10px 12px; text-align:left; font-size: 13px; border-bottom: 1px solid #e2e8f0; vertical-align: middle; }
th { font-weight: 700; color:#0f172a; text-transform: uppercase; font-size:10px; letter-spacing: .8px; }
tr:last-child td { border-bottom:none; }
tr:hover td { background:#f8fafc; }
td.actions { white-space: nowrap; }
td.actions button { margin-right:6px; padding: 5px 10px; font-size: 12px; }

.empty { text-align:center; padding: 40px; color:#64748b; }

/* Modal */
.modal-backdrop { position: fixed; inset:0; background: rgba(0,0,0,.5); display:none; align-items:center; justify-content:center; z-index: 9999; padding: 20px; }
.modal-backdrop.open { display: flex; }
.modal { background:#fff; border-radius:12px; padding: 24px; width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto; }
.modal h3 { margin-top:0; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.form-row.full { grid-template-columns: 1fr; }
.form-row label { font-size: 12px; color:#475569; font-weight: 600; }
.form-row input, .form-row select, .form-row textarea {
  width: 100%; padding: 9px 11px; border: 1px solid #cbd5e1; border-radius:6px;
  font-size: 13px; font-family: inherit; margin-top: 4px;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus { outline:none; border-color:#0f172a; box-shadow: 0 0 0 3px rgba(15,23,42,.1); }
.form-actions { display:flex; gap:10px; justify-content: flex-end; margin-top: 18px; }

.banner { background:#fef3c7; color:#854d0e; padding: 12px 16px; border-radius:8px; font-size:13px; margin-bottom:18px; border-left: 4px solid #f59e0b; }
.banner.success { background:#d1fae5; color: #065f46; border-color: #10b981; }
