/* ═══════════════════════════════════════════════════════
   Goal Sys Immobiliare – Unified Design System
   Agent-First MLS Platform · Top-Tab Navigation
   ═══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── CSS Custom Properties ── */
:root {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: #1e293b;
  --bg-topbar: rgba(2, 6, 23, 0.85); /* Darker than background for distinct header */
  --bg-card-hover: #334155;
  --bg-input: #0f172a;
  --border: #334155;
  --border-light: #475569;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-glow: rgba(37, 99, 235, 0.15);
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --pending: #8b5cf6;
  --glass: rgba(15, 23, 42, 0.85);
  --accent-glass: rgba(37, 99, 235, 0.08);
  --glass-border: rgba(255,255,255,0.06);
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-glow: 0 0 20px rgba(37, 99, 235, 0.2);
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --topbar-height: 83px;
  --transition: 0.2s ease-in-out;
}

[data-theme="light"] {
  --bg-primary: #f1f5f9; /* Slate-100 to make white cards pop */
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-topbar: #e2e8f0; /* Distinct light gray for topbar in light mode */
  --bg-card-hover: #f8fafc;
  --bg-input: #ffffff;
  --border: #e2e8f0;
  --border-light: #cbd5e1;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --glass: rgba(255,255,255,0.9);
  --accent-glass: rgba(255, 255, 255, 0.95);
  --glass-border: rgba(0,0,0,0.05);
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* ── Reset & Base ── */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; border: none; outline: none; }
input, select, textarea { font-family: inherit; outline: none; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ══════════════════════════════════
   TOP BAR
   ══════════════════════════════════ */
.top-bar {
  position: fixed; top: 1cm; left: 0; right: 0; z-index: 100;
  height: var(--topbar-height);
  background: #EBDDBE; /* Updated background to #EBDDBE */
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 24px;
  gap: 16px;
}

.top-bar-logo {
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
}
.top-bar-logo .main-logo {
  height: 60px; /* Adjusted to fit the taller top bar */
  width: auto;
  object-fit: contain;
}

/* ── Top Tabs ── */
.top-tabs {
  display: flex; align-items: center; gap: 4px;
  margin: 0 auto;
  background: var(--bg-primary);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}
.top-tab {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  transition: all var(--transition);
  white-space: nowrap;
  position: relative;
}
.top-tab:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}
.top-tab.active {
  color: var(--accent);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}
.top-tab .tab-icon { font-size: 15px; }
.top-tab .tab-badge {
  position: absolute; top: 2px; right: 4px;
  width: 8px; height: 8px;
  background: var(--danger);
  border-radius: 50%;
}

/* ── Top Bar Actions ── */
.top-bar-actions {
  display: flex; align-items: center; gap: 6px;
  flex-shrink: 0;
}
.top-bar-btn {
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
  position: relative;
}
.top-bar-btn:hover { background: var(--bg-card); color: var(--text-primary); }
.top-bar-btn .notif-dot {
  position: absolute; top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--bg-secondary);
}

/* ── User Menu ── */
.user-menu-wrapper { position: relative; }
.user-menu-trigger {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 12px 4px 4px;
  border-radius: var(--radius-xl);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition);
}
.user-menu-trigger:hover { border-color: var(--accent); }
.user-menu-trigger .user-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: #00478F;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 11px; color: var(--bg-primary);
}
.user-menu-trigger .user-name { font-size: 13px; font-weight: 600; }

.user-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: 260px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--transition);
  z-index: 200;
  overflow: hidden;
}
.user-dropdown.open { opacity: 1; visibility: visible; transform: translateY(0); }
.user-dropdown-header {
  padding: 16px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
}
.user-dropdown-header .dd-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: #00478F;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px; color: var(--bg-primary);
}
.user-dropdown-header .dd-info { flex: 1; }
.user-dropdown-header .dd-name { font-size: 14px; font-weight: 700; }
.user-dropdown-header .dd-role { font-size: 12px; color: var(--text-muted); }
.user-dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  font-size: 13px; font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition);
  cursor: pointer;
}
.user-dropdown-item:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.user-dropdown-item .dd-icon { font-size: 16px; width: 20px; text-align: center; }

/* ══════════════════════════════════
   MAIN CONTENT
   ══════════════════════════════════ */
.main-content {
  margin-top: calc(var(--topbar-height) + 1cm);
  min-height: calc(100vh - var(--topbar-height) - 1cm);
}

