/* ==========================================================================
   NIMJAY - Lake Atitlán Towns Marketplace & Escrow (nimjay.com)
   Full Stylesheet: Towns Navigation, Multi-Room Photos, Admin Listing Editor
   ========================================================================== */

:root {
  --color-bg: #f8f7f4;
  --color-surface: #ffffff;
  --color-surface-hover: #faf9f6;
  --color-surface-subtle: #f0eee9;
  
  --color-border: #e2ded7;
  --color-border-hover: #cfc9be;
  --color-border-focus: #1f5945;

  --color-text-main: #192024;
  --color-text-muted: #54626c;
  --color-text-subtle: #84919a;

  --color-primary: #1f5945;
  --color-primary-hover: #154233;
  --color-primary-light: #e8f2ee;
  --color-primary-border: #b8d9cc;

  --color-terracotta: #c2593f;
  --color-terracotta-light: #faeee9;

  --color-success-bg: #e6f4ea;
  --color-success-text: #137333;
  --color-success-border: #ceead6;

  --color-warning-bg: #fef7e0;
  --color-warning-text: #b06000;

  --color-danger: #d93025;
  --color-danger-bg: #fce8e6;

  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.12);

  --transition-fast: 0.15s ease;
  --transition-normal: 0.2s ease;

  --container-max: 1380px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background-color: var(--color-bg);
  color: var(--color-text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font: inherit;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ==========================================================================
   Navigation Bar
   ========================================================================== */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.nav-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.brand-logo {
  font-size: 1.85rem;
  line-height: 1;
}

.brand-name {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--color-primary);
  line-height: 1.1;
}

.brand-sub {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

.nav-meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--color-success-bg);
  border: 1px solid var(--color-success-border);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--color-success-text);
}

.badge-text {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-success-text);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

