/* ══════════════════════════════════════════════════════════════
   BiznesOgłoszenia — Shared CSS
══════════════════════════════════════════════════════════════ */

/* ─── VARIABLES ─── */
:root {
  --green:       #1a5c38;
  --green-deep:  #0f3d25;
  --green-mid:   #236b42;
  --green-light: #eaf4ee;
  --green-pale:  #f3faf5;
  --gold:        #c8922a;
  --gold-light:  #fdf6e9;
  --accent:      #e8f5ed;
  --bg:          #f4f6f4;
  --card:        #ffffff;
  --text:        #18201a;
  --text-muted:  #627068;
  --text-light:  #9aaa9e;
  --border:      #dde8e0;
  --shadow-sm:   0 1px 3px rgba(26,92,56,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:   0 4px 16px rgba(26,92,56,.10), 0 2px 6px rgba(0,0,0,.05);
  --shadow-lg:   0 12px 40px rgba(26,92,56,.14), 0 4px 12px rgba(0,0,0,.08);
  --radius-sm:   8px;
  --radius-md:   12px;
  --radius-lg:   18px;
  --nav-h:       64px;
  --sidebar-w:   240px;
  --ad-w:        300px;
}

/* ─── RESET & BASE ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; }

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ═══════════════════════════════════════════════════════
   NAVIGATION
═══════════════════════════════════════════════════════ */
#nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 900;
  height: var(--nav-h);
  background: var(--green-deep);
  box-shadow: 0 2px 12px rgba(0,0,0,.18);
}
.nav-inner {
  max-width: 1380px; margin: 0 auto;
  height: 100%;
  display: flex; align-items: center; gap: 20px;
  padding: 0 24px;
}
.nav-logo {
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0; color: white;
}
.nav-logo .logo-icon {
  width: 34px; height: 34px;
  background: var(--gold);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800; color: white;
}
.nav-logo .logo-text { font-size: 17px; font-weight: 800; line-height: 1.1; }
.nav-logo .logo-text span { color: var(--gold); }

