/* ==========================================================================
   ERMA — Airbnb-inspired Design System
   ========================================================================== */

/* ---------- CSS Variables ---------- */
:root {
    --color-primary: #1a3a5c;
    --color-primary-dark: #0f2640;
    --color-primary-light: #2a5a8c;
    --color-accent: #FF385C;
    --color-accent-dark: #e0294a;
    --color-accent-light: #ff5a78;

    --color-success: #059669;
    --color-success-bg: #d1fae5;
    --color-warning: #d97706;
    --color-warning-bg: #fef3c7;
    --color-error: #dc2626;
    --color-error-bg: #fee2e2;
    --color-info: #2563eb;
    --color-info-bg: #dbeafe;

    --color-bg: #f7f7f7;
    --color-surface: #ffffff;
    --color-text: #222222;
    --color-text-secondary: #717171;
    --color-text-muted: #b0b0b0;
    --color-border: #ebebeb;
    --color-border-dark: #dddddd;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-pill: 999px;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.10);
    --shadow-xl: 0 8px 30px rgba(0,0,0,0.12);
    --shadow-focus: 0 0 0 2px rgba(255,56,92,0.25);

    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --transition: 0.2s ease;
    --transition-slow: 0.35s ease;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-family);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }
input, button, textarea { font-family: inherit; }

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ==========================================================================
   NAVBAR
   ========================================================================== */

.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    backdrop-filter: blur(12px);
    background: rgba(255,255,255,0.95);
}

.navbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 72px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    text-decoration: none;
    transition: opacity var(--transition);
}

.navbar-brand:hover { opacity: 0.8; }

.brand-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--color-accent);
    color: #fff;
    border-radius: var(--radius-sm);
}

.brand-text {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--color-primary);
    letter-spacing: 1.5px;
}

.navbar-search {
    flex: 1;
    max-width: 480px;
    margin-left: auto;
}

.navbar-search-form { width: 100%; }

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

.search-icon {
    position: absolute;
    left: 14px;
    color: var(--color-text-secondary);
    pointer-events: none;
}

.navbar-search-input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    font-size: 0.875rem;
    background: var(--color-bg);
    color: var(--color-text);
    outline: none;
    transition: all var(--transition);
}

.navbar-search-input:focus {
    border-color: var(--color-primary);
    background: var(--color-surface);
    box-shadow: var(--shadow-md);
}

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

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.btn-upload-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--color-surface);
    border: 1px solid var(--color-border-dark);
    border-radius: var(--radius-pill);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text);
    transition: all var(--transition);
}

.btn-upload-nav:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--color-text);
}

/* ==========================================================================
   SUGGESTIONS DROPDOWN
   ========================================================================== */

.suggestions {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    z-index: 200;
    display: none;
    box-shadow: var(--shadow-xl);
    max-height: 360px;
    overflow-y: auto;
}

.suggestion-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--color-text);
    border-bottom: 1px solid var(--color-border);
    transition: background var(--transition);
}

.suggestion-item:last-child { border-bottom: none; }
.suggestion-item:hover { background: var(--color-bg); }

.suggestion-icon { color: var(--color-text-secondary); flex-shrink: 0; }

/* ==========================================================================
   FLASH MESSAGES
   ========================================================================== */

.flash-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 24px 0;
}

.flash {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    animation: slideDown 0.3s ease;
}

