/* WBM Listings Manager — v1.1.0 */
:root {
    --wbm-green:     #1A8F3C;
    --wbm-green-dk:  #146B2D;
    --wbm-green-lt:  #E8F5ED;
    --wbm-navy:      #0B1D3A;
    --wbm-gold:      #E8A838;
    --wbm-white:     #FFFFFF;
    --wbm-gray-100:  #F8F9FA;
    --wbm-gray-200:  #E9ECEF;
    --wbm-gray-400:  #ADB5BD;
    --wbm-gray-600:  #6C757D;
    --wbm-gray-800:  #343A40;
    --wbm-red:       #DC3545;
    --wbm-radius:    8px;
    --wbm-shadow:    0 2px 8px rgba(0,0,0,.1);
}

/* ── Base ── */
.wbm-wrap, .wbm-public-wrap, .wbm-detail-wrap, .wbm-featured-wrap {
    font-family: 'Outfit', 'Inter', system-ui, sans-serif;
    color: var(--wbm-gray-800);
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 16px;
}

/* ── Header ── */
.wbm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--wbm-green);
    flex-wrap: wrap;
    gap: 12px;
}
.wbm-header h1 {
    font-size: 1.6rem !important;
    color: var(--wbm-navy) !important;
    margin: 0 !important;
    font-weight: 700;
}
.wbm-version {
    font-size: .75rem;
    color: var(--wbm-gray-600);
    margin-left: 8px;
    background: var(--wbm-gray-200);
    padding: 2px 8px;
    border-radius: 20px;
}
.wbm-header-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Buttons ── */
.wbm-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: var(--wbm-radius);
    border: none;
    cursor: pointer;
    font-size: .875rem;
    font-weight: 600;
    text-decoration: none !important;
    transition: background .15s, box-shadow .15s;
}
.wbm-btn-primary  { background: var(--wbm-green) !important;  color: #fff !important; }
.wbm-btn-primary:hover  { background: var(--wbm-green-dk) !important; }
.wbm-btn-secondary { background: var(--wbm-navy) !important;  color: #fff !important; }
.wbm-btn-secondary:hover { background: #0d2548 !important; }
.wbm-btn-ghost    { background: transparent !important; color: var(--wbm-gray-600) !important; border: 1px solid var(--wbm-gray-200) !important; }
.wbm-btn-ghost:hover { background: var(--wbm-gray-100) !important; }
.wbm-btn-danger   { background: var(--wbm-red) !important; color: #fff !important; }
.wbm-btn-sm       { padding: 5px 10px !important; font-size: .78rem !important; }

/* ── Stat Cards ── */
.wbm-stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.wbm-stat-card {
    background: var(--wbm-white);
    border: 1px solid var(--wbm-gray-200);
    border-radius: var(--wbm-radius);
    padding: 20px 16px;
    text-align: center;
    box-shadow: var(--wbm-shadow);
}
.wbm-stat-card.wbm-stat-alert { border-top: 3px solid var(--wbm-gold); }
.wbm-stat-value { font-size: 2rem; font-weight: 700; color: var(--wbm-green); }
.wbm-stat-label { font-size: .78rem; color: var(--wbm-gray-600); margin-top: 4px; }

/* ── Tabs ── */
.wbm-tabs {
    display: flex;
    border-bottom: 2px solid var(--wbm-gray-200);
    margin-bottom: 20px;
    gap: 4px;
}
.wbm-tab {
    padding: 10px 20px;
    background: none !important;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-weight: 600;
    font-size: .875rem;
    color: var(--wbm-gray-600) !important;
    margin-bottom: -2px;
    transition: color .15s, border-color .15s;
}
.wbm-tab:hover  { color: var(--wbm-green) !important; }
.wbm-tab.active { color: var(--wbm-green) !important; border-bottom-color: var(--wbm-green); }
.wbm-tab-pane   { display: none; }
.wbm-tab-pane.active { display: block; }

/* ── Toolbar ── */
.wbm-toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.wbm-search-input, .wbm-select {
    padding: 8px 12px;
    border: 1px solid var(--wbm-gray-200);
    border-radius: var(--wbm-radius);
    font-size: .875rem;
    color: var(--wbm-gray-800) !important;
    background: #fff !important;
}
.wbm-search-input { flex: 1; min-width: 180px; }

/* ── Table ── */
.wbm-table-wrap { overflow-x: auto; border-radius: var(--wbm-radius); border: 1px solid var(--wbm-gray-200); }
.wbm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
}
.wbm-table th {
    background: var(--wbm-navy) !important;
    color: #fff !important;
    padding: 12px 14px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}
.wbm-table td {
    padding: 11px 14px;
    border-top: 1px solid var(--wbm-gray-200);
    color: var(--wbm-gray-800) !important;
    vertical-align: middle;
}
.wbm-table tr:hover td { background: var(--wbm-green-lt); }
.wbm-loading { text-align: center; color: var(--wbm-gray-400) !important; padding: 32px !important; }

/* ── Status badges ── */
.wbm-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.wbm-badge-active  { background: #d4edda; color: #155724 !important; }
.wbm-badge-pending { background: #fff3cd; color: #856404 !important; }
.wbm-badge-sold    { background: #cce5ff; color: #004085 !important; }
.wbm-badge-draft   { background: var(--wbm-gray-200); color: var(--wbm-gray-600) !important; }

/* ── Pagination ── */
.wbm-pagination { display: flex; gap: 6px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.wbm-page-btn {
    padding: 7px 13px;
    border: 1px solid var(--wbm-gray-200);
    border-radius: var(--wbm-radius);
    background: #fff !important;
    cursor: pointer;
    font-size: .85rem;
    color: var(--wbm-gray-800) !important;
}
.wbm-page-btn:hover  { border-color: var(--wbm-green); color: var(--wbm-green) !important; }
.wbm-page-btn.active { background: var(--wbm-green) !important; color: #fff !important; border-color: var(--wbm-green); }

/* ── Modal ── */
.wbm-modal {
    position: fixed; inset: 0; z-index: 99999;
    display: flex; align-items: center; justify-content: center;
}
.wbm-modal-backdrop {
    position: absolute; inset: 0;
    background: rgba(0,0,0,.55);
}
.wbm-modal-box {
    position: relative; z-index: 1;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
    max-height: 90vh;
    overflow-y: auto;
    width: 90%;
    max-width: 560px;
}
.wbm-modal-large { max-width: 840px; }
.wbm-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--wbm-gray-200);
    position: sticky; top: 0; background: #fff; z-index: 2;
}
.wbm-modal-header h2 { margin: 0 !important; font-size: 1.2rem !important; color: var(--wbm-navy) !important; }
.wbm-modal-close {
    background: none !important; border: none;
    font-size: 1.2rem; cursor: pointer;
    color: var(--wbm-gray-600) !important;
    line-height: 1; padding: 4px;
}
.wbm-modal-close:hover { color: var(--wbm-red) !important; }
.wbm-modal-body  { padding: 20px 24px; }
.wbm-modal-footer {
    display: flex; justify-content: flex-end; gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--wbm-gray-200);
    background: var(--wbm-gray-100);
    border-radius: 0 0 12px 12px;
}

/* ── Form ── */
.wbm-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.wbm-form-group { display: flex; flex-direction: column; gap: 5px; }
.wbm-col-2 { grid-column: span 2; }
.wbm-form-group label { font-size: .8rem; font-weight: 600; color: var(--wbm-gray-600) !important; }
.wbm-input, .wbm-textarea {
    padding: 9px 12px;
    border: 1px solid var(--wbm-gray-200);
    border-radius: 6px;
    font-size: .875rem;
    color: var(--wbm-gray-800) !important;
    background: #fff !important;
    width: 100%;
    box-sizing: border-box;
}
.wbm-input:focus, .wbm-textarea:focus { outline: 2px solid var(--wbm-green); outline-offset: 0; border-color: var(--wbm-green); }
.wbm-textarea { resize: vertical; }
.wbm-checkbox-label { display: flex !important; flex-direction: row !important; align-items: center; gap: 8px; cursor: pointer; }
.wbm-hint { font-size: .8rem; color: var(--wbm-gray-600) !important; margin-bottom: 12px; }
code { background: var(--wbm-gray-100); padding: 1px 5px; border-radius: 4px; font-size: .8rem; }

/* ── Public Listings — all !important to beat theme overrides ── */
#wbm-public.wbm-public-wrap {
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
}

#wbm-public .wbm-search-hero {
    background: linear-gradient(135deg, #0B1D3A 0%, #1a3a6b 100%) !important;
    padding: 36px 32px !important;
    border-radius: 12px !important;
    margin-bottom: 28px !important;
    box-sizing: border-box !important;
    display: block !important;
}
#wbm-public .wbm-search-hero-title {
    color: #ffffff !important;
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    margin: 0 0 6px 0 !important;
    padding: 0 !important;
    line-height: 1.3 !important;
    display: block !important;
}
#wbm-public .wbm-search-hero-sub {
    color: rgba(255,255,255,.65) !important;
    font-size: .9rem !important;
    margin: 0 0 20px 0 !important;
    padding: 0 !important;
    display: block !important;
}
#wbm-public .wbm-search-row {
    display: flex !important;
    flex-direction: row !important;
    gap: 10px !important;
    margin-bottom: 12px !important;
    align-items: stretch !important;
}
#wbm-public .wbm-pub-search {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    padding: 13px 18px !important;
    border-radius: 8px !important;
    border: none !important;
    outline: none !important;
    font-size: .95rem !important;
    color: #343A40 !important;
    background: #ffffff !important;
    box-shadow: 0 2px 8px rgba(0,0,0,.2) !important;
    box-sizing: border-box !important;
    height: auto !important;
}
#wbm-public .wbm-pub-search:focus {
    outline: 3px solid #E8A838 !important;
    box-shadow: none !important;
}
#wbm-public .wbm-search-btn {
    flex: 0 0 auto !important;
    padding: 13px 28px !important;
    background: #1A8F3C !important;
    background-color: #1A8F3C !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 8px !important;
    font-size: .95rem !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    display: inline-block !important;
    text-decoration: none !important;
    line-height: normal !important;
    box-shadow: none !important;
}
#wbm-public .wbm-search-btn:hover,
#wbm-public .wbm-search-btn:focus {
    background: #146B2D !important;
    background-color: #146B2D !important;
    color: #ffffff !important;
}
#wbm-public .wbm-filter-row {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 10px !important;
}
#wbm-public .wbm-pub-select {
    display: block !important;
    width: 100% !important;
    padding: 10px 14px !important;
    border-radius: 8px !important;
    border: 1px solid rgba(255,255,255,.25) !important;
    font-size: .875rem !important;
    background: rgba(255,255,255,.15) !important;
    background-color: rgba(255,255,255,.15) !important;
    color: #ffffff !important;
    cursor: pointer !important;
    box-sizing: border-box !important;
    height: auto !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}