.nav-search {
  flex: 1; max-width: 520px;
  display: flex; align-items: center;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: background .15s;
}
.nav-search:focus-within { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.3); }
.nav-search input {
  flex: 1; padding: 10px 14px;
  background: none; border: none; outline: none;
  color: white; font-size: 14px;
}
.nav-search input::placeholder { color: rgba(255,255,255,.55); }
.nav-search button {
  padding: 10px 16px;
  background: var(--gold); color: white;
  font-weight: 700; font-size: 13px;
  transition: background .15s;
}
.nav-search button:hover { background: #b07e22; }

.nav-links {
  display: flex; align-items: center; gap: 4px;
  margin-left: auto;
}
.nav-links > a {
  color: rgba(255,255,255,.78);
  font-size: 13.5px; font-weight: 600;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  transition: all .15s;
}
.nav-links > a:hover { color: white; background: rgba(255,255,255,.10); }

.btn-add {
  background: var(--gold) !important;
  color: white !important;
  border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 700 !important;
  padding: 8px 16px !important;
}
.btn-add:hover { background: #b07e22 !important; }

.btn-nav-login {
  color: rgba(255,255,255,.85); font-size: 13.5px; font-weight: 600;
  padding: 7px 12px; border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,.25);
  transition: all .15s;
}
.btn-nav-login:hover { background: rgba(255,255,255,.1); color: white; }

.btn-nav-reg {
  background: white; color: var(--green-deep);
  font-size: 13.5px; font-weight: 700;
  padding: 7px 14px; border-radius: var(--radius-sm);
  transition: all .15s;
}
.btn-nav-reg:hover { background: var(--green-light); }

/* Inbox link with badge */
.nav-inbox-link {
  position: relative;
  color: rgba(255,255,255,.78) !important;
  font-size: 13.5px; font-weight: 600;
  padding: 7px 12px !important;
  border-radius: var(--radius-sm);
  transition: all .15s;
  display: flex; align-items: center; gap: 5px;
}
.nav-inbox-link:hover { color: white !important; background: rgba(255,255,255,.10) !important; }

.unread-badge {
  background: #e53e3e; color: white;
  font-size: 11px; font-weight: 800;
  min-width: 18px; height: 18px;
  border-radius: 9px; padding: 0 5px;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
}
.unread-badge.hidden { display: none; }

/* User menu */
.nav-user-menu { position: relative; }
.nav-user-btn {
  display: flex; align-items: center; gap: 8px;
  color: white; font-size: 13.5px; font-weight: 600;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: background .15s;
}
.nav-user-btn:hover { background: rgba(255,255,255,.10); }
.nav-avatar {
  width: 28px; height: 28px;
  background: var(--gold); color: white;
  border-radius: 50%; font-size: 13px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}

.user-dropdown {
  position: absolute; top: calc(100% + 6px); right: 0;
  min-width: 200px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  opacity: 0; pointer-events: none;
  transform: translateY(-8px);
  transition: all .15s;
}
.user-dropdown.open { opacity: 1; pointer-events: all; transform: translateY(0); }
.user-dropdown-header {
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border);
}
.ud-name { font-weight: 700; font-size: 14px; color: var(--text); }
.ud-email { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.ud-link {
  display: block; padding: 10px 16px;
  font-size: 14px; color: var(--text);
  transition: background .1s;
}
.ud-link:hover { background: var(--green-pale); color: var(--green); }
.ud-link-danger { color: #c53030; }
.ud-link-danger:hover { background: #fff5f5; color: #c53030; }

/* ═══════════════════════════════════════════════════════
   AD SLOTS
═══════════════════════════════════════════════════════ */
.ad-slot {
  background: #f0f0f0;
  border: 1px dashed #ccc;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 4px;
  color: #999; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .5px;
}
.ad-slot .ad-label { font-size: 9px; opacity: .7; }
.ad-leaderboard {
  margin-top: var(--nav-h);
  background: white;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  padding: 10px 0; min-height: 70px;
}
.ad-leaderboard .ad-slot { width: 728px; max-width: 96vw; height: 90px; }
.ad-sidebar .ad-slot { width: 100%; height: 250px; margin-bottom: 16px; }
.ad-sidebar .ad-slot-wide { width: 100%; height: 120px; margin-bottom: 16px; }

/* ═══════════════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════════════ */
.btn-primary {
  background: var(--green); color: white;
  font-size: 14px; font-weight: 700;
  padding: 11px 22px; border-radius: var(--radius-sm);
  cursor: pointer; transition: background .15s;
  border: none;
}
.btn-primary:hover { background: var(--green-deep); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; }

.btn-secondary {
  background: white; color: var(--green);
  font-size: 14px; font-weight: 600;
  padding: 10px 20px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--green);
  cursor: pointer; transition: all .15s;
}
.btn-secondary:hover { background: var(--green-light); }

.btn-gold {
  background: var(--gold); color: white;
  font-size: 14px; font-weight: 700;
  padding: 11px 22px; border-radius: var(--radius-sm);
  border: none; cursor: pointer; transition: background .15s;
}
.btn-gold:hover { background: #b07e22; }

.btn-danger {
  background: #c53030; color: white;
  font-size: 13px; font-weight: 700;
  padding: 8px 16px; border-radius: var(--radius-sm);
  border: none; cursor: pointer; transition: background .15s;
}
.btn-danger:hover { background: #9b2121; }

.btn-block { width: 100%; }

/* ═══════════════════════════════════════════════════════
   FORMS
═══════════════════════════════════════════════════════ */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; font-size: 13px; font-weight: 700;
  color: var(--text); margin-bottom: 6px;
}
.form-group label small { font-weight: 400; color: var(--text-muted); }
.form-control {
  width: 100%; padding: 10px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px; color: var(--text);
  background: white; outline: none;
  transition: border-color .15s;
}
.form-control:focus { border-color: var(--green); }
.form-control::placeholder { color: var(--text-light); }
textarea.form-control { resize: vertical; min-height: 120px; }
select.form-control { appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%23627068' stroke-width='1.5' stroke-linecap='round' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  padding-right: 32px;
}
.form-err {
  color: #c53030; font-size: 13px; font-weight: 600;
  margin-bottom: 10px; min-height: 0;
}
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

/* ═══════════════════════════════════════════════════════
   MODALS
═══════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1100;
  background: rgba(10,30,18,.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none;
  transition: opacity .22s;
}
.modal-overlay.active { opacity: 1; pointer-events: all; }

.modal {
  position: fixed; z-index: 1200;
  top: 50%; left: 50%;
  transform: translate(-50%, -46%) scale(.97);
  width: 440px; max-width: calc(100vw - 24px);
  background: white;
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(10,30,18,.22), 0 4px 16px rgba(0,0,0,.08);
  opacity: 0; pointer-events: none;
  transition: opacity .22s, transform .22s cubic-bezier(.34,1.56,.64,1);
  overflow: hidden;
}
.modal.active {
  opacity: 1; pointer-events: all;
  transform: translate(-50%, -50%) scale(1);
}

/* Coloured top bar */
.modal::before {
  content: '';
  display: block;
  height: 5px;
  background: linear-gradient(90deg, var(--green) 0%, var(--gold) 100%);
}

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 26px 0;
}
.modal-header h2 {
  font-size: 20px; font-weight: 800; color: var(--text);
  letter-spacing: -.3px;
}
.modal-close {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 16px;
  border-radius: 50%; background: var(--bg);
  transition: all .15s; flex-shrink: 0;
}
.modal-close:hover { background: var(--border); color: var(--text); }

.modal-body { padding: 20px 26px 28px; }

/* Inputs inside modals */
.modal-body .form-group { margin-bottom: 14px; }
.modal-body .form-group label {
  font-size: 12.5px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .4px;
  margin-bottom: 6px; display: block;
}
.modal-body input[type="text"],
.modal-body input[type="email"],
.modal-body input[type="password"] {
  width: 100%; padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 14.5px; color: var(--text);
  background: var(--bg);
  outline: none; transition: all .15s;
  font-family: inherit;
}
.modal-body input:focus {
  border-color: var(--green);
  background: white;
  box-shadow: 0 0 0 3px rgba(26,92,56,.1);
}
.modal-body input::placeholder { color: var(--text-light); }

/* Login button inside modal */
.modal-body .btn-primary {
  font-size: 15px; padding: 13px;
  border-radius: 10px; font-weight: 800;
  letter-spacing: .1px;
}

.modal-switch {
  margin-top: 18px; text-align: center;
  font-size: 13.5px; color: var(--text-muted);
}
.modal-switch a { color: var(--green); font-weight: 700; }
.modal-switch a:hover { text-decoration: underline; }

/* ═══════════════════════════════════════════════════════
   TAGS
═══════════════════════════════════════════════════════ */
.tag {
  font-size: 11.5px; font-weight: 700; padding: 3px 9px;
  border-radius: 5px; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 4px;
}
.tag-cat-gold     { background: var(--gold-light); color: var(--gold); }
.tag-cat-udzialy  { background: #e8f0fb; color: #2557c7; }
.tag-cat-akcje    { background: #fce8f5; color: #a327a0; }
.tag-cat-firma    { background: #e8f5fd; color: #0d6d9e; }
.tag-cat-inwestor { background: #f0fce8; color: #2a7a1a; }
.tag-location     { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }
.tag-date         { background: var(--bg); color: var(--text-light); border: 1px solid var(--border); }
.tag-new          { background: #fff3cd; color: #856404; }

/* ═══════════════════════════════════════════════════════
   PAGE LAYOUT HELPERS
═══════════════════════════════════════════════════════ */
.page-top { margin-top: var(--nav-h); }

.page-wrap {
  max-width: 1200px; margin: 0 auto;
  padding: 32px 24px 64px;
}

.page-wrap-wide {
  max-width: 1380px; margin: 0 auto;
  padding: 32px 24px 64px;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 28px;
  align-items: start;
}
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }

.three-col-layout {
  max-width: 1380px; margin: 0 auto;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr var(--ad-w);
  gap: 24px;
  padding: 24px 24px 64px;
}
@media (max-width: 1100px) {
  .three-col-layout { grid-template-columns: 1fr var(--ad-w); }
  .three-col-layout .filters-sidebar { display: none; }
}
@media (max-width: 780px) {
  .three-col-layout { grid-template-columns: 1fr; }
  .three-col-layout .ad-sidebar { display: none; }
}

/* ─── Cards ─── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.card-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.card-header h2 { font-size: 16px; font-weight: 800; }
.card-body { padding: 22px; }

/* ─── Page breadcrumb / header ─── */
.page-header {
  margin-bottom: 24px;
}
.breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-muted);
  margin-bottom: 8px;
}
.breadcrumb a { color: var(--green); }
.breadcrumb span { color: var(--text-light); }
.page-header h1 { font-size: 1.6rem; font-weight: 800; line-height: 1.2; }
.page-header p { color: var(--text-muted); font-size: 14px; margin-top: 6px; }

/* ─── Listing card (shared across pages) ─── */
.listing-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 18px 20px;
  transition: box-shadow .2s, border-color .2s, transform .15s;
  cursor: pointer;
  display: flex; flex-direction: column; gap: 10px;
}
.listing-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--green);
  transform: translateY(-1px);
}
.listing-card-top {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 12px;
}
.listing-card-meta { flex: 1; }
.listing-card-title { font-size: 15.5px; font-weight: 700; margin-bottom: 5px; line-height: 1.35; }
.listing-card-desc {
  font-size: 13.5px; color: var(--text-muted); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.listing-card-price { font-size: 17px; font-weight: 800; color: var(--green); white-space: nowrap; flex-shrink: 0; }
.listing-card-price.negotiable { font-size: 14px; color: var(--text-muted); font-weight: 600; }
.listing-card-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.listing-card-actions {
  display: flex; gap: 8px; align-items: center;
  padding-top: 6px; border-top: 1px solid var(--border);
}
.listing-card-actions .btn-contact {
  flex: 1; padding: 9px;
  background: var(--green); color: white;
  font-size: 13px; font-weight: 700;
  border-radius: var(--radius-sm);
  text-align: center; transition: background .15s;
}
.listing-card-actions .btn-contact:hover { background: var(--green-deep); }
.listing-card-actions .btn-detail {
  padding: 9px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; color: var(--text-muted);
  transition: all .15s;
}
.listing-card-actions .btn-detail:hover { border-color: var(--green); color: var(--green); }

/* ═══════════════════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════════════════ */
#site-footer {
  background: var(--green-deep);
  color: rgba(255,255,255,.8);
  padding: 48px 24px 0;
  margin-top: 64px;
}
.footer-inner {
  max-width: 1380px; margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 40px;
  padding-bottom: 40px;
}
@media (max-width: 900px) { .footer-inner { grid-template-columns: 1fr 1fr; } }
@media (max-width: 540px) { .footer-inner { grid-template-columns: 1fr; } }

.footer-col .footer-logo {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
}
.footer-tagline { font-size: 13.5px; color: rgba(255,255,255,.55); line-height: 1.6; }
.footer-col h4 {
  font-size: 13px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .5px; color: rgba(255,255,255,.5);
  margin-bottom: 12px;
}
.footer-col a {
  display: block; font-size: 13.5px; color: rgba(255,255,255,.72);
  margin-bottom: 7px; transition: color .15s;
}
.footer-col a:hover { color: white; }
.footer-disclaimer { font-size: 12px; color: rgba(255,255,255,.45); line-height: 1.6; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding: 16px 0;
  max-width: 1380px; margin: 0 auto;
  display: flex; justify-content: space-between;
  font-size: 12.5px; color: rgba(255,255,255,.4);
}

/* ═══════════════════════════════════════════════════════
   TOAST
═══════════════════════════════════════════════════════ */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  padding: 12px 20px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; color: white;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px); opacity: 0;
  transition: all .25s;
  max-width: 320px;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast-success { background: var(--green); }
