/* ============================================
   NESTHARBOR — DESIGN SYSTEM
   Comprehensive styling foundation
   ============================================ */

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

:root {
  /* Brand Colors */
  --navy-900: #1a2332;
  --navy-800: #273656;
  --navy-700: #334b6e;
  --navy-600: #446b91;
  --teal-600: #0d9488;
  --teal-500: #14b8a6;
  --teal-400: #2dd4bf;
  --teal-100: #ccfbf1;
  --gold-500: #f59e0b;
  --gold-400: #fbbf24;
  --coral-500: #f87171;
  --coral-400: #fca5a5;

  /* Neutrals */
  --white: #ffffff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  /* Semantic */
  --bg: var(--white);
  --bg-alt: var(--gray-50);
  --text: var(--gray-800);
  --text-muted: var(--gray-500);
  --border: var(--gray-200);
  --primary: var(--navy-800);
  --primary-dark: var(--navy-900);
  --accent: var(--teal-600);
  --accent-light: var(--teal-100);
  --success: #10b981;
  --success-light: #d1fae5;
  --warning: var(--gold-500);
  --warning-light: #fef3c7;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --popular: var(--coral-500);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2.5rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -1px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 20px -5px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --shadow-xl: 0 20px 40px -10px rgba(0,0,0,0.15);

  /* Transitions */
  --tr-fast: 150ms ease;
  --tr-base: 250ms ease;
  --tr-slow: 400ms ease;

  /* Layout */
  --max-width: 1280px;
  --header-h: 72px;
}

/* ---------- BASE ---------- */
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1,h2,h3,h4,h5,h6 { font-weight: 700; line-height: 1.2; color: var(--navy-900); }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.5rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.75rem); }
a { color: var(--accent); text-decoration: none; transition: color var(--tr-fast); }
a:hover { color: var(--navy-800); }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
ul, ol { list-style: none; }

/* ---------- LAYOUT UTILITIES ---------- */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 var(--space-lg); }
.container-wide { max-width: 1440px; margin: 0 auto; padding: 0 var(--space-lg); }
.section { padding: var(--space-3xl) 0; }
.section-sm { padding: var(--space-2xl) 0; }
.section-tight { padding: var(--space-xl) 0; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.serif { font-family: var(--font-serif); }
.hidden { display: none !important; }
.grid { display: grid; gap: var(--space-lg); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.flex-wrap { flex-wrap: wrap; }

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-sm);
  padding: 0.75rem 1.75rem; border-radius: var(--radius-md);
  font-weight: 600; font-size: 0.95rem; text-decoration: none;
  transition: all var(--tr-base); cursor: pointer; white-space: nowrap;
  border: 2px solid transparent;
}
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-dark); color: var(--white); transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.btn-accent { background: var(--accent); color: var(--white); }
.btn-accent:hover { background: var(--teal-600); color: var(--white); transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.btn-outline { background: transparent; color: var(--primary); border-color: var(--border); }
.btn-outline:hover { border-color: var(--primary); background: var(--gray-50); }
.btn-ghost { background: transparent; color: var(--text); padding: 0.5rem 1rem; }
.btn-ghost:hover { background: var(--gray-100); }
.btn-white { background: var(--white); color: var(--primary); }
.btn-white:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.btn-lg { padding: 1rem 2.25rem; font-size: 1.05rem; }
.btn-sm { padding: 0.5rem 1.1rem; font-size: 0.85rem; }
.btn-block { display: flex; width: 100%; }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-success { background: var(--success); color: var(--white); }

/* ---------- BADGES ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.25rem 0.7rem; border-radius: var(--radius-full);
  font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
}
.badge-accent { background: var(--accent-light); color: var(--teal-600); }
.badge-navy { background: var(--navy-800); color: var(--white); }
.badge-gold { background: var(--warning-light); color: var(--warning); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-popular { background: var(--coral-400); color: var(--white); }
.badge-outline { background: transparent; border: 1px solid var(--border); color: var(--text-muted); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-info { background: #dbeafe; color: #2563eb; }

/* ---------- CARDS ---------- */
.card {
  background: var(--white); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); overflow: hidden;
  transition: box-shadow var(--tr-base), transform var(--tr-base);
}
.card:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); }
.card-body { padding: var(--space-lg); }
.card-flat { box-shadow: none; border: 1px solid var(--border); }

