/* ============================================================
   Sandworth Living — Professional Real Estate Design v4
   Palette: Navy #0B3D91 · Orange #F27C3A · Surface #FFFFFF
   Inspired by Trulia / NigeriaPropertyCentre
   ============================================================ */

:root {
    /* === Core Palette === */
    --primary:        #0B3D91;       /* deep navy                  */
    --primary-mid:    #1557C0;       /* medium blue                */
    --primary-dark:   #061f4a;       /* darkest navy               */
    --primary-light:  #EBF0FB;       /* tint for hover/chips       */
    --accent:         #F27C3A;       /* warm orange CTA            */
    --accent-dark:    #D4621E;
    --accent-light:   #FEF0E6;
    --green:          #00875A;       /* available / verified       */
    --green-light:    #E3F5EE;
    --red:            #D32F2F;
    --gold:           #E0A826;

    /* === Surface / Text === */
    --ink:            #1a2744;
    --ink-mid:        #334155;
    --muted:          #64748B;
    --muted-light:    #94A3B8;
    --surface:        #FFFFFF;
    --bg:             #F3F5F9;
    --bg-warm:        #FAF9F7;
    --line:           #E2E8F0;
    --line-light:     #F1F5F9;

    /* === Shadows === */
    --shadow-xs:  0 1px 3px rgba(10,30,70,.06), 0 1px 2px rgba(10,30,70,.04);
    --shadow-sm:  0 2px 8px rgba(10,30,70,.08), 0 1px 3px rgba(10,30,70,.06);
    --shadow-md:  0 4px 16px rgba(10,30,70,.12), 0 2px 6px rgba(10,30,70,.08);
    --shadow-lg:  0 8px 32px rgba(10,30,70,.14), 0 4px 12px rgba(10,30,70,.1);
    --shadow-xl:  0 20px 60px rgba(10,30,70,.18), 0 8px 24px rgba(10,30,70,.12);

    /* === Radii === */
    --r-xs:  4px;
    --r-sm:  8px;
    --r-md:  12px;
    --r-lg:  16px;
    --r-xl:  24px;
    --r-2xl: 32px;
}

/* ──────────────────────────────────────────────────────────
   RESET & BASE
   ────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 15px; }

body {
    margin: 0;
    font-family: "Instrument Sans", system-ui, -apple-system, sans-serif;
    font-size: 1rem;
    line-height: 1.65;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

img  { display: block; width: 100%; object-fit: cover; }
a    { color: inherit; text-decoration: none; }
form { margin: 0; }
h1, h2, h3, h4 { margin-top: 0; line-height: 1.2; font-weight: 700; }
ul   { padding-left: 20px; margin: 8px 0 0; }
li   { margin-bottom: 6px; }

code {
    padding: 2px 8px;
    border-radius: var(--r-xs);
    background: var(--line-light);
    font-size: .85em;
    font-family: monospace;
}

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

/* ──────────────────────────────────────────────────────────
   SHELL
   ────────────────────────────────────────────────────────── */
.site-shell {
    width: min(1320px, calc(100% - 40px));
    margin: 0 auto;
    padding: 0 0 0;
}

/* ──────────────────────────────────────────────────────────
   TOPBAR / HEADER
   ────────────────────────────────────────────────────────── */
.topbar {
    position: sticky;
    top: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    height: 68px;
    padding: 0 28px;
    background: var(--primary-dark);
    border-bottom: none;
    box-shadow: 0 2px 20px rgba(6,31,74,.45);
}

.brand { display: flex; align-items: center; flex-shrink: 0; }

.brand-logo {
    width: auto;
    height: 44px;
    max-width: 200px;
    object-fit: contain;
}

.topnav {
    display: flex;
    align-items: center;
    gap: 0;
}

.topnav a {
    padding: 6px 14px;
    border-radius: var(--r-sm);
    font-size: .875rem;
    font-weight: 600;
    color: rgba(255,255,255,.78);
    letter-spacing: .01em;
    transition: background .15s, color .15s;
    white-space: nowrap;
}

.topnav a.is-active {
    color: #fff;
    background: rgba(255,255,255,.14);
}

.topnav a:hover {
    background: rgba(255,255,255,.12);
    color: #fff;
}

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

/* ──────────────────────────────────────────────────────────
   BUTTONS
   ────────────────────────────────────────────────────────── */
.solid-button, .ghost-button, button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 2px solid transparent;
    border-radius: var(--r-sm);
    padding: 9px 20px;
    font-family: inherit;
    font-size: .875rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: background .16s, border-color .16s, color .16s, box-shadow .16s, transform .1s;
    white-space: nowrap;
    text-decoration: none;
}

.solid-button {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.solid-button:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
    box-shadow: 0 4px 16px rgba(242,124,58,.4);
    transform: translateY(-1px);
    color: #fff;
}
.solid-button:active { transform: translateY(0); }

.ghost-button {
    background: rgba(255,255,255,.1);
    border-color: rgba(255,255,255,.28);
    color: rgba(255,255,255,.9);
}
.ghost-button:hover {
    background: rgba(255,255,255,.18);
    border-color: rgba(255,255,255,.5);
    color: #fff;
}

/* ghost on light backgrounds */
.auth-shell .ghost-button,
.detail-intro-actions .ghost-button,
.filter-panel .ghost-button,
.cta-stack .ghost-button,
.section-heading .ghost-button,
.admin-toolbar .ghost-button {
    background: transparent;
    border-color: var(--line);
    color: var(--ink-mid);
}
.auth-shell .ghost-button:hover,
.detail-intro-actions .ghost-button:hover,
.filter-panel .ghost-button:hover,
.cta-stack .ghost-button:hover,
.section-heading .ghost-button:hover,
.admin-toolbar .ghost-button:hover {
    border-color: var(--primary-mid);
    color: var(--primary);
    background: var(--primary-light);
}

.solid-button.wide,
.ghost-button.wide { width: 100%; }

/* text link */
.text-link {
    color: var(--primary-mid);
    font-weight: 600;
    transition: color .14s;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: transparent;
}
.text-link:hover {
    color: var(--accent);
    text-decoration-color: currentColor;
}

/* ──────────────────────────────────────────────────────────
   FLASH MESSAGES
   ────────────────────────────────────────────────────────── */
