/* ============================================================
   RoomKey — visual identity
   Palette: pine ink on parchment sage, aged-brass accent for
   price/key tags, muted rust for alerts.
   Display type: Fraunces (doorplate-style serif)
   Body/UI type: Inter · Numerics: IBM Plex Mono (price tags)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,600;9..144,700&family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@500;600&display=swap');

:root {
  --paper: #EFEFE6;
  --paper-raised: #FFFFFF;
  --ink: #1C2B24;
  --ink-soft: #4B5B52;
  --line: #D8D6C8;
  --brass: #B9862F;
  --brass-dark: #93691F;
  --rust: #9C5233;
  --sage: #7A8F7E;
  --ok: #3E7A52;
  --radius: 10px;
  --shadow: 0 2px 10px rgba(28, 43, 36, 0.08);
  --shadow-lift: 0 8px 24px rgba(28, 43, 36, 0.14);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Inter', system-ui, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 .4em;
  letter-spacing: -0.01em;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: #0f1a14; box-shadow: var(--shadow); }
.btn-brass { background: var(--brass); color: #fff; }
.btn-brass:hover { background: var(--brass-dark); }
.btn-outline { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--paper); }
.btn-ghost { background: transparent; color: var(--ink-soft); }
.btn-danger { background: var(--rust); color: #fff; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-block { width: 100%; }

/* ---------- Top nav ---------- */
.navbar {
  background: var(--paper-raised);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}
.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}
.brand {
  font-family: 'Fraunces', serif;
  font-size: 22px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand .key-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--brass);
  display: inline-block;
}
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a.navlink {
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 14.5px;
  color: var(--ink-soft);
}
.nav-links a.navlink:hover, .nav-links a.navlink.active { background: var(--paper); color: var(--ink); }
.nav-badge {
  background: var(--rust); color: #fff; font-size: 11px; font-weight: 700;
  padding: 1px 6px; border-radius: 999px; margin-left: 6px;
}

/* ---------- Hero / search ---------- */
.hero {
  padding: 56px 0 40px;
  border-bottom: 1px solid var(--line);
}
.hero h1 { font-size: clamp(30px, 4vw, 46px); max-width: 640px; }
.hero p.lede { color: var(--ink-soft); font-size: 17px; max-width: 560px; margin-bottom: 28px; }

.search-panel {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr auto;
  gap: 12px;
}
@media (max-width: 900px) {
  .search-panel { grid-template-columns: 1fr 1fr; }
}
.field label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink-soft);
  margin-bottom: 6px;
  font-weight: 600;
}
.field input, .field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  background: var(--paper);
  color: var(--ink);
}
.field input:focus, .field select:focus, textarea:focus {
  outline: 2px solid var(--brass);
  outline-offset: 1px;
}

/* ---------- View toggle ---------- */
.view-toggle {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: var(--paper-raised);
}
.view-toggle button {
  border: none;
  background: transparent;
  padding: 8px 18px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  color: var(--ink-soft);
}
.view-toggle button.active { background: var(--ink); color: var(--paper); }

/* ---------- Listing grid & cards ---------- */
.listing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 22px;
  margin: 28px 0 50px;
}
.card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow .15s ease, transform .15s ease;
}
.card:hover { box-shadow: var(--shadow-lift); transform: translateY(-2px); }
.card-photo {
  aspect-ratio: 4 / 3;
  background: var(--paper) url('data:image/svg+xml;utf8,') center/cover;
  position: relative;
  overflow: hidden;
}
.card-photo img { width: 100%; height: 100%; object-fit: cover; }
.card-photo .type-chip {
  position: absolute; top: 10px; left: 10px;
  background: rgba(28,43,36,.82); color: #fff;
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .04em;
  padding: 4px 10px; border-radius: 999px;
}
.card-body { padding: 14px 16px 16px; }
.card-body h3 { font-size: 17px; margin-bottom: 2px; }
.card-loc { color: var(--ink-soft); font-size: 13.5px; margin-bottom: 10px; }

/* signature element: key-tag price chip */
.price-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--paper);
  border: 1px dashed var(--brass);
  border-radius: 999px;
  padding: 5px 12px 5px 8px;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 600;
  font-size: 14px;
  color: var(--brass-dark);
}
.price-tag .hole {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--paper-raised); border: 1.5px solid var(--brass);
}
.price-tag .per { font-family: 'Inter', sans-serif; font-weight: 500; font-size: 11px; color: var(--ink-soft); }

.card-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line);
  font-size: 12.5px; color: var(--ink-soft);
}