/* ---------- HEADER / NAVBAR ---------- */
.navbar {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(255,255,255,0.97); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
  display: flex; align-items: center;
}
.navbar-inner { display: flex; align-items: center; justify-content: space-between; width: 100%; gap: var(--space-xl); }
.navbar-logo { display: flex; align-items: center; gap: var(--space-sm); font-weight: 800; font-size: 1.35rem; color: var(--navy-900); }
.navbar-logo img { width: 36px; height: 36px; }
.navbar-logo span { font-family: var(--font-serif); }
.navbar-logo .accent { color: var(--accent); }
.navbar-links { display: flex; align-items: center; gap: var(--space-xl); }
.navbar-links a { color: var(--gray-700); font-weight: 500; font-size: 0.95rem; }
.navbar-links a:hover { color: var(--primary); }
.navbar-actions { display: flex; align-items: center; gap: var(--space-md); }
.navbar-search-mini {
  display: flex; align-items: center; gap: var(--space-sm);
  padding: 0.5rem 1rem; border: 1px solid var(--border);
  border-radius: var(--radius-full); font-size: 0.85rem; color: var(--text-muted);
  cursor: pointer; transition: all var(--tr-fast);
}
.navbar-search-mini:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.mobile-toggle { display: none; font-size: 1.5rem; color: var(--navy-900); }

/* ---------- HERO ---------- */
.hero {
  position: relative; min-height: 85vh; display: flex; align-items: center;
  overflow: hidden;
}
.hero-bg { position: absolute; inset: 0; z-index: 0; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; }
.hero-bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(26,35,50,0.75) 0%, rgba(26,35,50,0.45) 50%, rgba(13,148,136,0.3) 100%); }
.hero-content { position: relative; z-index: 1; color: var(--white); padding: var(--space-3xl) 0; }
.hero-content h1 { color: var(--white); margin-bottom: var(--space-md); }
.hero-content p { font-size: 1.15rem; max-width: 580px; margin-bottom: var(--space-xl); opacity: 0.95; }
.hero-search {
  background: var(--white); border-radius: var(--radius-lg);
  padding: var(--space-md); box-shadow: var(--shadow-xl);
  display: grid; grid-template-columns: 1.5fr 1fr 1fr auto; gap: var(--space-sm);
  max-width: 900px;
}
.hero-search-field { display: flex; flex-direction: column; gap: 2px; padding: 0.5rem 0.75rem; }
.hero-search-field label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.05em; }
.hero-search-field input, .hero-search-field select {
  border: none; outline: none; font-size: 0.9rem; color: var(--text); background: transparent;
}
.hero-search .btn { align-self: stretch; }

/* ---------- PROPERTY CARDS ---------- */
.property-card { cursor: pointer; position: relative; }
.property-card .card-img { position: relative; height: 240px; overflow: hidden; }
.property-card .card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--tr-slow); }
.property-card:hover .card-img img { transform: scale(1.06); }
.property-card .img-badges { position: absolute; top: var(--space-sm); left: var(--space-sm); display: flex; gap: var(--space-xs); }
.property-card .img-fav { position: absolute; top: var(--space-sm); right: var(--space-sm); width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,0.9); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all var(--tr-fast); }
.property-card .img-fav:hover { background: var(--white); }
.property-card .img-fav.active { color: var(--coral-500); }
.property-card .card-body { padding: var(--space-md) var(--space-lg); }
.property-card .card-price { font-size: 1.25rem; font-weight: 800; color: var(--navy-900); }
.property-card .card-price .period { font-size: 0.8rem; font-weight: 500; color: var(--text-muted); }
.property-card .card-loc { font-size: 0.85rem; color: var(--text-muted); margin: 0.25rem 0; }
.property-card .card-specs { display: flex; gap: var(--space-md); font-size: 0.85rem; color: var(--gray-600); margin-top: var(--space-sm); padding-top: var(--space-sm); border-top: 1px solid var(--border); }
.property-card .card-specs span { display: flex; align-items: center; gap: 4px; }

/* ---------- FILTERS SIDEBAR ---------- */
.filter-bar {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: var(--space-lg);
  position: sticky; top: calc(var(--header-h) + var(--space-md));
}
.filter-group { padding: var(--space-md) 0; border-bottom: 1px solid var(--border); }
.filter-group:last-child { border-bottom: none; }
.filter-group h4 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: var(--space-sm); color: var(--navy-800); }
.filter-chips { display: flex; flex-wrap: wrap; gap: var(--space-sm); }
.filter-chip {
  padding: 0.35rem 0.8rem; border: 1px solid var(--border); border-radius: var(--radius-full);
  font-size: 0.8rem; cursor: pointer; transition: all var(--tr-fast); color: var(--gray-700);
}
.filter-chip:hover { border-color: var(--primary); }
.filter-chip.active { background: var(--primary); color: var(--white); border-color: var(--primary); }
.price-range { display: flex; gap: var(--space-sm); align-items: center; }
.price-range input { flex: 1; padding: 0.4rem 0.6rem; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 0.85rem; }