.flash-stack {
    display: grid;
    gap: 8px;
    padding: 12px 28px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.flash {
    padding: 12px 18px;
    border-radius: var(--r-sm);
    font-size: .875rem;
    font-weight: 600;
}
.flash-success { background: var(--green-light); color: var(--green); border-left: 4px solid var(--green); }
.flash-error   { background: #FEE2E2; color: var(--red); border-left: 4px solid var(--red); }
.flash-info    { background: var(--primary-light); color: var(--primary); border-left: 4px solid var(--primary-mid); }

/* ──────────────────────────────────────────────────────────
   PAGE CONTENT WRAPPER
   ────────────────────────────────────────────────────────── */
.page-content {
    padding-bottom: 0;
}

/* ──────────────────────────────────────────────────────────
   EYEBROW / LABEL CHIP
   ────────────────────────────────────────────────────────── */
.eyebrow {
    display: inline-block;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 6px;
}

.page-hero .eyebrow,
.hero-copy .eyebrow {
    color: rgba(255,255,255,.7);
    letter-spacing: .12em;
}

/* ──────────────────────────────────────────────────────────
   HOME HERO
   ────────────────────────────────────────────────────────── */
.hero {
    position: relative;
    background:
        linear-gradient(135deg, rgba(8,34,82,.94) 0%, rgba(183,137,43,.58) 42%, rgba(11,61,145,.82) 100%),
        url('../img/Arepo-II4-1024x576.jpg') center/cover no-repeat;
    min-height: 580px;
    display: flex;
    align-items: center;
    padding: 60px max(28px, calc((100vw - 1320px)/2 + 20px));
    overflow: hidden;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 80px;
    background: linear-gradient(to top, var(--bg), transparent);
    pointer-events: none;
}

.hero-copy {
    position: relative;
    z-index: 2;
    max-width: 720px;
    color: #fff;
}

.hero-copy h1 {
    font-family: "Fraunces", Georgia, serif;
    font-size: clamp(2rem, 4.5vw, 3.4rem);
    font-weight: 700;
    line-height: 1.1;
    margin: 0 0 14px;
    color: #fff;
}

.hero-copy > p {
    font-size: 1.05rem;
    color: rgba(255,255,255,.85);
    margin: 0 0 28px;
    max-width: 560px;
}

/* ──────────────────────────────────────────────────────────
   SEARCH TABS
   ────────────────────────────────────────────────────────── */
.hero-tabs {
    display: inline-flex;
    align-self: flex-start;
    flex-wrap: wrap;
    gap: 4px;
    padding: 5px;
    border-radius: var(--r-md);
    background: rgba(255,255,255,.94);
    border: 1px solid rgba(15,23,42,.08);
    backdrop-filter: blur(12px);
    margin: 0 0 18px;
    box-shadow: 0 14px 34px rgba(15,23,42,.16);
}

.tab-search {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    width: auto;
    max-width: 100%;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: var(--surface);
    margin-bottom: 20px;
}

.tab-search-item {
    border: none;
    background: transparent;
    padding: 10px 16px;
    border-radius: var(--r-sm);
    color: var(--muted);
    font: 600 .875rem/1 "Instrument Sans", sans-serif;
    cursor: pointer;
    transition: background .14s, color .14s;
    white-space: nowrap;
}

.tab-search-item.is-active {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 2px 10px rgba(242,124,58,.4);
}

.tab-search-item:hover:not(.is-active) {
    background: var(--accent-light);
    color: var(--accent-dark);
}

.hero-tabs .tab-search-item {
    color: rgb(33 29 29 / 82%);
    font-size: .85rem;
    padding: 10px 14px;
}
.hero-tabs .tab-search-item:hover:not(.is-active) {
    background: var(--accent-light);
    color: #000;
}

/* ──────────────────────────────────────────────────────────
   HERO SEARCH FORM
   ────────────────────────────────────────────────────────── */
.hero-search {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 0;
    background: var(--surface);
    border-radius: var(--r-md);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    border: 2px solid rgba(255,255,255,.2);
    margin-bottom: 22px;
}

.hero-search input,
.hero-search select {
    border: none;
    outline: none;
    padding: 16px 18px;
    font: 500 .975rem/1 "Instrument Sans", sans-serif;
    color: var(--ink);
    background: var(--surface);
}

.hero-search input {
    border-right: 1px solid var(--line);
    min-width: 0;
}

.hero-search select {
    border-right: 1px solid var(--line);
    color: var(--muted);
    cursor: pointer;
    min-width: 130px;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2364748b'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    padding-right: 32px;
}

.hero-search button {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 0 28px;
    font: 700 .9rem/1 "Instrument Sans", sans-serif;
    cursor: pointer;
    transition: background .15s;
    white-space: nowrap;
}
.hero-search button:hover { background: var(--accent-dark); }

/* ──────────────────────────────────────────────────────────
   HERO MARKET STRIP (location quick links)
   ────────────────────────────────────────────────────────── */
.hero-market-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 28px;
    align-items: center;
}

.hero-market-strip::before {
    content: "Popular:";
    font-size: .78rem;
    font-weight: 600;
    color: rgba(255,255,255,.6);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-right: 4px;
}

.hero-market-strip a {
    padding: 5px 14px;
    border-radius: 20px;
    background: rgba(255,255,255,.14);
    border: 1px solid rgba(255,255,255,.25);
    color: rgba(255,255,255,.92);
    font-size: .8rem;
    font-weight: 600;
    transition: background .15s, border-color .15s;
    backdrop-filter: blur(8px);
}

.hero-market-strip a:hover {
    background: rgba(255,255,255,.25);
    border-color: rgba(255,255,255,.5);
    color: #fff;
}

/* ──────────────────────────────────────────────────────────
   STAT GRID (hero bottom stats)
   ────────────────────────────────────────────────────────── */
.stat-grid {
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
}

.stat-grid article {
    display: flex;
    flex-direction: column;
}

.stat-grid strong {
    font-family: "Fraunces", Georgia, serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
    line-height: 1;
}

.stat-grid span {
    font-size: .78rem;
    color: rgba(255,255,255,.65);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-top: 4px;
}

/* ──────────────────────────────────────────────────────────
   BROWSE BY LOCATION (home page)
   ────────────────────────────────────────────────────────── */
.location-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

.location-card {
    position: relative;
    border-radius: var(--r-md);
    overflow: hidden;
    aspect-ratio: 3/2;
    cursor: pointer;
    display: block;
    transition: transform .2s, box-shadow .2s;
}

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

.location-card img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform .4s;
}
.location-card:hover img { transform: scale(1.05); }

.location-card-label {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 20px 14px 12px;
    background: linear-gradient(to top, rgba(6,31,74,.85) 0%, transparent 100%);
    color: #fff;
}

.location-card-label strong {
    display: block;
    font-size: .92rem;
    font-weight: 700;
    line-height: 1.2;
}

.location-card-label span {
    font-size: .75rem;
    color: rgba(255,255,255,.75);
}

/* ──────────────────────────────────────────────────────────
   PAGE HERO (inner pages dark banner)
   ────────────────────────────────────────────────────────── */
.page-hero,
.page-hero.compact {
    width: 100vw;
    margin-left: calc(-1 * (100vw - min(1320px, 100vw - 40px)) / 2);
    padding: 52px max(28px, calc((100vw - min(1320px, 100vw - 40px)) / 2 + 20px)) 48px;
    background:
        linear-gradient(135deg, rgba(6,31,74,.97) 0%, rgba(11,61,145,.92) 100%);
    color: #fff;
    position: relative;
    overflow: hidden;
}

.page-hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        radial-gradient(ellipse at 80% 50%, rgba(242,124,58,.12) 0%, transparent 60%),
        radial-gradient(ellipse at 20% 80%, rgba(21,87,192,.2) 0%, transparent 50%);
    pointer-events: none;
}

.page-hero h1 {
    font-family: "Fraunces", Georgia, serif;
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    font-weight: 700;
    color: #fff;
    margin: 0 0 10px;
    position: relative;
    z-index: 1;
}