#wbm-public .wbm-pub-select option {
    color: #343A40 !important;
    background: #ffffff !important;
}
#wbm-public .wbm-pub-select:focus {
    outline: 2px solid #E8A838 !important;
}
#wbm-public .wbm-results-bar {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    margin-bottom: 20px !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
}
#wbm-public .wbm-pub-count {
    font-size: .875rem !important;
    color: #6C757D !important;
}
#wbm-public .wbm-pub-count strong {
    color: #1A8F3C !important;
    font-weight: 700 !important;
}

#wbm-public .wbm-listings-grid,
.wbm-listings-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)) !important;
    gap: 20px !important;
}

.wbm-listing-card {
    background: #fff;
    border: 1px solid var(--wbm-gray-200);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--wbm-shadow);
    transition: box-shadow .2s, transform .2s;
    display: flex; flex-direction: column;
}
.wbm-listing-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,.15); transform: translateY(-2px); }
.wbm-card-img { width: 100%; height: 180px; object-fit: cover; background: var(--wbm-gray-200); }
.wbm-card-img-placeholder {
    width: 100%; height: 180px;
    background: linear-gradient(135deg, var(--wbm-navy) 0%, var(--wbm-green) 100%);
    display: flex; align-items: center; justify-content: center;
    color: rgba(255,255,255,.4); font-size: 2.5rem;
}
.wbm-card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.wbm-card-type { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--wbm-green) !important; }
.wbm-card-title { font-size: 1rem; font-weight: 700; color: var(--wbm-navy) !important; line-height: 1.3; }
.wbm-card-location { font-size: .82rem; color: var(--wbm-gray-600) !important; }
.wbm-card-price { font-size: 1.3rem; font-weight: 800; color: var(--wbm-green) !important; margin-top: 4px; }
.wbm-card-metrics { display: flex; gap: 12px; flex-wrap: wrap; }
.wbm-metric { font-size: .78rem; color: var(--wbm-gray-600) !important; }
.wbm-metric span { font-weight: 700; color: var(--wbm-gray-800) !important; }
.wbm-card-footer { padding: 12px 16px; border-top: 1px solid var(--wbm-gray-200); }
.wbm-card-footer a {
    display: block; text-align: center;
    background: var(--wbm-green) !important;
    color: #fff !important;
    padding: 9px;
    border-radius: 6px;
    font-size: .85rem; font-weight: 600;
    text-decoration: none !important;
    transition: background .15s;
}
.wbm-card-footer a:hover { background: var(--wbm-green-dk) !important; }
.wbm-featured-badge {
    position: absolute; top: 10px; left: 10px;
    background: var(--wbm-gold); color: var(--wbm-navy) !important;
    font-size: .7rem; font-weight: 800;
    padding: 3px 10px; border-radius: 20px;
    text-transform: uppercase;
}
.wbm-card-wrap { position: relative; }

