/* ============================================
   NYC Property Dossier — v6 "Glass Vision"
   Modern glassmorphism with Apple Vision Pro aesthetics
   Typography: Space Grotesk + JetBrains Mono + Playfair Display
   ============================================ */

/* --- Design Tokens --- */
:root {
  /* Light base */
  --bg-deep: #f8fafc;
  --bg-base: #ffffff;
  --bg-surface: #f1f5f9;
  --bg-elevated: #ffffff;

  /* Glass colors (light mode) */
  --glass-bg: rgba(255, 255, 255, 0.65);
  --glass-border: rgba(0, 0, 0, 0.08);
  --glass-border-strong: rgba(0, 0, 0, 0.14);
  --glass-hover: rgba(0, 0, 0, 0.03);

  /* Aurora gradient colors */
  --aurora-blue: #2563eb;
  --aurora-indigo: #4f46e5;
  --aurora-purple: #7c3aed;
  --aurora-cyan: #0891b2;

  /* Text colors */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-faint: #cbd5e1;

  /* Accent colors (USGDS civic blues) */
  --accent-blue: #2563eb;
  --accent-indigo: #4f46e5;
  --accent-purple: #7c3aed;
  --accent-cyan: #0891b2;

  /* Status colors */
  --status-green: #059669;
  --status-amber: #d97706;
  --status-red: #dc2626;

  /* Typography */
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Space Grotesk', -apple-system, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', monospace;

  /* Spacing */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px;
  --s5: 20px; --s6: 24px; --s7: 32px; --s8: 48px; --s9: 64px;

  /* Radius */
  --r1: 8px; --r2: 12px; --r3: 16px; --r4: 20px; --r-pill: 9999px;

  /* Shadows */
  --shadow-glass-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-glass-md: 0 4px 16px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-glass-lg: 0 12px 40px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-glow-blue: 0 0 20px rgba(37, 99, 235, 0.15);
  --shadow-glow-purple: 0 0 20px rgba(124, 58, 237, 0.15);
  --shadow-focus: 0 0 0 3px rgba(37, 99, 235, 0.2);

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --t-fast: 150ms; --t-base: 250ms; --t-slow: 400ms;

  /* Layout */
  --header-h: 72px;
  --sidebar-w: 240px;
  --max-w: 1400px;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--bg-deep);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--accent-blue);
  text-decoration: none;
  transition: color var(--t-fast);
}

a:hover {
  color: var(--accent-cyan);
}

::selection {
  background: rgba(37, 99, 235, 0.15);
  color: var(--text-primary);
}

/* --- Aurora Background --- */
.aurora-bg {
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background:
    radial-gradient(ellipse at 20% 30%, rgba(37, 99, 235, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(79, 70, 229, 0.05) 0%, transparent 50%),
    radial-gradient(ellipse at 60% 70%, rgba(124, 58, 237, 0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 40% 80%, rgba(8, 145, 178, 0.03) 0%, transparent 50%);
  animation: aurora 20s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes aurora {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(5%, -5%) rotate(2deg); }
  66% { transform: translate(-5%, 5%) rotate(-2deg); }
}

/* --- Grain Overlay --- */
.grain-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' /%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.015'/%3E%3C/svg%3E");
  opacity: 1;
  pointer-events: none;
  z-index: 1;
}

/* --- Typography --- */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

h4, h5, h6 {
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--text-primary);
}

h1 { font-size: 3rem; line-height: 1.1; }
h2 { font-size: 2rem; line-height: 1.2; }
h3 { font-size: 1.5rem; line-height: 1.3; }
h4 { font-size: 1rem; line-height: 1.4; }

p {
  color: var(--text-secondary);
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.875em;
  letter-spacing: -0.01em;
}

.label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

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

.main-content {
  flex: 1;
  padding-top: var(--header-h);
}

.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--s6);
}

