/* ── Variables ─────────────────────────────────────── */
:root {
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.3);
  --secondary: #0ea5e9;
  --secondary-hover: #0284c7;
  --success: #10b981;
  --success-hover: #059669;
  --accent: #f43f5e;
  --warning: #f59e0b;
  --bg: #060c1a;
  --surface: rgba(15, 23, 42, 0.7);
  --card: rgba(20, 30, 50, 0.8);
  --border: rgba(255, 255, 255, 0.07);
  --border-active: rgba(99, 102, 241, 0.5);
  --text: #f1f5f9;
  --text-light: #94a3b8;
  --text-muted: #475569;
  --radius: 16px;
  --radius-lg: 22px;
  --shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
}

/* Light theme */
body.light-theme {
  --bg: #f0f4f8;
  --surface: rgba(255, 255, 255, 0.9);
  --card: rgba(255, 255, 255, 0.95);
  --border: rgba(0, 0, 0, 0.08);
  --border-active: rgba(99, 102, 241, 0.5);
  --text: #0f172a;
  --text-light: #475569;
  --text-muted: #94a3b8;
  --shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.12);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Background blobs ──────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 10% -10%, rgba(99, 102, 241, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 90% 110%, rgba(14, 165, 233, 0.1) 0%, transparent 60%),
    radial-gradient(ellipse 40% 40% at 50% 50%, rgba(16, 185, 129, 0.04) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 44px 44px;
  pointer-events: none;
  z-index: 0;
}

/* ── Layout ────────────────────────────────────────── */
.page-wrap {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Topbar ────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(6, 12, 26, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

body.light-theme .topbar {
  background: rgba(240, 244, 248, 0.92);
}

.topbar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-text {
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text);
}

.logo-imob {
  color: var(--text);
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  justify-content: center;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
  color: var(--text-light);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 10px;
  transition: all 0.2s;
  border: 1px solid transparent;
  white-space: nowrap;
}

.nav-link:hover {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.2);
  color: var(--text);
}

.nav-link.active {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.25);
  color: #818cf8;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.credit-badge-skeleton {
  height: 30px;
  width: 72px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.06);
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

@keyframes skeleton-pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.4;
  }
}

.credit-badge-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-logout {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(244, 63, 94, 0.08);
  border: 1px solid rgba(244, 63, 94, 0.2);
  color: #fb7185;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-logout:hover {
  background: rgba(244, 63, 94, 0.15);
  border-color: rgba(244, 63, 94, 0.35);
}

/* ── Main content ──────────────────────────────────── */
.main {
  flex: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: 48px 28px 80px;
  width: 100%;
}

/* ── Page header ───────────────────────────────────── */
.page-header {
  margin-bottom: 36px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  flex-wrap: wrap;
}

.page-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.22);
  padding: 5px 14px;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #34d399;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.page-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  background: linear-gradient(to right, #f1f5f9, #94a3b8);
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 10px;
}

.page-subtitle {
  color: var(--text-light);
  font-size: 0.97rem;
  max-width: 560px;
}

.stat-pill {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 12px;
  padding: 12px 20px;
  text-align: center;
}

.stat-pill-value {
  display: block;
  font-size: 1.6rem;
  font-weight: 900;
  color: #818cf8;
  line-height: 1;
}

.stat-pill-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

/* ── Filters bar ───────────────────────────────────── */
.filters-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.search-wrap {
  position: relative;
  flex: 1;
  min-width: 220px;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.filter-input {
  width: 100%;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px 12px 42px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  transition: all 0.25s ease;
  backdrop-filter: blur(12px);
}

.filter-input::placeholder {
  color: var(--text-muted);
}

.filter-input:focus {
  outline: none;
  border-color: rgba(99, 102, 241, 0.6);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}

.filter-tabs {
  display: flex;
  gap: 6px;
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
}

.filter-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-light);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.filter-tab:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.filter-tab.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 10px var(--primary-glow);
}

/* ── Mode Tabs (Aluguel / Venda) ──────────────────── */
.mode-tabs-wrapper {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.mode-tabs {
  display: flex;
  gap: 0;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 4px;
  position: relative;
}

.mode-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--text-light);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  position: relative;
  z-index: 1;
}

.mode-tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.mode-tab.active-aluguel {
  background: linear-gradient(135deg, #6366f1, #0ea5e9);
  color: #fff;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
}

.mode-tab.active-venda {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.35);
}