/* ── Detail Page ── */
.wbm-detail-grid { display: grid; grid-template-columns: 1fr 380px; gap: 28px; align-items: start; }
.wbm-detail-main { display: flex; flex-direction: column; gap: 20px; }
.wbm-detail-sidebar { position: sticky; top: 20px; }
.wbm-detail-title { font-size: 1.8rem; font-weight: 800; color: var(--wbm-navy) !important; margin: 0 !important; }
.wbm-detail-type { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--wbm-green) !important; margin-bottom: 6px; }
.wbm-detail-price { font-size: 2rem; font-weight: 800; color: var(--wbm-green) !important; }
.wbm-financials-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 14px; }
.wbm-fin-card {
    background: var(--wbm-gray-100);
    border-radius: 8px; padding: 14px;
    text-align: center;
    border-left: 3px solid var(--wbm-green);
}
.wbm-fin-value { font-size: 1.1rem; font-weight: 800; color: var(--wbm-green) !important; }
.wbm-fin-label { font-size: .72rem; color: var(--wbm-gray-600) !important; margin-top: 3px; }
.wbm-section-title { font-size: 1rem; font-weight: 700; color: var(--wbm-navy) !important; margin: 0 0 10px !important; padding-bottom: 8px; border-bottom: 2px solid var(--wbm-green-lt); }
.wbm-description { line-height: 1.7; color: var(--wbm-gray-800) !important; white-space: pre-line; }