/* ---------- Filters sidebar (browse page) ---------- */
.browse-layout { display: grid; grid-template-columns: 260px 1fr; gap: 30px; align-items: start; }
@media (max-width: 860px) { .browse-layout { grid-template-columns: 1fr; } }
.filters-box {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  position: sticky;
  top: 90px;
}
.filters-box h4 { font-size: 14px; text-transform: uppercase; letter-spacing: .05em; }
.filter-group { margin-bottom: 18px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--line); background: var(--paper);
  border-radius: 999px; padding: 6px 12px; font-size: 12.5px; cursor: pointer;
}
.chip.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ---------- Map ---------- */
#map, #detail-map { border-radius: var(--radius); border: 1px solid var(--line); }

/* ---------- Forms / auth cards / dashboard ---------- */
.auth-wrap { max-width: 420px; margin: 60px auto; }
.panel {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}
.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 6px; }
.form-row input, .form-row select, .form-row textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line);
  border-radius: 8px; font-family: 'Inter', sans-serif; font-size: 14.5px;
  background: var(--paper);
}
.form-row textarea { resize: vertical; min-height: 110px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.help-text { font-size: 12.5px; color: var(--ink-soft); margin-top: 4px; }

.alert {
  padding: 12px 16px; border-radius: 8px; font-size: 14px; margin-bottom: 18px;
}
.alert-success { background: #E4EEE6; color: var(--ok); border: 1px solid #BFE0C7; }
.alert-error { background: #F5E4DE; color: var(--rust); border: 1px solid #E8C3B4; }

/* ---------- Dashboard table ---------- */
.dash-header { display: flex; align-items: center; justify-content: space-between; margin: 30px 0 18px; }
table.data-table { width: 100%; border-collapse: collapse; background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
table.data-table th, table.data-table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
table.data-table th { background: var(--paper); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); }
table.data-table tr:last-child td { border-bottom: none; }
.status-pill { padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; }
.status-active { background: #E4EEE6; color: var(--ok); }
.status-inactive, .status-pending { background: #F1EAD8; color: var(--brass-dark); }
.status-rejected, .status-banned { background: #F5E4DE; color: var(--rust); }

.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin: 24px 0; }
.stat-card { background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.stat-card .num { font-family: 'Fraunces', serif; font-size: 32px; font-weight: 700; }
.stat-card .label { color: var(--ink-soft); font-size: 13px; }

/* ---------- Listing detail ---------- */
.detail-gallery { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; border-radius: var(--radius); overflow: hidden; }
.detail-gallery img { width: 100%; height: 100%; object-fit: cover; }
.detail-gallery .thumbs { display: grid; grid-template-rows: 1fr 1fr; gap: 10px; }
@media (max-width: 700px) { .detail-gallery { grid-template-columns: 1fr; } .detail-gallery .thumbs { display: none; } }

.detail-layout { display: grid; grid-template-columns: 1.6fr 1fr; gap: 34px; margin-top: 30px; }
@media (max-width: 900px) { .detail-layout { grid-template-columns: 1fr; } }
.amenity-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.amenity-list span { background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 13px; }

.sticky-contact { position: sticky; top: 90px; }

/* ---------- Messaging ---------- */
.chat-layout { display: grid; grid-template-columns: 300px 1fr; gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; min-height: 520px; background: var(--paper-raised); }
@media (max-width: 800px) { .chat-layout { grid-template-columns: 1fr; } }
.thread-list { border-right: 1px solid var(--line); overflow-y: auto; max-height: 640px; }
.thread-item { padding: 14px 16px; border-bottom: 1px solid var(--line); cursor: pointer; display: block; }
.thread-item:hover, .thread-item.active { background: var(--paper); }
.thread-item .t-title { font-weight: 600; font-size: 14px; }
.thread-item .t-sub { font-size: 12.5px; color: var(--ink-soft); }
.chat-panel { display: flex; flex-direction: column; }
.chat-messages { flex: 1; padding: 20px; overflow-y: auto; max-height: 500px; }
.msg-bubble { max-width: 70%; padding: 10px 14px; border-radius: 14px; margin-bottom: 10px; font-size: 14px; }
.msg-mine { background: var(--ink); color: var(--paper); margin-left: auto; border-bottom-right-radius: 4px; }
.msg-theirs { background: var(--paper); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg-time { font-size: 10.5px; opacity: .65; margin-top: 4px; }
.chat-input { display: flex; gap: 8px; padding: 14px; border-top: 1px solid var(--line); }
.chat-input input { flex: 1; padding: 11px 14px; border: 1px solid var(--line); border-radius: 999px; }

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--line); padding: 30px 0; color: var(--ink-soft); font-size: 13.5px; margin-top: 60px; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--ink-soft); }
.empty-state h3 { color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