/* ---------- FORM ELEMENTS ---------- */
.form-group { margin-bottom: var(--space-md); }
.form-label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: var(--space-xs); color: var(--gray-700); }
.form-label .req { color: var(--danger); }
.form-control {
  width: 100%; padding: 0.7rem 0.9rem; border: 1px solid var(--border);
  border-radius: var(--radius-md); font-size: 0.95rem; font-family: inherit;
  transition: border-color var(--tr-fast), box-shadow var(--tr-fast); background: var(--white);
}
.form-control:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
textarea.form-control { resize: vertical; min-height: 100px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-md); }
.form-hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.75rem center; padding-right: 2rem; }

/* ---------- TOGGLE SWITCH ---------- */
.toggle { position: relative; display: inline-flex; align-items: center; cursor: pointer; gap: var(--space-sm); }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-track { width: 44px; height: 24px; background: var(--gray-300); border-radius: var(--radius-full); position: relative; transition: background var(--tr-base); }
.toggle-track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; background: var(--white); border-radius: 50%; transition: transform var(--tr-base); box-shadow: var(--shadow-sm); }
.toggle input:checked + .toggle-track { background: var(--accent); }
.toggle input:checked + .toggle-track::after { transform: translateX(20px); }

/* ---------- MAP ---------- */
#map, .map-container { width: 100%; height: 500px; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border); }
.map-full { height: 70vh; border-radius: 0; }
.leaflet-popup-content-wrapper { border-radius: var(--radius-md); box-shadow: var(--shadow-lg); }
.leaflet-popup-content { margin: 0; width: 220px !important; }
.popup-card img { width: 100%; height: 120px; object-fit: cover; border-radius: var(--radius-md) var(--radius-md) 0 0; }
.popup-card .popup-body { padding: 0.6rem 0.8rem; }
.popup-card .popup-price { font-weight: 800; color: var(--navy-900); font-size: 1.1rem; }
.popup-card .popup-loc { font-size: 0.78rem; color: var(--text-muted); }
.popup-card .popup-specs { font-size: 0.75rem; color: var(--gray-600); margin-top: 4px; }

/* ---------- GALLERY ---------- */
.gallery-main { width: 100%; height: 460px; border-radius: var(--radius-lg); overflow: hidden; position: relative; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--space-sm); margin-top: var(--space-sm); }
.gallery-thumb { height: 80px; border-radius: var(--radius-sm); overflow: hidden; cursor: pointer; border: 2px solid transparent; transition: border-color var(--tr-fast); }
.gallery-thumb.active { border-color: var(--primary); }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,0.9); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; color: var(--navy-900); cursor: pointer; z-index: 2; }
.gallery-nav.prev { left: var(--space-sm); }
.gallery-nav.next { right: var(--space-sm); }

/* ---------- AMENITY GRID ---------- */
.amenity-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: var(--space-md); }
.amenity-item { display: flex; align-items: center; gap: var(--space-sm); font-size: 0.9rem; color: var(--gray-700); padding: var(--space-sm); border-radius: var(--radius-sm); background: var(--gray-50); }
.amenity-item .icon { width: 36px; height: 36px; border-radius: 50%; background: var(--accent-light); color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0; }