/* Inquiry form card */
.wbm-inquiry-card {
    background: #fff; border: 2px solid var(--wbm-green);
    border-radius: 10px; padding: 24px;
    box-shadow: var(--wbm-shadow);
}
.wbm-inquiry-card h3 { margin: 0 0 16px !important; color: var(--wbm-navy) !important; font-size: 1rem !important; }
.wbm-inquiry-form { display: flex; flex-direction: column; gap: 12px; }
.wbm-inquiry-form input, .wbm-inquiry-form textarea {
    width: 100%; padding: 10px 12px; border: 1px solid var(--wbm-gray-200);
    border-radius: 6px; font-size: .875rem; box-sizing: border-box;
    color: var(--wbm-gray-800) !important;
}
.wbm-inquiry-form button {
    width: 100%; padding: 12px;
    background: var(--wbm-green) !important; color: #fff !important;
    border: none; border-radius: 6px;
    font-size: 1rem; font-weight: 700; cursor: pointer;
}
.wbm-inquiry-form button:hover { background: var(--wbm-green-dk) !important; }
.wbm-inquiry-success { text-align: center; color: var(--wbm-green) !important; font-weight: 600; padding: 16px; }
.wbm-nda-note { font-size: .75rem; color: var(--wbm-gray-600) !important; }