.toast-error   { background: #c53030; }
.toast-info    { background: #2557c7; }

/* ═══════════════════════════════════════════════════════
   FILTERS SIDEBAR (index page)
═══════════════════════════════════════════════════════ */
.filters-sidebar {
  position: sticky; top: calc(var(--nav-h) + 12px);
  height: fit-content;
}
.filter-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden; margin-bottom: 16px;
}
.filter-header {
  background: var(--green-light);
  padding: 12px 16px;
  font-weight: 700; font-size: 13px; color: var(--green);
  display: flex; align-items: center; gap: 6px;
}
.filter-body { padding: 14px 16px; }
.filter-group { margin-bottom: 14px; }
.filter-group:last-child { margin-bottom: 0; }
.filter-group label {
  display: block; font-size: 12px; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: .4px; margin-bottom: 7px;
}
.filter-group select,
.filter-group input[type="text"],
.filter-group input[type="number"] {
  width: 100%; padding: 8px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px; color: var(--text);
  background: white; outline: none;
  transition: border-color .15s;
}
.filter-group select:focus,
.filter-group input:focus { border-color: var(--green); }
.price-range { display: flex; gap: 6px; align-items: center; }
.price-range input { flex: 1; }
.price-range span { color: var(--text-muted); font-size: 13px; }
.btn-filter-apply {
  width: 100%; padding: 9px;
  background: var(--green); color: white;
  font-size: 13px; font-weight: 700;
  border-radius: var(--radius-sm);
  transition: background .15s; cursor: pointer; border: none;
}
.btn-filter-apply:hover { background: var(--green-deep); }
.btn-filter-reset {
  width: 100%; padding: 7px;
  color: var(--text-muted); font-size: 12px; font-weight: 600;
  margin-top: 6px; cursor: pointer;
  background: none; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); transition: all .15s;
}
.btn-filter-reset:hover { border-color: var(--green); color: var(--green); }