.page-hero p {
    color: rgba(255,255,255,.8);
    max-width: 600px;
    font-size: 1rem;
    margin: 0;
    position: relative;
    z-index: 1;
}

.page-hero > div { position: relative; z-index: 1; }

/* ──────────────────────────────────────────────────────────
   SECTION BLOCKS
   ────────────────────────────────────────────────────────── */
.section-block {
    padding: 40px 0;
}

.section-block.section-tight { padding: 20px 0; }

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.section-heading h2 {
    font-family: "Fraunces", Georgia, serif;
    font-size: clamp(1.3rem, 2.5vw, 1.8rem);
    color: var(--ink);
    margin: 0;
}

/* ──────────────────────────────────────────────────────────
   LISTING CARDS (featured / grid)
   ────────────────────────────────────────────────────────── */
.listing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.listing-card {
    background: var(--surface);
    border-radius: var(--r-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform .2s, box-shadow .2s;
    border: 1px solid var(--line);
    display: flex;
    flex-direction: column;
}

.listing-card-link,
.listing-card-media,
.market-listing-media {
    display: block;
    color: inherit;
    text-decoration: none;
}

.listing-card-media {
    overflow: hidden;
}

.listing-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.listing-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    transition: transform .4s;
}

.listing-card:hover img { transform: scale(1.03); }

.listing-card .listing-card-link img { overflow: hidden; }

.listing-card-title-link {
    color: inherit;
    text-decoration: none;
    transition: color .14s ease;
}

.listing-card-title-link:hover {
    color: var(--primary);
}

.listing-body {
    padding: 16px 18px 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.listing-price {
    font-family: "Fraunces", Georgia, serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0 0 4px;
}

.listing-body h3 {
    font-size: .95rem;
    font-weight: 700;
    color: var(--ink);
    margin: 0 0 4px;
    line-height: 1.3;
}

.listing-meta {
    font-size: .82rem;
    color: var(--muted);
    margin: 4px 0 6px;
    border-top: 1px solid var(--line-light);
    padding-top: 8px;
}

.listing-body > p:last-of-type {
    font-size: .82rem;
    color: var(--muted);
    margin: 0 0 10px;
}

.badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 6px 0 12px;
}

.badge-row span,
.chip-row span {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    background: var(--primary-light);
    color: var(--primary-mid);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .03em;
    border: 1px solid transparent;
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip-row span {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: .8rem;
    cursor: default;
    border-color: var(--line);
    background: var(--surface);
    color: var(--ink-mid);
    transition: background .14s, border-color .14s;
}

.chip-row span:hover {
    background: var(--primary-light);
    border-color: var(--primary-mid);
    color: var(--primary);
    cursor: pointer;
}

.type-pill {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .04em;
    background: var(--green-light);
    color: var(--green);
    border: 1px solid var(--green);
}

.type-pill.for-sale {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary-mid);
}

.type-pill.commercial {
    background: #FEF3C7;
    color: #92400E;
    border-color: #F59E0B;
}

.market-listing-link {
    font-size: .82rem;
    font-weight: 700;
    color: var(--primary-mid);
    transition: color .14s;
    text-decoration: none;
}
.listing-card:hover .market-listing-link { color: var(--accent); }

.listing-card-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid var(--line-light);
}

.share-button {
    position: relative;
    appearance: none;
    border: 1px solid var(--line);
    background: #fff;
    color: #3f4868;
    border-radius: 999px;
    width: 40px;
    height: 40px;
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    box-shadow: 0 6px 18px rgba(15, 23, 42, .08);
    transition: background .14s ease, color .14s ease, border-color .14s ease, transform .14s ease, box-shadow .14s ease;
}

.share-button:hover,
.share-button:focus-visible {
    background: #f6f8ff;
    border-color: #adb7d9;
    color: #2f3c73;
    outline: none;
    box-shadow: 0 10px 22px rgba(15, 23, 42, .12);
}

.share-button:active {
    transform: translateY(1px);
}

.share-button.is-success {
    background: #effaf4;
    border-color: #8ed2ab;
    color: #127448;
}

.share-button.is-error {
    background: #fff5f5;
    border-color: #f3b0b0;
    color: #c23f3f;
}

.share-button[data-feedback]::after {
    content: attr(data-feedback);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 10px);
    transform: translateX(-50%);
    background: #1f2a44;
    color: #fff;
    font: 700 .72rem/1 "Instrument Sans", sans-serif;
    padding: 7px 10px;
    border-radius: 999px;
    white-space: nowrap;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .2);
    pointer-events: none;
    z-index: 5;
}

.share-button-icon {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.share-button-icon svg {
    width: 18px;
    height: 18px;
    display: block;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.share-button-icon svg circle {
    fill: #fff;
    stroke: currentColor;
}

/* ──────────────────────────────────────────────────────────
   MARKET GRID / MARKET LISTING GRID
   ────────────────────────────────────────────────────────── */
.market-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.market-card {
    position: relative;
    border-radius: var(--r-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    background: var(--surface);
    border: 1px solid var(--line);
    cursor: pointer;
    transition: transform .2s, box-shadow .2s;
    display: block;
    color: inherit;
}

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

.market-card img { height: 220px; }

.market-card-body {
    padding: 14px 16px 16px;
}

.market-listing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.fresh-listings-section .market-listing-grid {
    gap: 16px;
}

.market-listing-card {
    background: var(--surface);
    border-radius: var(--r-lg);
    overflow: hidden;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
    transition: transform .2s, box-shadow .2s;
    color: inherit;
}

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

.market-listing-media img { height: 200px; }

.fresh-listings-section .market-listing-body {
    padding: 16px 16px 18px;
}

/* ──────────────────────────────────────────────────────────
   PILLAR / FEATURE CARDS
   ────────────────────────────────────────────────────────── */
.pillar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.pillar-card {
    padding: 24px 20px;
    background: var(--surface);
    border-radius: var(--r-lg);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-xs);
    position: relative;
    overflow: hidden;
    transition: box-shadow .2s, border-color .2s;
}

.pillar-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 3px;
    background: linear-gradient(90deg, var(--primary-mid), var(--accent));
}

.pillar-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.pillar-card h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--ink);
    margin: 0 0 8px;
}

.pillar-card p {
    font-size: .875rem;
    color: var(--muted);
    margin: 0;
    line-height: 1.6;
}

/* ──────────────────────────────────────────────────────────
   DETAIL CARDS / ASIDE CARDS
   ────────────────────────────────────────────────────────── */
.detail-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 24px;
    box-shadow: var(--shadow-xs);
}

.detail-card.compact-card { padding: 16px 20px; }

.detail-card h2 {
    font-family: "Fraunces", Georgia, serif;
    font-size: 1.25rem;
    color: var(--ink);
    margin: 0 0 8px;
}

.detail-card p {
    font-size: .875rem;
    color: var(--ink-mid);
    margin: 4px 0;
}

.panel-kicker {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--muted);
    display: block;
    margin-bottom: 4px;
}