.mode-tab-icon {
  font-size: 1.1rem;
}

.mode-tab-badge {
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 800;
}

body.light-theme .mode-tabs {
  background: rgba(0, 0, 0, 0.04);
}

/* Venda mode price styling */
.venda-mode .price-label {
  display: none;
}

.venda-mode .card-price::after {
  content: '';
}

/* ── Loading ───────────────────────────────────────── */
.loading-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 100px 20px;
}

.spinner-ring {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(255, 255, 255, 0.06);
  border-top-color: var(--primary);
  border-right-color: var(--secondary);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-text {
  color: var(--text-light);
  font-size: 0.9rem;
  font-weight: 500;
}

/* ── Empty / Error ─────────────────────────────────── */
.empty-state,
.error-state {
  text-align: center;
  padding: 100px 20px;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 3.5rem;
  margin-bottom: 16px;
  opacity: 0.5;
  display: block;
}

.empty-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 8px;
}

.empty-sub {
  font-size: 0.88rem;
  max-width: 440px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ── Opportunities Grid ────────────────────────────── */
.oport-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}

/* ── Property Card ─────────────────────────────────── */
.oport-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  animation: fadeSlideIn 0.45s ease both;
}

.oport-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.4);
  border-color: rgba(99, 102, 241, 0.25);
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Photo area */
.card-photos {
  position: relative;
  height: 200px;
  overflow: hidden;
  background: rgba(6, 12, 26, 0.5);
  cursor: pointer;
}

.card-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.card-photos:hover .card-photo {
  transform: scale(1.04);
}

.card-photos-count {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 99px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.card-photo-nav {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  opacity: 0;
  transition: opacity 0.2s;
}

.card-photos:hover .card-photo-nav {
  opacity: 1;
}

.card-photo-btn {
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  border: none;
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  font-weight: 700;
}

.card-photo-btn:hover {
  background: rgba(99, 102, 241, 0.7);
}

.card-no-photo {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.card-no-photo-icon {
  font-size: 2.5rem;
  opacity: 0.3;
}

/* Photo Loader Overlay */
.photo-loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 12, 26, 0.4);
  z-index: 2;
  backdrop-filter: blur(2px);
}

.photo-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ── Location Banner ───────────────────────────────── */
.card-location-banner {
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.card-location-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.card-location-info {
  flex: 1;
  min-width: 0;
}

.card-location-type {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 3px;
}

.card-location-banner.tipo-morna {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(251, 191, 36, 0.06));
  border-top: 2px solid transparent;
  border-image: linear-gradient(90deg, #f59e0b, #fbbf24) 1;
}

.tipo-morna .card-location-icon {
  background: rgba(245, 158, 11, 0.15);
}

.tipo-morna .card-location-type {
  color: #fbbf24;
}

.card-location-banner.tipo-frio {
  background: linear-gradient(135deg, rgba(148, 163, 184, 0.1), rgba(15, 23, 42, 0.05));
}

.tipo-frio .card-location-icon {
  background: rgba(148, 163, 184, 0.15);
}

.tipo-frio .card-location-type {
  color: #94a3b8;
}


.card-location-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.02em;
}

.card-location-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Card Body ─────────────────────────────────────── */
.card-body {
  padding: 16px 18px;
}

.card-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-light);
  line-height: 1.4;
  margin-bottom: 14px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* Details chips */
.card-details {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.detail-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-light);
}

.detail-chip svg {
  opacity: 0.6;
}

/* Price */
.card-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 14px;
}

.price-value {
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--text);
}

.price-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}

.price-condo {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: auto;
}

/* Amenities */
.card-amenities {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 14px;
}

.amenity-tag {
  background: rgba(99, 102, 241, 0.06);
  border: 1px solid rgba(99, 102, 241, 0.12);
  border-radius: 6px;
  padding: 3px 9px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #818cf8;
}

/* Actions */
.card-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.btn-search-owner {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #fff;
  border: none;
  padding: 11px 16px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s;
  text-decoration: none;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-search-owner:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px var(--primary-glow);
  filter: brightness(1.08);
}

.btn-view-listing {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-light);
  padding: 11px 14px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  white-space: nowrap;
}

.btn-view-listing:hover {
  border-color: rgba(14, 165, 233, 0.35);
  color: #38bdf8;
  background: rgba(14, 165, 233, 0.06);
}