.page-content { padding: 28px; max-width: 1400px; margin: 0 auto; }
.page-header { margin-bottom: 24px; }
.page-title { font-size: 24px; font-weight: 700; margin-bottom: 4px; }
.page-subtitle { color: var(--text-secondary); font-size: 14px; }

/* ── Views ── */
.view { display: none; animation: fadeIn 0.3s ease; }
.view.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ══════════════════════════════════
   CARDS
   ══════════════════════════════════ */
.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px;
  transition: all var(--transition);
}
.card:hover { border-color: var(--border-light); }

/* ══════════════════════════════════
   INSERISCI TAB – Insert Form
   ══════════════════════════════════ */
.insert-form-container {
  display: grid; grid-template-columns: 1fr; gap: 24px;
}
.insert-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.insert-section h3 {
  font-size: 16px; font-weight: 700;
  margin-bottom: 20px; padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
}
.insert-section h3 .section-icon { font-size: 18px; }

.reserved-section {
  border-left: 4px solid var(--pending);
  position: relative;
}
.reserved-section::before {
  content: '🔒';
  position: absolute; top: 16px; right: 16px;
  font-size: 20px; opacity: 0.4;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.form-grid-3 { grid-template-columns: repeat(3, 1fr); }
.form-grid-2 { grid-template-columns: repeat(2, 1fr); }
.full-width { grid-column: 1 / -1; }

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  transition: all var(--transition);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-muted); }
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238892a8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}
.form-select option { background: var(--bg-card); color: var(--text-primary); }
.form-textarea { resize: vertical; min-height: 80px; }

.form-check {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0;
  cursor: pointer;
}
.form-check input[type="checkbox"] {
  width: 18px; height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}
.form-check-label { font-size: 14px; color: var(--text-primary); user-select: none; }

.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }

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

/* Status toggle pills */
.status-pills {
  display: flex; gap: 8px;
}
.status-pill {
  padding: 8px 18px;
  border-radius: var(--radius-xl);
  font-size: 13px; font-weight: 600;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}
.status-pill.active-disponibile {
  background: rgba(52,211,153,0.15);
  border-color: var(--success);
  color: var(--success);
}
.status-pill.active-pending {
  background: rgba(167,139,250,0.15);
  border-color: var(--pending);
  color: var(--pending);
}

/* Photo upload zone */
.photo-upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text-muted);
}
.photo-upload-zone:hover {
  border-color: var(--accent);
  background: var(--accent-glow);
  color: var(--accent);
}
.photo-upload-zone .upload-icon { font-size: 32px; margin-bottom: 8px; }
.photo-upload-zone p { font-size: 14px; }
.photo-preview-grid {
  display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px;
}
.photo-preview {
  width: 80px; height: 80px;
  border-radius: var(--radius-sm);
  overflow: hidden; position: relative;
}
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-preview .remove-photo {
  position: absolute; top: 2px; right: 2px;
  width: 20px; height: 20px;
  background: rgba(0,0,0,0.7);
  border-radius: 50%;
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px;
  cursor: pointer;
}

/* ── My Listings (inside Inserisci tab) ── */
.my-listings-section {
  margin-top: 32px;
}
.my-listings-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
}
.my-listings-header h3 { font-size: 18px; font-weight: 700; }

/* ══════════════════════════════════
   CERCA TAB – Search
   ══════════════════════════════════ */
.search-hero-banner {
  text-align: center;
  padding: 40px 20px 24px;
}
.search-hero-banner h2 {
  font-size: 28px; font-weight: 800; margin-bottom: 8px;
}
.search-hero-banner p {
  color: var(--text-secondary); font-size: 15px;
}

.search-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
}
.search-filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

/* Location mode toggle */
.location-toggle {
  display: flex; gap: 4px;
  background: var(--bg-primary);
  padding: 3px; border-radius: var(--radius-sm);
  margin-bottom: 10px;
}
.location-toggle button {
  flex: 1; padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px; font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  transition: all var(--transition);
}
.location-toggle button.active {
  background: var(--bg-card);
  color: var(--accent);
}

/* Multi-zone tags */
.multi-zone-input {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 6px 10px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-height: 42px;
  align-items: center;
  cursor: text;
}
.multi-zone-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.zone-tag {
  display: flex; align-items: center; gap: 4px;
  padding: 3px 10px;
  background: var(--accent-glow);
  border: 1px solid rgba(212,168,83,0.3);
  border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 600;
  color: var(--accent);
}
.zone-tag .remove-tag {
  cursor: pointer; font-size: 14px; line-height: 1;
  opacity: 0.7;
  transition: opacity var(--transition);
}
.zone-tag .remove-tag:hover { opacity: 1; }
.multi-zone-input input {
  border: none; background: transparent;
  color: var(--text-primary);
  font-size: 14px;
  flex: 1; min-width: 100px;
  padding: 4px 0;
}