/* Currency Toggle */
.currency-toggle {
  display: flex;
  background-color: var(--color-surface-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.curr-btn {
  background: none;
  border: none;
  padding: 0.35rem 0.65rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text-muted);
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.curr-btn:hover { color: var(--color-text-main); }

.curr-btn.active {
  background-color: var(--color-surface);
  color: var(--color-primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* Button Styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 0.95rem;
  font-size: 0.86rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background-color: var(--color-primary);
  color: #ffffff;
}

.btn-primary:hover { background-color: var(--color-primary-hover); }

.btn-outline {
  background-color: var(--color-surface);
  border-color: var(--color-border);
  color: var(--color-text-main);
}

.btn-outline:hover {
  background-color: var(--color-surface-hover);
  border-color: var(--color-border-hover);
}

.btn-admin {
  background-color: #1e293b;
  color: #ffffff;
  border: 1px solid #0f172a;
}

.btn-admin:hover { background-color: #0f172a; }

.btn-stripe {
  background-color: #635bff;
  color: #ffffff;
  border: 1px solid #4e44e6;
}

.btn-stripe:hover { background-color: #4e44e6; }

.btn-whatsapp {
  background-color: #25d366;
  color: #ffffff;
  border: 1px solid #1ebe5d;
}

.btn-whatsapp:hover { background-color: #1ebe5d; }

.badge-count-pending {
  background-color: var(--color-terracotta);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-full);
}

.heart-icon {
  color: #e53e3e;
  font-size: 1rem;
}

.badge-count {
  background-color: var(--color-primary-light);
  color: var(--color-primary);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: var(--radius-full);
}

/* ==========================================================================
   Main Wrapper & Hero Bar
   ========================================================================== */
.main-wrapper {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 1.25rem 1.25rem 3rem;
}

.directory-hero {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.hero-heading {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-text-main);
  margin-bottom: 0.35rem;
}

.hero-description {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  max-width: 720px;
  line-height: 1.45;
}

.hero-stats-strip {
  display: flex;
  gap: 0.75rem;
  flex-shrink: 0;
}

.stat-pill {
  background-color: var(--color-surface-subtle);
  border: 1px solid var(--color-border);
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  text-align: center;
  min-width: 90px;
}

.stat-pill strong {
  display: block;
  font-size: 1.15rem;
  color: var(--color-primary);
}

.stat-pill span {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

/* ==========================================================================
   Town / Village Navigation Bar
   ========================================================================== */
.town-sections-nav {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.25rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  overflow-x: auto;
}

.town-nav-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.town-pills-container {
  display: flex;
  gap: 0.45rem;
  flex-wrap: nowrap;
}

.town-pill {
  background-color: var(--color-surface-subtle);
  border: 1px solid var(--color-border);
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text-muted);
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.town-pill:hover {
  background-color: var(--color-surface);
  color: var(--color-text-main);
  border-color: var(--color-border-hover);
}

.town-pill.active {
  background-color: var(--color-primary);
  color: #ffffff;
  border-color: var(--color-primary);
}

/* ==========================================================================
   Filters Station
   ========================================================================== */
.filters-panel {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.25rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
}

.search-primary-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
}

.search-input-wrap {
  position: relative;
  flex: 1 1 320px;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 0.85rem;
  font-size: 0.95rem;
  color: var(--color-text-subtle);
  pointer-events: none;
}

.main-search-input {
  width: 100%;
  padding: 0.65rem 2.2rem 0.65rem 2.4rem;
  font-size: 0.9rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background-color: var(--color-surface-subtle);
  color: var(--color-text-main);
  outline: none;
  transition: all var(--transition-fast);
}

.main-search-input:focus {
  border-color: var(--color-primary);
  background-color: var(--color-surface);
}

.clear-search-btn {
  position: absolute;
  right: 0.6rem;
  background: none;
  border: none;
  color: var(--color-text-subtle);
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  font-size: 0.85rem;
}

.filter-select-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-select {
  padding: 0.6rem 2rem 0.6rem 0.85rem;
  font-size: 0.86rem;
  font-weight: 500;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background-color: var(--color-surface);
  color: var(--color-text-main);
  cursor: pointer;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2212%22%20height%3D%2212%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%2354626c%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22m6%209%206%206%206-6%22%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
}

/* Quick Filter Chips */
.filter-chips-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-surface-subtle);
  flex-wrap: wrap;
}

.chips-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.chips-container {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.filter-chip {
  background-color: var(--color-surface-subtle);
  border: 1px solid var(--color-border);
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-text-muted);
  border-radius: var(--radius-full);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all var(--transition-fast);
}

.filter-chip:hover {
  border-color: var(--color-border-hover);
  color: var(--color-text-main);
}

.filter-chip.active {
  background-color: var(--color-primary-light);
  border-color: var(--color-primary-border);
  color: var(--color-primary);
  font-weight: 600;
}

.btn-text-reset {
  margin-left: auto;
  background: none;
  border: none;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-terracotta);
  cursor: pointer;
}

/* ==========================================================================
   View Mode & Layout Toggles
   ========================================================================== */
.view-mode-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.layout-toggles {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: 3px 5px;
  border-radius: var(--radius-sm);
}

.layout-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-text-muted);
  padding: 0 0.35rem;
}

.layout-btn {
  background: none;
  border: none;
  padding: 0.35rem 0.65rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text-muted);
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.layout-btn.active {
  background-color: var(--color-primary);
  color: #ffffff;
}