.flash-success { background: var(--color-success-bg); color: #065f46; border: 1px solid #6ee7b7; }
.flash-error { background: var(--color-error-bg); color: #991b1b; border: 1px solid #fca5a5; }

.flash-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: inherit;
    opacity: 0.6;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.flash-close:hover { opacity: 1; }

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

/* ==========================================================================
   HERO SECTION
   ========================================================================== */

.hero {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
    padding: 80px 24px 72px;
    text-align: center;
}

.hero-inner { max-width: 680px; margin: 0 auto; }

.hero-title {
    font-size: 2.75rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
    line-height: 1.15;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: rgba(255,255,255,0.75);
    margin-bottom: 36px;
    font-weight: 400;
}

.hero-search-form { width: 100%; }

.hero-search-bar {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--color-surface);
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-xl);
    overflow: visible;
    border: 3px solid transparent;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.hero-search-bar:focus-within {
    border-color: var(--color-accent);
    box-shadow: var(--shadow-xl), 0 0 0 4px rgba(255,56,92,0.15);
}

.hero-search-icon {
    position: absolute;
    left: 20px;
    color: var(--color-text-secondary);
    pointer-events: none;
    z-index: 1;
}

.hero-search-input {
    flex: 1;
    padding: 18px 20px 18px 52px;
    border: none;
    border-radius: var(--radius-pill);
    font-size: 1.0625rem;
    color: var(--color-text);
    outline: none;
    background: transparent;
    min-width: 0;
}

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

.hero-search-btn {
    padding: 12px 28px;
    margin: 6px;
    background: var(--color-accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-pill);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition);
    white-space: nowrap;
    flex-shrink: 0;
}

.hero-search-btn:hover {
    background: var(--color-accent-dark);
    transform: scale(1.02);
}

.hero-suggestions {
    left: 0;
    right: 0;
    border-radius: var(--radius-lg);
}

/* ==========================================================================
   DASHBOARD STATS
   ========================================================================== */

.stats-section {
    margin-top: -36px;
    position: relative;
    z-index: 10;
    padding-bottom: 8px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.stat-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-lg);
    transition: transform var(--transition), box-shadow var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

.stat-icon-total { background: #ede9fe; color: #7c3aed; }
.stat-icon-active { background: var(--color-success-bg); color: var(--color-success); }
.stat-icon-sold { background: var(--color-warning-bg); color: var(--color-warning); }
.stat-icon-changes { background: #fce7f3; color: #db2777; }

.stat-info { display: flex; flex-direction: column; }

.stat-number {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.8125rem;
    color: var(--color-text-secondary);
    font-weight: 500;
}

/* ==========================================================================
   FILTER PILLS
   ========================================================================== */

.filter-section {
    padding: 24px 0 8px;
}

.filter-pills {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: 1px solid var(--color-border-dark);
    border-radius: var(--radius-pill);
    background: var(--color-surface);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}

.filter-pill:hover {
    border-color: var(--color-text);
    color: var(--color-text);
    box-shadow: var(--shadow-sm);
}

.filter-pill.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

.pill-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.pill-dot-active { background: var(--color-success); }
.pill-dot-sold { background: var(--color-warning); }
.pill-dot-rented { background: var(--color-info); }

.filter-pill.active .pill-dot-active,
.filter-pill.active .pill-dot-sold,
.filter-pill.active .pill-dot-rented {
    background: rgba(255,255,255,0.8);
}

/* ==========================================================================
   PROPERTIES GRID (CARD LAYOUT)
   ========================================================================== */

.properties-section {
    padding: 16px 0 48px;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.section-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--color-text);
}

.section-badge {
    display: inline-flex;
    padding: 4px 12px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--color-text-secondary);
}

.properties-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.property-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    transition: transform var(--transition), box-shadow var(--transition);
    cursor: pointer;
    display: block;
    text-decoration: none;
    color: inherit;
}

.property-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card-img-placeholder {
    position: relative;
    height: 160px;
    background: linear-gradient(135deg, #e8ecf1 0%, #d1d8e0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    overflow: hidden;
}

.card-map-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-map-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-status {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    backdrop-filter: blur(8px);
}

.card-body {
    padding: 16px;
}

.card-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 4px;
    min-height: 1.5em;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    color: var(--color-text);
    font-weight: 500;
    margin-bottom: 8px;
}

.card-meta-sep { color: var(--color-text-muted); }