/* --- Header --- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid var(--glass-border);
  z-index: 1000;
  transition: background var(--t-base);
}

.site-header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-blue), var(--accent-purple), transparent);
  opacity: 0.4;
}

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--s6);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s6);
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--s3);
  color: var(--text-primary) !important;
  text-decoration: none !important;
  transition: transform var(--t-base) var(--ease);
}

.logo:hover {
  transform: translateY(-1px);
}

.logo-mark {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r1);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-glass-sm);
  transition: all var(--t-base);
}

.logo:hover .logo-mark {
  box-shadow: var(--shadow-glow-blue);
}

.logo-text-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.logo-text {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.logo-accent {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-tagline {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

.nav-links {
  display: flex;
  gap: var(--s1);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: var(--s2);
  padding: var(--s2) var(--s4);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted) !important;
  border-radius: var(--r-pill);
  transition: all var(--t-base);
  position: relative;
  overflow: hidden;
}

.nav-link::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--glass-hover);
  opacity: 0;
  transition: opacity var(--t-fast);
}

.nav-link:hover::before {
  opacity: 1;
}

.nav-link:hover {
  color: var(--text-secondary) !important;
}

.nav-link.active {
  color: var(--accent-blue) !important;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-glass-sm);
}

.nav-icon {
  font-size: 1rem;
  opacity: 0.7;
  transition: opacity var(--t-fast);
}

.nav-link.active .nav-icon {
  opacity: 1;
}

.nav-label {
  font-weight: 500;
}

.header-right {
  display: flex;
  align-items: center;
  gap: var(--s4);
}

.status-pill {
  display: flex;
  align-items: center;
  gap: var(--s2);
  padding: var(--s2) var(--s4);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-pill);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-glass-sm);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--status-green);
  box-shadow: 0 0 8px rgba(5, 150, 105, 0.4);
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.85); }
}

.status-text {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

.nav-toggle {
  display: none;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--r1);
  padding: var(--s2);
  cursor: pointer;
  flex-direction: column;
  gap: 4px;
  transition: all var(--t-base);
}

.nav-toggle:hover {
  background: var(--glass-hover);
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 1px;
  transition: all var(--t-base);
}

/* --- Footer --- */
.site-footer {
  border-top: 1px solid var(--glass-border);
  padding: var(--s5) var(--s6);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(16px);
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-text {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.footer-stat {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

/* --- Hero / Search --- */
.hero {
  padding: var(--s9) 0 var(--s8);
  background:
    radial-gradient(ellipse 60% 40% at 50% -10%, rgba(37, 99, 235, 0.05) 0%, transparent 60%),
    var(--bg-base);
  position: relative;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-blue), var(--accent-purple), transparent);
  opacity: 0.4;
}

.hero-content {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--s6);
  text-align: center;
}

.hero h1 {
  margin-bottom: var(--s4);
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-blue) 50%, var(--accent-purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-shift 8s ease infinite;
  background-size: 200% auto;
}

@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.hero p {
  max-width: 560px;
  margin: 0 auto var(--s7);
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.search-mode-bar {
  display: flex;
  justify-content: center;
  gap: var(--s2);
  margin-bottom: var(--s6);
}

.mode-btn {
  padding: var(--s2) var(--s5);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: all var(--t-base);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  backdrop-filter: blur(12px);
}

.mode-btn:hover {
  color: var(--text-secondary);
  background: var(--glass-hover);
  box-shadow: var(--shadow-glass-sm);
}

.mode-btn.active {
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-indigo));
  border-color: transparent;
  box-shadow: var(--shadow-glow-blue);
  font-weight: 600;
}

.search-box {
  position: relative;
  max-width: 640px;
  margin: 0 auto;
}

.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: var(--s5);
  color: var(--text-muted);
  font-size: 18px;
  pointer-events: none;
  z-index: 2;
  transition: color var(--t-base);
}

.search-input {
  width: 100%;
  padding: var(--s4) var(--s5) var(--s4) 52px;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text-primary);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--r3);
  outline: none;
  transition: all var(--t-base);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-glass-md);
}

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

.search-input:focus {
  border-color: var(--accent-blue);
  box-shadow: var(--shadow-focus), var(--shadow-glow-blue);
}

.search-input:focus + .search-icon {
  color: var(--accent-blue);
}

.search-spinner {
  position: absolute;
  right: var(--s5);
  width: 18px;
  height: 18px;
  border: 2px solid var(--glass-border);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  opacity: 0;
  animation: spin 0.8s linear infinite;
}