.results-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.results-count {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.results-count strong {
  color: var(--color-text-main);
  font-weight: 700;
}

.sort-label {
  font-size: 0.82rem;
  color: var(--color-text-muted);
}

.sort-select {
  padding: 0.35rem 1.8rem 0.35rem 0.65rem;
  font-size: 0.82rem;
  font-weight: 500;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background-color: var(--color-surface);
  color: var(--color-text-main);
  cursor: pointer;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2212%22%20height%3D%2212%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%2354626c%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22m6%209%206%206%206-6%22%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right 0.55rem center;
}

/* Active Tags */
.active-tags-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.active-tag {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  font-size: 0.76rem;
  color: var(--color-text-main);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.active-tag button {
  background: none;
  border: none;
  color: var(--color-text-subtle);
  cursor: pointer;
}

/* ==========================================================================
   Main Content Layouts (Split, Grid, Map)
   ========================================================================== */
.main-content-layout {
  display: flex;
  gap: 1.25rem;
  margin-bottom: 3rem;
}

.main-content-layout.split-mode {
  display: grid;
  grid-template-columns: 46% 54%;
  align-items: start;
}

.main-content-layout.split-mode .map-section {
  position: sticky;
  top: 75px;
  height: calc(100vh - 95px);
  min-height: 520px;
}

.main-content-layout.split-mode .houses-container {
  grid-template-columns: 1fr;
}

.main-content-layout.grid-mode .map-section { display: none; }
.main-content-layout.grid-mode { display: block; }
.main-content-layout.grid-mode .houses-container {
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
}

.main-content-layout.map-mode { display: block; }
.main-content-layout.map-mode .houses-section { display: none; }
.main-content-layout.map-mode .map-section {
  height: 75vh;
  min-height: 550px;
}

/* ==========================================================================
   Dynamic Leaflet Map Container
   ========================================================================== */
.map-section {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.map-header {
  padding: 0.75rem 1rem;
  background-color: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 2;
}

.map-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.map-icon { font-size: 1.25rem; }

.map-title {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--color-text-main);
}

.map-subtitle {
  font-size: 0.74rem;
  color: var(--color-text-muted);
}

.map-quick-jumps {
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  padding-bottom: 2px;
}

.map-jump-btn, .map-jump-town-btn {
  background-color: var(--color-surface-subtle);
  border: 1px solid var(--color-border);
  padding: 0.2rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-text-muted);
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.map-jump-town-btn:hover {
  background-color: var(--color-surface);
  color: var(--color-primary);
  border-color: var(--color-primary-border);
}

.map-canvas {
  width: 100%;
  flex: 1;
  min-height: 480px;
  height: 100%;
  background-color: #e2e8f0;
  position: relative;
  z-index: 1;
}

#atitlan-map.leaflet-container {
  width: 100%;
  height: 100%;
  min-height: 480px;
  background-color: #e2e8f0;
}

/* Custom Marker Pills */
.map-marker-pill {
  background-color: var(--color-primary);
  color: #ffffff;
  padding: 4px 8px;
  border-radius: var(--radius-full);
  font-size: 0.76rem;
  font-weight: 800;
  border: 2px solid #ffffff;
  box-shadow: 0 3px 8px rgba(0,0,0,0.25);
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
  transform: translate(-50%, -50%);
  transition: transform var(--transition-fast), background-color var(--transition-fast);
}

.map-marker-pill:hover, .map-marker-pill.active {
  transform: translate(-50%, -50%) scale(1.15);
  background-color: var(--color-terracotta);
  z-index: 1000 !important;
}

.map-popup-card {
  padding: 0.25rem;
  max-width: 230px;
}

.map-popup-img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 0.45rem;
}

.map-popup-title {
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.25rem;
}

.map-popup-price {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--color-primary);
  margin-bottom: 0.35rem;
}

.map-popup-btn {
  width: 100%;
  padding: 0.3rem;
  font-size: 0.75rem;
  font-weight: 700;
}

/* ==========================================================================
   House Cards & Multi-Room Switcher
   ========================================================================== */
.houses-container {
  display: grid;
  gap: 1.25rem;
}

.house-card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
  position: relative;
}

.house-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-border-hover);
}