/* ── Pagination ────────────────────────────────────── */
.pagination-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 48px;
  flex-wrap: wrap;
}

.page-btn {
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-light);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-btn:hover {
  border-color: var(--border-active);
  color: var(--text);
}

.page-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.page-gap {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ── Photo Lightbox ────────────────────────────────── */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(12px);
  align-items: center;
  justify-content: center;
}

.lightbox.open {
  display: flex;
}

.lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: var(--radius);
  object-fit: contain;
  box-shadow: 0 32px 64px rgba(0, 0, 0, 0.8);
  animation: fadeSlideIn 0.3s ease both;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s;
}

.lightbox-close {
  top: 20px;
  right: 20px;
  font-size: 1rem;
}

.lightbox-prev {
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.6rem;
}

.lightbox-next {
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.6rem;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(99, 102, 241, 0.4);
  border-color: rgba(99, 102, 241, 0.5);
}

.lightbox-counter {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 99px;
}

/* ── Theme toggle ──────────────────────────────────── */
#theme-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 500;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 46px;
  height: 46px;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

#theme-toggle:hover {
  transform: scale(1.1) rotate(10deg);
  border-color: var(--border-active);
}

/* ── Credit / Plan Badge ───────────────────────────── */
.credit-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  padding: 6px 12px;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 800;
  color: #fbbf24;
  white-space: nowrap;
}

.credit-badge.low {
  background: rgba(244, 63, 94, 0.1);
  border-color: rgba(244, 63, 94, 0.3);
  color: #fb7185;
}

.credit-badge.admin-badge {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.3);
  color: #818cf8;
}

.plan-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.22);
  padding: 6px 12px;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 800;
  color: #818cf8;
  white-space: nowrap;
}

/* ── Mobile Hamburger & Sidebar ─────────────────────── */
.btn-hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-light);
  flex-shrink: 0;
}

.btn-hamburger:hover {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.3);
  color: #818cf8;
}

.mobile-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 9990;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-sidebar-overlay.open {
  display: block;
  opacity: 1;
}

.mobile-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: min(300px, 88vw);
  height: 100dvh;
  background: rgba(10, 18, 35, 0.97);
  backdrop-filter: blur(24px);
  border-left: 1px solid rgba(99, 102, 241, 0.2);
  z-index: 9991;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.mobile-sidebar.open {
  transform: translateX(0);
}

.mobile-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}

.mobile-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.mobile-sidebar-brand .logo-text {
  font-size: 1.1rem;
}

.btn-sidebar-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-light);
  transition: all 0.2s;
  font-size: 1.1rem;
}

.btn-sidebar-close:hover {
  background: rgba(244, 63, 94, 0.1);
  border-color: rgba(244, 63, 94, 0.3);
  color: #fb7185;
}

.mobile-sidebar-user {
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(99, 102, 241, 0.05);
  border-bottom: 1px solid var(--border);
}

.mobile-sidebar-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
}

.mobile-sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mobile-sidebar-section-label {
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 10px 8px 6px;
  margin-top: 8px;
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-light);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 12px 14px;
  border-radius: 12px;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.mobile-nav-link:hover,
.mobile-nav-link:active {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.2);
  color: var(--text);
}

.mobile-nav-link.active {
  background: rgba(99, 102, 241, 0.14);
  border-color: rgba(99, 102, 241, 0.3);
  color: #818cf8;
}

.mobile-nav-link.danger {
  color: #fb7185;
  background: rgba(244, 63, 94, 0.06);
  border-color: rgba(244, 63, 94, 0.15);
}

.mobile-nav-link.danger:hover {
  background: rgba(244, 63, 94, 0.12);
  border-color: rgba(244, 63, 94, 0.3);
}

.mobile-nav-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
  transition: all 0.2s;
}

.mobile-nav-link.active .mobile-nav-icon {
  background: rgba(99, 102, 241, 0.2);
}

.mobile-nav-link.danger .mobile-nav-icon {
  background: rgba(244, 63, 94, 0.1);
}

.mobile-sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
}