.search-spinner.visible {
  opacity: 1;
}

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

/* --- Autocomplete --- */
.autocomplete-dropdown {
  position: absolute;
  top: calc(100% + var(--s3));
  left: 0;
  right: 0;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--r3);
  backdrop-filter: blur(24px);
  box-shadow: var(--shadow-glass-lg);
  max-height: 440px;
  overflow-y: auto;
  z-index: 100;
  display: none;
}

.autocomplete-dropdown.visible {
  display: block;
  animation: slideDown var(--t-slow) var(--ease);
}

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

.autocomplete-item {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s4) var(--s5);
  cursor: pointer;
  border-bottom: 1px solid var(--glass-border);
  transition: all var(--t-fast);
  position: relative;
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--glass-hover);
  opacity: 0;
  transition: opacity var(--t-fast);
}

.autocomplete-item:hover::before,
.autocomplete-item.highlighted::before {
  opacity: 1;
}

.autocomplete-item-icon {
  position: relative;
  z-index: 1;
  color: var(--accent-blue);
  font-size: 16px;
  opacity: 0.6;
  transition: opacity var(--t-fast);
}

.autocomplete-item:hover .autocomplete-item-icon,
.autocomplete-item.highlighted .autocomplete-item-icon {
  opacity: 1;
}

.autocomplete-item-label {
  position: relative;
  z-index: 1;
  font-size: 0.9375rem;
  color: var(--text-primary);
  font-weight: 500;
}

.autocomplete-item-sub {
  position: relative;
  z-index: 1;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-top: 2px;
}

/* --- Property Layout --- */
.property-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  gap: 0;
  min-height: calc(100vh - var(--header-h));
}

/* --- Sidebar --- */
.sidebar {
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  background: rgba(248, 250, 252, 0.7);
  backdrop-filter: blur(16px);
  border-right: 1px solid var(--glass-border);
  padding: var(--s6) 0;
}

.sidebar::-webkit-scrollbar {
  width: 4px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background: var(--glass-border);
  border-radius: 2px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--glass-border-strong);
}

.sidebar-section-label {
  padding: var(--s2) var(--s5);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-faint);
}

.sidebar-tab {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s3) var(--s5);
  margin: 2px var(--s3);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  border-radius: var(--r1);
  cursor: pointer;
  width: calc(100% - var(--s6));
  transition: all var(--t-base);
  text-align: left;
  position: relative;
}

.sidebar-tab::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  background: linear-gradient(180deg, var(--accent-blue), var(--accent-purple));
  border-radius: 2px;
  transition: height var(--t-base) var(--ease);
}

.sidebar-tab:hover {
  background: var(--glass-hover);
  color: var(--text-secondary);
}

.sidebar-tab.active {
  background: var(--glass-bg);
  color: var(--accent-blue);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-glass-sm);
}

.sidebar-tab.active::before {
  height: 60%;
}

.sidebar-tab-icon {
  font-size: 16px;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
  opacity: 0.6;
  transition: opacity var(--t-fast);
}

.sidebar-tab.active .sidebar-tab-icon {
  opacity: 1;
}

.sidebar-tab-count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 3px var(--s2);
  border-radius: var(--r-pill);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-faint);
  transition: all var(--t-base);
}

.sidebar-tab.active .sidebar-tab-count {
  background: rgba(37, 99, 235, 0.1);
  border-color: rgba(37, 99, 235, 0.25);
  color: var(--accent-blue);
}

.sidebar-tab-count.has-data {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.2);
  color: var(--accent-blue);
}

/* --- Property Content --- */
.property-content {
  padding: var(--s6);
  overflow-y: auto;
  background: var(--bg-base);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  animation: fadeUp var(--t-slow) var(--ease);
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Profile Header --- */
.profile-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s5);
  margin-bottom: var(--s7);
  flex-wrap: wrap;
  padding: var(--s6);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--r3);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-glass-md);
  position: relative;
  overflow: hidden;
}

.profile-bar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
  opacity: 0.6;
}

.profile-address {
  font-family: var(--font-display);
  font-size: 2rem;
  margin-bottom: var(--s2);
  color: var(--text-primary);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.profile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
}