.card-media {
  position: relative;
  width: 100%;
  height: 220px;
  background-color: var(--color-surface-subtle);
  overflow: hidden;
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.house-card:hover .card-img { transform: scale(1.03); }

/* Card Room Switcher Bar (NEW!) */
.card-room-switcher {
  position: absolute;
  bottom: 0.5rem;
  left: 0.5rem;
  right: 0.5rem;
  display: flex;
  gap: 0.3rem;
  z-index: 3;
  background-color: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
  padding: 3px;
  border-radius: var(--radius-sm);
}

.room-pill {
  flex: 1;
  background: none;
  border: none;
  color: #cbd5e1;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 4px;
  border-radius: 3px;
  cursor: pointer;
  text-align: center;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.room-pill:hover { color: #ffffff; }

.room-pill.active {
  background-color: #ffffff;
  color: var(--color-primary);
}

.card-top-badges {
  position: absolute;
  top: 0.65rem;
  left: 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  z-index: 2;
}

.badge-status {
  padding: 0.2rem 0.55rem;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: var(--radius-full);
}

.badge-status.available {
  background-color: rgba(230, 244, 234, 0.95);
  color: var(--color-success-text);
  border: 1px solid var(--color-success-border);
}

.badge-status.upcoming {
  background-color: rgba(254, 247, 224, 0.95);
  color: var(--color-warning-text);
  border: 1px solid #f9e29c;
}

.badge-verified {
  background-color: rgba(31, 89, 69, 0.92);
  color: #ffffff;
  padding: 0.2rem 0.55rem;
  font-size: 0.68rem;
  font-weight: 700;
  border-radius: var(--radius-full);
}

.card-favorite-btn {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  color: #a0aec0;
  transition: all var(--transition-fast);
  z-index: 2;
}

.card-favorite-btn:hover {
  transform: scale(1.1);
  color: #e53e3e;
}

.card-favorite-btn.saved {
  color: #e53e3e;
  background-color: #ffffff;
}

.card-body {
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-location-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}

.card-location {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-terracotta);
}

.card-map-jump {
  font-size: 0.74rem;
  color: var(--color-primary);
  font-weight: 600;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

.card-map-jump:hover { text-decoration: underline; }

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-text-main);
  line-height: 1.3;
  margin-bottom: 0.45rem;
}

.card-summary {
  font-size: 0.84rem;
  color: var(--color-text-muted);
  line-height: 1.4;
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-owner-strip {
  background-color: var(--color-surface-subtle);
  border-left: 3px solid var(--color-primary);
  padding: 0.45rem 0.65rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.owner-info {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
}

.owner-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background-color: var(--color-primary-light);
  color: var(--color-primary);
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-specs-bar {
  display: flex;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-top: 1px solid var(--color-surface-subtle);
  border-bottom: 1px solid var(--color-surface-subtle);
  margin-bottom: 0.75rem;
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

.card-utilities-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.85rem;
}

.util-pill {
  font-size: 0.72rem;
  background-color: var(--color-surface-subtle);
  border: 1px solid var(--color-border);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
}

.util-pill.included {
  background-color: #f0f7f4;
  border-color: #c9e2d6;
  color: #1a5c43;
  font-weight: 600;
}

.card-footer {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-surface-subtle);
}

.price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.price-main {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--color-primary);
}

.price-period {
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

.deposit-hint {
  font-size: 0.72rem;
  color: var(--color-text-subtle);
}

.card-actions-row {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 0.5rem;
}

/* ==========================================================================
   Admin Portal Modal & Tabs
   ========================================================================== */
.admin-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 95%;
  max-width: 980px;
  max-height: 90vh;
  background-color: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.admin-modal-header {
  padding: 1.15rem 1.5rem;
  background-color: #1a2530;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-header-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.admin-badge-icon { font-size: 1.75rem; }

.admin-header-title h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.admin-header-title p {
  font-size: 0.8rem;
  color: #94a3b8;
}

/* Admin PIN Auth View */
.admin-auth-view {
  padding: 3rem 1.5rem;
  display: flex;
  justify-content: center;
}

.admin-pin-card {
  max-width: 380px;
  text-align: center;
  background-color: var(--color-surface-subtle);
  border: 1px solid var(--color-border);
  padding: 2rem 1.75rem;
  border-radius: var(--radius-md);
}

.admin-lock-icon {
  font-size: 2.2rem;
  margin-bottom: 0.75rem;
}

.admin-pin-card h4 {
  font-size: 1.1rem;
  margin-bottom: 0.35rem;
}

.admin-pin-card p {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 1.25rem;
}

.pin-input-group {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.pin-input-group input {
  flex: 1;
  padding: 0.6rem;
  font-size: 1.1rem;
  letter-spacing: 0.25em;
  text-align: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

.pin-hint {
  font-size: 0.75rem;
  color: var(--color-text-subtle);
}

/* Admin Main Dashboard */
.admin-dashboard-view {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
}

.admin-nav-tabs {
  display: flex;
  background-color: var(--color-surface-subtle);
  border-bottom: 1px solid var(--color-border);
  padding: 0 1.25rem;
  gap: 0.5rem;
  overflow-x: auto;
}

.admin-tab-btn {
  background: none;
  border: none;
  padding: 0.85rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
  border-bottom: 3px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}

.admin-tab-btn:hover { color: var(--color-text-main); }

.admin-tab-btn.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  background-color: var(--color-surface);
}

.admin-tab-panel {
  display: none;
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

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

.panel-header-desc { margin-bottom: 1.25rem; }

.panel-header-desc h4 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.panel-header-desc p {
  font-size: 0.84rem;
  color: var(--color-text-muted);
}

/* Pending Approvals List */
.pending-list, .admin-edit-houses-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.pending-item-card, .admin-edit-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  display: flex;
  gap: 1.25rem;
  align-items: center;
  background-color: var(--color-surface);
}

.pending-img, .admin-edit-card-img {
  width: 90px;
  height: 70px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.pending-details, .admin-edit-details { flex: 1; }

.pending-title, .admin-edit-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.pending-meta, .admin-edit-meta {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-bottom: 0.25rem;
}

.pending-host-contact {
  font-size: 0.78rem;
  color: var(--color-primary);
  font-weight: 600;
}

.pending-actions, .admin-edit-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-approve {
  background-color: var(--color-success-text);
  color: #ffffff;
}

.btn-reject {
  background-color: var(--color-danger-bg);
  color: var(--color-danger);
  border: 1px solid #f5c2c7;
}

/* Escrow & Stripe Metrics */
.ledger-metrics-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.ledger-metric-card {
  background-color: var(--color-surface-subtle);
  border: 1px solid var(--color-border);
  padding: 1rem 1.15rem;
  border-radius: var(--radius-sm);
}

.ledger-metric-card span {
  font-size: 0.74rem;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--color-text-muted);
  display: block;
  margin-bottom: 0.2rem;
}

.ledger-metric-card strong {
  font-size: 1.4rem;
  color: var(--color-text-main);
  display: block;
}

.ledger-metric-card small {
  font-size: 0.72rem;
  color: var(--color-text-subtle);
}

.ledger-metric-card.highlight-profit {
  border-color: var(--color-primary-border);
  background-color: var(--color-primary-light);
}

.ledger-metric-card.highlight-profit strong { color: var(--color-primary); }

.ledger-table-wrap { overflow-x: auto; }

.ledger-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.ledger-table th, .ledger-table td {
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--color-border);
  text-align: left;
}

.ledger-table th {
  background-color: var(--color-surface-subtle);
  font-weight: 700;
  color: var(--color-text-main);
}

.status-badge-pending {
  background-color: var(--color-warning-bg);
  color: var(--color-warning-text);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.72rem;
}

.status-badge-paid {
  background-color: var(--color-success-bg);
  color: var(--color-success-text);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.72rem;
}

.fee-selector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.85rem;
}

.fee-option { cursor: pointer; }
.fee-option input { display: none; }

.fee-option-box {
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  background-color: var(--color-surface);
  position: relative;
  transition: all var(--transition-fast);
}

.fee-option-box strong {
  display: block;
  font-size: 1.1rem;
  color: var(--color-text-main);
  margin-bottom: 0.25rem;
}

.fee-option-box span {
  display: block;
  font-size: 0.78rem;
  color: var(--color-primary);
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.fee-option-box small {
  font-size: 0.72rem;
  color: var(--color-text-muted);
}

.fee-option input:checked + .fee-option-box {
  border-color: var(--color-primary);
  background-color: var(--color-primary-light);
}

.rec-tag {
  position: absolute;
  top: -10px;
  right: 10px;
  background-color: var(--color-primary);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-full);
}

/* ==========================================================================
   Stripe Booking Modal
   ========================================================================== */
.booking-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 92%;
  max-width: 640px;
  max-height: 90vh;
  background-color: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.booking-modal-content {
  padding: 1.5rem;
  overflow-y: auto;
}

.booking-cost-breakdown {
  background-color: var(--color-surface-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 1.15rem;
  margin-bottom: 1.25rem;
}

.cost-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.86rem;
  margin-bottom: 0.45rem;
  color: var(--color-text-muted);
}

.cost-row.total-row {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-border);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--color-primary);
}