.feature-list { padding-left: 16px; }
.feature-list li {
    font-size: .875rem;
    color: var(--ink-mid);
    margin-bottom: 8px;
    padding-left: 4px;
}

.cta-stack { display: grid; gap: 10px; margin-top: 16px; }

.agent-card h3 { margin: 8px 0 6px; font-size: .98rem; }

/* ──────────────────────────────────────────────────────────
   FILTER / SEARCH LAYOUT
   ────────────────────────────────────────────────────────── */
.search-layout-map {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(360px, .8fr);
    gap: 20px;
    min-height: calc(100vh - 140px);
    align-items: start;
    padding: 20px 0;
}

.search-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 24px;
    padding: 24px 0;
    align-items: start;
}

.results-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    position: sticky;
    top: 80px;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: var(--line) transparent;
}

.results-panel::-webkit-scrollbar { width: 4px; }
.results-panel::-webkit-scrollbar-track { background: transparent; }
.results-panel::-webkit-scrollbar-thumb {
    background: var(--line);
    border-radius: 2px;
}

/* ──────────────────────────────────────────────────────────
   FILTER BAR (inline)
   ────────────────────────────────────────────────────────── */
.inline-filter-bar {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 12px 14px;
    box-shadow: var(--shadow-xs);
    align-items: center;
}

.inline-filter-bar input,
.inline-filter-bar select {
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    padding: 9px 12px;
    font: .875rem/1 "Instrument Sans", sans-serif;
    color: var(--ink);
    outline: none;
    background: var(--bg);
    transition: border-color .14s, box-shadow .14s;
}

.inline-filter-bar input:focus,
.inline-filter-bar select:focus {
    border-color: var(--primary-mid);
    box-shadow: 0 0 0 3px rgba(21,87,192,.12);
    background: var(--surface);
}

.inline-filter-bar .check-row {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: .875rem;
    color: var(--ink-mid);
    cursor: pointer;
    white-space: nowrap;
}

.inline-filter-bar .check-row input[type=checkbox] {
    width: 16px; height: 16px;
    padding: 0;
    accent-color: var(--primary-mid);
}

.inline-filter-bar .solid-button {
    padding: 9px 18px;
    border-radius: var(--r-sm);
    font-size: .875rem;
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    white-space: nowrap;
}
.inline-filter-bar .solid-button:hover {
    background: var(--primary-mid);
    border-color: var(--primary-mid);
    box-shadow: 0 4px 12px rgba(11,61,145,.3);
}

/* price range row inside filter bar */
.price-range-row {
    display: flex;
    align-items: center;
    gap: 6px;
    grid-column: 1 / -1;
    border-top: 1px solid var(--line-light);
    padding-top: 10px;
    margin-top: 2px;
    flex-wrap: wrap;
}

.price-range-row label {
    font-size: .78rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .06em;
    white-space: nowrap;
    margin-right: 4px;
}

.price-range-row input,
.price-range-row select {
    flex: 1;
    min-width: 100px;
    max-width: 160px;
}

.price-range-row .range-sep {
    color: var(--muted-light);
    font-size: .8rem;
    font-weight: 600;
}

/* sort row */
.sort-row {
    display: flex;
    align-items: center;
    gap: 8px;
    grid-column: 1 / -1;
    border-top: 1px solid var(--line-light);
    padding-top: 10px;
    margin-top: 2px;
    flex-wrap: wrap;
}

.sort-row label {
    font-size: .78rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .06em;
    white-space: nowrap;
    margin-right: 4px;
}

.sort-row select {
    flex: 0 0 auto;
    min-width: 140px;
}

/* ──────────────────────────────────────────────────────────
   RESULTS HEADER
   ────────────────────────────────────────────────────────── */
.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0 6px;
}

.results-header strong {
    font-family: "Fraunces", Georgia, serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--primary);
}

.results-header span {
    font-size: .875rem;
    color: var(--muted);
}

.results-header .topbar-actions {
    gap: 6px;
}

.results-header .ghost-button {
    font-size: .8rem;
    padding: 7px 14px;
    background: transparent;
    border-color: var(--line);
    color: var(--muted);
}
.results-header .ghost-button:hover {
    border-color: var(--primary-mid);
    color: var(--primary);
    background: var(--primary-light);
}

/* ──────────────────────────────────────────────────────────
   RESULT CARDS (list view)
   ────────────────────────────────────────────────────────── */
.results-list {
    display: grid;
    gap: 14px;
}

.result-card {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    overflow: hidden;
    box-shadow: var(--shadow-xs);
    transition: box-shadow .2s, border-color .2s, transform .2s;
    cursor: pointer;
}

.result-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
    transform: translateX(2px);
}

.result-card img {
    width: 200px;
    height: 100%;
    min-height: 160px;
    object-fit: cover;
    flex-shrink: 0;
    transition: transform .4s;
}
.result-card:hover img { transform: scale(1.04); }

.result-card-body {
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.result-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.result-card-top .listing-price { font-size: 1.1rem; }
.result-card-top h2 {
    font-size: .95rem;
    font-weight: 700;
    margin: 2px 0 4px;
    color: var(--ink);
}

.muted-text {
    font-size: .82rem;
    color: var(--muted);
}

.result-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid var(--line-light);
    gap: 12px;
}

.result-action-links {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* ──────────────────────────────────────────────────────────
   MAP PANE
   ────────────────────────────────────────────────────────── */
.map-pane {
    position: sticky;
    top: 88px;
    border-radius: var(--r-lg);
    overflow: hidden;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
}

.map-canvas {
    height: calc(100vh - 120px);
    width: 100%;
    background: var(--bg);
    border-radius: var(--r-lg);
}

/* ──────────────────────────────────────────────────────────
   EMPTY STATE
   ────────────────────────────────────────────────────────── */
.empty-state {
    padding: 60px 32px;
    text-align: center;
    background: var(--surface);
    border: 2px dashed var(--line);
    border-radius: var(--r-xl);
    grid-column: 1 / -1;
}

.empty-state h2 {
    font-size: 1.1rem;
    color: var(--ink-mid);
    margin: 0 0 8px;
}

.empty-state p {
    font-size: .875rem;
    color: var(--muted);
    margin: 0;
}

/* ──────────────────────────────────────────────────────────
   BREADCRUMB
   ────────────────────────────────────────────────────────── */
.breadcrumb-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 0;
    font-size: .82rem;
    color: var(--muted);
    border-bottom: 1px solid var(--line-light);
    margin-bottom: 20px;
}

.breadcrumb-row a {
    color: var(--primary-mid);
    font-weight: 600;
    transition: color .14s;
}
.breadcrumb-row a:hover { color: var(--accent); }
.breadcrumb-row span:not(.muted-text) { color: var(--muted-light); }

/* ──────────────────────────────────────────────────────────
   PROPERTY DETAIL PAGE
   ────────────────────────────────────────────────────────── */
.detail-intro {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 28px;
    align-items: start;
    padding-bottom: 24px;
}

.detail-intro-copy {}

.detail-intro-top {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 12px;
}

.detail-intro-copy .listing-price {
    font-size: 1.8rem;
    font-weight: 700;
}