/* ═══════════════════════════════════════════════════════
   MESSAGES PAGE
═══════════════════════════════════════════════════════ */
.messages-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  height: calc(100vh - var(--nav-h) - 2px);
  overflow: hidden;
}
@media (max-width: 700px) {
  .messages-layout { grid-template-columns: 1fr; }
  .messages-layout .conv-list-panel.thread-open { display: none; }
  .messages-layout .thread-panel:not(.empty) { display: flex; }
}

.conv-list-panel {
  border-right: 1px solid var(--border);
  background: white;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.conv-list-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.conv-list-header h2 { font-size: 16px; font-weight: 800; }
.conv-list { flex: 1; overflow-y: auto; }
.conv-item {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .15s;
  display: flex; align-items: flex-start; gap: 12px;
}
.conv-item:hover { background: var(--green-pale); }
.conv-item.active { background: var(--green-light); }
.conv-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--green-light);
  color: var(--green); font-size: 16px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.conv-meta { flex: 1; min-width: 0; }
.conv-name { font-weight: 700; font-size: 14px; margin-bottom: 2px; }
.conv-listing { font-size: 12px; color: var(--text-muted); margin-bottom: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-preview { font-size: 13px; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-right { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex-shrink: 0; }
.conv-time { font-size: 11px; color: var(--text-light); }
.conv-unread-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green);
}

