/**
 * Nhà Ở Việt (NÓV) — Components Stylesheet
 * Buttons, Badges, Search & Filters, Property Listing Cards, Dialogs, Seller Dashboard & Map
 */

/* =====================================================================
   Buttons & Action Controls
   ===================================================================== */
.button {
  min-height: 42px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.16s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.button:active {
  transform: scale(0.96) translateY(0);
}

.button-primary {
  background: linear-gradient(135deg, var(--brand) 0%, #004dc9 100%);
  color: #fff;
  border-color: #0b4fc7;
}
.button-primary:hover {
  background: linear-gradient(135deg, #124ec4 0%, #003fa8 100%);
  color: #fff;
}

.button-secondary {
  background: var(--teal);
  color: #fff;
}
.button-secondary:hover {
  background: var(--teal-hover);
  color: #fff;
}

.button-outline {
  border-color: var(--border);
  background: #fff;
  color: var(--ink);
}
.button-outline:hover {
  border-color: #94a3b8;
  background: var(--page);
}

.button-danger {
  background: var(--coral);
  color: white;
}
.button-danger:hover {
  background: #992c20;
}

.button-small {
  min-height: 34px;
  padding: 6px 11px;
  font-size: 12px;
}

.text-button {
  border: 0;
  padding: 6px 6px;
  background: none;
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
}
.text-button:hover {
  text-decoration: underline;
}

/* =====================================================================
   Search Hero & Filter Panels
   ===================================================================== */
.search-box {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.search-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.segmented {
  display: inline-flex;
  gap: 3px;
  padding: 4px;
  border-radius: var(--radius-sm);
  background: #ebf1f8;
}

.segmented button {
  min-width: 90px;
  border: 0;
  border-radius: 6px;
  padding: 8px 14px;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
  transition: all 0.15s ease;
}

.segmented button[aria-pressed="true"] {
  background: white;
  color: var(--brand);
  box-shadow: 0 1px 4px rgba(23, 36, 58, 0.12);
}

.search-quick {
  display: flex;
  gap: 12px;
}

.quick-link {
  border: 0;
  padding: 6px 8px;
  background: none;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}
.quick-link:hover {
  color: var(--brand);
  background: var(--surface-blue);
}

.search-fields {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(210px, 1.35fr) minmax(170px, 0.85fr) auto;
  gap: 9px;
}

.field-box {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field-box:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(21, 94, 239, 0.14);
}

.field-symbol {
  color: var(--teal);
  font-size: 18px;
  line-height: 1;
}

.field-content {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 3px;
}

.field-content label, .field-content .label {
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.field-content input, .field-content select {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.field-content input::placeholder {
  color: #94a3b8;
  font-weight: 500;
}

.search-submit {
  min-width: 116px;
  min-height: 52px;
}

.popular-areas {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 12px 2px 2px;
  color: var(--muted);
  font-size: 11px;
}

.popular-areas-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.area-chip {
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-full);
  padding: 5px 11px;
  background: #f8fafc;
  color: #334155;
  font-size: 11px;
  font-weight: 600;
  transition: all 0.15s ease;
}
.area-chip:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--surface-blue);
}

/* =====================================================================
   Content Header, Sort & Filter Sidebar
   ===================================================================== */
.content-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  padding: 24px 0 14px;
}

.content-head h2 {
  margin: 0;
  font-family: "Be Vietnam Pro", sans-serif;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.results-meta {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.results-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.results-subactions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sort-control {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: white;
  color: var(--muted);
  font-size: 12px;
}

.sort-control select {
  min-height: 38px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.filter-toggle {
  display: none;
}

.results-layout {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  align-items: start;
  gap: 20px;
}

.filters {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: white;
  box-shadow: var(--shadow-xs);
}

.filter-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}

.filter-title h3 {
  margin: 0;
  font-size: 13.5px;
  font-weight: 800;
}

.filter-group {
  padding: 14px 0;
  border-bottom: 1px solid #f1f5f9;
}
.filter-group:last-child {
  border: 0;
  padding-bottom: 0;
}

.filter-group h4 {
  margin: 0 0 10px;
  font-size: 11.5px;
  font-weight: 700;
}

.filter-select, .filter-input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
}

.filter-select:focus, .filter-input:focus, textarea:focus, input:focus-visible, select:focus-visible {
  outline: 3px solid rgba(21, 94, 239, 0.2);
  outline-offset: 1px;
}

.check-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 8px 0;
  color: #334155;
  font-size: 12px;
}

.check-label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.check-label input {
  width: 15px;
  height: 15px;
  accent-color: var(--brand);
}

.check-count {
  color: #94a3b8;
  font-size: 11px;
}

.range-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.filters-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
}

/* =====================================================================
   Property Listing Cards Grid & Modern Card System
   ===================================================================== */
.listing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.listing-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: white;
  transition: box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease;
  animation: reveal 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
}