.profile-actions {
  display: flex;
  gap: var(--s2);
  flex-wrap: wrap;
  align-self: center;
}

/* --- Cards --- */
.card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--r3);
  overflow: hidden;
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-glass-sm);
  transition: all var(--t-base);
}

.card:hover {
  box-shadow: var(--shadow-glass-md);
  border-color: var(--glass-border-strong);
}

.card + .card {
  margin-top: var(--s4);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s4) var(--s5);
  border-bottom: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.015);
}

.card-head h4 {
  font-size: 0.9375rem;
  display: flex;
  align-items: center;
  gap: var(--s2);
  font-weight: 600;
}

.card-body {
  padding: var(--s5);
}

/* --- Badges --- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px var(--s3);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--r-pill);
  letter-spacing: 0.02em;
  white-space: nowrap;
  border: 1px solid;
  backdrop-filter: blur(8px);
}

.badge-blue {
  color: var(--accent-blue);
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.2);
}

.badge-muted {
  color: var(--text-muted);
  background: var(--glass-bg);
  border-color: var(--glass-border);
}

.badge-green {
  color: var(--status-green);
  background: rgba(5, 150, 105, 0.08);
  border-color: rgba(5, 150, 105, 0.2);
}

.badge-red {
  color: var(--status-red);
  background: rgba(220, 38, 38, 0.08);
  border-color: rgba(220, 38, 38, 0.2);
}

.badge-amber {
  color: var(--status-amber);
  background: rgba(217, 119, 6, 0.08);
  border-color: rgba(217, 119, 6, 0.2);
}

.badge-purple {
  color: var(--accent-purple);
  background: rgba(124, 58, 237, 0.08);
  border-color: rgba(124, 58, 237, 0.2);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  padding: var(--s2) var(--s5);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: all var(--t-base);
  white-space: nowrap;
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--glass-hover);
  opacity: 0;
  transition: opacity var(--t-fast);
}

.btn:hover::before {
  opacity: 1;
}

.btn:hover {
  color: var(--text-primary);
  box-shadow: var(--shadow-glass-sm);
}

.btn:active {
  transform: scale(0.98);
}

.btn-accent {
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-indigo));
  border-color: transparent;
  font-weight: 600;
  box-shadow: var(--shadow-glow-blue);
}

.btn-accent::before {
  background: rgba(255, 255, 255, 0.1);
}

.btn-accent:hover {
  box-shadow: var(--shadow-glow-blue), var(--shadow-glass-md);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
}

.btn-ghost:hover {
  background: var(--glass-bg);
  border-color: var(--glass-border);
}

.btn-sm {
  padding: 6px var(--s3);
  font-size: 0.8125rem;
}

.btn.favorited {
  color: var(--accent-blue);
  border-color: rgba(37, 99, 235, 0.25);
  background: rgba(37, 99, 235, 0.08);
}

/* --- Stat Grid --- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--s4);
}

.stat-card {
  padding: var(--s6) var(--s5);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--r3);
  text-align: center;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(16px);
  transition: all var(--t-base);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-blue), transparent);
  opacity: 0;
  transition: opacity var(--t-base);
}

.stat-card {
  background: var(--glass-bg);
}

.stat-card:hover {
  border-color: var(--glass-border-strong);
  box-shadow: var(--shadow-glass-md);
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 6px;
}

.stat-value.accent {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

/* --- Collapsible Sections --- */
.collapsible {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--r2);
  margin-bottom: var(--s4);
  backdrop-filter: blur(16px);
  transition: all var(--t-base);
  position: relative;
  overflow: hidden;
}

.collapsible::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--accent-blue), var(--accent-purple));
  opacity: 0;
  transition: opacity var(--t-base);
}

.collapsible:hover {
  border-color: var(--glass-border-strong);
}

.collapsible.open::before {
  opacity: 1;
}

.collapsible-toggle {
  display: flex;
  align-items: center;
  gap: var(--s3);
  width: 100%;
  padding: var(--s4) var(--s5);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-primary);
  text-align: left;
  transition: background var(--t-fast);
}

.collapsible-toggle:hover {
  background: var(--glass-hover);
}

.collapsible-chevron {
  font-size: 12px;
  color: var(--text-muted);
  transition: all var(--t-base) var(--ease);
  margin-right: var(--s2);
  flex-shrink: 0;
}