.detail-intro-copy h1 {
    font-family: "Fraunces", Georgia, serif;
    font-size: clamp(1.4rem, 2.5vw, 1.9rem);
    color: var(--ink);
    margin: 0 0 6px;
}

.detail-intro-actions {
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: sticky;
    top: 88px;
}

.action-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 24px;
    box-shadow: var(--shadow-md);
}

.action-card-price {
    font-family: "Fraunces", Georgia, serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 16px;
}

.action-card-buttons { display: grid; gap: 10px; }

.action-card .solid-button {
    background: var(--accent);
    border-color: var(--accent);
    justify-content: center;
    padding: 14px 20px;
    font-size: .95rem;
}

/* Gallery */
.gallery-main { border-radius: var(--r-lg); overflow: hidden; margin-bottom: 12px; }
.gallery-main img { height: 400px; border-radius: var(--r-lg); cursor: zoom-in; }
.gallery-thumbs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}
.gallery-thumb {
    border-radius: var(--r-sm);
    overflow: hidden;
    cursor: pointer;
    opacity: .7;
    transition: opacity .2s, transform .2s;
    border: 2px solid transparent;
}
.gallery-thumb:hover { opacity: 1; transform: scale(1.02); }
.gallery-thumb.is-active { opacity: 1; border-color: var(--accent); }
.gallery-thumb img { height: 76px; }

/* chip row in detail */
.detail-intro-chips {
    margin: 12px 0 16px;
}

.detail-intro-chips span {
    padding: 6px 14px;
    border: 1px solid var(--line);
    background: var(--bg);
    color: var(--ink-mid);
    border-radius: 20px;
    font-size: .82rem;
    font-weight: 600;
}

/* Fact strip */
.fact-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    overflow: hidden;
    box-shadow: var(--shadow-xs);
    margin: 20px 0;
}

.fact-strip > div {
    padding: 16px 18px;
    border-right: 1px solid var(--line);
}
.fact-strip > div:last-child { border-right: none; }

.fact-strip span {
    display: block;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
    margin-bottom: 4px;
}

.fact-strip strong {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ink);
}

/* ──────────────────────────────────────────────────────────
   AUTH PAGES
   ────────────────────────────────────────────────────────── */
.auth-shell {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 20px;
    background:
        radial-gradient(ellipse at 30% 50%, rgba(11,61,145,.07) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 50%, rgba(242,124,58,.06) 0%, transparent 50%),
        var(--bg);
}

.auth-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-xl);
    padding: 40px 44px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 460px;
}

.auth-card h1 {
    font-family: "Fraunces", Georgia, serif;
    font-size: 1.6rem;
    color: var(--ink);
    margin: 6px 0 10px;
}

.auth-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-title-row h1 {
    margin: 6px 0 10px;
}

.auth-title-icon {
    width: 40px;
    height: 40px;
    object-fit: contain;
    flex: 0 0 auto;
    margin-top: 2px;
}

.auth-card > p {
    font-size: .9rem;
    color: var(--muted);
    margin: 0 0 24px;
}

.auth-card .muted-text {
    margin-top: 20px;
    font-size: .85rem;
    text-align: center;
}

/* ──────────────────────────────────────────────────────────
   FORMS
   ────────────────────────────────────────────────────────── */
.filter-form,
.filter-panel form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.filter-form label,
.filter-panel label {
    font-size: .82rem;
    font-weight: 700;
    color: var(--ink-mid);
    display: block;
    margin-bottom: 4px;
}

.filter-form input,
.filter-form select,
.filter-form textarea,
.filter-panel input,
.filter-panel select,
.filter-panel textarea {
    width: 100%;
    border: 1.5px solid var(--line);
    border-radius: var(--r-sm);
    padding: 11px 14px;
    font: .9rem/1.5 "Instrument Sans", sans-serif;
    color: var(--ink);
    background: var(--surface);
    outline: none;
    transition: border-color .14s, box-shadow .14s;
}

.filter-form input:focus,
.filter-form select:focus,
.filter-form textarea:focus,
.filter-panel input:focus,
.filter-panel select:focus,
.filter-panel textarea:focus {
    border-color: var(--primary-mid);
    box-shadow: 0 0 0 3px rgba(21,87,192,.12);
}

.filter-form .solid-button {
    padding: 13px 24px;
    font-size: .9rem;
    justify-content: center;
}

.filter-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-xl);
    padding: 28px;
    box-shadow: var(--shadow-sm);
}

.filter-panel h2,
.filter-panel h3 {
    font-family: "Fraunces", Georgia, serif;
    margin: 0 0 18px;
    font-size: 1.1rem;
    color: var(--ink);
}

/* ──────────────────────────────────────────────────────────
   MANAGER STATS / PLAN STATS
   ────────────────────────────────────────────────────────── */
.manager-stats,
.plan-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin: 24px 0;
}

.manager-stats article,
.plan-stats article {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 20px 22px;
    box-shadow: var(--shadow-xs);
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
    overflow: hidden;
    transition: box-shadow .2s;
}

.manager-stats article:hover,
.plan-stats article:hover {
    box-shadow: var(--shadow-sm);
}

.manager-stats article::before,
.plan-stats article::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 3px;
    background: linear-gradient(90deg, var(--primary-mid), var(--accent));
}

.manager-stats span,
.plan-stats span {
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
}

.manager-stats strong,
.plan-stats strong {
    font-family: "Fraunces", Georgia, serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.1;
}

/* ──────────────────────────────────────────────────────────
   MANAGER / PIPELINE
   ────────────────────────────────────────────────────────── */
.manager-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 24px;
    align-items: start;
    margin-top: 28px;
}

.pipeline-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 16px;
}

.pipeline-card {
    padding: 20px;
    background: var(--surface);
    border-radius: var(--r-md);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-xs);
    position: relative;
    overflow: hidden;
    transition: box-shadow .2s;
}

.pipeline-card:hover { box-shadow: var(--shadow-sm); }

.pipeline-card:nth-child(1)::before { background: var(--accent); }
.pipeline-card:nth-child(2)::before { background: var(--gold); }
.pipeline-card:nth-child(3)::before { background: var(--green); }
.pipeline-card:nth-child(n+4)::before { background: var(--primary-mid); }

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

.pipeline-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.pipeline-head span {
    padding: 4px 10px;
    border-radius: var(--r-xs);
    background: var(--primary-light);
    color: var(--primary-mid);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .04em;
    white-space: nowrap;
}

.pipeline-card h3 { margin: 0; font-size: .95rem; }

/* ──────────────────────────────────────────────────────────
   TIMELINE (plan page)
   ────────────────────────────────────────────────────────── */
.timeline-list { display: grid; gap: 12px; }

.timeline-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 16px;
    align-items: start;
    padding: 18px 20px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-xs);
    transition: box-shadow .2s;
    position: relative;
    overflow: hidden;
}

.timeline-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: var(--accent);
}

.timeline-card:hover { box-shadow: var(--shadow-sm); }

.timeline-index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: var(--r-sm);
    background: var(--primary-light);
    color: var(--primary-mid);
    font-weight: 800;
    font-size: .88rem;
    flex-shrink: 0;
    border: 1.5px solid rgba(21,87,192,.2);
}