.listing-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

.listing-image-wrap {
  position: relative;
  aspect-ratio: 1.55;
  overflow: hidden;
  background: #e2e8f0;
}

.listing-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.listing-card:hover .listing-image {
  transform: scale(1.04);
}

.image-labels {
  position: absolute;
  left: 10px;
  top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  z-index: 2;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.02em;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.badge-vip {
  background: #fef08a;
  color: #713f12;
  border: 1px solid #fde047;
}

.badge-new {
  background: #e6f7f2;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.badge-sale {
  background: rgba(255, 255, 255, 0.96);
  color: #1e293b;
  border: 1px solid #e2e8f0;
}

.favorite-button {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: #64748b;
  font-size: 19px;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  transition: all 0.15s ease;
  z-index: 2;
}

.favorite-button[aria-pressed="true"] {
  color: var(--coral);
}
.favorite-button:hover {
  color: var(--coral);
  transform: scale(1.08);
}

.listing-body {
  padding: 14px 14px 12px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.listing-price-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.listing-price {
  margin: 0;
  color: var(--brand);
  font-family: "Be Vietnam Pro", sans-serif;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.listing-unit {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}

.listing-title {
  display: -webkit-box;
  overflow: hidden;
  min-height: 38px;
  margin: 7px 0 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.listing-location {
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.listing-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  font-size: 11px;
}

.listing-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  padding-top: 10px;
  color: #64748b;
  font-size: 10px;
  margin-top: auto;
}

.card-details {
  border: 0;
  padding: 4px 6px;
  background: transparent;
  color: var(--brand);
  font-size: 11px;
  font-weight: 800;
}
.card-details:hover {
  text-decoration: underline;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 44px 20px;
  border: 1.5px dashed #cbd5e1;
  border-radius: var(--radius-md);
  background: white;
  text-align: center;
}

.empty-state strong {
  display: block;
  margin-bottom: 6px;
  font-size: 16px;
}

.empty-state p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
}

/* =====================================================================
   Owner Dashboard, Saved Views & Moderation Items
   ===================================================================== */
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  padding: 28px 0 18px;
}

.page-heading h1 {
  margin-bottom: 4px;
  font-size: 26px;
}

.page-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.owner-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: white;
}

.state-tab {
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 8px 13px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  transition: all 0.15s ease;
}

.state-tab.active {
  border-color: #bfdbfe;
  background: var(--surface-blue);
  color: var(--brand);
}

.owner-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.owner-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: white;
  box-shadow: var(--shadow-xs);
}

.owner-row img {
  width: 110px;
  height: 78px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.owner-row h3 {
  margin: 0 0 4px;
  font-size: 13px;
  line-height: 1.45;
}

.owner-row p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.owner-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 7px;
  color: var(--success);
  font-size: 11px;
  font-weight: 800;
}
.owner-status.pending {
  color: var(--warning);
}

.owner-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.moderation-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 0 0 14px;
}

.summary-item {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: white;
  box-shadow: var(--shadow-xs);
}

.summary-item small {
  color: var(--muted);
  font-size: 11px;
}

.summary-item strong {
  display: block;
  margin-top: 4px;
  font-family: "Be Vietnam Pro", sans-serif;
  font-size: 22px;
}

.admin-label {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 11px;
}

.listing-grid.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.saved-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.saved-tabs button {
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 10px 14px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.saved-tabs button.active {
  border-color: var(--brand);
  color: var(--brand);
}

.saved-search-list {
  display: grid;
  gap: 12px;
}

.saved-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: white;
  box-shadow: var(--shadow-xs);
}

.saved-search-row h3 {
  margin: 0 0 5px;
  font-size: 14px;
}

.saved-search-row p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.saved-search-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.saved-search-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.demo-label {
  color: var(--warning);
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
}