.collapsible.open .collapsible-chevron {
  transform: rotate(90deg);
  color: var(--accent-blue);
}

.collapsible-meta {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--s2);
}

.collapsible-body {
  display: none;
  padding: 0 var(--s5) var(--s5);
  border-top: 1px solid var(--glass-border);
}

.collapsible.open .collapsible-body {
  display: block;
  animation: fadeUp var(--t-base) var(--ease);
}

/* --- Date Box --- */
.date-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 52px;
  padding: var(--s2) 0;
  flex-shrink: 0;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--r1);
  font-family: var(--font-mono);
  backdrop-filter: blur(8px);
}

.date-box-month {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-blue);
  letter-spacing: 0.06em;
}

.date-box-day {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
}

.date-box-year {
  font-size: 0.625rem;
  color: var(--text-muted);
}

/* --- Data Table --- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.data-table th {
  text-align: left;
  padding: var(--s3) var(--s4);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.015);
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
}

.data-table td {
  padding: var(--s3) var(--s4);
  border-bottom: 1px solid var(--glass-border);
  color: var(--text-secondary);
  vertical-align: top;
}

.data-table tr:hover td {
  background: var(--glass-hover);
}

.data-table td:first-child {
  color: var(--text-primary);
  font-weight: 500;
}

.data-table-wrap {
  max-height: 440px;
  overflow-y: auto;
  border: 1px solid var(--glass-border);
  border-radius: var(--r2);
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
}

/* --- Alert Boxes --- */
.alert-box {
  display: flex;
  align-items: flex-start;
  gap: var(--s4);
  padding: var(--s5);
  border-radius: var(--r3);
  margin-bottom: var(--s4);
  border: 1px solid;
  backdrop-filter: blur(16px);
}

.alert-box-blue {
  background: rgba(37, 99, 235, 0.06);
  border-color: rgba(37, 99, 235, 0.15);
}

.alert-box-red {
  background: rgba(220, 38, 38, 0.06);
  border-color: rgba(220, 38, 38, 0.15);
}

.alert-box-green {
  background: rgba(5, 150, 105, 0.06);
  border-color: rgba(5, 150, 105, 0.15);
}

.alert-box-amber {
  background: rgba(217, 119, 6, 0.06);
  border-color: rgba(217, 119, 6, 0.15);
}

.alert-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.alert-text h4 {
  font-size: 0.9375rem;
  margin-bottom: 4px;
}

.alert-text p {
  font-size: 0.875rem;
  line-height: 1.6;
}

/* --- Source Pills --- */
.source-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px var(--s3);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--r-pill);
  border: 1px solid;
  letter-spacing: 0.02em;
  backdrop-filter: blur(8px);
}

.source-pill.p1 {
  color: var(--status-green);
  background: rgba(5, 150, 105, 0.08);
  border-color: rgba(5, 150, 105, 0.2);
}

.source-pill.p2 {
  color: var(--accent-blue);
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.2);
}

.source-pill.p3 {
  color: var(--status-amber);
  background: rgba(217, 119, 6, 0.08);
  border-color: rgba(217, 119, 6, 0.2);
}

.source-pill.p4 {
  color: var(--text-muted);
  background: var(--glass-bg);
  border-color: var(--glass-border);
}

/* --- Owner Card --- */
.owner-card {
  display: flex;
  align-items: flex-start;
  gap: var(--s4);
  padding: var(--s4) var(--s5);
  border: 1px solid var(--glass-border);
  border-radius: var(--r2);
  margin-bottom: var(--s4);
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  transition: all var(--t-base);
}

.owner-card:hover {
  border-color: var(--glass-border-strong);
  box-shadow: var(--shadow-glass-sm);
}

.owner-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--accent-blue);
  flex-shrink: 0;
}

.owner-info h4 {
  font-size: 0.9375rem;
  margin-bottom: 2px;
}

.owner-info p {
  font-size: 0.8125rem;
}

/* --- Risk Meter --- */
.risk-meter {
  display: flex;
  align-items: center;
  gap: var(--s6);
  margin-bottom: var(--s6);
}