/* ── Responsive ────────────────────────────────────── */
@media (max-width: 768px) {
  .card-photo-nav {
    opacity: 1;
  }

  .topbar {
    padding: 0 16px;
    height: 58px;
  }

  .topbar-right {
    gap: 8px;
  }

  .main {
    padding: 32px 16px 80px;
  }

  .oport-grid {
    grid-template-columns: 1fr;
  }

  .page-title {
    font-size: 1.8rem;
  }

  .filters-bar {
    flex-direction: column;
    align-items: stretch;
  }

  /* Hide desktop nav, show hamburger */
  .topbar-nav {
    display: none !important;
  }

  .btn-hamburger {
    display: flex;
  }

  .topbar .btn-logout {
    display: none;
  }

  .btn-logout .nav-label {
    display: none;
  }

  /* Hide logo text — icon only on mobile */
  .topbar-logo .logo-text {
    display: none;
  }

  .filter-tabs {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    /* 2x2 para acomodar 4 abas */
    gap: 6px;
  }

  .filter-tab {
    justify-content: center;
    padding: 10px 8px;
    font-size: 0.8rem;
  }

  .mode-tabs-wrapper {
    margin-bottom: 20px;
  }

  .mode-tabs {
    width: 100%;
  }

  .mode-tab {
    flex: 1;
    justify-content: center;
    padding: 11px 16px;
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .card-actions {
    flex-direction: column;
  }

  .filter-tab {
    font-size: 0.75rem;
    padding: 10px 6px;
    gap: 4px;
  }

  .mode-tab {
    padding: 10px 12px;
    font-size: 0.8rem;
    gap: 6px;
  }
}

/* ── Badge Super Quente ────────────────────────────── */
.badge-super-quente {
  position: absolute;
  top: 10px;
  left: 10px;
  background: linear-gradient(135deg, #f43f5e, #fb923c);
  color: white;
  padding: 5px 12px;
  border-radius: 9px;
  font-size: 0.75rem;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(244, 63, 94, 0.4);
  z-index: 5;
  border: 1px solid rgba(255, 255, 255, 0.2);
  pointer-events: none;
}

.badge-super-quente strong {
  font-weight: 900;
  text-transform: uppercase;
}

.special-tab {
  border: 1px solid rgba(244, 63, 94, 0.2);
  color: #fb7185;
}

.special-tab:hover {
  background: rgba(244, 63, 94, 0.1);
}

.special-tab.active {
  background: linear-gradient(135deg, #f43f5e, #e11d48);
  border-color: #f43f5e;
  box-shadow: 0 4px 12px rgba(244, 63, 94, 0.3);
  color: white;
}

/* ── Advanced Filters ──────────────────────────────── */
.filters-bar-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 32px;
  width: 100%;
}

.btn-toggle-advanced {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1.5px solid var(--border);
  color: var(--text-light);
  padding: 11px 18px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  backdrop-filter: blur(12px);
}

.btn-toggle-advanced:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-active);
  color: var(--text);
}

.btn-toggle-advanced.active {
  background: rgba(99, 102, 241, 0.1);
  border-color: var(--primary);
  color: #818cf8;
}

.advanced-filters-panel {
  display: none;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  backdrop-filter: blur(20px);
  animation: slideDown 0.3s ease-out;
  box-shadow: var(--shadow);
}

.advanced-filters-panel.open {
  display: block;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.advanced-filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-group label {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05rem;
}

.dual-inputs {
  display: flex;
  gap: 8px;
}

.filter-input-small,
.filter-select {
  width: 100%;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s;
}

.filter-input-small:focus,
.filter-select:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(0, 0, 0, 0.3);
}

.filter-input-small::placeholder {
  color: var(--text-muted);
}