.timeline-card h3 { margin: 0 0 4px; font-size: .95rem; }
.timeline-card p  { margin: 0; color: var(--muted); font-size: .85rem; }

/* Team list */
.team-list { display: grid; gap: 12px; }

.team-card {
    padding: 16px 18px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    transition: box-shadow .2s;
}
.team-card:hover { box-shadow: var(--shadow-xs); }

.team-card h3 { margin: 4px 0 6px; font-size: .95rem; }
.team-card strong {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--primary-mid);
}
.team-card p {
    color: var(--muted);
    font-size: .85rem;
    margin: 0;
}

/* ──────────────────────────────────────────────────────────
   RECORD TABLE
   ────────────────────────────────────────────────────────── */
.record-table {
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    overflow: hidden;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.record-table-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    gap: 16px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--line-light);
    font-size: .875rem;
    transition: background .12s;
}

.record-table-row:not(.record-table-head):hover { background: var(--bg); }
.record-table-row:last-child { border-bottom: none; }

.record-table-head {
    font-size: .74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--muted);
    background: var(--bg);
}

/* ──────────────────────────────────────────────────────────
   DASHBOARD PIPELINE CARDS (status colors)
   ────────────────────────────────────────────────────────── */
.pipeline-card .pipeline-head span[class*="pending"],
.pipeline-card .pipeline-head span {
    background: var(--primary-light);
    color: var(--primary-mid);
}

/* ──────────────────────────────────────────────────────────
   ADMIN PAGE
   ────────────────────────────────────────────────────────── */
.admin-header {
    background:
        linear-gradient(135deg, rgba(6,31,74,.97) 0%, rgba(11,61,145,.92) 100%);
    border-radius: var(--r-xl);
    padding: 36px 40px 24px;
    color: #fff;
    margin: 24px 0;
    position: relative;
    overflow: hidden;
}

.admin-header::before {
    content: '';
    position: absolute;
    top: -40px; right: -40px;
    width: 200px; height: 200px;
    border-radius: 50%;
    background: rgba(242,124,58,.15);
    pointer-events: none;
}

.admin-header-content { position: relative; z-index: 1; margin-bottom: 20px; }

.admin-header h1 {
    font-family: "Fraunces", Georgia, serif;
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    font-weight: 700;
    color: #fff;
    margin: 6px 0 10px;
}

.admin-header p {
    color: rgba(255,255,255,.75);
    font-size: .9rem;
    max-width: 700px;
    margin: 0;
}

.admin-header-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.admin-header-tabs a {
    display: inline-flex;
    align-items: center;
    padding: 8px 20px;
    border-radius: var(--r-sm);
    font-size: .875rem;
    font-weight: 700;
    color: rgba(255,255,255,.8);
    background: rgba(255,255,255,.1);
    border: 1.5px solid rgba(255,255,255,.2);
    transition: background .15s, color .15s, border-color .15s;
    text-decoration: none;
    min-height: 42px;
}

.admin-header-tabs a:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.admin-header-tabs a.is-active {
    background: rgba(255,255,255,.94);
    border-color: rgba(255,255,255,.94);
    color: var(--primary-mid);
}

.admin-workspace {
    display: grid;
    gap: 24px;
    margin: 24px 0;
}

.admin-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.admin-shortcut-card {
    text-decoration: none;
    color: inherit;
    transition: transform .16s, box-shadow .16s, border-color .16s;
}

.admin-shortcut-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary-light);
    box-shadow: var(--shadow-md);
}

.admin-page-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.admin-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 24px 28px;
    box-shadow: var(--shadow-xs);
}

.admin-toolbar h2 {
    font-size: 1.05rem;
    margin: 4px 0 6px;
    color: var(--ink);
}

.admin-toolbar p {
    font-size: .875rem;
    color: var(--muted);
    margin: 0;
}

.admin-toolbar-form {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-shrink: 0;
}

.admin-section {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-xl);
    padding: 28px 32px;
    box-shadow: var(--shadow-xs);
}

.admin-content-layout {
    display: grid;
    grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
    gap: 20px;
    margin-top: 22px;
    align-items: start;
}

.admin-content-sidebar {
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: sticky;
    top: 92px;
}

.admin-content-sidebar h3 {
    margin: 0;
    color: var(--ink);
    font-size: 1rem;
}

.admin-content-sidebar p {
    margin: 0;
    color: var(--muted);
    font-size: .88rem;
    line-height: 1.6;
}

.admin-content-create-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.admin-content-pages {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.admin-content-page {
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: var(--bg);
    overflow: hidden;
}

.admin-content-page summary {
    list-style: none;
    cursor: pointer;
    padding: 18px 20px;
    background: linear-gradient(135deg, rgba(21,87,192,.06), rgba(242,124,58,.08));
}

.admin-content-page summary::-webkit-details-marker {
    display: none;
}

.admin-content-page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.admin-content-page-heading strong {
    display: block;
    margin-top: 4px;
    font-size: 1rem;
    color: var(--ink);
}

.admin-content-blocks {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
    padding: 18px;
}

.admin-content-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: var(--surface);
    box-shadow: var(--shadow-xs);
}

.admin-content-form-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.admin-content-form-head h3 {
    margin: 4px 0 0;
    color: var(--ink);
    font-size: 1rem;
}

.admin-code-field {
    min-height: 250px;
    font-family: Consolas, "Courier New", monospace;
    font-size: .85rem;
    line-height: 1.65;
    white-space: pre;
}

.admin-form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 16px;
    margin-top: 20px;
}

.admin-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.admin-field label {
    font-size: .8rem;
    font-weight: 700;
    color: var(--ink-mid);
    text-transform: uppercase;
    letter-spacing: .05em;
}

.admin-field input,
.admin-field select,
.admin-field textarea {
    border: 1.5px solid var(--line);
    border-radius: var(--r-sm);
    padding: 10px 14px;
    font: .9rem/1.5 "Instrument Sans", sans-serif;
    color: var(--ink);
    background: var(--bg);
    outline: none;
    transition: border-color .14s, box-shadow .14s;
}

.admin-field input:focus,
.admin-field select:focus,
.admin-field textarea:focus {
    border-color: var(--primary-mid);
    box-shadow: 0 0 0 3px rgba(21,87,192,.1);
    background: var(--surface);
}

.admin-span-3 { grid-column: span 3; }
.admin-span-2 { grid-column: span 2; }

.admin-editor-state {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    font-size: .875rem;
}

.admin-gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0,1fr));
    gap: 12px;
    margin-top: 16px;
}

.admin-gallery-item {
    border-radius: var(--r-sm);
    overflow: hidden;
    border: 2px solid var(--line);
    aspect-ratio: 4/3;
    background: var(--bg);
    transition: border-color .14s;
}

.admin-gallery-item:hover { border-color: var(--primary-mid); }
.admin-gallery-item img { width: 100%; height: 100%; object-fit: cover; }

.admin-preview-card,
.admin-preview-empty {
    border-radius: var(--r-lg);
    overflow: hidden;
    border: 1.5px solid var(--line);
    background: var(--bg);
    min-height: 280px;
    height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: .875rem;
}