.escrow-assurance-box {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background-color: var(--color-success-bg);
  border: 1px solid var(--color-success-border);
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--color-success-text);
  margin-bottom: 1.25rem;
}

.stripe-card-fields {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  background-color: var(--color-surface);
  margin-bottom: 1.25rem;
}

.fake-stripe-input {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--color-surface-subtle);
}

.fake-stripe-input:last-child { border-bottom: none; }

.fake-stripe-input input {
  border: none;
  outline: none;
  font-size: 0.88rem;
  width: 100%;
}

.booking-voucher-success {
  text-align: center;
  padding: 1rem 0;
}

.voucher-check {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.voucher-box {
  background-color: var(--color-surface-subtle);
  border: 1px dashed var(--color-primary);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  margin: 1.25rem 0;
  text-align: left;
}

.voucher-code {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--color-primary);
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

/* ==========================================================================
   Shared Modals, Drawers & Forms
   ========================================================================== */
.modal-backdrop, .drawer-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
  z-index: 1500;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.modal-backdrop.open, .drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

/* Saved Drawer */
.saved-drawer {
  position: fixed;
  top: 0;
  right: -420px;
  width: 100%;
  max-width: 420px;
  height: 100%;
  background-color: var(--color-surface);
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
  z-index: 1600;
  display: flex;
  flex-direction: column;
  transition: right 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.saved-drawer.open { right: 0; }

.drawer-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.drawer-subtitle {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.drawer-close-btn {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
}

.drawer-body {
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.drawer-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--color-text-muted);
  font-size: 0.92rem;
}

.drawer-empty-icon {
  font-size: 2.2rem;
  margin-bottom: 0.75rem;
  color: var(--color-text-subtle);
}

.saved-item-card {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background-color: var(--color-surface);
  position: relative;
}

.saved-item-img {
  width: 75px;
  height: 75px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}

.saved-item-info { flex: 1; }

.saved-item-title {
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.saved-item-meta {
  font-size: 0.76rem;
  color: var(--color-text-muted);
  margin-bottom: 0.4rem;
}

.saved-item-price {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-primary);
}

.saved-item-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

.btn-mini {
  padding: 0.2rem 0.5rem;
  font-size: 0.74rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
}

.btn-remove-saved {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  background: none;
  border: none;
  color: var(--color-text-subtle);
  cursor: pointer;
}

.drawer-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--color-border);
  background-color: var(--color-surface-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.btn-block { width: 100%; }

.btn-text-clear {
  background: none;
  border: none;
  color: var(--color-text-subtle);
  font-size: 0.8rem;
  cursor: pointer;
  text-align: center;
}

/* Detail Modal */
.detail-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 92%;
  max-width: 900px;
  max-height: 90vh;
  background-color: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 1600;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--color-border);
  color: var(--color-text-main);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.modal-content-scroll {
  overflow-y: auto;
  padding: 1.75rem 2rem;
}

.modal-gallery { margin-bottom: 1.5rem; }

.gallery-main-img-wrap {
  width: 100%;
  height: 360px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 0.65rem;
  background-color: var(--color-surface-subtle);
}

.gallery-main-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-thumbs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
}