/* ---------- CHAT WIDGET ---------- */
.chat-widget { position: fixed; bottom: 20px; right: 20px; z-index: 9999; }
.chat-toggle {
  width: 60px; height: 60px; border-radius: 50%; background: var(--primary);
  color: var(--white); font-size: 1.5rem; display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-xl); cursor: pointer; transition: transform var(--tr-base);
  position: relative;
}
.chat-toggle:hover { transform: scale(1.08); }
.chat-toggle .chat-pulse { position: absolute; width: 100%; height: 100%; border-radius: 50%; border: 2px solid var(--primary); animation: pulse 2s infinite; }
@keyframes pulse { 0% { transform: scale(1); opacity: 1; } 100% { transform: scale(1.6); opacity: 0; } }
.chat-badge { position: absolute; top: -4px; right: -4px; width: 22px; height: 22px; background: var(--coral-500); color: var(--white); border-radius: 50%; font-size: 0.7rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.chat-window {
  position: fixed; bottom: 90px; right: 20px; width: 380px; max-height: 600px;
  background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-xl);
  display: none; flex-direction: column; overflow: hidden;
}
.chat-window.open { display: flex; }
.chat-header { background: var(--primary); color: var(--white); padding: var(--space-md); display: flex; align-items: center; gap: var(--space-sm); }
.chat-header .avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }
.chat-header .info { flex: 1; }
.chat-header .info .name { font-weight: 700; font-size: 0.95rem; }
.chat-header .info .status { font-size: 0.75rem; opacity: 0.85; display: flex; align-items: center; gap: 4px; }
.chat-header .info .status .dot { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; }
.chat-header .close { color: var(--white); font-size: 1.3rem; cursor: pointer; opacity: 0.7; }
.chat-header .close:hover { opacity: 1; }
.chat-messages { flex: 1; overflow-y: auto; padding: var(--space-md); display: flex; flex-direction: column; gap: var(--space-sm); max-height: 380px; background: var(--gray-50); }
.chat-msg { max-width: 80%; padding: 0.6rem 0.9rem; border-radius: var(--radius-lg); font-size: 0.88rem; line-height: 1.4; }
.chat-msg.bot { background: var(--white); border: 1px solid var(--border); align-self: flex-start; border-bottom-left-radius: 4px; }
.chat-msg.user { background: var(--primary); color: var(--white); align-self: flex-end; border-bottom-right-radius: 4px; }
.chat-msg.system { background: var(--warning-light); color: var(--warning); align-self: center; font-size: 0.78rem; text-align: center; max-width: 90%; }
.chat-msg .msg-time { font-size: 0.68rem; opacity: 0.6; margin-top: 4px; }
.chat-quick { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 var(--space-md) var(--space-sm); background: var(--gray-50); }
.chat-quick button { padding: 0.35rem 0.7rem; border: 1px solid var(--border); border-radius: var(--radius-full); font-size: 0.75rem; background: var(--white); cursor: pointer; transition: all var(--tr-fast); }
.chat-quick button:hover { border-color: var(--accent); color: var(--accent); }
.chat-input { display: flex; padding: var(--space-sm); border-top: 1px solid var(--border); gap: var(--space-sm); background: var(--white); }
.chat-input input { flex: 1; padding: 0.55rem 0.8rem; border: 1px solid var(--border); border-radius: var(--radius-full); font-size: 0.88rem; outline: none; }
.chat-input input:focus { border-color: var(--accent); }
.chat-input button { width: 38px; height: 38px; border-radius: 50%; background: var(--accent); color: var(--white); display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.typing-indicator { display: flex; gap: 4px; padding: 0.6rem 0.9rem; }
.typing-indicator span { width: 8px; height: 8px; border-radius: 50%; background: var(--gray-400); animation: typing 1.4s infinite; }
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-6px); } }

/* ---------- DASHBOARD LAYOUT ---------- */
.dash-layout { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; background: var(--bg-alt); }
.dash-sidebar {
  background: var(--navy-900); color: var(--white); padding: var(--space-lg) 0;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.dash-sidebar .brand { padding: 0 var(--space-lg) var(--space-lg); font-size: 1.2rem; font-weight: 800; font-family: var(--font-serif); border-bottom: 1px solid rgba(255,255,255,0.1); }
.dash-sidebar .brand .accent { color: var(--teal-400); }
.dash-nav { padding: var(--space-md) 0; }
.dash-nav a {
  display: flex; align-items: center; gap: var(--space-md); padding: 0.7rem var(--space-lg);
  color: rgba(255,255,255,0.7); font-size: 0.9rem; font-weight: 500; transition: all var(--tr-fast); border-left: 3px solid transparent;
}
.dash-nav a:hover { background: rgba(255,255,255,0.05); color: var(--white); }
.dash-nav a.active { background: rgba(255,255,255,0.08); color: var(--white); border-left-color: var(--teal-400); }
.dash-nav a .nav-icon { font-size: 1.1rem; width: 24px; text-align: center; }
.dash-nav a .nav-badge { margin-left: auto; background: var(--coral-500); color: var(--white); font-size: 0.7rem; padding: 1px 7px; border-radius: var(--radius-full); }
.dash-main { padding: var(--space-xl); overflow-x: hidden; }
.dash-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-xl); }
.dash-title h1 { font-size: 1.6rem; }
.dash-title p { color: var(--text-muted); font-size: 0.9rem; }

