/* ======================================================================
   Family Properties Rentals - Main Stylesheet
   Option B "Soft & Airy" - house palette from CLAUDE.md
   ====================================================================== */

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

:root {
  --bg:        #F4F5F7;
  --surface:   #FFFFFF;
  --nav-dark:  #1e3a5f;
  --text:      #1F2937;
  --muted:     #6B7280;
  --border:    #E5E7EB;
  --accent:    #2563EB;
  --accent-h:  #1D4ED8;
  --success:   #16A34A;
  --warning:   #D97706;
  --danger:    #DC2626;
  --wa:        #25D366;

  --r-card:  12px;
  --r-btn:    8px;
  --r-input:  6px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.10);
  --shadow:    0 2px 12px rgba(0,0,0,.09);
  --shadow-lg: 0 8px 28px rgba(0,0,0,.13);
}

body {
  font-family: -apple-system, "Segoe UI", Roboto, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ── TOP CONTACT STRIP ──────────────────────────────────────────────── */
.top-strip {
  background: var(--nav-dark);
  color: rgba(255,255,255,.72);
  font-size: .78rem;
  display: flex; align-items: center; justify-content: center;
  gap: 18px; padding: 7px 20px; flex-wrap: wrap;
}
.top-strip a { color: #fff; font-weight: 600; text-decoration: none; }
.top-strip a:hover { text-decoration: underline; }
.top-strip .sep { opacity: .3; }

/* ── HEADER ─────────────────────────────────────────────────────────── */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 200;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
}
.header-inner {
  max-width: 100%; margin: 0 auto; padding: 0 24px;
  height: 64px; display: flex; align-items: center; gap: 16px;
}
.brand { display: flex; align-items: baseline; gap: 10px; }
.brand-name { font-size: 1.05rem; font-weight: 800; letter-spacing: -.01em; }
.brand-sub  { font-size: .75rem; color: var(--muted); }
.header-nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav-link {
  color: var(--muted); font-size: .85rem; font-weight: 500;
  padding: 7px 14px; border-radius: var(--r-btn); transition: all .15s;
}
.nav-link:hover { background: #f1f5f9; color: var(--text); }
.nav-cta {
  background: var(--accent); color: #fff !important;
  border-radius: var(--r-btn); padding: 8px 18px;
  font-size: .85rem; font-weight: 600; transition: background .15s;
}
.nav-cta:hover { background: var(--accent-h); }
.nav-wa {
  background: var(--wa); color: #fff !important;
  border-radius: var(--r-btn); padding: 8px 16px;
  font-size: .82rem; font-weight: 700; display: flex; align-items: center; gap: 6px;
  transition: opacity .15s;
}
.nav-wa:hover { opacity: .88; }
.user-pill {
  display: flex; align-items: center; gap: 8px;
  background: #f1f5f9; border-radius: 20px; padding: 5px 14px 5px 8px;
  font-size: .82rem;
}
.user-pill .avatar {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent); color: #fff;
  font-size: .72rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.btn-logout {
  background: none; border: 1.5px solid var(--border); border-radius: 6px;
  padding: 6px 14px; font-size: .8rem; font-weight: 600; cursor: pointer;
  color: var(--muted); transition: all .15s;
}
.btn-logout:hover { border-color: var(--danger); color: var(--danger); }

/* ── BUTTONS ────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: var(--r-btn); padding: 10px 22px;
  font-size: .9rem; font-weight: 600; cursor: pointer;
  transition: all .15s; text-decoration: none; border: none;
}
.btn-primary   { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-h); }
.btn-outline   { background: #fff; color: var(--text); border: 1.5px solid var(--border); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-success   { background: var(--success); color: #fff; }
.btn-success:hover { opacity: .9; }
.btn-danger    { background: var(--danger); color: #fff; }
.btn-danger:hover  { opacity: .9; }
.btn-wa        { background: var(--wa); color: #fff; }
.btn-wa:hover  { opacity: .88; }
.btn-sm        { padding: 6px 14px; font-size: .8rem; }

/* ── HERO ────────────────────────────────────────────────────────────── */
.hero {
  max-width: 100%; margin: 32px auto 0; padding: 0 24px;
  display: grid; grid-template-columns: 1fr 400px; gap: 48px; align-items: start;
  position: relative;
}
/* Views slideshow: the view image REPLACES the hero text (alternating),
   with an animated fade+slide transition. */
.hero-text  { position: relative; }
.hero-panel { position: relative; z-index: 1; }
.hero-text > .hero-logo,
.hero-text > .hero-title,
.hero-text > .hero-desc { transition: opacity .5s ease; }
.hero-text.showview > .hero-logo,
.hero-text.showview > .hero-title,
.hero-text.showview > .hero-desc { opacity: 0; }
.hero-view {
  position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background-size: cover; background-position: center; background-repeat: no-repeat;
  border-radius: 12px; box-shadow: var(--shadow);
  opacity: 0; transform: translateY(12px) scale(.99);
  transition: opacity .5s ease, transform .5s ease;
}
.hero-text.showview .hero-view { opacity: 1; transform: translateY(0) scale(1); }
.hero-eyebrow {
  display: inline-block; background: #eff6ff; color: var(--accent);
  font-size: .73rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  padding: 4px 12px; border-radius: 20px; margin-bottom: 16px;
}
.hero-logo {
  height: 195px; width: auto; max-width: 100%;
  display: block; margin: 0 auto 20px; border-radius: 8px;
}
.hero-title {
  font-size: 2.4rem; font-weight: 800; line-height: 1.18;
  letter-spacing: -.02em; margin-bottom: 16px; text-align: center;
}
.hero-title em { font-style: normal; color: var(--accent); }
.hero-desc { color: var(--muted); font-size: .97rem; line-height: 1.7; margin-bottom: 26px; text-align: center; }
.hero-ctas { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; }
.hero-trust { display: flex; gap: 20px; flex-wrap: wrap; }
.trust-item { display: flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--muted); }
.trust-icon {
  width: 30px; height: 30px; background: #eff6ff; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 1rem;
}

/* Hero stats panel */
.hero-panel {
  background: var(--surface); border-radius: 16px; padding: 20px;
  box-shadow: var(--shadow-lg); border: 1px solid var(--border);
}
.panel-title {
  font-size: .72rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 18px;
}
.panel-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stat-box { background: #f8fafc; border-radius: 10px; padding: 14px; text-align: center; }
.stat-val { font-size: 1.9rem; font-weight: 800; line-height: 1; }
.stat-val.accent { color: var(--accent); }
.stat-val.green  { color: var(--success); }
.stat-val.warn   { color: var(--warning); }
.stat-label { font-size: .72rem; color: var(--muted); margin-top: 4px; }
.panel-divider { border: none; border-top: 1px solid var(--border); margin: 14px 0; }
.panel-trust {
  display: flex; flex-wrap: wrap; gap: 10px 18px;
  justify-content: center; margin-top: 16px;
}

/* ── FILTER BAR ──────────────────────────────────────────────────────── */
.filter-section {
  max-width: 100%; margin: 8px auto 0; padding: 0 24px;
}
.filter-section-title {
  font-size: 1.3rem; font-weight: 800; margin-bottom: 14px;
}
.filter-row {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  padding-bottom: 4px;
}
.filter-divider { width: 1px; height: 22px; background: var(--border); margin: 0 4px; }
.pill {
  padding: 6px 16px; border-radius: 20px; border: 1.5px solid var(--border);
  background: var(--surface); color: var(--muted); font-size: .8rem; font-weight: 500;
  cursor: pointer; white-space: nowrap; transition: all .15s; user-select: none;
}
.pill:hover  { border-color: var(--accent); color: var(--accent); }
.pill.active { background: #eff6ff; border-color: var(--accent); color: var(--accent); font-weight: 700; }
.pill.status-available.active { background: #dcfce7; border-color: var(--success); color: #166534; }
.pill.status-let.active { background: #fee2e2; border-color: var(--danger); color: #991b1b; }
.pill.status-soon.active { background: #fef9c3; border-color: var(--warning); color: #854d0e; }
.filter-count { margin-left: auto; font-size: .82rem; color: var(--muted); }

/* ── PROPERTY GRID ───────────────────────────────────────────────────── */
.properties-grid {
  max-width: 100%; margin: 24px auto 56px; padding: 0 24px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}
.no-results {
  max-width: 100%; margin: 0 auto; padding: 40px 24px;
  text-align: center; color: var(--muted); font-size: .95rem;
}

/* ── PROPERTY CARD ───────────────────────────────────────────────────── */
.prop-card {
  background: var(--surface); border-radius: var(--r-card);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  overflow: hidden; transition: box-shadow .2s, transform .2s;
  cursor: pointer;
}
.prop-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }

/* Card photo */
.card-photo {
  height: 210px; position: relative; overflow: hidden;
  background: #e2e8f0;
  display: flex; align-items: center; justify-content: center;
}
.card-photo img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .4s ease;
}
.prop-card:hover .card-photo img { transform: scale(1.04); }
.card-photo-placeholder {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: #94a3b8; font-size: .82rem;
}
.card-photo-placeholder span { font-size: 2.5rem; }

/* Status badge */
.status-badge {
  position: absolute; top: 12px; right: 12px;
  padding: 3px 10px; border-radius: 12px;
  font-size: .7rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
}
.status-badge.available { background: #dcfce7; color: #166534; }
.status-badge.let        { background: #fee2e2; color: #991b1b; }
.status-badge.soon       { background: #fef9c3; color: #854d0e; }

/* Photo count badge */
.photo-count-badge {
  position: absolute; bottom: 10px; right: 10px;
  background: rgba(0,0,0,.55); color: #fff;
  font-size: .7rem; padding: 2px 8px; border-radius: 10px;
  display: flex; align-items: center; gap: 4px;
}

/* Card body */
.card-body { padding: 18px; }
.card-location {
  display: flex; align-items: center; gap: 5px;
  font-size: .78rem; color: var(--muted); margin-bottom: 6px;
}
.card-name { font-size: 1.05rem; font-weight: 700; margin-bottom: 12px; }
.card-specs {
  display: flex; gap: 8px 12px; flex-wrap: wrap; align-content: flex-start;
  font-size: .78rem; color: var(--muted); margin-bottom: 14px;
  min-height: 46px;   /* reserve 2 lines so all cards align even with few icons */
}
.spec { display: flex; align-items: center; gap: 4px; }

/* Card footer */
.card-footer {
  display: flex; align-items: center; justify-content: space-between;
  border-top: 1px solid var(--border); padding-top: 14px;
}
.card-price {}
.price-val   { font-size: 1.25rem; font-weight: 800; }
.price-per   { font-size: .73rem; color: var(--muted); }
.price-lock  { font-size: .78rem; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.price-lock strong { color: var(--accent); }

.card-enquire {
  background: var(--accent); color: #fff;
  border: none; border-radius: 8px; padding: 9px 18px;
  font-size: .83rem; font-weight: 600; cursor: pointer; transition: background .15s;
}
.card-enquire:hover { background: var(--accent-h); }

/* ── PHOTO GALLERY MODAL ─────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  z-index: 500; display: flex; align-items: center; justify-content: center;
  padding: 16px;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--surface); border-radius: 16px;
  width: 100%; max-width: 860px; max-height: 92vh;
  overflow-y: auto; box-shadow: 0 24px 64px rgba(0,0,0,.25);
  transform: translateY(20px); transition: transform .25s;
}
.modal-overlay.open .modal { transform: translateY(0); }

.modal-header {
  padding: 20px 24px 16px; border-bottom: 1px solid var(--border);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  position: sticky; top: 0; background: var(--surface); z-index: 10;
}
.modal-title { font-size: 1.2rem; font-weight: 800; }
.modal-subtitle { font-size: .83rem; color: var(--muted); margin-top: 3px; }
.modal-close {
  background: #f1f5f9; border: none; border-radius: 8px; width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 1.1rem; color: var(--muted); transition: all .15s;
  flex-shrink: 0;
}
.modal-close:hover { background: #fee2e2; color: var(--danger); }

.modal-body { padding: 24px; }

/* Gallery carousel */
.gallery-main {
  width: 100%; border-radius: 10px; overflow: hidden;
  background: #1e293b; margin-bottom: 12px; position: relative;
}
.gallery-main img {
  width: 100%; max-height: 440px; object-fit: contain;
  display: block; background: #1e293b;
}
.gallery-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  display: flex; justify-content: space-between; width: 100%; padding: 0 10px;
  pointer-events: none;
}
.gallery-btn {
  background: rgba(0,0,0,.55); color: #fff; border: none;
  border-radius: 50%; width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; pointer-events: all; transition: background .15s;
  font-size: 1rem;
}
.gallery-btn:hover { background: rgba(0,0,0,.8); }
.gallery-caption {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,.7));
  color: #fff; padding: 20px 14px 10px;
  font-size: .8rem; font-weight: 600;
}
.gallery-thumbs {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.gallery-thumb {
  width: 68px; height: 52px; border-radius: 6px; overflow: hidden;
  border: 2px solid transparent; cursor: pointer; transition: all .15s;
  background: #e2e8f0; flex-shrink: 0;
}
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumb.active { border-color: var(--accent); }
.gallery-thumb:hover  { border-color: var(--accent); opacity: .85; }

/* Property details in modal */
.modal-details { margin-top: 22px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.detail-item {}
.detail-label { font-size: .72rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.detail-val   { font-size: .95rem; font-weight: 600; }
.detail-desc  { font-size: .88rem; color: var(--text); line-height: 1.65; }
.private-note {
  background: #eff6ff; border-radius: 8px; padding: 12px 16px;
  font-size: .83rem; color: #1e40af; margin-top: 14px; line-height: 1.6;
}
.feature-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.feature-chip {
  background: #f1f5f9; border-radius: 16px; padding: 4px 12px;
  font-size: .78rem; color: var(--text); display: flex; align-items: center; gap: 4px;
}
.modal-enquire-row {
  display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px;
  padding-top: 18px; border-top: 1px solid var(--border);
}

/* ── LOGIN GATE CARD ─────────────────────────────────────────────────── */
.login-gate-modal .modal-body {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; padding: 40px 24px;
}
.login-gate-icon { font-size: 3rem; margin-bottom: 16px; }
.login-gate-title { font-size: 1.2rem; font-weight: 800; margin-bottom: 8px; }
.login-gate-desc { color: var(--muted); margin-bottom: 24px; line-height: 1.6; }
.login-gate-btns { display: flex; gap: 10px; }

/* ── CONTACT STRIP ───────────────────────────────────────────────────── */
.contact-strip {
  background: var(--nav-dark); padding: 40px 24px;
  text-align: center;
}
.contact-strip h2 { font-size: 1.5rem; font-weight: 800; color: #fff; margin-bottom: 8px; }
.contact-strip p  { color: rgba(255,255,255,.65); margin-bottom: 20px; }
.contact-btns     { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.c-btn {
  padding: 10px 22px; border-radius: 8px; font-size: .88rem; font-weight: 700;
  text-decoration: none; cursor: pointer; transition: opacity .15s; white-space: nowrap;
}
.c-btn:hover  { opacity: .85; }
.c-btn-phone  { background: rgba(255,255,255,.12); color: #fff; border: 1.5px solid rgba(255,255,255,.2); }
.c-btn-email  { background: rgba(255,255,255,.12); color: #fff; border: 1.5px solid rgba(255,255,255,.2); }
.c-btn-wa     { background: var(--wa); color: #fff; }

/* ── ENQUIRY FORM ──────────────────────────────────────────────────────── */
.enquiry-card {
  max-width: 580px; margin: 24px auto 0; background: var(--surface);
  border-radius: 14px; padding: 24px; text-align: left; box-shadow: var(--shadow-lg);
}
.enquiry-title { font-size: 1.05rem; font-weight: 800; color: var(--text); margin-bottom: 4px; }
.enquiry-sub   { font-size: .82rem; color: var(--muted); margin-bottom: 16px; }
.enquiry-row   { display: flex; gap: 12px; flex-wrap: wrap; }
.enquiry-row .form-group { flex: 1 1 170px; margin-bottom: 12px; }
.enquiry-feedback { margin-top: 10px; font-size: .85rem; min-height: 1.1em; }
.enquiry-feedback.ok  { color: var(--success); }
.enquiry-feedback.err { color: var(--danger); }

/* compact enquiry block inside the property detail modal */
.modal-enquiry { margin-top: 20px; border-top: 1px solid var(--border); padding-top: 16px; }
.modal-enquiry .enquiry-title { font-size: .95rem; margin-bottom: 10px; }

/* ── FORMS (login / register) ────────────────────────────────────────── */
.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--bg); padding: 24px;
}
.auth-card {
  background: var(--surface); border-radius: 16px;
  padding: 36px 40px; width: 100%; max-width: 420px;
  box-shadow: var(--shadow-lg);
}
.auth-logo { text-align: center; margin-bottom: 24px; }
.auth-logo-name { font-size: 1.1rem; font-weight: 800; }
.auth-logo-sub  { font-size: .77rem; color: var(--muted); margin-top: 2px; }
.auth-title     { font-size: 1.3rem; font-weight: 800; text-align: center; margin-bottom: 6px; }
.auth-sub       { font-size: .85rem; color: var(--muted); text-align: center; margin-bottom: 24px; }
.form-group     { margin-bottom: 16px; }
.form-label     { display: block; font-size: .82rem; font-weight: 600; margin-bottom: 6px; }
.form-input {
  width: 100%; padding: 10px 14px; border-radius: var(--r-input);
  border: 1.5px solid var(--border); font-size: .9rem;
  background: var(--surface); color: var(--text);
  transition: border-color .15s;
}
.form-input:focus { outline: none; border-color: var(--accent); }
.form-input::placeholder { color: #c4c9d2; }
.form-hint { font-size: .75rem; color: var(--muted); margin-top: 4px; }
.form-submit { width: 100%; margin-top: 8px; }

.alert {
  padding: 10px 16px; border-radius: 8px; font-size: .85rem;
  margin-bottom: 16px; display: flex; align-items: flex-start; gap: 8px;
}
.alert-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.alert-info    { background: #eff6ff; color: #1e40af; border: 1px solid #93c5fd; }

.auth-footer   { text-align: center; margin-top: 20px; font-size: .83rem; color: var(--muted); }
.auth-footer a { color: var(--accent); font-weight: 600; }

/* ── ADMIN PANEL ─────────────────────────────────────────────────────── */
.admin-page   { background: var(--bg); min-height: 100vh; }
.admin-wrap   { max-width: 1300px; margin: 0 auto; padding: 24px 20px; }
.admin-header {
  background: var(--nav-dark); color: #fff;
  padding: 0 24px; height: 58px;
  display: flex; align-items: center; gap: 16px;
  position: sticky; top: 0; z-index: 200;
  box-shadow: 0 1px 4px rgba(0,0,0,.15);
}
.admin-header .brand-name { color: #fff; font-size: .97rem; }
.admin-header .brand-sub  { color: rgba(255,255,255,.55); }
.admin-badge {
  background: rgba(255,255,255,.15); color: #fff;
  font-size: .7rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 8px;
}
.admin-header-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.admin-header a { color: rgba(255,255,255,.8); font-size: .82rem; text-decoration: none; }
.admin-header a:hover { color: #fff; }

/* Tabs */
.admin-tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 24px; }
.admin-tab {
  padding: 10px 22px; font-size: .88rem; font-weight: 600;
  color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent;
  margin-bottom: -2px; transition: all .15s; background: none; border: none;
  border-bottom: 3px solid transparent;
}
.admin-tab:hover  { color: var(--text); }
.admin-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Admin section headers */
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; flex-wrap: wrap; gap: 12px;
}
.section-head h2 { font-size: 1.1rem; font-weight: 800; }

/* Admin tables */
.admin-table-wrap { overflow-x: auto; background: var(--surface); border-radius: 10px; border: 1px solid var(--border); }
.admin-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.admin-table th {
  text-align: left; font-size: .72rem; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--muted);
  padding: 10px 16px; border-bottom: 1px solid var(--border); background: #f8fafc;
}
.admin-table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: #f8fafc; }

/* User status badges */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 9px; border-radius: 10px;
  font-size: .7rem; font-weight: 700; letter-spacing: .04em;
}
.badge-green   { background: #dcfce7; color: #166534; }
.badge-yellow  { background: #fef9c3; color: #854d0e; }
.badge-red     { background: #fee2e2; color: #991b1b; }
.badge-blue    { background: #dbeafe; color: #1e40af; }
.badge-gray    { background: #f1f5f9; color: var(--muted); }

/* Actions cell */
.actions-cell { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.action-btn {
  padding: 5px 12px; border-radius: 6px; border: 1.5px solid var(--border);
  font-size: .75rem; font-weight: 600; cursor: pointer; background: var(--surface);
  color: var(--text); transition: all .15s; white-space: nowrap;
}
.action-btn:hover       { border-color: var(--accent); color: var(--accent); background: #eff6ff; }
.action-btn.danger:hover { border-color: var(--danger); color: var(--danger); background: #fee2e2; }
.action-btn.success:hover { border-color: var(--success); color: var(--success); background: #dcfce7; }

/* ── PROPERTY EDITOR ─────────────────────────────────────────────────── */
.prop-editor { background: var(--surface); border-radius: 12px; border: 1px solid var(--border); padding: 28px; margin-top: 24px; }
.prop-editor-title { font-size: 1.1rem; font-weight: 800; margin-bottom: 20px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.editor-grid .full-width { grid-column: 1 / -1; }
.select-input {
  width: 100%; padding: 10px 14px; border-radius: var(--r-input);
  border: 1.5px solid var(--border); font-size: .9rem; background: var(--surface);
  color: var(--text); cursor: pointer;
}
.select-input:focus { outline: none; border-color: var(--accent); }
.textarea-input {
  width: 100%; padding: 10px 14px; border-radius: var(--r-input);
  border: 1.5px solid var(--border); font-size: .9rem; min-height: 90px;
  resize: vertical; font-family: inherit; color: var(--text); background: var(--surface);
}
.textarea-input:focus { outline: none; border-color: var(--accent); }

/* ── PHOTO SLOT GRID ─────────────────────────────────────────────────── */
.slots-section { margin-top: 28px; }
.slots-section-title { font-size: .82rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.slots-group-label { font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.slots-group { margin-bottom: 20px; }
.slots-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }

.slot-item {
  border-radius: 10px; border: 2px dashed var(--border); overflow: hidden;
  cursor: pointer; transition: all .18s; position: relative; aspect-ratio: 4/3;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: #f8fafc;
}
.slot-item:hover { border-color: var(--accent); background: #eff6ff; }
.slot-item.has-photo { border-style: solid; border-color: var(--border); }
.slot-item.has-photo:hover { border-color: var(--accent); }

.slot-item img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.slot-label {
  font-size: .7rem; font-weight: 600; color: var(--muted); text-align: center;
  padding: 4px; z-index: 1;
}
.slot-item.has-photo .slot-label {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,.7));
  color: #fff; padding: 14px 6px 6px; text-align: center;
}
.slot-icon { font-size: 1.6rem; margin-bottom: 4px; color: #cbd5e1; z-index: 1; }
.slot-delete {
  position: absolute; top: 4px; right: 4px; z-index: 5;
  background: rgba(220,38,38,.85); color: #fff; border: none; border-radius: 50%;
  width: 22px; height: 22px; display: none; align-items: center; justify-content: center;
  font-size: .75rem; cursor: pointer; font-weight: 700;
}
.slot-item.has-photo:hover .slot-delete { display: flex; }

/* Upload processing modal */
.upload-modal { background: var(--surface); border-radius: 14px; padding: 28px; max-width: 440px; width: 100%; }
.upload-preview {
  width: 100%; border-radius: 10px; overflow: hidden;
  background: #e2e8f0; margin-bottom: 18px; aspect-ratio: 4/3;
  display: flex; align-items: center; justify-content: center;
}
.upload-preview img { width: 100%; height: 100%; object-fit: cover; }
.upload-mode-btns { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.upload-mode-btn {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  border-radius: 10px; border: 2px solid var(--border); background: var(--surface);
  cursor: pointer; transition: all .15s; text-align: left;
}
.upload-mode-btn:hover  { border-color: var(--accent); background: #eff6ff; }
.upload-mode-btn.active { border-color: var(--accent); background: #eff6ff; }
.upload-mode-btn.disabled { opacity: .45; cursor: not-allowed; }
.upload-mode-icon { font-size: 1.4rem; flex-shrink: 0; }
.upload-mode-name { font-size: .88rem; font-weight: 700; }
.upload-mode-desc { font-size: .75rem; color: var(--muted); margin-top: 1px; }
.upload-btn-row { display: flex; gap: 10px; }

/* Mobile picker action sheet */
.action-sheet-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  z-index: 600; display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.action-sheet-overlay.open { opacity: 1; pointer-events: all; }
.action-sheet {
  background: var(--surface); border-radius: 16px 16px 0 0;
  width: 100%; max-width: 480px; padding: 16px 16px 32px;
  transform: translateY(100%); transition: transform .25s;
}
.action-sheet-overlay.open .action-sheet { transform: translateY(0); }
.action-sheet-title { text-align: center; font-size: .82rem; font-weight: 600; color: var(--muted); margin-bottom: 14px; }
.action-sheet-btn {
  display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 15px 16px; border: none; background: none; border-radius: 12px;
  font-size: 1rem; font-weight: 600; cursor: pointer; transition: background .15s;
}
.action-sheet-btn:hover  { background: #f8fafc; }
.action-sheet-btn .icon  { font-size: 1.4rem; width: 32px; text-align: center; }
.action-sheet-cancel { display: block; width: 100%; margin-top: 10px; padding: 14px; border-radius: 12px; border: none; background: #f1f5f9; font-size: .95rem; font-weight: 700; cursor: pointer; color: var(--danger); }

/* Progress / spinner */
.spinner { display: inline-block; width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-row { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 24px; color: var(--muted); font-size: .9rem; }
.spinner-dark { border-color: rgba(30,58,95,.2); border-top-color: var(--nav-dark); }

/* ── RESPONSIVE ──────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 32px; margin-top: 28px; }
  .hero-panel { display: none; }
  .hero-title { font-size: 1.9rem; }
}
@media (max-width: 640px) {
  /* Header stays pinned to the top on scroll (sticky, set globally) and the
     nav - including the Admin link - stays visible + compact in portrait. */
  .header-inner { padding: 0 12px; height: 56px; gap: 8px; }
  .site-header .brand img { height: 34px !important; }
  .brand-sub { display: none; }
  .header-nav { gap: 6px; margin-left: auto; flex-wrap: nowrap; }
  .nav-link { display: inline-block; padding: 6px 10px; font-size: .8rem; white-space: nowrap; }
  .nav-cta  { padding: 7px 12px; font-size: .8rem; white-space: nowrap; }
  .nav-wa   { display: none; }           /* WhatsApp also in top strip + contact section */
  .user-pill { padding: 4px 6px; gap: 0; }
  .user-pill span { display: none; }     /* keep avatar, drop username text to save room */
  .btn-logout { padding: 6px 10px; font-size: .77rem; white-space: nowrap; }
  .hero { padding: 0 14px; }
  .hero-logo { height: 135px; margin-bottom: 14px; }
  .hero-title { font-size: 1.6rem; }
  .filter-section { padding: 0 14px; }
  .properties-grid { padding: 0 14px; grid-template-columns: 1fr; }
  .auth-card { padding: 28px 20px; }
  .admin-wrap { padding: 14px; }
  .editor-grid { grid-template-columns: 1fr; }
  .modal-body { padding: 16px; }
  .modal { border-radius: 16px 16px 0 0; }
  .modal-overlay { align-items: flex-end; padding: 0; }
  .detail-grid { grid-template-columns: 1fr; }
  /* Admin panel header: keep it pinned and let controls wrap instead of overflow */
  .admin-header { position: sticky; top: 0; z-index: 200; flex-wrap: wrap; gap: 8px 10px; padding: 10px 14px; }
  .admin-header #adminUsername { display: none; }
}

/* ── USER MENU (avatar dropdown) ───────────────────────────────────────── */
.user-menu-wrap { position: relative; display: inline-flex; }
.user-menu-trigger {
  display: inline-flex; align-items: center; background: none; border: none;
  cursor: pointer; padding: 0; border-radius: 20px;
}
.user-menu-trigger .user-pill { cursor: pointer; }
.user-menu {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 210px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: var(--shadow-lg); padding: 6px;
  display: none; z-index: 300;
}
.user-menu.open { display: block; }
.user-menu-item {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; gap: 12px; padding: 9px 12px; background: none; border: none;
  font-size: .88rem; color: var(--text); cursor: pointer; border-radius: 6px; text-align: left;
}
.user-menu-item:hover { background: var(--bg); }
.user-menu-item .item-label { display: flex; align-items: center; gap: 8px; }
.user-menu-item .item-icon  { font-size: 1rem; }
.theme-switch {
  width: 34px; height: 18px; border-radius: 999px; background: #cbd5e1;
  position: relative; flex-shrink: 0; transition: background .15s;
}
.theme-switch::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 14px; height: 14px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s;
}
.user-menu-item.on .theme-switch { background: var(--accent); }
.user-menu-item.on .theme-switch::after { transform: translateX(16px); }

/* ── DARK MODE ─────────────────────────────────────────────────────────── */
/* Applied by adding `dark` to <html> (early inline script in each page head,
   toggled from the avatar menu, persisted in localStorage 'cj4k-theme'). */
html.dark {
  --bg:        #0f172a;
  --surface:   #1e293b;
  --text:      #e5e7eb;
  --muted:     #94a3b8;
  --border:    #334155;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.5);
  --shadow:    0 2px 12px rgba(0,0,0,.45);
  --shadow-lg: 0 10px 30px rgba(0,0,0,.6);
}
html.dark body { background: var(--bg); color: var(--text); }
/* Hardcoded light neutrals → dark equivalents */
html.dark .stat-box,
html.dark .modal-details,
html.dark .admin-table tr:hover td,
html.dark .action-sheet-btn:hover { background: #0f172a; }
html.dark .user-pill,
html.dark .nav-link:hover { background: #334155; }
html.dark .pill.active { background: #1e293b; color: #bfdbfe; border-color: var(--accent); }
html.dark .card-photo-placeholder,
html.dark .gallery-main,
html.dark .gallery-main img { background: #0f172a; color: #64748b; }
html.dark .trust-icon { background: rgba(37,99,235,.18); }
html.dark .admin-table th { background: #0f172a; color: var(--muted); }
html.dark .slot-item { background: #0f172a; border-color: #334155; }
html.dark .slot-item .slot-label { color: var(--muted); }
html.dark .feature-chip { background: #0f172a; color: var(--muted); }
html.dark .form-input::placeholder,
html.dark .textarea-input::placeholder { color: #64748b; }