.gallery-thumb {
  width: 95px;
  height: 65px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  opacity: 0.7;
  position: relative;
  flex-shrink: 0;
}

.gallery-thumb.active {
  border-color: var(--color-primary);
  opacity: 1;
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: rgba(15, 23, 42, 0.75);
  color: #ffffff;
  font-size: 0.62rem;
  text-align: center;
  font-weight: 700;
  padding: 1px 0;
}

.detail-header-block { margin-bottom: 1.25rem; }

.detail-neighborhood {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-terracotta);
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.detail-title {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--color-text-main);
  margin-bottom: 0.35rem;
}

.detail-facts-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.65rem;
  background-color: var(--color-surface-subtle);
  border: 1px solid var(--color-border);
  padding: 0.85rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
}

.fact-item {
  display: flex;
  flex-direction: column;
}

.fact-item span {
  font-size: 0.7rem;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--color-text-muted);
}

.fact-item strong {
  font-size: 1rem;
  color: var(--color-primary);
}

.detail-host-card {
  border: 1px solid var(--color-primary-border);
  background-color: var(--color-primary-light);
  border-radius: var(--radius-sm);
  padding: 1.15rem 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.host-profile-left {
  display: flex;
  gap: 0.85rem;
  align-items: center;
}

.host-avatar-large {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: var(--color-primary);
  color: #ffffff;
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.host-details h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-primary-hover);
}

.host-details p {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.host-meta-tags {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.25rem;
  font-size: 0.72rem;
}

.host-tag {
  background-color: #ffffff;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
}

.detail-grid-sections {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 1.75rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 820px) {
  .detail-grid-sections { grid-template-columns: 1fr; }
}

.detail-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text-main);
  margin-bottom: 0.65rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--color-border);
}