/* ---------- STAT CARDS ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--space-lg); margin-bottom: var(--space-xl); }
.stat-card { background: var(--white); border-radius: var(--radius-lg); padding: var(--space-lg); box-shadow: var(--shadow-sm); }
.stat-card .stat-icon { width: 48px; height: 48px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; font-size: 1.4rem; margin-bottom: var(--space-md); }
.stat-card .stat-value { font-size: 1.8rem; font-weight: 800; color: var(--navy-900); }
.stat-card .stat-label { font-size: 0.85rem; color: var(--text-muted); }
.stat-card .stat-trend { font-size: 0.78rem; margin-top: var(--space-xs); display: flex; align-items: center; gap: 4px; }
.stat-trend.up { color: var(--success); }
.stat-trend.down { color: var(--danger); }

/* ---------- TABLES ---------- */
.table-wrap { background: var(--white); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
table.data-table { width: 100%; border-collapse: collapse; }
table.data-table th { text-align: left; padding: 0.9rem var(--space-md); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); background: var(--gray-50); border-bottom: 1px solid var(--border); font-weight: 700; }
table.data-table td { padding: 0.9rem var(--space-md); border-bottom: 1px solid var(--border); font-size: 0.9rem; }
table.data-table tr:last-child td { border-bottom: none; }
table.data-table tr:hover td { background: var(--gray-50); }
.table-img { width: 50px; height: 38px; border-radius: var(--radius-sm); object-fit: cover; }

/* ---------- TABS ---------- */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: var(--space-xl); }
.tab { padding: 0.75rem 1.25rem; font-weight: 600; font-size: 0.9rem; color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all var(--tr-fast); }
.tab:hover { color: var(--primary); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ---------- MODAL ---------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(26,35,50,0.6); backdrop-filter: blur(4px); z-index: 5000; display: none; align-items: center; justify-content: center; padding: var(--space-lg); }
.modal-overlay.open { display: flex; }
.modal { background: var(--white); border-radius: var(--radius-lg); max-width: 600px; width: 100%; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-xl); }
.modal-header { padding: var(--space-lg); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-header h3 { font-size: 1.25rem; }
.modal-header .close { font-size: 1.5rem; color: var(--text-muted); cursor: pointer; }
.modal-body { padding: var(--space-lg); }
.modal-footer { padding: var(--space-lg); border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: var(--space-sm); }

/* ---------- NOTIFICATION TOAST ---------- */
.toast-container { position: fixed; top: 80px; right: 20px; z-index: 6000; display: flex; flex-direction: column; gap: var(--space-sm); }
.toast { background: var(--white); border-radius: var(--radius-md); box-shadow: var(--shadow-xl); padding: var(--space-md) var(--space-lg); display: flex; align-items: center; gap: var(--space-sm); min-width: 280px; max-width: 380px; animation: slideIn 0.3s ease; border-left: 4px solid var(--accent); }
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ---------- PAYMENT METHODS ---------- */
.pay-method { border: 2px solid var(--border); border-radius: var(--radius-md); padding: var(--space-md); cursor: pointer; transition: all var(--tr-fast); display: flex; align-items: center; gap: var(--space-md); }
.pay-method:hover { border-color: var(--primary); }
.pay-method.selected { border-color: var(--accent); background: var(--accent-light); }
.pay-method.locked { opacity: 0.5; cursor: not-allowed; position: relative; }
.pay-method .lock-icon { position: absolute; top: 8px; right: 8px; font-size: 1rem; }
.pay-method .pm-icon { font-size: 2rem; }
.pay-method .pm-info { flex: 1; }
.pay-method .pm-name { font-weight: 700; font-size: 0.95rem; }
.pay-method .pm-desc { font-size: 0.78rem; color: var(--text-muted); }

/* ---------- PROGRESS / STEPS ---------- */
.steps { display: flex; justify-content: space-between; margin-bottom: var(--space-xl); position: relative; }
.steps::before { content: ''; position: absolute; top: 18px; left: 5%; right: 5%; height: 2px; background: var(--border); z-index: 0; }
.step { display: flex; flex-direction: column; align-items: center; gap: var(--space-xs); position: relative; z-index: 1; }
.step .step-num { width: 38px; height: 38px; border-radius: 50%; background: var(--white); border: 2px solid var(--border); display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--text-muted); transition: all var(--tr-base); }
.step.active .step-num { border-color: var(--accent); background: var(--accent); color: var(--white); }
.step.complete .step-num { border-color: var(--success); background: var(--success); color: var(--white); }
.step .step-label { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); }
.step.active .step-label { color: var(--primary); }