.risk-circle {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 700;
  flex-shrink: 0;
  border: 2px solid;
  position: relative;
  backdrop-filter: blur(12px);
}

.risk-circle::after {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 1px solid;
  opacity: 0.2;
}

.risk-low {
  border-color: var(--status-green);
  color: var(--status-green);
  background: rgba(5, 150, 105, 0.08);
}

.risk-low::after {
  border-color: var(--status-green);
}

.risk-medium {
  border-color: var(--status-amber);
  color: var(--status-amber);
  background: rgba(217, 119, 6, 0.08);
}

.risk-medium::after {
  border-color: var(--status-amber);
}

.risk-high {
  border-color: var(--status-red);
  color: var(--status-red);
  background: rgba(220, 38, 38, 0.08);
}

.risk-high::after {
  border-color: var(--status-red);
}

.risk-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s3);
}

.risk-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s3) var(--s4);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--r1);
  font-size: 0.875rem;
  backdrop-filter: blur(12px);
}

.risk-item-label {
  color: var(--text-secondary);
}

.risk-item-val {
  font-weight: 600;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-primary);
}

/* --- Skeleton --- */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--glass-bg) 25%,
    var(--glass-hover) 50%,
    var(--glass-bg) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 2s ease infinite;
  border-radius: var(--r1);
}

.skeleton-line {
  height: 14px;
  margin-bottom: var(--s3);
}

.skeleton-line:last-child {
  margin-bottom: 0;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* --- Empty / Error States --- */
.empty-state {
  text-align: center;
  padding: var(--s9) var(--s6);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: var(--s5);
  opacity: 0.15;
}

.empty-state h3 {
  font-size: 1.25rem;
  margin-bottom: var(--s3);
  color: var(--text-secondary);
  font-family: var(--font-display);
}

.empty-state p {
  font-size: 0.9375rem;
  color: var(--text-muted);
  max-width: 400px;
  margin: 0 auto;
  line-height: 1.7;
}

/* --- Property List Items --- */
.property-list-item {
  display: flex;
  align-items: center;
  gap: var(--s4);
  padding: var(--s4) var(--s5);
  cursor: pointer;
  border-bottom: 1px solid var(--glass-border);
  transition: all var(--t-fast);
  position: relative;
}

.property-list-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--glass-hover);
  opacity: 0;
  transition: opacity var(--t-fast);
}

.property-list-item:last-child {
  border-bottom: none;
}

.property-list-item:hover::before {
  opacity: 1;
}

.property-list-icon {
  position: relative;
  z-index: 1;
  color: var(--accent-blue);
  font-size: 16px;
  flex-shrink: 0;
  opacity: 0.5;
  transition: opacity var(--t-fast);
}

.property-list-item:hover .property-list-icon {
  opacity: 1;
}

.property-list-address {
  position: relative;
  z-index: 1;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-primary);
}

.property-list-meta {
  position: relative;
  z-index: 1;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-top: 2px;
}

.property-list-chevron {
  position: relative;
  z-index: 1;
  color: var(--text-muted);
  font-size: 18px;
  margin-left: auto;
  transition: all var(--t-fast);
}

.property-list-item:hover .property-list-chevron {
  transform: translateX(3px);
  color: var(--accent-blue);
}

/* --- Summary Grid --- */
.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s4);
}

.summary-item {
  padding: var(--s4) var(--s5);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--r2);
  backdrop-filter: blur(16px);
  transition: all var(--t-base);
}

.summary-item:hover {
  border-color: var(--glass-border-strong);
  box-shadow: var(--shadow-glass-sm);
}

.summary-item-label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.summary-item-value {
  font-size: 0.9375rem;
  color: var(--text-primary);
  font-weight: 500;
}

/* --- Map --- */
.map-frame {
  width: 100%;
  height: 280px;
  border-radius: var(--r3);
  border: 1px solid var(--glass-border);
  overflow: hidden;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-glass-sm);
}

.map-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  filter: none;
}