.detail-description-text {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.55;
  margin-bottom: 1rem;
}

.detail-amenities-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.amenity-chip {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  background-color: var(--color-surface-subtle);
  padding: 0.4rem 0.65rem;
  border-radius: var(--radius-sm);
}

.utilities-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  margin-bottom: 1.25rem;
}

.utilities-table th, .utilities-table td {
  padding: 0.5rem 0.65rem;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
}

.util-status-incl {
  color: var(--color-success-text);
  font-weight: 700;
}

.direct-inquiry-box {
  background-color: var(--color-surface-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 1.15rem;
}

.direct-inquiry-box h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.inquiry-textarea {
  width: 100%;
  padding: 0.55rem;
  font-size: 0.82rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background-color: var(--color-surface);
  margin: 0.5rem 0;
  resize: vertical;
}

/* Compare Modal */
.compare-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 95%;
  max-width: 1050px;
  max-height: 90vh;
  background-color: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 1600;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.compare-modal-header {
  padding: 1.15rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.compare-table-wrapper {
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.compare-table th, .compare-table td {
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--color-border);
  text-align: left;
}

.compare-table th {
  background-color: var(--color-surface-subtle);
  font-weight: 700;
  width: 160px;
}

/* Listing Modal Form & Admin Edit Modal */
.listing-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 92%;
  max-width: 780px;
  max-height: 90vh;
  background-color: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 1600;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  padding: 1.15rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.new-house-form {
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.form-section {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-surface-subtle);
}

.form-section-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 0.85rem;
}

.form-row {
  display: flex;
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}

.form-row.three-cols > * { flex: 1; }
.form-row.four-cols > * { flex: 1; }
.form-row.two-cols > * { flex: 1; }

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.form-group.full-width { width: 100%; }

.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
}

.form-group input, .form-group select, .form-group textarea {
  padding: 0.55rem 0.65rem;
  font-size: 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  outline: none;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--color-primary);
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.6rem;
}

.custom-checkbox {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  cursor: pointer;
}

.custom-checkbox input[type="checkbox"] { accent-color: var(--color-primary); }

.photo-preset-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(105px, 1fr));
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.preset-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.35rem;
  text-align: center;
}

.preset-label img {
  width: 100%;
  height: 55px;
  object-fit: cover;
  border-radius: 4px;
}

.preset-label span {
  font-size: 0.7rem;
  font-weight: 600;
}

.preset-label input[type="radio"] { display: none; }

.preset-label:has(input[type="radio"]:checked) {
  border-color: var(--color-primary);
  background-color: var(--color-primary-light);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
  padding-top: 0.85rem;
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  background-color: #1a202c;
  color: #ffffff;
  padding: 0.65rem 1.15rem;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
}