/* ---------- NEARBY POI ---------- */
.poi-item { display: flex; align-items: center; gap: var(--space-md); padding: var(--space-md); border-radius: var(--radius-md); background: var(--gray-50); margin-bottom: var(--space-sm); }
.poi-item .poi-icon { width: 44px; height: 44px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; font-size: 1.3rem; flex-shrink: 0; }
.poi-item .poi-info { flex: 1; }
.poi-item .poi-name { font-weight: 600; font-size: 0.9rem; }
.poi-item .poi-dist { font-size: 0.78rem; color: var(--text-muted); }
.poi-item .poi-walk { font-size: 0.72rem; background: var(--success-light); color: var(--success); padding: 2px 8px; border-radius: var(--radius-full); }

/* ---------- INSTALLMENT CALCULATOR ---------- */
.installment-box { background: linear-gradient(135deg, var(--navy-800), var(--teal-600)); color: var(--white); border-radius: var(--radius-lg); padding: var(--space-xl); }
.installment-box h3 { color: var(--white); }
.installment-row { display: flex; justify-content: space-between; padding: var(--space-sm) 0; border-bottom: 1px solid rgba(255,255,255,0.15); font-size: 0.95rem; }
.installment-row:last-child { border-bottom: none; }
.installment-row .label { opacity: 0.85; }
.installment-row .value { font-weight: 700; }
.installment-total { font-size: 1.5rem; font-weight: 800; margin-top: var(--space-sm); }

/* ---------- FOOTER ---------- */
.footer { background: var(--navy-900); color: rgba(255,255,255,0.7); padding: var(--space-3xl) 0 var(--space-xl); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr; gap: var(--space-xl); margin-bottom: var(--space-2xl); }
.footer-brand .logo { display: flex; align-items: center; gap: var(--space-sm); font-size: 1.3rem; font-weight: 800; color: var(--white); margin-bottom: var(--space-md); font-family: var(--font-serif); }
.footer-brand .logo .accent { color: var(--teal-400); }
.footer-brand p { font-size: 0.9rem; max-width: 300px; margin-bottom: var(--space-md); }
.footer-col h4 { color: var(--white); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: var(--space-md); }
.footer-col ul li { margin-bottom: 0.6rem; }
.footer-col ul li a { color: rgba(255,255,255,0.6); font-size: 0.88rem; }
.footer-col ul li a:hover { color: var(--teal-400); }
.footer-social { display: flex; gap: var(--space-sm); margin-top: var(--space-md); }
.footer-social a { width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,0.1); display: flex; align-items: center; justify-content: center; color: var(--white); transition: all var(--tr-fast); }
.footer-social a:hover { background: var(--teal-600); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: var(--space-lg); display: flex; justify-content: space-between; align-items: center; font-size: 0.82rem; }
.footer-bottom .pay-icons { display: flex; gap: var(--space-sm); flex-wrap: wrap; }
.footer-bottom .pay-icons span { padding: 4px 10px; border: 1px solid rgba(255,255,255,0.2); border-radius: var(--radius-sm); font-size: 0.72rem; }