.thread-panel {
  display: flex; flex-direction: column;
  background: var(--bg);
  overflow: hidden;
}
.thread-empty {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  color: var(--text-muted);
  gap: 12px;
}
.thread-empty-icon { font-size: 48px; }
.thread-empty p { font-size: 14px; }

.thread-header {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
  display: flex; align-items: center; gap: 12px;
  flex-shrink: 0;
}
.thread-header-info { flex: 1; }
.thread-other-name { font-weight: 700; font-size: 15px; }
.thread-listing-link { font-size: 13px; color: var(--green); }
.thread-listing-link:hover { text-decoration: underline; }

.thread-messages {
  flex: 1; overflow-y: auto;
  padding: 20px;
  display: flex; flex-direction: column; gap: 10px;
}
.msg-bubble {
  max-width: 72%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 14px; line-height: 1.5;
  position: relative;
}
.msg-bubble.mine {
  background: var(--green); color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.msg-bubble.theirs {
  background: white; color: var(--text);
  border: 1px solid var(--border);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.msg-bubble.mine .msg-time { color: rgba(255,255,255,.65); }
.msg-bubble.theirs .msg-time { color: var(--text-light); }
.msg-time { font-size: 11px; margin-top: 4px; display: block; }
.msg-sender-name {
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  margin-bottom: 2px;
}

.thread-compose {
  background: white;
  border-top: 1px solid var(--border);
  padding: 14px 20px;
  display: flex; gap: 10px; align-items: flex-end;
  flex-shrink: 0;
}
.thread-compose textarea {
  flex: 1; padding: 10px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px; resize: none;
  outline: none; line-height: 1.5;
  max-height: 120px; min-height: 44px;
  transition: border-color .15s;
  font-family: inherit;
}
.thread-compose textarea:focus { border-color: var(--green); }
.thread-compose button {
  background: var(--green); color: white;
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  font-weight: 700; font-size: 14px;
  flex-shrink: 0; transition: background .15s;
}
.thread-compose button:hover { background: var(--green-deep); }
.thread-compose button:disabled { opacity: .5; cursor: not-allowed; }

/* ═══════════════════════════════════════════════════════
   ACCOUNT PAGE
═══════════════════════════════════════════════════════ */
.account-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 28px;
  align-items: start;
}
@media (max-width: 760px) { .account-layout { grid-template-columns: 1fr; } }

.account-nav {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  position: sticky;
  top: calc(var(--nav-h) + 16px);
}
.account-nav a {
  display: block; padding: 12px 18px;
  font-size: 14px; font-weight: 600; color: var(--text);
  border-bottom: 1px solid var(--border);
  transition: all .15s;
  display: flex; align-items: center; gap: 8px;
}
.account-nav a:last-child { border-bottom: none; }
.account-nav a:hover { background: var(--green-pale); color: var(--green); }
.account-nav a.active { background: var(--green-light); color: var(--green); font-weight: 700; }

/* My listings mini cards */
.my-listing-row {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 16px 0; border-bottom: 1px solid var(--border);
}
.my-listing-row:last-child { border-bottom: none; }
.my-listing-info { flex: 1; }
.my-listing-title { font-weight: 700; font-size: 14.5px; margin-bottom: 4px; }
.my-listing-meta { font-size: 13px; color: var(--text-muted); }
.my-listing-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* Settings section */
.settings-section { margin-bottom: 36px; }
.settings-section h3 {
  font-size: 15px; font-weight: 800;
  margin-bottom: 16px; padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
}

/* ═══════════════════════════════════════════════════════
   ADD LISTING PAGE
═══════════════════════════════════════════════════════ */
.add-listing-wrap {
  max-width: 780px; margin: 0 auto;
  padding: 32px 24px 80px;
}
.add-listing-wrap .page-top { height: var(--nav-h); }

.cat-select-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px; margin-bottom: 4px;
}
@media (max-width: 640px) { .cat-select-grid { grid-template-columns: repeat(2, 1fr); } }

