:root {
  --bg: #0b0b0c;
  --surface: #17171a;
  --surface-2: #1f1f23;
  --border: #2b2b30;
  --text: #f5f3ef;
  --muted: #9a9a97;
  --primary: #8ce23b;
  --primary-dark: #74c22a;
  --primary-tint: rgba(140, 226, 59, 0.15);
  --accent: #8ce23b;
  --on-primary: #0b0b0c;
  --whatsapp: #25d366;
  --radius: 14px;
  --max-w: 1080px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f7f5;
    --surface: #ffffff;
    --surface-2: #f0f1ed;
    --border: #e3e3df;
    --text: #16181d;
    --muted: #656c68;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
}

main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 24px 20px 64px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
}
.brand span { color: var(--primary); }
.brand-icon { width: 30px; height: 30px; border-radius: 6px; display: block; }

.topbar-right { display: flex; align-items: center; gap: 16px; }

.lang-switch {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
}
.lang-switch a { color: var(--muted); text-decoration: none; }
.lang-switch a.active { color: var(--primary); }
.lang-switch a:hover { color: var(--text); }

.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
}
.btn-primary { background: var(--primary); color: var(--on-primary); font-weight: 700; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-whatsapp { background: var(--whatsapp); color: #fff; }
.btn-block { width: 100%; text-align: center; padding: 14px; font-size: 1.05rem; }

.hero { text-align: center; padding: 32px 0 12px; }
.hero h1 { font-size: 2rem; margin: 0 0 8px; }
.hero p { color: var(--muted); margin: 0; }

.search-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin: 24px 0 32px;
}
.search-bar input, .search-bar select {
  flex: 1 1 200px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 1rem;
}
.search-bar .btn { flex: 0 0 auto; }

.location-banner { margin: -16px 0 24px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  transition: transform .15s ease, border-color .15s ease;
  display: block;
}
.card:hover { transform: translateY(-3px); border-color: var(--primary); }

.card-photo { aspect-ratio: 4/3; background: var(--surface-2); }
.card-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-photo-fallback {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem;
}
.card-photo-fallback.big { font-size: 4rem; }

.card-body { padding: 14px 16px; }
.card-body h3 { margin: 0 0 4px; font-size: 1.05rem; }

.muted { color: var(--muted); font-size: 0.9rem; margin: 0 0 8px; }
.muted.small { font-size: 0.85rem; }

.tag {
  display: inline-block;
  background: var(--primary-tint);
  color: var(--accent);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.8rem;
  font-weight: 600;
}

.price { font-weight: 700; margin: 10px 0 0; color: var(--primary); }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}
.empty-state .btn { margin-top: 16px; }

.back-link {
  display: inline-block;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 16px;
  font-size: 0.9rem;
}
.back-link:hover { color: var(--primary); }

.profile {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 32px;
}
.profile-photo {
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-2);
}
.profile-photo img { width: 100%; height: 100%; object-fit: cover; }
.profile-info h1 { margin: 0 0 6px; font-size: 1.8rem; }
.bio { margin: 16px 0; white-space: pre-wrap; }
.contact-buttons { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }

.banner-success, .banner-error {
  padding: 14px 18px;
  border-radius: 10px;
  margin-bottom: 20px;
  font-weight: 600;
}
.banner-success { background: var(--primary-tint); color: var(--accent); }
.banner-error { background: rgba(255, 90, 90, 0.15); color: #ff5a5a; }

.form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  flex: 1;
}
.form input, .form select, .form textarea {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 1rem;
  font-weight: 400;
  font-family: inherit;
}
.form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.form-row label { min-width: 220px; }

.checkbox-row { display: flex; gap: 20px; flex-direction: row; }
.checkbox-inline {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 8px;
  font-weight: 400 !important;
}
.checkbox-inline input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.autocomplete-wrap { position: relative; }
.autocomplete-list {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 220px;
  overflow-y: auto;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  z-index: 20;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}
.autocomplete-item {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 0.95rem;
  border-bottom: 1px solid var(--border);
}
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover,
.autocomplete-item:active { background: var(--primary); color: #fff; }

.footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 24px 20px 40px;
}

.admin-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.admin-table th, .admin-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.admin-table th { color: var(--muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table a { color: var(--text); }
.admin-thumb {
  width: 40px; height: 40px;
  border-radius: 8px;
  object-fit: cover;
  display: block;
}
.admin-thumb-fallback {
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2);
  font-size: 1.2rem;
}
.btn-danger { border-color: var(--primary); color: var(--primary); }
.btn-danger:hover { background: var(--primary); color: #fff; }

@media (max-width: 640px) {
  .profile { grid-template-columns: 1fr; }
  .profile-photo { max-width: 220px; margin: 0 auto; }
}