/* ── Import ── */
.wbm-import-result { padding: 12px; border-radius: 6px; font-size: .875rem; margin-top: 12px; }
.wbm-import-result.success { background: #d4edda; color: #155724 !important; }
.wbm-import-result.error   { background: #f8d7da; color: #721c24 !important; }

/* ── Settings ── */
.wbm-settings-form { max-width: 640px; }
.wbm-settings-row { display: flex; align-items: center; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--wbm-gray-200); }
.wbm-settings-row label { font-weight: 600; min-width: 120px; }
.wbm-link { color: var(--wbm-green) !important; font-size: .875rem; }
.wbm-link-sm { font-size: .75rem; color: var(--wbm-gray-600) !important; }
.wbm-loading-msg { text-align: center; padding: 40px; color: var(--wbm-gray-400); }

/* ── Responsive ── */
@media (max-width: 768px) {
    .wbm-form-grid                       { grid-template-columns: 1fr !important; }
    .wbm-col-2                           { grid-column: span 1 !important; }
    .wbm-detail-grid                     { grid-template-columns: 1fr !important; }
    .wbm-detail-sidebar                  { position: static !important; }
    .wbm-modal-box                       { width: 96% !important; }
    #wbm-public .wbm-filter-row          { grid-template-columns: 1fr 1fr !important; }
    #wbm-public .wbm-search-row          { flex-direction: column !important; }
    #wbm-public .wbm-search-btn          { width: 100% !important; }
    #wbm-public .wbm-search-hero         { padding: 24px 16px !important; }
}
@media (max-width: 480px) {
    #wbm-public .wbm-filter-row          { grid-template-columns: 1fr !important; }
}

/* ── Photo Uploader ── */
.wbm-photo-uploader {
    display: flex !important;
    flex-direction: column;
    gap: 12px;
}
.wbm-photo-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    min-height: 0;
}
.wbm-photo-thumb {
    position: relative;
    width: 90px;
    height: 90px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid var(--wbm-gray-200);
    flex-shrink: 0;
}
.wbm-photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.wbm-photo-remove {
    position: absolute !important;
    top: 4px !important;
    right: 4px !important;
    width: 22px !important;
    height: 22px !important;
    border-radius: 50% !important;
    background: rgba(0,0,0,.65) !important;
    color: #fff !important;
    border: none !important;
    cursor: pointer !important;
    font-size: .7rem !important;
    line-height: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    opacity: 0;
    transition: opacity .15s;
}
.wbm-photo-thumb:hover .wbm-photo-remove { opacity: 1 !important; }

/* ── Photo uploader buttons + progress ── */
.wbm-photo-btn-row {
    display: flex !important;
    gap: 8px !important;
    flex-wrap: wrap;
}
.wbm-upload-label {
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
}
.wbm-upload-progress {
    margin-top: 4px;
}
.wbm-upload-bar {
    height: 6px;
    background: var(--wbm-gray-200);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 4px;
}
.wbm-upload-fill {
    height: 100%;
    background: var(--wbm-green);
    border-radius: 3px;
    width: 0;
    transition: width .3s ease;
}
#wbm-upload-status {
    font-size: .78rem;
    color: var(--wbm-gray-600) !important;
}
