﻿:root {
    --navy: #002244;
    --navy-deep: #001a33;
    --gold: #d4af37;
    --gold-hover: #b8962d;
    --ink: #1f2933;
    --muted: #6b7280;
    --line: #e5e7eb;
    --surface: #f4f5f7;
    --topbar-h: 58px;
    --sidebar-w: 232px;
}

html, body { height: 100%; }
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--ink);
    background: var(--surface);
    font-size: 14.5px;
}
.brand-text { font-family: 'Montserrat', sans-serif; font-weight: 800; letter-spacing: 1px; }
.text-gold { color: var(--gold) !important; }
.text-navy { color: var(--navy) !important; }
a { color: var(--navy); }
a:hover { color: var(--gold-hover); }

.btn-navy { background: var(--navy); color: #fff; border: 1px solid var(--navy); }
.btn-navy:hover, .btn-navy:focus { background: var(--navy-deep); color: #fff; border-color: var(--navy-deep); }
.form-control:focus { border-color: var(--gold); box-shadow: 0 0 0 .2rem rgba(212,175,55,.2); }

/* Top bar */
.topbar { background: var(--navy); height: var(--topbar-h); box-shadow: 0 1px 0 rgba(255,255,255,.06); }
.topbar .navbar-brand { color: #fff; font-size: .95rem; }
.topbar .navbar-brand:hover { color: #fff; }
.brand-icon { height: 28px; width: 28px; object-fit: contain; }
.topbar-link { color: rgba(255,255,255,.8); text-decoration: none; font-size: .9rem; }
.topbar-link:hover { color: var(--gold); }

/* Layout */
.shell { display: flex; padding-top: var(--topbar-h); min-height: 100vh; }
.sidebar { width: var(--sidebar-w); background: #fff; border-right: 1px solid var(--line); flex: 0 0 auto; }
@media (min-width: 992px) {
    .sidebar { position: sticky; top: var(--topbar-h); height: calc(100vh - var(--topbar-h)); overflow-y: auto; }
}
.content { flex: 1 1 auto; min-width: 0; padding: 1.5rem; }
@media (min-width: 992px) { .content { padding: 2rem 2.25rem; } }

.side-section { font-size: .7rem; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); padding: 1.25rem 1.25rem .5rem; }
.side-link {
    display: flex; align-items: center; gap: .65rem;
    padding: .55rem 1.25rem; color: var(--ink); text-decoration: none; font-weight: 500;
    border-left: 3px solid transparent;
}
.side-link i { width: 1.1rem; text-align: center; color: var(--muted); }
.side-link:hover { background: var(--surface); color: var(--navy); }
.side-link.active { background: #fbf6e6; border-left-color: var(--gold); color: var(--navy); }
.side-link.active i { color: var(--gold-hover); }
.side-link .count { margin-left: auto; font-size: .72rem; font-weight: 700; background: var(--navy); color: #fff; border-radius: 10px; padding: 1px 7px; }
.side-link .count:empty { display: none; }
.side-link .count-muted { background: #c8ccd2; }

/* Page header */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.page-title { font-family: 'Montserrat', sans-serif; font-weight: 800; font-size: 1.45rem; color: var(--navy); margin: 0; }
.page-sub { color: var(--muted); font-size: .9rem; }
.page-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.search-box { max-width: 420px; }
.search-box .input-group-text { background: #fff; }

/* Cards */
.card { border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.card-header { background: #fff; font-weight: 600; border-bottom: 1px solid var(--line); font-size: .85rem; letter-spacing: .3px; text-transform: uppercase; color: var(--muted); }
.list-card { overflow: hidden; }

/* Enquiry list */
.enquiry-table thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); background: #fafbfc; padding: .6rem .9rem; }
.enquiry-table td { padding: .75rem .9rem; vertical-align: middle; border-bottom: 1px solid var(--line); cursor: pointer; }
.enquiry-table tbody tr:last-child td { border-bottom: 0; }
.enquiry-table .row-new td { background: #fffdf5; }
.enquiry-table .row-new .from-name { font-weight: 700; }
.col-star { width: 36px; text-align: center; }
.col-status { width: 100px; }
.col-date { width: 110px; white-space: nowrap; color: var(--muted); font-size: .85rem; }
.from-name { font-weight: 600; color: var(--ink); }
.from-email { color: var(--muted); font-size: .82rem; }
.msg-link { color: var(--ink); text-decoration: none; }
.msg-link:hover { color: var(--navy); }
.spam-reason { color: #b45309; font-size: .78rem; margin-top: 2px; }
@media (max-width: 767px) {
    .col-msg, .col-status, .enquiry-table thead { display: none; }
}

.badge-status { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; padding: 3px 8px; border-radius: 4px; }
.badge-new      { background: #fde68a; color: #78350f; }
.badge-read     { background: #e5e7eb; color: #374151; }
.badge-replied  { background: #d1fae5; color: #065f46; }
.badge-archived { background: #e0e7ff; color: #3730a3; }

.empty-state { text-align: center; padding: 4rem 1rem; color: var(--muted); }
.empty-state i { font-size: 2.5rem; display: block; margin-bottom: .5rem; opacity: .4; }

.pager { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 1rem; }
.pager-text { color: var(--muted); font-size: .85rem; }
.pager a[href="#"] { pointer-events: none; opacity: .4; }

/* Detail */
.back-link { color: var(--muted); text-decoration: none; font-size: .9rem; }
.back-link:hover { color: var(--navy); }
.detail-card { overflow: hidden; }
.detail-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--line); }
.detail-name { font-family: 'Montserrat', sans-serif; font-weight: 800; font-size: 1.25rem; color: var(--navy); margin: 0; }
.detail-meta { color: var(--muted); font-size: .9rem; }
.detail-meta a { text-decoration: none; }
.star-btn { font-size: 1.35rem; color: #c8ccd2; text-decoration: none; line-height: 1; padding-top: 2px; }
.star-btn:hover { color: var(--gold); }
.detail-body { padding: 1.5rem; white-space: pre-wrap; word-break: break-word; line-height: 1.65; font-size: 1rem; }
.detail-actions { display: flex; flex-wrap: wrap; gap: .5rem; padding: 1rem 1.5rem; background: #fafbfc; border-top: 1px solid var(--line); }
.detail-actions .btn { font-size: .875rem; }

.meta-list > div { display: flex; flex-direction: column; gap: 2px; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.meta-list > div:last-child { border-bottom: 0; }
.meta-list span { font-size: .72rem; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); }
.meta-list strong { font-weight: 500; }

.related-list { list-style: none; margin: 0; padding: 0; }
.related-list li { display: flex; justify-content: space-between; padding: .6rem 1rem; border-bottom: 1px solid var(--line); font-size: .9rem; }
.related-list li:last-child { border-bottom: 0; }
.related-list a { text-decoration: none; }
.related-list span { color: var(--muted); font-size: .8rem; }

/* Login */
.login-body { background: var(--navy); background-image: radial-gradient(circle at 20% 10%, #0b3566 0, var(--navy) 55%); }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem; }
.login-card { background: #fff; width: 100%; max-width: 400px; padding: 2.25rem 2rem; border-radius: 10px; box-shadow: 0 20px 50px rgba(0,0,0,.35); border-top: 4px solid var(--gold); }
.login-logo { height: 56px; }
.login-card .form-label { font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); }

/* Hidden trap fields (kept off-screen, never display:none) */
.nv-extra { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* Agents */
.avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.avatar-text { background: var(--navy); color: #fff; font-weight: 700; font-size: .8rem; }
.avatar-lg { width: 72px; height: 72px; font-size: 1.4rem; }

/* Listings grid */
.listing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.listing-tile { display: block; background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; text-decoration: none; color: var(--ink); box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.listing-tile:hover { border-color: #c5cbd4; color: var(--ink); }
.lt-img { position: relative; aspect-ratio: 4 / 3; background: #e9ecf0 center / cover no-repeat; }
.lt-status { position: absolute; top: .5rem; left: .5rem; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; padding: 2px 8px; border-radius: 4px; background: #e5e7eb; color: #374151; }
.lt-status.on { background: #d1fae5; color: #065f46; }
.lt-count { position: absolute; bottom: .5rem; right: .5rem; font-size: .75rem; background: rgba(0,0,0,.55); color: #fff; padding: 2px 7px; border-radius: 4px; }
.lt-body { padding: .75rem .9rem; }
.lt-price { font-family: 'Montserrat', sans-serif; font-weight: 800; font-size: 1.1rem; color: var(--navy); }
.lt-addr { font-weight: 600; }
.lt-meta { color: var(--muted); font-size: .82rem; }

/* Share box */
.share-box { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem; background: #fbf6e6; border: 1px solid #ecd9a0; border-radius: 8px; padding: .9rem 1.1rem; margin-bottom: 1.25rem; }
.share-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); }
.share-url { font-weight: 600; word-break: break-all; text-decoration: none; }
.share-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.btn-fb { background: #1877F2; color: #fff; border-color: #1877F2; }
.btn-fb:hover { background: #1566d1; color: #fff; }

/* Photo manager */
.upload-zone { background: var(--surface); border: 1px dashed #c5cbd4; border-radius: 8px; padding: .9rem; margin-bottom: 1rem; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .75rem; }
.photo-tile { position: relative; border: 2px solid transparent; border-radius: 8px; overflow: hidden; background: #fff; }
.photo-tile img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.photo-tile.is-hero { border-color: var(--gold); }
.pt-hero { display: none; position: absolute; top: .4rem; left: .4rem; background: var(--gold); color: var(--navy); font-size: .68rem; font-weight: 700; padding: 1px 6px; border-radius: 3px; }
.photo-tile.is-hero .pt-hero { display: inline-block; }
.pt-size { position: absolute; top: .4rem; right: .4rem; background: rgba(0,0,0,.55); color: #fff; font-size: .68rem; padding: 1px 6px; border-radius: 3px; }
.pt-caption { width: 100%; border: 0; border-top: 1px solid var(--line); font: inherit; font-size: .8rem; padding: .35rem .5rem; }
.pt-actions { display: flex; border-top: 1px solid var(--line); }
.pt-btn { flex: 1; border: 0; background: #fff; padding: .35rem 0; color: var(--muted); cursor: pointer; font-size: .9rem; }
.pt-btn:hover { background: var(--surface); color: var(--navy); }
.pt-drag { cursor: grab; }
.pt-danger:hover { color: #b91c1c; }
.sortable-ghost { opacity: .4; }

/* Listing stats + leads */
.lt-stats { display: flex; gap: .75rem; margin-top: .4rem; font-size: .78rem; color: var(--muted); }
.lt-stats .hot { color: #b45309; font-weight: 600; }
.stat-row { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 1.25rem; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: .6rem 1rem; min-width: 110px; }
.stat strong { display: block; font-family: 'Montserrat', sans-serif; font-size: 1.3rem; color: var(--navy); line-height: 1.1; }
.stat span { font-size: .75rem; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.lead-list { list-style: none; margin: 0; padding: 0; }
.lead-list li { padding: .9rem 1rem; border-bottom: 1px solid var(--line); }
.lead-list li:last-child { border-bottom: 0; }
.lead-list li.is-new { background: #fffdf5; }
.lead-head { display: flex; align-items: center; gap: .5rem; }
.lead-listing, .lead-contact { font-size: .88rem; margin-top: .2rem; }
.lead-listing a, .lead-contact a { text-decoration: none; font-weight: 500; }
.lead-when { font-size: .88rem; margin-top: .2rem; color: #065f46; font-weight: 600; }
.lead-msg { margin-top: .4rem; white-space: pre-wrap; font-size: .92rem; }
.lead-actions { display: flex; gap: .4rem; margin-top: .6rem; }
.pt-room, .pt-after { width: 100%; border: 0; border-top: 1px solid var(--line); font: inherit; font-size: .78rem; padding: .3rem .4rem; background: #fff; }
.pt-after { color: #b45309; }
.agent-logo-preview { max-height: 80px; max-width: 100%; }

/* Floor plan editor */
.plan-editor { position: relative; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; cursor: crosshair; background: #fff; user-select: none; }
.plan-editor img { width: 100%; display: block; pointer-events: none; }
.plan-pin { position: absolute; transform: translate(-50%, -100%); background: var(--navy); color: #fff; border: 2px solid var(--gold); border-radius: 999px; padding: 2px 9px; font-size: .72rem; font-weight: 700; cursor: pointer; white-space: nowrap; box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.plan-pin::after { content: ''; position: absolute; left: 50%; bottom: -7px; width: 8px; height: 8px; background: var(--gold); transform: translateX(-50%) rotate(45deg); }

/* Site media */
.slot-nav .list-group-item { display: flex; justify-content: space-between; align-items: center; font-size: .9rem; }
.slot-nav .list-group-item.active { background: var(--navy); border-color: var(--navy); }
.slot-nav .badge { background: #e5e7eb; color: #374151; }
.slot-nav .active .badge { background: var(--gold); color: var(--navy); }
.logo-grid .photo-tile img { object-fit: contain; background: #f4f5f7; padding: .5rem; }
.pair-list { display: grid; gap: .75rem; margin-top: 1rem; }
.pair-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: .75rem; align-items: center; }
.pair-img { position: relative; }
.pair-img img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; }
.pair-img span { position: absolute; top: .4rem; left: .4rem; background: rgba(0,0,0,.6); color: #fff; font-size: .68rem; text-transform: uppercase; font-weight: 700; padding: 1px 6px; border-radius: 3px; }