.support-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
  align-items: start;
  gap: 18px;
}

.support-panel {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: white;
  box-shadow: var(--shadow-xs);
}

.support-panel h2 {
  margin: 0 0 6px;
  font-family: "Be Vietnam Pro", sans-serif;
  font-size: 17px;
}

.support-panel > p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.support-form {
  display: grid;
  gap: 12px;
}
.support-form .button {
  justify-self: start;
}

.support-cases {
  display: grid;
  gap: 10px;
}

.support-case {
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  background: #f8fafc;
}

.support-case-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.support-case h3 {
  margin: 0 0 4px;
  font-size: 12px;
}

.support-case p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.support-case-status {
  flex: 0 0 auto;
  border-radius: 4px;
  padding: 4px 7px;
  background: var(--surface-blue);
  color: var(--brand);
  font-size: 9.5px;
  font-weight: 800;
}

.support-thread {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.support-message {
  padding: 8px 10px;
  border-radius: 6px;
  background: white;
  color: #334155;
  font-size: 11px;
  line-height: 1.55;
  border: 1px solid #edf2f7;
}

.support-message strong {
  display: block;
  margin-bottom: 2px;
  color: var(--ink);
  font-size: 10px;
}

.support-reply-form {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}
.support-reply-form textarea {
  width: 100%;
  min-height: 60px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px;
  font-size: 11px;
  resize: vertical;
}
.support-reply-form .button {
  justify-self: start;
}

.support-tips {
  margin: 0;
  padding-left: 18px;
  color: #334155;
  font-size: 12px;
  line-height: 1.8;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.metric-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: white;
}

.metric-card small {
  color: var(--muted);
  font-size: 10px;
}

.metric-card strong {
  display: block;
  margin-top: 6px;
  font-family: "Be Vietnam Pro", sans-serif;
  font-size: 21px;
}

.metric-series {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.metric-day {
  display: grid;
  grid-template-columns: 80px 1fr 36px;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
}

.metric-bar-track {
  height: 8px;
  overflow: hidden;
  border-radius: var(--radius-full);
  background: #e2e8f0;
}

.metric-bar {
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.metric-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.trust-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 26px;
  padding: 14px 18px;
  border: 1px solid #cce8de;
  border-radius: var(--radius-md);
  background: var(--surface-mint);
}

.trust-copy {
  display: flex;
  align-items: center;
  gap: 12px;
}

.trust-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: white;
  color: var(--teal);
  font-weight: 800;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.trust-copy strong {
  display: block;
  color: #0f5146;
  font-size: 12px;
}

.trust-copy small {
  display: block;
  margin-top: 3px;
  color: #27695f;
  font-size: 10.5px;
}

.site-footer {
  margin-top: 40px;
  padding: 36px 0 26px;
  border-top: 1px solid var(--border);
  background: #f8fafc;
  font-size: 12.5px;
}
.site-footer a:hover {
  color: var(--brand);
  text-decoration: underline;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: 30px;
}

.footer-brand-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* =====================================================================
   Dialogs / Modals, Forms & Toasts
   ===================================================================== */
dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  right: auto;
  bottom: auto;
  inset: auto;
  transform: translate(-50%, -50%);
  margin: 0;
  width: min(720px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  max-height: min(90vh, calc(100dvh - 36px));
  height: auto;
  border: 0;
  border-radius: var(--radius-lg, 16px);
  padding: 0;
  background: white;
  color: var(--ink);
  box-shadow: 0 24px 70px rgba(16, 32, 55, 0.28), 0 0 0 1px rgba(0, 0, 0, 0.05);
  animation: reveal 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden !important;
  display: none;
  flex-direction: column;
  z-index: 1000 !important;
}

dialog[open] {
  display: flex !important;
}

#post-dialog {
  height: min(88vh, 800px);
}

dialog::backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6) !important;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 999 !important;
}

dialog > form,
#post-form {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  max-height: 100% !important;
  min-height: 0 !important;
  overflow: hidden !important;
  width: 100% !important;
  margin: 0 !important;
}

.dialog-head {
  flex: 0 0 auto !important;
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03);
}

.dialog-head h2 {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  font-family: "Be Vietnam Pro", sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.35;
}