/* Footer & Community Guide */
.community-guide-section {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.75rem 1.5rem;
  margin-top: 2rem;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.guide-card {
  border-top: 2px solid var(--color-primary-light);
  padding-top: 0.75rem;
}

.guide-icon {
  font-size: 1.5rem;
  margin-bottom: 0.35rem;
}

.guide-card h4 {
  font-size: 0.92rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.guide-card p {
  font-size: 0.82rem;
  color: var(--color-text-muted);
}

.site-footer {
  background-color: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: 2.5rem 1.25rem 1.5rem;
}

.footer-container {
  max-width: var(--container-max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1.5fr;
  gap: 2.5rem;
  margin-bottom: 2rem;
}

@media (max-width: 768px) {
  .footer-container {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
}

.footer-logo {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--color-primary);
  margin-bottom: 0.35rem;
}

.footer-subtext {
  font-size: 0.82rem;
  color: var(--color-text-muted);
}

.footer-bottom {
  max-width: var(--container-max);
  margin: 0 auto;
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--color-text-subtle);
}

.back-to-top {
  background: none;
  border: none;
  color: var(--color-primary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 1024px) {
  .main-content-layout.split-mode {
    grid-template-columns: 1fr;
  }
  .main-content-layout.split-mode .map-section {
    position: static;
    height: 380px;
    min-height: 380px;
    margin-bottom: 1.25rem;
  }
}

@media (max-width: 900px) {
  .nav-meta-badge { display: none; }
  .directory-hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  .hero-stats-strip {
    width: 100%;
    justify-content: space-between;
  }
  .form-row.four-cols, .form-row.three-cols, .form-row.two-cols {
    flex-direction: column;
    gap: 0.75rem;
  }
}

@media (max-width: 600px) {
  .nav-container { padding: 0.5rem 0.85rem; }
  .brand-sub { display: none; }
  .saved-label { display: none; }
  .search-primary-row { flex-direction: column; align-items: stretch; }
  .filter-select-group { flex-direction: column; }
  .filter-select { width: 100%; }
  .card-actions-row { grid-template-columns: 1fr; }
  .modal-content-scroll { padding: 1.25rem; }
  .gallery-main-img-wrap { height: 210px; }
}

/* ==========================================================================
   Availability Calendar (calendar.js)
   ========================================================================== */
.cal-root { position: relative; }
.cal-nav { display: flex; justify-content: space-between; margin-bottom: 0.25rem; }
.cal-nav-btn { border: 1px solid var(--color-border); background: var(--color-surface); border-radius: 6px; width: 34px; height: 30px; cursor: pointer; font-size: 1.1rem; line-height: 1; }
.cal-nav-btn:hover { background: var(--color-primary-light); }
.cal-months { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.cal-month-title { font-weight: 700; font-size: 0.9rem; text-align: center; margin-bottom: 0.35rem; color: var(--color-text-main); }
.cal-dow, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-dow span { text-align: center; font-size: 0.68rem; color: var(--color-text-subtle); padding: 2px 0; }
.cal-cell { aspect-ratio: 1 / 1; min-height: 32px; }
.cal-day { border: 1px solid transparent; background: var(--color-surface); border-radius: 6px; font-size: 0.8rem; cursor: pointer; color: var(--color-text-main); padding: 0; }
.cal-day:hover:not(:disabled) { background: var(--color-primary-light); border-color: var(--color-primary-border); }
.cal-day:disabled { cursor: default; }
.cal-day.is-today { border-color: var(--color-primary); font-weight: 700; }
.cal-day.is-past { color: #b9b9b9; background: transparent; }
.cal-day.is-booked { background: var(--color-terracotta-light); color: var(--color-terracotta); text-decoration: line-through; }
.cal-day.is-blocked { background: repeating-linear-gradient(45deg, #eee, #eee 4px, #f7f7f7 4px, #f7f7f7 8px); color: #999; text-decoration: line-through; }
.cal-day.is-in-range { background: var(--color-primary-light); border-color: var(--color-primary-border); }
.cal-day.is-start, .cal-day.is-end { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.cal-legend { display: flex; flex-wrap: wrap; gap: 0.9rem; font-size: 0.72rem; color: var(--color-text-muted); margin-top: 0.6rem; }
.cal-legend .lg { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; border: 1px solid var(--color-border); }
.lg-free { background: #fff; } .lg-booked { background: var(--color-terracotta-light); border-color: var(--color-terracotta) !important; }
.lg-blocked { background: repeating-linear-gradient(45deg, #ddd, #ddd 3px, #f4f4f4 3px, #f4f4f4 6px); } .lg-sel { background: var(--color-primary); }
.cal-msg { min-height: 1.1rem; margin-top: 0.4rem; font-size: 0.78rem; color: var(--color-text-muted); }
.cal-msg.is-error { color: var(--color-danger); font-weight: 600; }
.stay-type-row { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.6rem; }
.stay-type-row label { border: 1px solid var(--color-border); border-radius: 6px; padding: 0.45rem 0.8rem; cursor: pointer; font-size: 0.85rem; display: flex; gap: 0.4rem; align-items: center; }
.stay-type-row label.active { border-color: var(--color-primary); background: var(--color-primary-light); font-weight: 700; }
.stay-summary { background: var(--color-primary-light); border: 1px solid var(--color-primary-border); border-radius: 6px; padding: 0.5rem 0.75rem; font-size: 0.82rem; margin-top: 0.5rem; }
.stay-terms-pill { display: inline-block; font-size: 0.72rem; background: var(--color-warning-bg); color: var(--color-warning-text); border-radius: 999px; padding: 2px 10px; font-weight: 600; }