.card-address {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-city {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    margin-bottom: 12px;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid var(--color-border);
}

.card-mls {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-secondary);
}

.card-type {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

/* ==========================================================================
   STATUS BADGES
   ========================================================================== */

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge-lg {
    padding: 6px 16px;
    font-size: 0.8125rem;
}

.status-active { background: var(--color-success-bg); color: #166534; }
.status-sold { background: var(--color-warning-bg); color: #92400e; }
.status-rented { background: var(--color-info-bg); color: #1e40af; }
.status-unknown { background: #f1f5f9; color: #64748b; }

/* Glassmorphism card badges */
.card-img-placeholder .status-active { background: rgba(5,150,105,0.85); color: #fff; }
.card-img-placeholder .status-sold { background: rgba(217,119,6,0.85); color: #fff; }
.card-img-placeholder .status-rented { background: rgba(37,99,235,0.85); color: #fff; }
.card-img-placeholder .status-unknown { background: rgba(100,116,139,0.85); color: #fff; }

.mls-badge-lg {
    display: inline-block;
    padding: 6px 16px;
    background: var(--color-primary);
    color: #fff;
    border-radius: var(--radius-pill);
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}

/* ==========================================================================
   UPLOAD SECTION
   ========================================================================== */

.upload-section {
    padding: 0 0 48px;
}

.upload-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-border);
    overflow: hidden;
    transition: box-shadow var(--transition);
}

.upload-highlight {
    animation: highlightPulse 2s ease;
}

@keyframes highlightPulse {
    0%, 100% { box-shadow: var(--shadow-md); }
    50% { box-shadow: 0 0 0 4px var(--color-accent), var(--shadow-lg); }
}

.upload-card-inner {
    padding: 32px;
}

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

.upload-desc {
    font-size: 0.9375rem;
    color: var(--color-text-secondary);
    margin-top: 8px;
}

.drop-zone {
    border: 2px dashed var(--color-border-dark);
    border-radius: var(--radius-lg);
    padding: 48px 24px;
    text-align: center;
    background: var(--color-bg);
    transition: all var(--transition);
    cursor: pointer;
}

.drop-zone-active,
.drop-zone:hover {
    border-color: var(--color-accent);
    background: #fff5f7;
}

.drop-icon {
    color: var(--color-text-muted);
    margin: 0 auto 16px;
    display: block;
}

.drop-zone-active .drop-icon,
.drop-zone:hover .drop-icon {
    color: var(--color-accent);
}

.drop-text {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 4px;
}

.drop-subtext {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-bottom: 12px;
}

.drop-browse-btn {
    display: inline-block;
    padding: 10px 24px;
    background: var(--color-surface);
    border: 1px solid var(--color-border-dark);
    border-radius: var(--radius-pill);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text);
    cursor: pointer;
    transition: all var(--transition);
}

.drop-browse-btn:hover {
    border-color: var(--color-text);
    box-shadow: var(--shadow-sm);
}

.drop-hint {
    margin-top: 12px;
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    transition: color var(--transition);
}

.drop-hint.file-selected {
    color: var(--color-success);
    font-weight: 600;
}

.btn-import {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 24px;
    margin-top: 20px;
    background: var(--color-success);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-import:hover:not(:disabled) {
    background: #047857;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-import:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==========================================================================
   TIMELINE (RECENT CHANGES)
   ========================================================================== */

.changes-section {
    padding: 0 0 64px;
}

.timeline {
    position: relative;
    padding-left: 28px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--color-border);
}

.timeline-item {
    position: relative;
    padding-bottom: 24px;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
    position: absolute;
    left: -24px;
    top: 6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--color-accent);
    border: 2px solid var(--color-surface);
    box-shadow: 0 0 0 2px var(--color-accent);
}

.timeline-content {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    transition: box-shadow var(--transition);
}

.timeline-content:hover {
    box-shadow: var(--shadow-md);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    flex-wrap: wrap;
    gap: 8px;
}

.timeline-mls {
    font-weight: 700;
    color: var(--color-primary);
    font-size: 0.9375rem;
    transition: color var(--transition);
}

.timeline-mls:hover { color: var(--color-accent); }

.timeline-time {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

.timeline-address {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    margin-bottom: 8px;
}

.timeline-change {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 0.875rem;
}

.timeline-field {
    display: inline-block;
    padding: 2px 10px;
    background: #f1f5f9;
    border-radius: var(--radius-sm);
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-primary);
}

.timeline-arrow { color: var(--color-text-muted); display: flex; align-items: center; }

.timeline-old {
    color: var(--color-error);
    font-weight: 500;
    text-decoration: line-through;
    text-decoration-color: rgba(220,38,38,0.3);
}

.timeline-new {
    color: var(--color-success);
    font-weight: 600;
}

.timeline-file {
    margin-top: 6px;
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

/* ==========================================================================
   EMPTY STATE
   ========================================================================== */

.empty-state {
    text-align: center;
    padding: 64px 24px;
    color: var(--color-text-secondary);
}

.empty-state svg { margin: 0 auto 16px; color: var(--color-text-muted); }
.empty-state h3 { font-size: 1.125rem; font-weight: 600; margin-bottom: 6px; color: var(--color-text); }
.empty-state p { font-size: 0.9375rem; color: var(--color-text-secondary); }

.empty-state-sm { padding: 32px 24px; }

.btn-back-home {
    display: inline-block;
    margin-top: 20px;
    padding: 10px 24px;
    background: var(--color-primary);
    color: #fff;
    border-radius: var(--radius-pill);
    font-weight: 600;
    font-size: 0.875rem;
    transition: background var(--transition);
}

.btn-back-home:hover { background: var(--color-primary-dark); }

/* ==========================================================================
   LOADING SPINNER
   ========================================================================== */

.loading-spinner {
    grid-column: 1 / -1;
    text-align: center;
    padding: 64px 24px;
    color: var(--color-text-secondary);
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: spin 0.8s linear infinite;
}

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

/* ==========================================================================
   SEARCH RESULTS PAGE
   ========================================================================== */

.search-results-header {
    padding-top: 24px;
    margin-bottom: 24px;
}

.results-bar {
    margin-bottom: 16px;
}

.results-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text);
}

.results-info { margin-bottom: 8px; }

/* ==========================================================================
   PROPERTY DETAIL PAGE
   ========================================================================== */

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 24px 0 16px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    transition: color var(--transition);
}

.back-link:hover { color: var(--color-accent); }

/* Detail Hero */
.detail-hero {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-border);
}

.detail-hero-main {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.detail-address {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.2;
}

.detail-location {
    font-size: 1rem;
    color: var(--color-text-secondary);
    margin-top: 4px;
}

.detail-hero-badges {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.btn-zillow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #006AFF;
    color: #fff;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s;
}

.btn-zillow:hover {
    background: #0055cc;
    color: #fff;
    text-decoration: none;
}

.btn-zillow svg {
    flex-shrink: 0;
}

.detail-hero-price {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 16px;
    border-top: 1px solid var(--color-border);
}

.price-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.price-amount {
    font-size: 2rem;
    font-weight: 800;
    color: var(--color-text);
}

.price-sqft {
    font-size: 0.9375rem;
    color: var(--color-text-secondary);
    font-weight: 500;
}

/* Metrics Bar */
.metrics-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 20px 32px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-border);
    flex-wrap: wrap;
}

.metric {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 24px;
}

.metric-icon { color: var(--color-primary); flex-shrink: 0; }

.metric-info { display: flex; flex-direction: column; }

.metric-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.2;
}

.metric-label {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.metric-divider {
    width: 1px;
    height: 40px;
    background: var(--color-border);
}

/* Detail Map */
.detail-map-card {
    height: 300px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 24px;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
}

.detail-map-static {
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 24px;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
}

.detail-map-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

/* Detail Grid */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

.detail-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
}

.detail-card-wide {
    margin-bottom: 24px;
}

.detail-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--color-border);
}