.close-button {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  min-width: 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: white;
  font-size: 18px;
  line-height: 1;
  display: grid;
  place-items: center;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
}
.close-button:hover {
  background: #f1f5f9;
  color: var(--ink);
  border-color: var(--border-strong);
}

.dialog-body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 18px 20px;
}

.dialog-foot,
dialog > form > .form-actions,
#post-form > .form-actions {
  flex: 0 0 auto !important;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  z-index: 10;
  margin-top: 0 !important;
  box-shadow: 0 -4px 14px rgba(15, 23, 42, 0.04);
}

.detail-photo {
  width: 100%;
  height: 320px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: #e2e8f0;
}

.detail-topline {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-top: 14px;
}

.detail-title {
  margin: 0 0 7px;
  font-family: "Be Vietnam Pro", sans-serif;
  font-size: 20px;
  line-height: 1.4;
  font-weight: 800;
}

.detail-price {
  margin: 0;
  color: var(--brand);
  font-family: "Be Vietnam Pro", sans-serif;
  font-size: 24px;
  font-weight: 800;
  white-space: nowrap;
}

.detail-description {
  margin: 16px 0;
  color: #334155;
  font-size: 13.5px;
  line-height: 1.75;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.detail-contact {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-mint);
  color: #115e52;
  font-size: 12px;
  font-weight: 600;
}

.modal-disclaimer {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-field {
  display: grid;
  gap: 6px;
}
.form-field.full {
  grid-column: 1 / -1;
}

.form-field label {
  font-size: 11.5px;
  font-weight: 700;
}

.form-field input, .form-field select, .form-field textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: white;
  color: var(--ink);
  font-size: 12.5px;
}

.form-field textarea {
  min-height: 100px;
  resize: vertical;
}

.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}

.upload-demo {
  padding: 18px;
  border: 1.5px dashed #94a3b8;
  border-radius: var(--radius-sm);
  background: #f8fafc;
  color: var(--muted);
  font-size: 11.5px;
}
.upload-demo strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
}

.steps {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 11px;
}

.steps span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.step-dot {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #edf2f8;
  font-size: 10px;
  font-weight: 800;
}

.steps .current {
  color: var(--brand);
  font-weight: 800;
}
.steps .current .step-dot {
  background: var(--brand);
  color: white;
}

/* =====================================================================
   Smart Fast-Posting (Cơ chế đăng tin thông minh, vị trí theo thứ tự & Chips)
   ===================================================================== */
.smart-paste-card {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  border: 1px solid #86efac;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.08);
}
.smart-paste-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.smart-paste-card-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 800;
  color: #15803d;
}
.smart-paste-box {
  display: flex;
  gap: 8px;
}
.smart-paste-input {
  flex: 1 1 auto;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-sm);
  background: #ffffff;
  font-size: 12px;
  color: var(--ink);
}
.smart-paste-input:focus {
  outline: none;
  border-color: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
}

.segmented-control {
  display: flex;
  padding: 4px;
  background: #e2e8f0;
  border-radius: var(--radius-sm);
  gap: 4px;
}
.segmented-btn {
  flex: 1 1 50%;
  min-height: 38px;
  border: 0;
  border-radius: calc(var(--radius-sm) - 2px);
  background: transparent;
  color: #475569;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.18s ease;
}
.segmented-btn:hover {
  color: var(--ink);
}
.segmented-btn.active {
  background: #ffffff;
  color: var(--brand);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.loc-stepper-box {
  padding: 14px;
  border-radius: var(--radius-md);
  background: #f8fafc;
  border: 1px solid var(--border-strong);
  margin-bottom: 12px;
}
.loc-stepper-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.loc-stepper-head label {
  font-size: 12px;
  font-weight: 800;
  color: var(--ink);
}
.loc-step-row {
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--border);
}
.loc-step-row:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}
.loc-step-label {
  display: block;
  font-size: 10.5px;
  font-weight: 800;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.loc-chips-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.loc-chip, .quick-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  transition: all 0.16s cubic-bezier(0.16, 1, 0.3, 1);
}
.loc-chip:hover, .quick-chip:hover {
  border-color: var(--brand);
  background: var(--surface-blue);
  color: var(--brand);
  transform: translateY(-1px);
}
.loc-chip:active, .quick-chip:active {
  transform: scale(0.95);
}
.loc-chip.active, .quick-chip.active {
  border-color: var(--brand);
  background: var(--brand);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(21, 94, 239, 0.3);
}
.loc-chip.active::before, .quick-chip.active::before {
  content: "✓ ";
  font-size: 11px;
}
.loc-result-row {
  margin-top: 10px;
  padding-top: 10px;
}
.loc-result-label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
}
.loc-result-input-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
}