.cat-select-btn {
  padding: 12px 8px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: center; cursor: pointer;
  transition: all .15s;
  background: white;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.cat-select-btn .cat-icon { font-size: 22px; }
.cat-select-btn .cat-name { font-size: 12px; font-weight: 700; color: var(--text-muted); line-height: 1.3; }
.cat-select-btn:hover { border-color: var(--green); }
.cat-select-btn.selected { border-color: var(--green); background: var(--green-light); }
.cat-select-btn.selected .cat-name { color: var(--green); }

/* ═══════════════════════════════════════════════════════
   LISTING DETAIL PAGE
═══════════════════════════════════════════════════════ */
.listing-detail-hero {
  background: linear-gradient(135deg, var(--green-deep) 0%, var(--green-mid) 100%);
  padding: 32px 24px 28px;
  margin-top: var(--nav-h);
}
.listing-detail-hero-inner { max-width: 1200px; margin: 0 auto; }
.listing-detail-hero .breadcrumb a { color: rgba(255,255,255,.65); }
.listing-detail-hero .breadcrumb span { color: rgba(255,255,255,.4); }
.listing-detail-hero h1 { color: white; font-size: 1.8rem; font-weight: 800; margin-top: 12px; line-height: 1.25; }
.listing-detail-hero .price-hero {
  font-size: 2rem; font-weight: 800; color: var(--gold);
  margin-top: 10px;
}
.listing-detail-hero .price-hero.negotiable { font-size: 1.3rem; color: rgba(255,255,255,.65); font-weight: 600; }

.listing-detail-body { max-width: 1200px; margin: 0 auto; padding: 32px 24px 80px; }

.detail-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.detail-card-section {
  padding: 24px 28px;
  border-bottom: 1px solid var(--border);
}
.detail-card-section:last-child { border-bottom: none; }
.detail-card-section h3 {
  font-size: 14px; font-weight: 800; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .5px;
  margin-bottom: 14px;
}
.detail-desc { font-size: 15px; line-height: 1.75; color: var(--text); white-space: pre-wrap; }

.contact-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  position: sticky;
  top: calc(var(--nav-h) + 16px);
}
.contact-card-header {
  background: var(--green);
  padding: 18px 22px;
  color: white;
}
.contact-card-header h3 { font-size: 16px; font-weight: 800; }
.contact-card-header p { font-size: 13px; color: rgba(255,255,255,.75); margin-top: 4px; }
.contact-card-body { padding: 20px 22px; }
.contact-owner {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 18px;
}
.contact-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--green-light); color: var(--green);
  font-size: 18px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.contact-name { font-weight: 700; font-size: 15px; }