.admin-preview-card img {
    width: 100%; height: 100%;
    object-fit: cover;
}

.admin-inventory-table {
    margin-top: 20px;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    overflow: hidden;
    background: var(--surface);
}

.admin-inventory-row {
    display: grid;
    grid-template-columns: minmax(320px, 2.4fr) minmax(90px, .8fr) minmax(120px, .9fr) minmax(100px, .8fr) minmax(100px, .8fr) minmax(110px, .8fr);
    gap: 16px;
    align-items: center;
    padding: 16px 18px;
    border-bottom: 1px solid var(--line-light);
}

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

.admin-inventory-head {
    background: var(--bg);
    color: var(--muted);
    font-size: .74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.admin-property-cell {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    min-width: 0;
}

.admin-property-cell img {
    width: 92px;
    height: 72px;
    border-radius: var(--r-sm);
    object-fit: cover;
    border: 1px solid var(--line);
    background: var(--bg);
}

.admin-property-summary {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.admin-property-summary strong {
    color: var(--ink);
    font-size: .94rem;
    line-height: 1.35;
}

.admin-property-summary span {
    color: var(--muted);
    font-size: .82rem;
    line-height: 1.45;
}

.admin-inventory-value {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: var(--ink);
    font-size: .85rem;
    line-height: 1.45;
}

.admin-inventory-value strong {
    font-size: .9rem;
    color: var(--ink);
}

.admin-inventory-value span {
    color: var(--muted);
    font-size: .78rem;
}

.admin-price-cell strong {
    color: var(--accent-dark);
}

.admin-table-actions {
    display: flex;
    justify-content: flex-start;
}

.admin-table-actions .text-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--bg);
    color: var(--primary-mid);
    font-weight: 700;
    text-decoration: none;
    transition: border-color .14s, background .14s, color .14s;
}

.admin-table-actions .text-link:hover {
    border-color: var(--primary-mid);
    background: var(--primary-light);
    color: var(--primary);
}

.admin-empty-inline {
    grid-column: 1 / -1;
    padding: 8px 0;
    color: var(--muted);
    font-size: .9rem;
}

.admin-inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.admin-property-card {
    background: var(--bg);
    border: 1.5px solid var(--line);
    border-radius: var(--r-md);
    overflow: hidden;
    box-shadow: var(--shadow-xs);
    transition: box-shadow .2s, border-color .2s;
}

.admin-property-card:hover {
    box-shadow: var(--shadow-sm);
    border-color: var(--primary-mid);
}

.admin-property-card img { height: 160px; }

.admin-property-body {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.admin-property-body h3 { font-size: .92rem; margin: 0; }
.admin-property-body p { font-size: .82rem; color: var(--muted); margin: 0; }

.admin-property-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.admin-property-actions .ghost-button {
    font-size: .78rem;
    padding: 6px 12px;
    border-color: var(--line);
    color: var(--muted);
    background: transparent;
}
.admin-property-actions .ghost-button:hover {
    border-color: var(--primary-mid);
    color: var(--primary);
    background: var(--primary-light);
}

.admin-form-actions {
    display: flex;
    gap: 12px;
    padding-top: 16px;
    margin-top: 8px;
    border-top: 1px solid var(--line-light);
}

.admin-status-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: .72rem;
    font-weight: 700;
}

.admin-status-pill.pending { background: #FEF3C7; color: #92400E; }
.admin-status-pill.approved { background: var(--green-light); color: var(--green); }
.admin-status-pill.active { background: var(--primary-light); color: var(--primary-mid); }
.admin-status-pill.rejected { background: #FEE2E2; color: var(--red); }

.admin-apps-table { margin-top: 16px; }
.admin-app-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr auto;
    gap: 14px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--line-light);
    align-items: center;
    font-size: .875rem;
    background: var(--surface);
    transition: background .12s;
}
.admin-app-row:first-child { border-radius: var(--r-md) var(--r-md) 0 0; }
.admin-app-row:last-child { border-bottom: none; border-radius: 0 0 var(--r-md) var(--r-md); }
.admin-app-row:hover { background: var(--bg); }

.admin-app-row.admin-app-head {
    background: var(--bg);
    font-size: .74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--muted);
    border-radius: var(--r-md) var(--r-md) 0 0;
}