.advanced-filters-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.btn-clear-filters {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 10px 16px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-clear-filters:hover {
  color: var(--accent);
  background: rgba(244, 63, 94, 0.05);
}

.btn-apply-filters {
  background: var(--primary);
  border: none;
  color: #fff;
  padding: 10px 24px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-apply-filters:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

body.light-theme .filter-input-small,
body.light-theme .filter-select {
  background: #fff;
}

body.light-theme .btn-toggle-advanced {
  background: #fff;
}

/* ── Modal Overlay ─────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 12, 26, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}

.modal-content {
  background: var(--card);
  border: 1px solid var(--border-active);
  border-radius: 24px;
  width: 100%;
  max-width: 480px;
  padding: 32px;
  box-shadow: 0 32px 64px rgba(0, 0, 0, 0.6);
  text-align: center;
  animation: scaleUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-header {
  margin-bottom: 24px;
}

.modal-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  filter: drop-shadow(0 0 12px var(--primary-glow));
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}

.modal-body {
  margin-bottom: 32px;
}

.modal-body p {
  color: var(--text-light);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 12px;
}

.modal-body strong {
  color: #818cf8;
}

.modal-footer {
  display: flex;
  justify-content: center;
}

.btn-modal-close {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 14px 48px;
  border-radius: 14px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 10px 20px var(--primary-glow);
  width: 100%;
}

.btn-modal-close:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 12px 24px var(--primary-glow);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes scaleUp {
  from {
    opacity: 0;
    transform: scale(0.9);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

body.light-theme .modal-content {
  background: #fff;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.1);
}

/* ── App Tutorial ───────────────────────────────────── */
.tut-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: all;
  background: transparent;
}

.topbar.tutorial-mode {
  z-index: 10001 !important;
}

.tut-highlight {
  position: relative !important;
  z-index: 10002 !important;
  background: var(--bg) !important;
  border: 2px solid var(--primary) !important;
  border-radius: 10px !important;
  box-shadow: 0 0 0 9999px rgba(6, 12, 26, 0.85), 0 0 25px var(--primary-glow) !important;
  pointer-events: none !important;
}

.tut-modal {
  background: var(--card);
  border: 1px solid var(--border-active);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
  border-radius: var(--radius-lg);
  padding: 24px 30px;
  width: 100%;
  max-width: 360px;
  text-align: center;
  animation: tut-fade-up 0.5s ease-out;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10003;
}

.tut-progress {
  font-size: 0.8rem;
  background: rgba(99, 102, 241, 0.2);
  color: #818cf8;
  padding: 4px 10px;
  border-radius: 20px;
  display: inline-block;
  margin-bottom: 12px;
  font-weight: 700;
}

.tut-modal h2 {
  font-size: 1.3rem;
  margin-bottom: 10px;
  color: #fff;
}

.tut-modal p {
  color: var(--text-light);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 24px;
}

.tut-btn {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s;
}

.tut-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
}

.tut-arrow {
  position: fixed;
  font-size: 2.5rem;
  color: var(--primary);
  z-index: 10003;
  text-shadow: 0 0 15px var(--primary-glow);
  animation: tut-bounce 1.5s infinite;
  pointer-events: none;
  display: none;
}

@keyframes tut-fade-up {
  from {
    opacity: 0;
    transform: translate(-50%, 20px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes tut-bounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}
/* ── Trending Section (Prédios em Alta) ──────────────── */
.trending-section {
  margin-bottom: 32px;
}

.trending-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.trending-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}

.trending-subtitle {
  font-size: 0.85rem;
  color: var(--text-light);
  font-weight: 600;
}

.trending-carousel-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
}

.trending-btn {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text-light);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.trending-btn:hover {
  background: rgba(99, 102, 241, 0.15);
  color: #fff;
  border-color: rgba(99, 102, 241, 0.4);
  transform: scale(1.05);
}

.trending-btn:active {
  transform: scale(0.95);
}

.trending-btn svg {
  pointer-events: none;
}

.trending-list {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 8px 4px;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none;  /* IE and Edge */
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  flex: 1;
}

.trending-list::-webkit-scrollbar {
  display: none; /* WebKit */
}

.trending-card {
  flex: 0 0 260px;
  background: linear-gradient(145deg, var(--card), rgba(15, 23, 42, 0.4));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  scroll-snap-align: start;
}

.trending-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  transition: height 0.3s;
}

.trending-card.tipo-morna::before {
  background: #fbbf24;
}

.trending-card.tipo-quente::before {
  background: #f43f5e;
}

.trending-card:hover {
  transform: translateY(-6px);
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(99, 102, 241, 0.1) inset;
}

.trending-card:hover::before {
  height: 6px;
}

.trending-card-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 4px;
}

.trending-card-count {
  font-size: 0.8rem;
  color: var(--primary);
  font-weight: 800;
  background: rgba(99, 102, 241, 0.12);
  padding: 5px 12px;
  border-radius: 999px;
  align-self: flex-start;
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.trending-card-info {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Mobile specific overrides */
@media (max-width: 768px) {
  .trending-btn {
    display: none; /* Hide arrows on mobile to save space, rely on touch swipe */
  }
  
  .trending-card {
    flex: 0 0 220px;
    padding: 14px 16px;
  }
  
  .trending-header {
    flex-direction: column;
    gap: 4px;
  }
}