.auto-title-box {
  margin-top: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.title-hint-text {
  font-size: 11px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.quick-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 4px;
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.plan {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 190px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: white;
}

.plan.featured {
  border: 2px solid var(--brand);
  background: #f8fbff;
}

.plan h3 {
  margin: 8px 0 4px;
  font-size: 13.5px;
}

.plan-price {
  margin: 0;
  font-family: "Be Vietnam Pro", sans-serif;
  font-size: 19px;
  font-weight: 800;
}

.plan small {
  margin: 4px 0 12px;
  color: var(--muted);
  font-size: 10.5px;
}

.plan ul {
  margin: 0 0 12px;
  padding-left: 16px;
  color: #334155;
  font-size: 11px;
  line-height: 1.7;
}

.plan .button {
  width: 100%;
  margin-top: auto;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  max-width: min(380px, calc(100vw - 36px));
  padding: 12px 16px;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-sm);
  background: #f0fdf4;
  color: #14532d;
  box-shadow: var(--shadow-lg);
  font-size: 12.5px;
  font-weight: 700;
  animation: reveal 0.18s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* =====================================================================
   Auth Modal Tabs
   ===================================================================== */
.auth-tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 16px;
}

.auth-tab {
  flex: 1;
  padding: 12px 14px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  font-weight: 700;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
}

.auth-tab:hover {
  color: var(--ink);
}

.auth-tab.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
  background: rgba(21, 94, 239, 0.05);
}

/* =====================================================================
   Leaflet Map Price Markers & Popups
   ===================================================================== */
.map-price-marker {
  background: #ffffff;
  color: var(--ink);
  border: 1.5px solid var(--brand);
  border-radius: 20px;
  padding: 4px 10px;
  font-weight: 800;
  font-size: 11px;
  box-shadow: 0 4px 12px rgba(21, 94, 239, 0.25);
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.map-price-marker:hover, .map-price-marker.active {
  background: var(--brand);
  color: #ffffff;
  transform: scale(1.12);
  z-index: 1000 !important;
}

.map-price-marker.vip {
  background: #f59e0b;
  color: #ffffff;
  border-color: #d97706;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4);
}

.map-price-marker.rent {
  border-color: var(--teal);
}

.map-popup-card {
  width: 230px;
  padding: 2px;
}

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

.map-popup-card h4 {
  margin: 0 0 4px;
  font-size: 13px;
  color: var(--ink);
  line-height: 1.3;
}

.map-popup-card .price {
  font-size: 14px;
  font-weight: 800;
  color: var(--brand);
  margin-bottom: 4px;
}

.map-popup-card .meta {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 8px;
}

/* =====================================================================
   Floating Post Button (FAB stacked above Chat Button)
   ===================================================================== */
.post-floating-btn {
  position: fixed;
  bottom: 88px;
  right: 24px;
  min-height: 48px;
  padding: 0 18px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--brand) 0%, #004dc9 100%);
  color: #ffffff;
  border: none;
  box-shadow: 0 6px 20px rgba(21, 94, 239, 0.42);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 800;
  z-index: 24;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, bottom 0.2s ease;
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.post-floating-btn:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 8px 24px rgba(21, 94, 239, 0.52);
}

.post-floating-btn:active {
  transform: scale(0.95);
}

.post-floating-icon {
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}

.post-floating-label {
  letter-spacing: 0.01em;
}

body.has-compare-dock .post-floating-btn {
  bottom: 160px;
}

/* =====================================================================
   Print Stylesheet
   ===================================================================== */
@media print {
  body * {
    visibility: hidden !important;
  }
  #contract-dialog, #contract-dialog * {
    visibility: visible !important;
  }
  #contract-dialog {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    border: 0 !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
  }
  #contract-printable {
    border: 0 !important;
    padding: 10mm 15mm !important;
    font-family: "Times New Roman", Times, serif !important;
    font-size: 13pt !important;
    color: #000 !important;
  }
  .no-print {
    display: none !important;
  }
}