.admin-app-actions { display: flex; gap: 6px; }
.admin-app-actions button {
    font-size: .8rem;
    padding: 6px 12px;
    border-radius: var(--r-xs);
    border: 1.5px solid transparent;
    cursor: pointer;
    font-weight: 700;
    transition: .14s;
}
.admin-btn-approve { background: var(--green-light); color: var(--green); border-color: var(--green); }
.admin-btn-approve:hover { background: var(--green); color: #fff; }
.admin-btn-reject { background: #FEE2E2; color: var(--red); border-color: var(--red); }
.admin-btn-reject:hover { background: var(--red); color: #fff; }
.admin-btn-edit { background: var(--primary-light); color: var(--primary-mid); border-color: var(--primary-mid); }
.admin-btn-edit:hover { background: var(--primary-mid); color: #fff; }
.admin-btn-delete { background: var(--line-light); color: var(--muted); border-color: var(--line); }
.admin-btn-delete:hover { background: #FEE2E2; color: var(--red); border-color: var(--red); }

/* ──────────────────────────────────────────────────────────
   MANAGER PAGE (landlord)
   ────────────────────────────────────────────────────────── */
.manager-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: sticky;
    top: 88px;
}

.pipeline-board { display: flex; flex-direction: column; gap: 16px; }

/* ──────────────────────────────────────────────────────────
   RECENT LISTINGS
   ────────────────────────────────────────────────────────── */
.recent-list { display: grid; gap: 10px; }
.recent-card {
    display: grid;
    grid-template-columns: 80px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    font-size: .875rem;
    transition: box-shadow .2s;
}
.recent-card:hover { box-shadow: var(--shadow-xs); }
.recent-card img { height: 56px; border-radius: var(--r-xs); object-fit: cover; }
.recent-card h3 { margin: 0 0 4px; font-size: .875rem; }
.recent-card p { margin: 0; font-size: .8rem; color: var(--muted); }

/* ──────────────────────────────────────────────────────────
   FOOTER
   ────────────────────────────────────────────────────────── */
.site-footer {
    background: var(--primary-dark);
    color: rgba(255,255,255,.8);
    margin-top: 64px;
    /* No padding tricks here — inner wrapper handles centering */
}

.footer-inner {
    max-width: 1320px;
    margin: 0 auto;
    padding: 56px 40px 32px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.8fr 1fr 1fr 1fr;
    gap: 48px 40px;
    margin-bottom: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(255,255,255,.1);
    align-items: start; /* columns don't stretch past their own content */
}

/* Brand column */
.footer-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
}

.footer-brand img {
    display: block;
    width: auto;
    height: 36px;
    opacity: .88;
    margin-bottom: 10px;
}

/* Text logo shown when img fails to load */
.footer-brand-name {
    display: none; /* shown via JS / onerror */
    font-size: 1.25rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -.02em;
    margin-bottom: 10px;
    line-height: 1;
}
.footer-brand-name em {
    font-style: normal;
    color: var(--accent);
}

.footer-brand p {
    font-size: .875rem;
    color: rgba(255,255,255,.58);
    line-height: 1.75;
    margin: 4px 0 18px;
    max-width: 280px;
}

.footer-social {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.footer-social a {
    width: 36px;
    height: 36px;
    border-radius: var(--r-sm);
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.14);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .78rem;
    font-weight: 700;
    color: rgba(255,255,255,.7);
    transition: background .15s, border-color .15s, color .15s;
    text-decoration: none;
    flex-shrink: 0;
}
.footer-social a:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* Nav columns */
.footer-col {
    display: flex;
    flex-direction: column;
}

.footer-col h4 {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: rgba(255,255,255,.38);
    margin: 0 0 18px;
    line-height: 1;
}

.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-col ul li a {
    font-size: .875rem;
    color: rgba(255,255,255,.65);
    transition: color .14s;
    text-decoration: none;
    line-height: 1.4;
}
.footer-col ul li a:hover { color: var(--accent); }

.footer-contact-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.footer-contact-label {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: rgba(255,255,255,.4);
}

.footer-contact-text,
.footer-contact-note {
    font-size: .875rem;
    line-height: 1.55;
    color: rgba(255,255,255,.65);
}

/* Bottom bar */
.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.footer-bottom p {
    font-size: .8rem;
    color: rgba(255,255,255,.38);
    margin: 0;
    line-height: 1.5;
}

.footer-bottom-links {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}
.footer-bottom-links a {
    font-size: .8rem;
    color: rgba(255,255,255,.42);
    transition: color .14s;
    text-decoration: none;
    white-space: nowrap;
}
.footer-bottom-links a:hover { color: rgba(255,255,255,.82); }

/* ──────────────────────────────────────────────────────────
   PAGE TRANSITIONS
   ────────────────────────────────────────────────────────── */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.page-content > section:first-child,
.page-content > nav:first-child + section {
    animation: fadeIn .35s ease-out both;
}

body.is-transitioning * { pointer-events: none; }
body.is-transitioning { opacity: .7; transition: opacity .2s; }

/* ──────────────────────────────────────────────────────────
   UTILITIES
   ────────────────────────────────────────────────────────── */
.muted-text { color: var(--muted); }
.text-center { text-align: center; }

/* ──────────────────────────────────────────────────────────
   RESPONSIVE
   ────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
    .search-layout-map { grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr); }
    .detail-intro { grid-template-columns: 1fr 300px; }
    /* Brand col + 3 nav cols → brand takes full first row, then 3 cols share second row */
    .footer-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 32px 28px;
    }
    .footer-brand {
        grid-column: 1 / -1; /* spans all three columns */
        flex-direction: row;
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 20px;
        padding-bottom: 28px;
        border-bottom: 1px solid rgba(255,255,255,.08);
        margin-bottom: 4px;
    }
    .footer-brand p { margin-bottom: 0; max-width: 340px; }
    .footer-social { align-self: flex-start; margin-top: 0; }
    .manager-layout { grid-template-columns: 1fr; }
    .manager-sidebar { position: static; }
}

@media (max-width: 900px) {
    .topbar { padding: 0 18px; }
    .topnav { display: none; }
    .search-layout-map { grid-template-columns: 1fr; }
    .map-pane { display: none; }
    .detail-intro { grid-template-columns: 1fr; }
    .detail-intro-actions { position: static; }
    .inline-filter-bar { grid-template-columns: 1fr 1fr; }
    .admin-content-layout { grid-template-columns: 1fr; }
    .admin-content-sidebar { position: static; }
    .admin-page-actions { width: 100%; }
    .admin-form-grid { grid-template-columns: 1fr 1fr; }
    .admin-span-3, .admin-span-2 { grid-column: span 2; }
    .admin-inventory-row { grid-template-columns: minmax(280px, 2fr) repeat(5, minmax(90px, 1fr)); gap: 12px; }
    .admin-property-cell { grid-template-columns: 80px minmax(0, 1fr); gap: 12px; }
    .admin-property-cell img { width: 80px; height: 64px; }
    .admin-app-row { grid-template-columns: 1fr 1fr; }
    .admin-app-row.admin-app-head { display: none; }
    .record-table-row { grid-template-columns: 1fr 1fr; }
    .search-layout { grid-template-columns: 1fr; }
    .pipeline-grid { grid-template-columns: repeat(2, 1fr); }
    .gallery-thumbs { grid-template-columns: repeat(3, 1fr); }
    .fact-strip { grid-template-columns: repeat(2, 1fr); }
    .hero { padding: 40px 24px; min-height: 480px; }
}

@media (max-width: 640px) {
    .site-shell { width: calc(100% - 24px); }
    .listing-grid { grid-template-columns: 1fr; }
    .pillar-grid { grid-template-columns: 1fr; }
    .manager-stats, .plan-stats { grid-template-columns: 1fr 1fr; }
    .stat-grid { gap: 20px; }
    .topbar-actions .ghost-button { display: none; }
    .hero-search { grid-template-columns: 1fr; border-radius: var(--r-sm); }
    .hero-search input, .hero-search select { border-right: none; border-bottom: 1px solid var(--line); }
    .hero-search button { padding: 14px; }
    .admin-gallery-grid { grid-template-columns: repeat(2, 1fr); }
    .admin-content-blocks { grid-template-columns: 1fr; padding: 14px; }
    .admin-content-page summary { padding: 16px; }
    .admin-content-form { padding: 16px; }
    .admin-page-actions { flex-direction: column; }
    .admin-form-grid { grid-template-columns: 1fr; }
    .admin-span-3, .admin-span-2 { grid-column: span 1; }
    .admin-inventory-table {
        border: none;
        background: transparent;
        overflow: visible;
    }
    .admin-inventory-head {
        display: none;
    }
    .admin-inventory-row {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 16px;
        margin-bottom: 12px;
        border: 1px solid var(--line);
        border-radius: var(--r-lg);
        background: var(--surface);
    }
    .admin-property-cell {
        grid-template-columns: 72px minmax(0, 1fr);
    }
    .admin-property-cell img {
        width: 72px;
        height: 72px;
    }
    .auth-card { padding: 28px 24px; }
    .result-card { grid-template-columns: 1fr; }
    .result-card img { width: 100%; height: 200px; }
    /* Footer: single column, tighter padding */
    .footer-inner { padding: 40px 24px 28px; }
    .footer-grid { grid-template-columns: 1fr; gap: 28px; }
    .footer-brand { flex-direction: column; border-bottom: none; padding-bottom: 0; margin-bottom: 0; }
    .footer-bottom { flex-direction: column; align-items: flex-start; gap: 14px; }
    .footer-bottom-links { gap: 16px; }
    .location-grid { grid-template-columns: repeat(2, 1fr); }
    .pipeline-grid { grid-template-columns: 1fr; }
    .hero { min-height: 400px; }
    .hero-copy h1 { font-size: 1.8rem; }
    .page-hero, .page-hero.compact { padding: 36px 20px; }
}