/* Radius search */
.radius-controls {
  display: flex; gap: 10px; align-items: flex-end;
}
.radius-controls .form-group { flex: 1; }
.radius-slider { width: 100%; accent-color: var(--accent); }

/* Filter toggles */
.filter-toggles {
  display: flex; gap: 12px; flex-wrap: wrap;
  align-items: center;
}
.filter-toggle {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-secondary);
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}
.filter-toggle.active {
  background: rgba(52,211,153,0.15);
  border-color: var(--success);
  color: var(--success);
}
.filter-toggle .toggle-icon { font-size: 16px; }

.search-actions {
  display: flex; justify-content: flex-end; gap: 10px;
  margin-top: 16px;
  align-items: center;
}
.results-count {
  margin-right: auto;
  font-size: 14px; color: var(--text-secondary);
}

.search-empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}
.search-empty-state .empty-icon { font-size: 56px; margin-bottom: 16px; opacity: 0.3; }
.search-empty-state h3 { font-size: 20px; font-weight: 600; color: var(--text-secondary); margin-bottom: 8px; }
.search-empty-state p { font-size: 14px; max-width: 400px; margin: 0 auto; }

/* ══════════════════════════════════
   PROPERTY CARDS
   ══════════════════════════════════ */
.listings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}
.property-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
  cursor: pointer;
}
.property-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--border-light); }
.property-card .property-image { position: relative; height: 200px; overflow: hidden; }
.property-card .property-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.property-card:hover .property-image img { transform: scale(1.05); }
.property-card .property-badge {
  position: absolute; top: 12px; left: 12px;
  padding: 4px 12px; border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 600;
  backdrop-filter: blur(8px);
}
.badge-disponibile { background: rgba(52,211,153,0.2); color: var(--success); border: 1px solid rgba(52,211,153,0.3); }
.badge-trattativa { background: rgba(251,191,36,0.2); color: var(--warning); border: 1px solid rgba(251,191,36,0.3); }
.badge-pending { background: rgba(167,139,250,0.2); color: var(--pending); border: 1px solid rgba(167,139,250,0.3); }
.badge-venduto { background: rgba(248,113,113,0.2); color: var(--danger); border: 1px solid rgba(248,113,113,0.3); }
.property-card .property-exclusive {
  position: absolute; top: 12px; right: 12px;
  padding: 4px 10px;
  background: rgba(212,168,83,0.2); border: 1px solid rgba(212,168,83,0.3);
  border-radius: var(--radius-sm); font-size: 11px; font-weight: 700; color: var(--accent);
}
.property-card .property-info { padding: 18px; }
.property-card .property-price { font-size: 22px; font-weight: 800; color: var(--accent); margin-bottom: 4px; }
.property-card .property-address { font-size: 14px; color: var(--text-secondary); margin-bottom: 12px; }
.property-card .property-features { display: flex; gap: 16px; margin-bottom: 14px; }
.property-card .feature { display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--text-secondary); }
.property-card .feature svg { width: 16px; height: 16px; color: var(--text-muted); }
.property-card .property-agent {
  display: flex; align-items: center; gap: 10px;
  padding-top: 14px; border-top: 1px solid var(--border);
}
.agent-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: white;
  flex-shrink: 0;
}
.property-card .agent-name { font-size: 13px; font-weight: 500; }
.property-card .agent-agency { font-size: 11px; color: var(--text-muted); }
.property-card .property-actions { margin-left: auto; display: flex; gap: 6px; }
.property-card .action-btn {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.property-card .action-btn:hover { background: var(--accent-glow); color: var(--accent); }

/* ── Property Detail ── */
.detail-hero { position: relative; height: 400px; border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 24px; }
.detail-hero img { width: 100%; height: 100%; object-fit: cover; }
.detail-hero .hero-overlay {
  position: absolute; bottom: 0; left: 0; right: 0; padding: 32px;
  background: linear-gradient(transparent, rgba(10,15,30,0.95));
}
.detail-hero .hero-price { font-size: 36px; font-weight: 800; color: var(--accent); }
.detail-hero .hero-address { font-size: 18px; color: var(--text-primary); margin-top: 4px; }
.detail-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; }
.detail-features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin-bottom: 24px; }
.detail-feature {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 16px; text-align: center;
}
.detail-feature .feat-value { font-size: 22px; font-weight: 700; color: var(--text-primary); }
.detail-feature .feat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ══════════════════════════════════
   CHAT TAB
   ══════════════════════════════════ */