.detail-card-title svg { color: var(--color-primary); flex-shrink: 0; }

.detail-rows {}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.9rem;
}

.detail-row:last-child { border-bottom: none; }

.detail-key {
    font-weight: 500;
    color: var(--color-text-secondary);
    flex-shrink: 0;
}

.detail-val {
    font-weight: 500;
    color: var(--color-text);
    text-align: right;
    word-break: break-word;
}

.legal-text {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    background: var(--color-bg);
    padding: 16px;
    border-radius: var(--radius-md);
    line-height: 1.7;
    word-break: break-word;
}

/* Detail Timeline */
.detail-timeline {
    margin-top: 0;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

.site-footer {
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    padding: 24px 0;
    margin-top: auto;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.footer-left {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}

.footer-brand {
    font-weight: 800;
    color: var(--color-primary);
    letter-spacing: 1px;
}

.footer-separator { color: var(--color-text-muted); }

.footer-right {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 1024px) {
    .properties-grid {
        grid-template-columns: repeat(3, 1fr);
    }

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

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

@media (max-width: 768px) {
    .navbar-inner { height: 64px; gap: 12px; }
    .upload-label { display: none; }
    .navbar-search { max-width: 280px; }

    .hero { padding: 56px 16px 56px; }
    .hero-title { font-size: 1.875rem; }
    .hero-subtitle { font-size: 1rem; margin-bottom: 24px; }

    .hero-search-bar { flex-direction: column; border-radius: var(--radius-lg); padding: 4px; }
    .hero-search-input { padding: 14px 16px 14px 44px; font-size: 1rem; }
    .hero-search-icon { left: 16px; }
    .hero-search-btn { width: 100%; margin: 4px; border-radius: var(--radius-md); padding: 14px; }

    .stats-section { margin-top: -24px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .stat-card { padding: 16px; }
    .stat-number { font-size: 1.375rem; }

    .properties-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .card-img-placeholder { height: 120px; }

    .metrics-bar {
        padding: 16px;
        gap: 0;
    }

    .metric { padding: 8px 12px; }
    .metric-divider { height: 28px; }

    .detail-address { font-size: 1.375rem; }
    .price-amount { font-size: 1.5rem; }
}

@media (max-width: 480px) {
    .container { padding: 0 16px; }
    .navbar-inner { padding: 0 16px; }

    .navbar-search { display: none; }

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

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .stat-card { padding: 12px 16px; }
    .stat-number { font-size: 1.25rem; }
    .stat-icon { width: 40px; height: 40px; }

    .filter-pills { gap: 8px; }
    .filter-pill { padding: 8px 14px; font-size: 0.8125rem; }

    .metrics-bar {
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .metric-divider { display: none; }
    .metric { width: 50%; padding: 10px 8px; }

    .detail-hero { padding: 20px; }
    .detail-hero-main { flex-direction: column; }

    .upload-card-inner { padding: 20px; }
    .drop-zone { padding: 32px 16px; }
}

/* ==========================================================================
   PRINT
   ========================================================================== */

@media print {
    .navbar, .site-footer, .upload-section, .filter-section,
    .hero-search-form, .btn-upload-nav, .back-link { display: none; }

    body { background: #fff; }
    .hero { background: none; padding: 24px 0; }
    .hero-title { color: var(--color-text); font-size: 1.5rem; }
    .hero-subtitle { color: var(--color-text-secondary); }

    .stat-card, .property-card, .detail-card, .upload-card, .timeline-content {
        box-shadow: none;
        border: 1px solid #ddd;
    }

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

    .property-card:hover, .stat-card:hover, .timeline-content:hover {
        transform: none;
        box-shadow: none;
    }
}