/* --- Toast --- */
.toast {
  position: fixed;
  bottom: var(--s6);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: var(--s4) var(--s7);
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-indigo));
  color: #ffffff;
  border-radius: var(--r-pill);
  font-size: 0.9375rem;
  font-weight: 600;
  box-shadow: var(--shadow-glass-lg), var(--shadow-glow-blue);
  opacity: 0;
  pointer-events: none;
  transition: all var(--t-base) var(--ease);
  z-index: 9999;
  backdrop-filter: blur(16px);
}

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* --- AI Badge --- */
.ai-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  margin-top: var(--s2);
  padding: var(--s2) var(--s4);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent-purple);
  background: rgba(124, 58, 237, 0.06);
  border: 1px solid rgba(124, 58, 237, 0.18);
  border-radius: var(--r-pill);
  backdrop-filter: blur(8px);
}

/* --- Section Heading --- */
.section-heading {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: var(--s4);
  margin-top: var(--s7);
  padding-bottom: var(--s3);
  border-bottom: 1px solid var(--glass-border);
  position: relative;
}

.section-heading::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
  opacity: 0.6;
}

.section-heading:first-child {
  margin-top: 0;
}

/* --- Source Link --- */
.source-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  margin-left: var(--s2);
  font-size: 0.8125rem;
  color: var(--text-muted);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--r1);
  text-decoration: none !important;
  transition: all var(--t-base);
  vertical-align: middle;
  backdrop-filter: blur(8px);
}

.source-link:hover {
  color: var(--accent-blue);
  border-color: rgba(37, 99, 235, 0.2);
  background: rgba(37, 99, 235, 0.06);
  box-shadow: var(--shadow-glass-sm);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  :root {
    --header-h: 64px;
  }

  .property-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: auto;
    top: auto;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    border-right: none;
    border-top: 1px solid var(--glass-border);
    padding: 0;
    z-index: 100;
    display: flex;
    gap: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(24px);
  }

  .sidebar-section-label {
    display: none;
  }

  .sidebar-tab {
    padding: var(--s4) var(--s4);
    margin: 0;
    border-radius: 0;
    min-width: max-content;
    flex-shrink: 0;
  }

  .sidebar-tab::before {
    display: none;
  }

  .sidebar-tab-icon {
    display: none;
  }

  .property-content {
    padding-bottom: 72px;
  }

  .hero h1 {
    font-size: 2.25rem;
  }

  .hero p {
    font-size: 0.9375rem;
  }

  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

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

  .profile-bar {
    flex-direction: column;
  }

  .profile-address {
    font-size: 1.5rem;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--glass-border);
    padding: var(--s3);
    gap: var(--s2);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-link {
    border-radius: var(--r2);
    justify-content: flex-start;
  }

  .status-pill {
    display: none;
  }

  .footer-inner {
    flex-direction: column;
    gap: var(--s2);
    text-align: center;
  }

  .logo-tagline {
    display: none;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.875rem;
  }

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

/* --- Stagger Animations --- */
.stat-card {
  animation: staggerIn var(--t-slow) var(--ease) backwards;
}

.stat-card:nth-child(1) { animation-delay: 0ms; }
.stat-card:nth-child(2) { animation-delay: 60ms; }
.stat-card:nth-child(3) { animation-delay: 120ms; }
.stat-card:nth-child(4) { animation-delay: 180ms; }
.stat-card:nth-child(5) { animation-delay: 240ms; }
.stat-card:nth-child(6) { animation-delay: 300ms; }

@keyframes staggerIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.collapsible {
  animation: staggerIn var(--t-slow) var(--ease) backwards;
}

.collapsible:nth-child(1) { animation-delay: 0ms; }
.collapsible:nth-child(2) { animation-delay: 50ms; }
.collapsible:nth-child(3) { animation-delay: 100ms; }
.collapsible:nth-child(4) { animation-delay: 150ms; }
.collapsible:nth-child(5) { animation-delay: 200ms; }

.summary-item {
  animation: staggerIn var(--t-slow) var(--ease) backwards;
}

.summary-item:nth-child(1) { animation-delay: 0ms; }
.summary-item:nth-child(2) { animation-delay: 80ms; }
.summary-item:nth-child(3) { animation-delay: 160ms; }
.summary-item:nth-child(4) { animation-delay: 240ms; }
.summary-item:nth-child(5) { animation-delay: 320ms; }
.summary-item:nth-child(6) { animation-delay: 400ms; }