.contact-since { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.contact-phone {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  background: var(--green-pale);
  border-radius: var(--radius-sm);
  font-weight: 700; font-size: 15px;
  color: var(--green); margin-bottom: 12px;
}

.contact-disclaimer {
  font-size: 11.5px; color: var(--text-light);
  line-height: 1.5; margin-top: 14px; text-align: center;
}

/* ═══════════════════════════════════════════════════════
   SIMILAR LISTINGS
═══════════════════════════════════════════════════════ */
.similar-listings { margin-top: 36px; }
.similar-listings h2 { font-size: 18px; font-weight: 800; margin-bottom: 16px; }
.similar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

/* ═══════════════════════════════════════════════════════
   EMPTY STATES
═══════════════════════════════════════════════════════ */
.empty-state {
  text-align: center; padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 52px; margin-bottom: 16px; }
.empty-state h3 { font-size: 18px; font-weight: 800; color: var(--text); margin-bottom: 8px; }
.empty-state p { font-size: 14px; line-height: 1.6; max-width: 360px; margin: 0 auto 20px; }

/* ═══════════════════════════════════════════════════════
   HERO STRIP (index)
═══════════════════════════════════════════════════════ */
.hero-strip {
  background: linear-gradient(135deg, var(--green-deep) 0%, var(--green-mid) 100%);
  padding: 28px 24px 22px;
}
.hero-strip-inner { max-width: 1380px; margin: 0 auto; }
.hero-strip h1 { font-size: 1.5rem; font-weight: 800; color: white; margin-bottom: 6px; }
.hero-strip p { color: rgba(255,255,255,.7); font-size: 14px; margin-bottom: 18px; }
.cat-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-pill {
  padding: 7px 16px; border-radius: 50px;
  font-size: 13px; font-weight: 600;
  border: 1.5px solid rgba(255,255,255,.28);
  color: rgba(255,255,255,.88);
  background: rgba(255,255,255,.10);
  cursor: pointer; transition: all .15s;
  display: flex; align-items: center; gap: 6px;
}
.cat-pill:hover, .cat-pill.active { background: white; color: var(--green-deep); border-color: white; }
.cat-pill .count {
  font-size: 11px; font-weight: 700;
  background: rgba(255,255,255,.25); padding: 1px 6px; border-radius: 10px;
}
.cat-pill.active .count { background: var(--green-light); color: var(--green); }

/* ─── Stats bar ─── */
.stats-bar { background: white; border-bottom: 1px solid var(--border); padding: 10px 24px; }
.stats-bar-inner {
  max-width: 1380px; margin: 0 auto;
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
}
.stat-item { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-muted); }
.stat-item strong { color: var(--green); font-weight: 700; }
.stat-sep { color: var(--border); }

/* ─── Sort bar ─── */
.sort-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 16px; flex-wrap: wrap;
}
.sort-bar-left { font-size: 14px; color: var(--text-muted); }
.sort-bar-left strong { color: var(--text); }
.sort-bar-right { display: flex; align-items: center; gap: 8px; }
.sort-select {
  padding: 7px 10px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: 13px;
  background: white; outline: none; cursor: pointer;
}
.sort-select:focus { border-color: var(--green); }
.view-toggle { display: flex; gap: 2px; }
.view-btn {
  padding: 7px 9px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: 14px;
  color: var(--text-muted); background: white; cursor: pointer; transition: all .15s;
}
.view-btn.active { background: var(--green); border-color: var(--green); color: white; }

/* ─── Listings grid ─── */
.listings-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.listings-grid.grid-2 { grid-template-columns: 1fr 1fr; }

/* ─── Spin loader ─── */
.spinner {
  display: flex; align-items: center; justify-content: center;
  padding: 40px; color: var(--text-muted);
}
.spinner::after {
  content: '';
  width: 28px; height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Confirm dialog ─── */
.confirm-modal { max-width: 360px; }
.confirm-modal .modal-body { padding: 16px 24px 24px; }
.confirm-modal p { font-size: 14px; color: var(--text-muted); margin-bottom: 20px; }
.confirm-btns { display: flex; gap: 10px; justify-content: flex-end; }