.chat-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  height: calc(100vh - var(--topbar-height) - 56px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.chat-sidebar {
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
}
.chat-sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}
.chat-list { flex: 1; overflow-y: auto; }
.chat-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
}
.chat-item:hover, .chat-item.active { background: var(--bg-card-hover); }
.chat-item.active { border-left: 3px solid var(--accent); }
.chat-item .chat-avatar {
  width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px; color: white;
}
.chat-item .chat-preview { flex: 1; min-width: 0; }
.chat-item .chat-name { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.chat-item .chat-last-msg { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item .chat-time { font-size: 11px; color: var(--text-muted); flex-shrink: 0; }
.chat-item .chat-unread {
  width: 20px; height: 20px; background: var(--accent); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: var(--bg-primary);
}
.chat-main { display: flex; flex-direction: column; background: var(--bg-primary); }
.chat-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-card);
}
.chat-property-link {
  margin-left: auto;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  background: var(--accent-glow);
  border: 1px solid rgba(212,168,83,0.3);
  color: var(--accent);
  font-size: 12px; font-weight: 600;
  display: flex; align-items: center; gap: 6px;
  transition: all var(--transition);
}
.chat-property-link:hover { background: rgba(212,168,83,0.25); }
.chat-messages {
  flex: 1; padding: 20px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 12px;
}
.message {
  max-width: 70%; padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 14px; line-height: 1.5;
  animation: msgIn 0.3s ease;
}
@keyframes msgIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.message.sent {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--accent), #b8903d);
  color: var(--bg-primary);
  border-bottom-right-radius: 4px;
}
.message.received {
  align-self: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.message .msg-time { font-size: 11px; margin-top: 6px; opacity: 0.6; }
.chat-input-area {
  padding: 16px 20px; border-top: 1px solid var(--border);
  display: flex; gap: 12px; align-items: center;
  background: var(--bg-card);
}
.chat-input-area input {
  flex: 1; padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  color: var(--text-primary);
  font-size: 14px;
}
.chat-input-area input:focus { border-color: var(--accent); }
.chat-input-area .send-btn {
  width: 42px; height: 42px; border-radius: 50%;
  background: #EBDDBE;
  color: var(--bg-primary);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.chat-input-area .send-btn:hover { transform: scale(1.05); box-shadow: 0 4px 15px rgba(212,168,83,0.3); }

/* Chat interest mini chart */
.chat-interest-bar {
  display: flex; gap: 2px; height: 20px; align-items: flex-end;
  margin-top: 4px;
}
.chat-interest-bar .bar {
  width: 4px; border-radius: 2px;
  background: var(--accent);
  opacity: 0.5;
  transition: all var(--transition);
}

/* ══════════════════════════════════
   CLIENTE TAB
   ══════════════════════════════════ */
.client-mode-banner {
  background: linear-gradient(135deg, rgba(96,165,250,0.15), rgba(52,211,153,0.1));
  border: 1px solid rgba(96,165,250,0.3);
  border-radius: var(--radius-lg);
  padding: 16px 24px;
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 24px;
  animation: fadeIn 0.3s ease;
}
.client-mode-banner .banner-icon { font-size: 24px; }
.client-mode-banner .banner-text { flex: 1; }
.client-mode-banner .banner-text strong { color: var(--info); font-size: 15px; }
.client-mode-banner .banner-text p { color: var(--text-secondary); font-size: 13px; margin-top: 2px; }

/* Client property card: no agent info */
.client-property-card .property-agent { display: none; }
.client-property-card .share-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--info), #3b82f6);
  color: white;
  font-size: 13px; font-weight: 600;
  margin-top: 12px;
  transition: all var(--transition);
  width: 100%;
  justify-content: center;
}
.client-property-card .share-btn:hover { box-shadow: 0 4px 15px rgba(96,165,250,0.3); transform: translateY(-1px); }

/* ══════════════════════════════════
   LOCANDINA MODAL
   ══════════════════════════════════ */
.locandina-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  opacity: 0; visibility: hidden;
  transition: all var(--transition);
}
.locandina-overlay.active { opacity: 1; visibility: visible; }