/* ---------- MISC ---------- */
.divider { height: 1px; background: var(--border); margin: var(--space-xl) 0; }
.empty-state { text-align: center; padding: var(--space-3xl) var(--space-lg); color: var(--text-muted); }
.empty-state .icon { font-size: 3rem; margin-bottom: var(--space-md); }
.alert { padding: var(--space-md) var(--space-lg); border-radius: var(--radius-md); margin-bottom: var(--space-md); display: flex; gap: var(--space-sm); align-items: flex-start; }
.alert-info { background: var(--accent-light); color: var(--teal-600); }
.alert-warning { background: var(--warning-light); color: var(--warning); }
.alert-success { background: var(--success-light); color: var(--success); }
.alert-danger { background: var(--danger-light); color: var(--danger); }
.section-header { text-align: center; margin-bottom: var(--space-2xl); }
.section-header h2 { margin-bottom: var(--space-sm); }
.section-header p { color: var(--text-muted); max-width: 600px; margin: 0 auto; font-size: 1.05rem; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.8rem; font-weight: 700; color: var(--accent); margin-bottom: var(--space-sm); }
.value-prop { text-align: center; padding: var(--space-lg); }
.value-prop .vp-icon { width: 64px; height: 64px; border-radius: var(--radius-lg); background: var(--accent-light); color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 1.8rem; margin: 0 auto var(--space-md); }
.value-prop h3 { margin-bottom: var(--space-sm); }
.value-prop p { color: var(--text-muted); font-size: 0.95rem; }
.testimonial-card { background: var(--white); border-radius: var(--radius-lg); padding: var(--space-xl); box-shadow: var(--shadow-sm); position: relative; }
.testimonial-card .quote-mark { font-size: 3rem; color: var(--accent-light); font-family: var(--font-serif); line-height: 1; margin-bottom: var(--space-sm); }
.testimonial-card .stars { color: var(--gold-400); margin-bottom: var(--space-sm); font-size: 1.1rem; }
.testimonial-card .quote-text { font-size: 1rem; color: var(--gray-700); margin-bottom: var(--space-md); font-style: italic; }
.testimonial-card .author { display: flex; align-items: center; gap: var(--space-sm); }
.testimonial-card .author .avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--navy-800); color: var(--white); display: flex; align-items: center; justify-content: center; font-weight: 700; }
.testimonial-card .author .name { font-weight: 700; font-size: 0.9rem; }
.testimonial-card .author .role { font-size: 0.78rem; color: var(--text-muted); }
.city-card { position: relative; height: 220px; border-radius: var(--radius-lg); overflow: hidden; cursor: pointer; }
.city-card img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--tr-slow); }
.city-card:hover img { transform: scale(1.08); }
.city-card .overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(26,35,50,0.8), transparent 60%); display: flex; align-items: flex-end; padding: var(--space-lg); }
.city-card .overlay .name { color: var(--white); font-size: 1.3rem; font-weight: 700; }
.city-card .overlay .count { color: rgba(255,255,255,0.8); font-size: 0.85rem; }
.timeline-item { display: flex; gap: var(--space-md); padding: var(--space-md) 0; }
.timeline-item .tl-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); flex-shrink: 0; margin-top: 4px; position: relative; }
.timeline-item .tl-dot::before { content: ''; position: absolute; top: 16px; left: 5px; width: 2px; height: 100%; background: var(--border); }
.timeline-item:last-child .tl-dot::before { display: none; }
.timeline-item .tl-content h4 { font-size: 0.95rem; margin-bottom: 2px; }
.timeline-item .tl-content p { font-size: 0.85rem; color: var(--text-muted); }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .hero-search { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .navbar-links { display: none; position: absolute; top: var(--header-h); left: 0; right: 0; background: var(--white); flex-direction: column; padding: var(--space-lg); box-shadow: var(--shadow-lg); border-bottom: 1px solid var(--border); gap: var(--space-md); }
  .navbar-links.open { display: flex; }
  .mobile-toggle { display: block; }
  .navbar-search-mini { display: none; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .hero { min-height: auto; padding: var(--space-2xl) 0; }
  .hero-search { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-bottom { flex-direction: column; gap: var(--space-md); }
  .dash-layout { grid-template-columns: 1fr; }
  .dash-sidebar { position: fixed; left: -250px; z-index: 100; transition: left var(--tr-base); width: 250px; }
  .dash-sidebar.open { left: 0; }
  .chat-window { width: calc(100vw - 40px); right: 20px; }
  .form-row { grid-template-columns: 1fr; }
  .gallery-thumbs { grid-template-columns: repeat(4, 1fr); }
  .section { padding: var(--space-2xl) 0; }
  .steps { flex-wrap: wrap; gap: var(--space-md); }
  .steps::before { display: none; }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  .gallery-thumbs { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- PRINT ---------- */
@media print {
  .navbar, .footer, .chat-widget, .btn { display: none !important; }
  .card, .stat-card, .table-wrap { box-shadow: none; border: 1px solid var(--border); }
}

/* ---------- AFFORDABILITY / MORTGAGE CALCULATOR ---------- */
.calc-box { background: var(--gray-50); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-lg); }
.calc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--space-md); margin-bottom: var(--space-md); }
.calc-result { margin-top: var(--space-md); padding: var(--space-md); border-radius: var(--radius-md); background: var(--white); border: 1px solid var(--border); font-size: 0.92rem; display: none; }
.calc-result.show { display: block; }
.calc-result .big { font-size: 1.7rem; font-weight: 800; color: var(--accent); }
.calc-result .row { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px dashed var(--border); }
.calc-result .row:last-child { border-bottom: none; }
.calc-result .note { font-size: 0.78rem; color: var(--text-muted); margin-top: var(--space-sm); }

/* ---------- NAV CONTROLS (currency + theme) ---------- */
.nav-currency { padding: 6px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 0.8rem; font-family: var(--font-sans); background: var(--white); color: var(--text); cursor: pointer; }
.nav-icon-btn { background: transparent; border: 1px solid var(--border); border-radius: var(--radius-sm); width: 34px; height: 34px; cursor: pointer; font-size: 1rem; line-height: 1; transition: background 0.15s; }
.nav-icon-btn:hover { background: var(--gray-100); }

/* ---------- COMPARE BAR ---------- */
.compare-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1500; background: var(--navy-900); color: #fff; box-shadow: 0 -4px 20px rgba(0,0,0,0.25); }
.compare-bar-inner { max-width: 1240px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.compare-items { display: flex; gap: 10px; flex-wrap: wrap; }
.compare-chip { display: flex; align-items: center; gap: 6px; background: rgba(255,255,255,0.12); border-radius: 999px; padding: 4px 6px 4px 4px; font-size: 0.78rem; }
.compare-chip img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.compare-chip span { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compare-chip button { background: rgba(255,255,255,0.2); border: none; color: #fff; border-radius: 50%; width: 18px; height: 18px; cursor: pointer; line-height: 1; }
.compare-actions { display: flex; gap: 8px; }

/* ---------- COMPARE TABLE ---------- */
.compare-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); }
table.compare-table { width: 100%; border-collapse: collapse; min-width: 640px; }
table.compare-table th, table.compare-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); text-align: left; font-size: 0.9rem; vertical-align: top; }
table.compare-table th { background: var(--gray-50); font-weight: 700; width: 180px; color: var(--navy-900); }
table.compare-table thead th { text-align: center; }
table.compare-table thead img { width: 100%; height: 110px; object-fit: cover; border-radius: var(--radius-sm); margin-bottom: 6px; }
table.compare-table .best { color: var(--success); font-weight: 700; }