.locandina-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 90%; max-width: 520px;
  overflow: hidden;
  transform: scale(0.95);
  transition: transform var(--transition);
  box-shadow: var(--shadow-lg);
}
.locandina-overlay.active .locandina-card { transform: scale(1); }

.locandina-image { height: 240px; overflow: hidden; position: relative; }
.locandina-image img { width: 100%; height: 100%; object-fit: cover; }
.locandina-image .locandina-price {
  position: absolute; bottom: 16px; left: 16px;
  background: rgba(10,15,30,0.85);
  backdrop-filter: blur(8px);
  padding: 8px 18px;
  border-radius: var(--radius-md);
  font-size: 24px; font-weight: 800;
  color: var(--accent);
}
.locandina-body { padding: 24px; }
.locandina-title { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.locandina-address { font-size: 14px; color: var(--text-secondary); margin-bottom: 16px; }
.locandina-features {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.locandina-feat { text-align: center; }
.locandina-feat .val { font-size: 18px; font-weight: 700; }
.locandina-feat .lbl { font-size: 11px; color: var(--text-muted); }
.locandina-desc { font-size: 14px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 20px; }
.locandina-share-actions {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.locandina-share-btn {
  flex: 1; min-width: 100px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: all var(--transition);
}
.locandina-share-btn.whatsapp { background: #25d366; color: white; }
.locandina-share-btn.whatsapp:hover { background: #20bd5a; }
.locandina-share-btn.email { background: var(--info); color: white; }
.locandina-share-btn.email:hover { background: #4b94f7; }
.locandina-share-btn.copy { background: var(--bg-input); color: var(--text-primary); border: 1px solid var(--border); }
.locandina-share-btn.copy:hover { border-color: var(--accent); color: var(--accent); }
.locandina-close {
  position: absolute; top: 16px; right: 16px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(10,15,30,0.7);
  backdrop-filter: blur(8px);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  cursor: pointer;
  transition: all var(--transition);
}
.locandina-close:hover { background: var(--danger); }

/* ══════════════════════════════════
   AGENT AREA (Dropdown panel)
   ══════════════════════════════════ */
.agent-panel-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 500;
  opacity: 0; visibility: hidden;
  transition: all var(--transition);
}
.agent-panel-overlay.active { opacity: 1; visibility: visible; }
.agent-panel {
  position: fixed; top: 0; right: -480px;
  width: 460px; height: 100vh;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  z-index: 501;
  display: flex; flex-direction: column;
  transition: right var(--transition);
  box-shadow: var(--shadow-lg);
}
.agent-panel.open { right: 0; }
.agent-panel-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.agent-panel-header h2 { font-size: 18px; font-weight: 700; }
.agent-panel-body { flex: 1; overflow-y: auto; padding: 24px; }
.agent-profile-card { text-align: center; margin-bottom: 24px; }
.agent-profile-card .agent-avatar-lg {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: #00478F;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 24px; color: var(--bg-primary);
  margin: 0 auto 12px;
}
.agent-stats-row {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px; margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.agent-stat { text-align: center; }
.agent-stat .stat-val { font-size: 20px; font-weight: 800; }
.agent-stat .stat-lbl { font-size: 12px; color: var(--text-secondary); }

.mls-rules { display: flex; flex-direction: column; gap: 14px; }
.rule-item {
  display: flex; gap: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
}
.rule-item .rule-icon { font-size: 20px; flex-shrink: 0; margin-top: 2px; }
.rule-item strong { display: block; font-size: 14px; margin-bottom: 4px; }
.rule-item p { font-size: 13px; color: var(--text-secondary); line-height: 1.4; }

/* Activity / Audit */
.activity-list { display: flex; flex-direction: column; gap: 2px; }
.activity-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: none; }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; flex-shrink: 0; }
.activity-text { font-size: 14px; color: var(--text-secondary); }
.activity-text strong { color: var(--text-primary); }
.activity-time { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ══════════════════════════════════
   BUTTONS
   ══════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600;
  transition: all var(--transition);
}
.btn-primary { background: #EBDDBE; color: var(--bg-primary); }
.btn-primary:hover { box-shadow: 0 4px 20px rgba(182, 219, 210, 0.5); transform: translateY(-1px); }
.btn-secondary { background: #EBDDBE; color: var(--text-primary); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger { background: rgba(248,113,113,0.12); color: var(--danger); }
.btn-danger:hover { background: rgba(248,113,113,0.2); }
.btn-sm { padding: 6px 14px; font-size: 13px; }

/* ── Status Badges ── */
.status-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 600;
}
.status-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; }
.status-disponibile { background: rgba(52,211,153,0.12); color: var(--success); }
.status-disponibile::before { background: var(--success); }
.status-trattativa { background: rgba(251,191,36,0.12); color: var(--warning); }
.status-trattativa::before { background: var(--warning); }
.status-pending { background: rgba(167,139,250,0.12); color: var(--pending); }
.status-pending::before { background: var(--pending); }
.status-venduto { background: rgba(248,113,113,0.12); color: var(--danger); }
.status-venduto::before { background: var(--danger); }

/* ── Tabs / Pills ── */
.tabs { display: flex; gap: 4px; background: var(--bg-secondary); padding: 4px; border-radius: var(--radius-md); width: fit-content; }
.tab-btn {
  padding: 8px 18px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600;
  color: var(--text-secondary); background: transparent;
  transition: all var(--transition);
}
.tab-btn.active { background: var(--bg-card); color: var(--accent); box-shadow: var(--shadow-sm); }
.tab-btn:hover:not(.active) { color: var(--text-primary); }

/* ── Tables ── */
.table-wrapper { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; }
thead { background: var(--bg-secondary); }
th { padding: 12px 16px; text-align: left; font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
td { padding: 14px 16px; font-size: 14px; border-top: 1px solid var(--border); }
tr { transition: background var(--transition); }
tbody tr:hover { background: var(--bg-card-hover); }
.contact-avatar { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; color: white; flex-shrink: 0; }

/* ── Empty State ── */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-state .empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.3; }
.empty-state h3 { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.empty-state p { color: var(--text-muted); font-size: 14px; margin-bottom: 20px; }

/* ── Modal (generic) ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  opacity: 0; visibility: hidden;
  transition: all var(--transition);
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 90%; max-width: 680px;
  max-height: 90vh; overflow-y: auto;
  transform: scale(0.95) translateY(20px);
  transition: transform var(--transition);
  box-shadow: var(--shadow-lg);
}
.modal-overlay.active .modal { transform: scale(1) translateY(0); }
.modal-header {
  padding: 22px 28px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h2 { font-size: 20px; font-weight: 700; }
.modal-close {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--bg-input); color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.modal-close:hover { background: var(--danger); color: white; }
.modal-body { padding: 28px; }
.modal-footer { padding: 18px 28px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* ── Toast Notifications ── */
.toast-container { position: fixed; top: 80px; right: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 10px; }
.toast {
  padding: 14px 20px; border-radius: var(--radius-md);
  font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-lg); animation: toastIn 0.4s ease;
  display: flex; align-items: center; gap: 10px; min-width: 280px;
}
@keyframes toastIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
.toast-success { background: var(--bg-card); border: 1px solid var(--success); color: var(--success); }
.toast-error { background: var(--bg-card); border: 1px solid var(--danger); color: var(--danger); }
.toast-info { background: var(--bg-card); border: 1px solid var(--info); color: var(--info); }

/* ── Leaflet Map ── */
.leaflet-container { font-family: 'Inter', sans-serif; z-index: 10; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.leaflet-popup-content-wrapper { background: var(--bg-card); color: var(--text-primary); border-radius: var(--radius-sm); border: 1px solid var(--border); box-shadow: var(--shadow-md); padding: 0; }
.leaflet-popup-tip { background: var(--bg-card); }
.leaflet-popup-content { margin: 12px; }
.map-popup-title { font-weight: 700; font-size: 14px; margin-bottom: 4px; color: var(--accent); }
.map-popup-price { font-weight: 800; font-size: 16px; margin-bottom: 8px; }
.map-popup-img { width: 100%; height: 100px; object-fit: cover; border-radius: 4px; margin-bottom: 8px; }
.theme-toggle:hover { color: var(--accent); }

/* ══════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════ */
@media (max-width: 1024px) {
  .top-tabs { gap: 2px; }
  .top-tab { padding: 8px 14px; font-size: 12px; }
  .top-tab .tab-label { display: none; }
  .chat-layout { grid-template-columns: 1fr; }
  .chat-sidebar { display: none; }
  .detail-grid { grid-template-columns: 1fr; }
  .agent-panel { width: 100%; right: -100%; }
}

/* ══════════════════════════════════
   AI CHATBOT (Bottom-Right)
   ══════════════════════════════════ */
.ai-fab {
  position: fixed; bottom: 24px; right: 24px; z-index: 900;
  width: 56px; height: 56px; border-radius: 50%;
  background: #00478F;
  color: #FFD700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 24px var(--accent-glow);
  cursor: pointer;
  transition: all var(--transition);
  font-size: 24px;
}
.ai-fab:hover { transform: scale(1.1); box-shadow: 0 8px 32px var(--accent-glow); }
.ai-fab.hidden { transform: scale(0); opacity: 0; pointer-events: none; }
.ai-fab .fab-pulse {
  position: absolute; inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--accent-glow);
  animation: fabPulse 2s ease-in-out infinite;
}
@keyframes fabPulse { 0%,100%{transform:scale(1);opacity:1} 50%{transform:scale(1.2);opacity:0} }

.ai-chat-window {
  position: fixed; bottom: 24px; right: 24px; z-index: 901;
  width: 400px; height: 560px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg), 0 0 40px var(--accent-glow);
  display: flex; flex-direction: column;
  overflow: hidden;
  transform: scale(0.9) translateY(20px); opacity: 0;
  transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1);
  pointer-events: none;
}
.ai-chat-window.open {
  transform: scale(1) translateY(0); opacity: 1;
  pointer-events: all;
}

.ai-chat-header {
  padding: 16px 20px;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: white;
  display: flex; align-items: center; gap: 12px;
}
.ai-chat-header .ai-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.ai-chat-header .ai-info { flex: 1; }
.ai-chat-header .ai-name { font-weight: 700; font-size: 14px; }
.ai-chat-header .ai-status { font-size: 12px; opacity: 0.8; display: flex; align-items: center; gap: 4px; }
.ai-chat-header .ai-status::before { content: ''; width: 6px; height: 6px; background: #34d399; border-radius: 50%; }
.ai-chat-close {
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,0.15);
  color: white;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all var(--transition);
}
.ai-chat-close:hover { background: rgba(255,255,255,0.3); }

.ai-chat-body {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
}

.ai-msg {
  max-width: 85%; padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13px; line-height: 1.6;
  animation: msgIn 0.3s ease;
}
.ai-msg.bot {
  align-self: flex-start;
  background: linear-gradient(135deg, rgba(124,58,237,0.12), rgba(168,85,247,0.08));
  border: 1px solid rgba(124,58,237,0.2);
  color: var(--text-primary);
}
.ai-msg.user {
  align-self: flex-end;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  color: var(--text-primary);
}

/* Property card inside AI chat */
.ai-property-card {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden; margin-top: 8px;
  cursor: pointer; transition: all var(--transition);
}
.ai-property-card:hover { border-color: var(--accent); }
.ai-property-card .ai-prop-img { height: 100px; overflow: hidden; }
.ai-property-card .ai-prop-img img { width: 100%; height: 100%; object-fit: cover; }
.ai-property-card .ai-prop-body { padding: 10px; }
.ai-property-card .ai-prop-price { font-weight: 800; font-size: 16px; color: var(--accent); }
.ai-property-card .ai-prop-title { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.ai-property-card .ai-prop-feats { display: flex; gap: 10px; margin-top: 6px; }
.ai-property-card .ai-prop-feats span { font-size: 11px; color: var(--text-muted); }

/* Quick action buttons in AI chat */
.ai-actions {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px;
}
.ai-action-btn {
  padding: 6px 12px; border-radius: var(--radius-md);
  font-size: 12px; font-weight: 600;
  background: rgba(124,58,237,0.1);
  border: 1px solid rgba(124,58,237,0.25);
  color: #747474;
  cursor: pointer; transition: all var(--transition);
}
.ai-action-btn:hover { background: rgba(124,58,237,0.2); }
.ai-action-btn.accent { background: rgba(212,168,83,0.15); border-color: rgba(212,168,83,0.3); color: var(--accent); }
.ai-action-btn.success { background: rgba(52,211,153,0.12); border-color: rgba(52,211,153,0.3); color: var(--success); }

/* Quick prompts at bottom */
.ai-quick-prompts {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
}
.ai-quick-prompt {
  padding: 5px 12px; border-radius: var(--radius-md);
  font-size: 11px; font-weight: 600;
  background: var(--bg-primary); border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer; transition: all var(--transition);
  white-space: nowrap;
}
.ai-quick-prompt:hover { border-color: #747474; color: #747474; }

.ai-chat-input-area {
  padding: 12px 16px; border-top: 1px solid var(--border);
  display: flex; gap: 8px; align-items: center;
  background: var(--bg-card);
}
.ai-chat-input-area input {
  flex: 1; padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  color: var(--text-primary); font-size: 13px;
}
.ai-chat-input-area input:focus { border-color: #747474; box-shadow: 0 0 0 3px rgba(124,58,237,0.15); }
.ai-chat-input-area .ai-send {
  width: 36px; height: 36px; border-radius: 50%;
  background: #EBDDBE;
  color: white;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
}
.ai-chat-input-area .ai-send:hover { transform: scale(1.05); }

/* Typing dots */
.ai-typing { display: flex; gap: 4px; padding: 10px 14px; align-self: flex-start; }
.ai-typing .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #747474; opacity: 0.4;
  animation: typeDot 1.4s ease-in-out infinite;
}
.ai-typing .dot:nth-child(2) { animation-delay: 0.2s; }
.ai-typing .dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typeDot { 0%,100%{opacity:0.3;transform:translateY(0)} 50%{opacity:1;transform:translateY(-4px)} }

/* ══════════════════════════════════
   AI SUGGESTIONS (Sparkle buttons)
   ══════════════════════════════════ */
.form-group-ai { position: relative; }
.ai-suggest-btn {
  position: absolute; top: 0; right: 0;
  padding: 3px 10px; border-radius: 12px;
  font-size: 11px; font-weight: 600;
  background: linear-gradient(135deg, rgba(124,58,237,0.15), rgba(168,85,247,0.1));
  border: 1px solid rgba(124,58,237,0.25);
  color: #747474;
  cursor: pointer; transition: all var(--transition);
  display: flex; align-items: center; gap: 4px;
}
.ai-suggest-btn:hover { background: linear-gradient(135deg, rgba(124,58,237,0.25), rgba(168,85,247,0.18)); }
.ai-suggest-btn .sparkle { font-size: 12px; }

.ai-suggestion-dropdown {
  position: absolute; top: 100%; left: 0; right: 0;
  background: var(--bg-card);
  border: 1px solid rgba(124,58,237,0.25);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 50;
  max-height: 200px; overflow-y: auto;
  display: none;
  animation: fadeIn 0.2s ease;
}
.ai-suggestion-dropdown.open { display: block; }
.ai-suggestion-item {
  padding: 10px 14px;
  font-size: 13px; line-height: 1.5;
  color: var(--text-secondary);
  cursor: pointer; transition: all var(--transition);
  border-bottom: 1px solid var(--border);
}
.ai-suggestion-item:last-child { border-bottom: none; }
.ai-suggestion-item:hover { background: rgba(124,58,237,0.08); color: var(--text-primary); }
.ai-suggestion-item .suggestion-label {
  font-size: 11px; font-weight: 700; color: #747474;
  text-transform: uppercase; letter-spacing: 0.5px;
  margin-bottom: 4px;
}

/* ══════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════ */
@media (max-width: 1024px) {
  .top-tabs { gap: 2px; }
  .top-tab { padding: 8px 14px; font-size: 12px; }
  .top-tab .tab-label { display: none; }
  .chat-layout { grid-template-columns: 1fr; }
  .chat-sidebar { display: none; }
  .detail-grid { grid-template-columns: 1fr; }
  .agent-panel { width: 100%; right: -100%; }
  .ai-chat-window { width: 340px; height: 480px; }
}
@media (max-width: 768px) {
  .top-bar { padding: 0 12px; gap: 8px; }
  .top-bar-logo h1 { display: none; }
  .user-menu-trigger .user-name { display: none; }
  .page-content { padding: 16px; }
  .listings-grid { grid-template-columns: 1fr; }
  .search-filters-grid { grid-template-columns: 1fr 1fr; }
  .detail-hero { height: 240px; }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .form-grid-3 { grid-template-columns: 1fr 1fr; }
  .locandina-features { grid-template-columns: repeat(3, 1fr); }
  .ai-chat-window { width: calc(100vw - 32px); right: 16px; bottom: 16px; height: 70vh; }
  .ai-fab { bottom: 16px; right: 16px; }
}
@media (max-width: 480px) {
  .top-tabs { padding: 3px; }
  .top-tab { padding: 6px 10px; }
  .search-filters-grid { grid-template-columns: 1fr; }
  .form-grid, .form-grid-3, .form-grid-2 { grid-template-columns: 1fr; }
}