/* ---------- REVIEWS ---------- */
.review-item { border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-md); margin-bottom: var(--space-sm); background: var(--white); }
.review-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.review-stars { color: var(--gold-500); font-size: 1rem; letter-spacing: 2px; }
.review-name { font-weight: 700; color: var(--navy-900); }
.review-date { font-size: 0.75rem; color: var(--text-muted); }
.rating-summary { display: flex; align-items: center; gap: var(--space-md); padding: var(--space-md); background: var(--gray-50); border-radius: var(--radius-md); margin-bottom: var(--space-md); }
.rating-summary .avg { font-size: 2.4rem; font-weight: 800; color: var(--navy-900); line-height: 1; }
.star-input { font-size: 1.8rem; color: var(--gray-300); cursor: pointer; letter-spacing: 4px; }
.star-input span.on { color: var(--gold-500); }

/* ---------- DARK MODE ---------- */
[data-theme="dark"] {
  --white: #0f1621;
  --gray-50: #131c29;
  --gray-100: #1a2534;
  --gray-200: #26333f;
  --gray-300: #3a4a5a;
  --gray-400: #6b7c8f;
  --gray-500: #9aa7b4;
  --gray-600: #b8c2cc;
  --gray-700: #d3dae1;
  --gray-800: #e7ecf1;
  --gray-900: #f5f8fa;
  --bg: #0b1119;
  --bg-alt: #131c29;
  --text: #e7ecf1;
  --text-muted: #9aa7b4;
  --border: #26333f;
  --navy-900: #e7ecf1;
  --accent-light: rgba(13,148,136,0.18);
  --success-light: rgba(16,185,129,0.18);
  --warning-light: rgba(245,158,11,0.18);
  --danger-light: rgba(239,68,68,0.18);
}
[data-theme="dark"] body { background: var(--bg); color: var(--text); }
[data-theme="dark"] .navbar { background: #0f1621; }
[data-theme="dark"] .card, [data-theme="dark"] .filter-bar, [data-theme="dark"] .modal,
[data-theme="dark"] .map-results-panel, [data-theme="dark"] .legend, [data-theme="dark"] .calc-box,
[data-theme="dark"] .review-item, [data-theme="dark"] .auth-card, [data-theme="dark"] .installment-box { background: #131c29; }
[data-theme="dark"] .nav-currency, [data-theme="dark"] .nav-icon-btn { background: #1a2534; color: var(--text); }
[data-theme="dark"] table.compare-table th { background: #1a2534; color: var(--text); }
[data-theme="dark"] .footer { background: #0a0f16; }

/* ---------- CARD COMPARE BUTTON ---------- */
.property-card .img-compare { position: absolute; top: calc(var(--space-sm) + 42px); right: var(--space-sm); width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,0.9); display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 1rem; font-weight: 700; color: var(--navy-800); transition: all var(--tr-fast); }
.property-card .img-compare:hover { background: var(--white); }
.property-card .img-compare.active { background: var(--accent) !important; color: #fff !important; }
