/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: 'Nunito Sans', 'Public Sans', -apple-system, sans-serif;
  background: #F5F4EF;
  color: #1a1a1a;
}

/* ===== App Shell ===== */
.app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* ===== TOP BAR ===== */
.topbar {
  display: flex;
  align-items: center;
  background: #1b4332;
  padding: 0 1.25rem;
  height: 52px;
  flex-shrink: 0;
  gap: 1rem;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-right: 0.5rem;
  flex-shrink: 0;
}

.brand-icon {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: #d4a853;
  color: #1b4332;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Public Sans', sans-serif;
  font-weight: 800;
  font-size: 0.75rem;
}

.brand-name {
  color: #fff;
  font-family: 'Public Sans', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
}

/* ===== VIEW TOGGLE (My Properties / All) ===== */
.view-toggle {
  display: flex;
  background: rgba(0,0,0,0.2);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
  flex-shrink: 0;
}

.vt-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.8rem;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: rgba(255,255,255,0.55);
  font-family: 'Public Sans', sans-serif;
  font-weight: 600;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.vt-btn:hover {
  color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.08);
}

.vt-btn.vt-active {
  background: #d4a853;
  color: #1b4332;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.vt-btn.vt-active svg { stroke: #1b4332; }
.vt-btn svg { width: 14px; height: 14px; flex-shrink: 0; }

/* ===== FILE TABS ===== */
.tab-bar {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  flex: 1;
  height: 100%;
  padding-top: 8px;
}

.tab {
  position: relative;
  padding: 0.5rem 1.1rem 0.55rem;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  color: rgba(255,255,255,0.6);
  font-family: 'Public Sans', sans-serif;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  /* 3D effect */
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.06),
    0 -1px 3px rgba(0,0,0,0.15);
}

.tab:hover {
  background: rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.85);
}

.tab.active {
  background: #F5F4EF;
  color: #1a1a1a;
  border-color: #d1d5db;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.8),
    -1px -1px 3px rgba(0,0,0,0.06),
    1px -1px 3px rgba(0,0,0,0.06);
  z-index: 2;
  /* Extend down to cover the border */
  margin-bottom: -1px;
  padding-bottom: calc(0.55rem + 1px);
}

.tab-badge {
  display: inline-block;
  background: rgba(255,255,255,0.2);
  color: inherit;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 8px;
  min-width: 18px;
  text-align: center;
  margin-left: 0.3rem;
}

.tab.active .tab-badge {
  background: #2d6a4f;
  color: #fff;
}

.tab-badge-warn {
  background: #d97706 !important;
  color: #fff !important;
}

/* ===== TOP BAR USER ===== */
.topbar-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  flex-shrink: 0;
}

.topbar-user .user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #d4a853;
  color: #1b4332;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.7rem;
  font-family: 'Public Sans', sans-serif;
}

.topbar-user .user-name {
  color: rgba(255,255,255,0.8);
  font-size: 0.8rem;
  font-weight: 600;
}

.topbar-logout {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.6);
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.topbar-logout:hover {
  background: rgba(255,255,255,0.18);
  color: #fff;
}

/* ===== MAIN CONTENT ===== */
.main-content {
  flex: 1;
  overflow: hidden;
  border-top: 1px solid #d1d5db;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: calc(100vh - 52px);
}

/* ===== INBOX VIEW (2-panel) ===== */
.view-inbox {
  display: none;
  flex: 1;
}

.view-inbox.view-active {
  display: grid;
  grid-template-columns: 360px 1fr;
}

/* ===== THREAD LIST ===== */
.thread-list {
  background: #fff;
  border-right: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.thread-list-header {
  padding: 1rem 1.25rem 0.75rem;
  border-bottom: 1px solid #f0f0ec;
}

.thread-list-header h2 {
  font-family: 'Public Sans', sans-serif;
  font-weight: 800;
  font-size: 1.15rem;
  margin-bottom: 0.6rem;
}

.thread-filters {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.6rem;
}

.filter-btn {
  padding: 0.25rem 0.65rem;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  background: #fff;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.15s;
}

.filter-btn:hover { border-color: #2d6a4f; color: #2d6a4f; }
.filter-btn.active { background: #2d6a4f; color: #fff; border-color: #2d6a4f; }

.thread-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.7rem;
  background: #f9faf8;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.thread-search svg { flex-shrink: 0; color: #9ca3af; }
.thread-search input {
  flex: 1; border: none; background: transparent;
  font-size: 0.82rem; font-family: inherit; outline: none; color: #1a1a1a;
}

.thread-items { flex: 1; overflow-y: auto; }

/* Thread Item */
.thread-item {
  display: flex;
  gap: 0.7rem;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid #f5f5f0;
  cursor: pointer;
  transition: background 0.1s;
}

.thread-item:hover { background: #fafaf8; }
.thread-item.active { background: #f0f7f4; border-left: 3px solid #2d6a4f; }
.thread-item.unread .thread-guest { font-weight: 700; }
.thread-item.unread .thread-preview { color: #1a1a1a; font-weight: 600; }

.thread-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.75rem; color: #fff;
}

.thread-content { flex: 1; min-width: 0; }

.thread-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.15rem; }
.thread-guest { font-weight: 600; font-size: 0.85rem; color: #1a1a1a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread-time { font-size: 0.7rem; color: #9ca3af; white-space: nowrap; margin-left: 0.5rem; }

.thread-mid { display: flex; align-items: center; gap: 0.35rem; margin-bottom: 0.15rem; }

.channel-icon {
  width: 14px; height: 14px; border-radius: 3px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.5rem; font-weight: 800; color: #fff; flex-shrink: 0;
}
.channel-icon.airbnb { background: #FF5A5F; }
.channel-icon.vrbo { background: #3B5FC0; }
.channel-icon.sms { background: #059669; }

.thread-property { font-size: 0.75rem; color: #6b7280; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread-preview { font-size: 0.78rem; color: #9ca3af; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3; }

.thread-bottom { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.2rem; }

.agent-tag {
  display: inline-flex; align-items: center; gap: 0.25rem;
  font-size: 0.65rem; font-weight: 600; padding: 0.1rem 0.35rem;
  border-radius: 4px; background: #f3f4f6; color: #6b7280;
}
.agent-tag.ai { background: #ecfdf5; color: #059669; }
.agent-tag.human { background: #eff6ff; color: #2563eb; }

.unread-dot { width: 8px; height: 8px; border-radius: 50%; background: #2d6a4f; flex-shrink: 0; margin-left: auto; }

.cat-tag {
  display: inline-flex; align-items: center; gap: 0.2rem;
  font-size: 0.65rem; font-weight: 700; padding: 0.12rem 0.4rem;
  border-radius: 4px; white-space: nowrap;
}
.cat-booking { background: #ecfdf5; color: #059669; }
.cat-booking_request { background: #eff6ff; color: #2563eb; }
.cat-inquiry { background: #fef3c7; color: #b45309; }
.cat-message { background: #f3f4f6; color: #374151; }
.cat-review { background: #fef9c3; color: #a16207; }
.cat-cancellation { background: #fef2f2; color: #dc2626; }
.cat-modification { background: #ede9fe; color: #7c3aed; }
.cat-reminder { background: #f0f9ff; color: #0369a1; }
.cat-payout { background: #ecfdf5; color: #059669; }
.cat-other { background: #f3f4f6; color: #6b7280; }

/* ===== CONVERSATION PANEL ===== */
.conversation {
  display: flex; flex-direction: column; overflow: hidden; background: #fafaf8;
}

.conv-empty {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 0.75rem;
  color: #9ca3af; font-size: 0.9rem;
}

.conv-active { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

.conv-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.85rem 1.25rem; background: #fff; border-bottom: 1px solid #e5e7eb;
}

.conv-guest-name { font-family: 'Public Sans', sans-serif; font-weight: 700; font-size: 1.05rem; }

.conv-meta { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.15rem; }

.channel-badge {
  display: inline-block; padding: 0.12rem 0.45rem; border-radius: 4px;
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
}
.channel-badge.airbnb { background: #fff1f2; color: #FF5A5F; }
.channel-badge.vrbo { background: #eef2ff; color: #3B5FC0; }
.channel-badge.sms { background: #ecfdf5; color: #059669; }

.conv-property, .conv-dates { font-size: 0.78rem; color: #6b7280; }

.conv-header-actions { display: flex; gap: 0.35rem; }

.icon-btn {
  width: 34px; height: 34px; border: 1px solid #e5e7eb; border-radius: 8px;
  background: #fff; display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: #6b7280; transition: all 0.15s;
}
.icon-btn:hover { border-color: #2d6a4f; color: #2d6a4f; }

/* Messages */
.conv-messages {
  flex: 1; overflow-y: auto; padding: 1.25rem;
  display: flex; flex-direction: column; gap: 0.85rem;
}

.booking-summary-card {
  background: linear-gradient(180deg, #fffdf7, #fff);
  border: 1px solid #eadfc8;
  border-radius: 14px;
  padding: 0.95rem 1rem;
  box-shadow: 0 8px 24px rgba(27, 67, 50, 0.06);
}

.booking-summary-card.starter {
  border-color: #d4a853;
  background: linear-gradient(180deg, #fff8e8, #fffdf7);
}

.booking-summary-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.8rem;
}

.booking-summary-kicker {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
  color: #8b6b2f;
  margin-bottom: 0.2rem;
}

.booking-summary-title {
  font-family: 'Public Sans', sans-serif;
  font-size: 1rem;
  font-weight: 800;
  color: #1b4332;
}

.booking-summary-intro {
  font-size: 0.78rem;
  color: #6b7280;
  max-width: 280px;
  text-align: right;
}

.booking-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.65rem 0.8rem;
}

.booking-summary-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.booking-summary-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9ca3af;
  font-weight: 700;
}

.booking-summary-value {
  font-size: 0.84rem;
  color: #1f2937;
  font-weight: 700;
  line-height: 1.35;
}

.msg-bubble {
  max-width: 70%; padding: 0.75rem 1rem; border-radius: 12px;
  font-size: 0.85rem; line-height: 1.5; position: relative;
}
.msg-bubble.guest { background: #fff; border: 1px solid #e5e7eb; align-self: flex-start; border-bottom-left-radius: 4px; }
.msg-bubble.team { background: #2d6a4f; color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.msg-bubble.ai { background: linear-gradient(135deg, #ecfdf5, #d1fae5); color: #1a1a1a; align-self: flex-end; border: 1px solid #a7f3d0; border-bottom-right-radius: 4px; }

.msg-sender { font-size: 0.7rem; font-weight: 700; margin-bottom: 0.15rem; opacity: 0.7; }
.msg-bubble.team .msg-sender { color: rgba(255,255,255,0.7); }
.msg-bubble.ai .msg-sender { color: #059669; }

.msg-meta { margin-bottom: 0.35rem; }
.msg-badge {
  display: inline-flex; align-items: center; gap: 0.25rem;
  font-size: 0.62rem; font-weight: 700; padding: 0.18rem 0.45rem;
  border-radius: 999px; text-transform: uppercase; letter-spacing: 0.02em;
}
.msg-badge.guest { background: #f3f4f6; color: #6b7280; }
.msg-badge.human { background: rgba(255,255,255,0.18); color: rgba(255,255,255,0.9); border: 1px solid rgba(255,255,255,0.18); }
.msg-badge.ai { background: #d1fae5; color: #047857; border: 1px solid #a7f3d0; }

.msg-text { white-space: pre-wrap; }

.msg-time { font-size: 0.65rem; margin-top: 0.35rem; opacity: 0.5; }
.msg-bubble.team .msg-time { color: rgba(255,255,255,0.5); }

.msg-ai-tag { display: inline-flex; align-items: center; gap: 0.2rem; font-size: 0.62rem; font-weight: 600; color: #059669; margin-top: 0.2rem; }
.msg-ai-tag svg { width: 12px; height: 12px; }

.msg-system { text-align: center; font-size: 0.75rem; color: #9ca3af; padding: 0.4rem 0; }

/* Composer */
.conv-composer {
  padding: 0.6rem 1.25rem 1rem; background: #fff; border-top: 1px solid #e5e7eb;
}

.composer-agent-tag {
  display: flex; align-items: center; gap: 0.35rem;
  font-size: 0.72rem; color: #6b7280; margin-bottom: 0.55rem;
}

.composer-agent-tag.clean {
  margin-bottom: 0;
}

.composer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}

.agent-dot { width: 8px; height: 8px; border-radius: 50%; }
.agent-dot.human { background: #2563eb; }

.bella-draft-box {
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px;
  padding: 0.75rem; margin-bottom: 0.75rem;
}
.bella-draft-box.empty { color: #9ca3af; font-size: 0.85rem; }
.bella-draft-head {
  display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.45rem;
}
.bella-draft-title { font-size: 0.78rem; font-weight: 700; color: #2563eb; flex: 1; }
.bella-draft-head button {
  border: 1px solid #d1d5db; background: #fff; color: #374151;
  border-radius: 6px; padding: 0.3rem 0.7rem; font-size: 0.72rem; font-weight: 600;
  cursor: pointer; transition: all 0.15s ease;
}
.bella-draft-head button:hover {
  background: #f3f4f6; border-color: #9ca3af;
}
.bella-copy-btn { color: #1d4ed8 !important; border-color: #bfdbfe !important; }
.bella-copy-btn:hover { background: #eff6ff !important; }
.bella-rewrite-btn { color: #7c3aed !important; border-color: #c4b5fd !important; }
.bella-rewrite-btn:hover { background: #f5f3ff !important; }
.bella-clear-btn { color: #dc2626 !important; border-color: #fecaca !important; }
.bella-clear-btn:hover { background: #fef2f2 !important; }
.bella-draft-head button:disabled {
  opacity: 0.5; cursor: not-allowed;
}
#bellaDraftText {
  width: 100%; min-height: 120px; resize: vertical; border: 1px solid #d1d5db;
  border-radius: 10px; padding: 0.75rem; font: inherit; line-height: 1.5; background: #fff;
}
.composer-actions-only { display: flex; gap: 0.5rem; }
.btn-airbnb-reply {
  display: inline-flex; align-items: center; justify-content: center; width: 100%;
  background: #FF5A5F; color: #fff; text-decoration: none; font-weight: 700;
  border-radius: 10px; padding: 0.8rem 1rem;
}
.btn-airbnb-reply:hover { background: #e1484d; }
.agent-dot.ai { background: #059669; }

.composer-input-row { display: flex; gap: 0.4rem; align-items: flex-end; }

.composer-input-row textarea {
  flex: 1; border: 1.5px solid #e5e7eb; border-radius: 10px;
  padding: 0.6rem 0.9rem; font-family: inherit; font-size: 0.85rem;
  resize: none; min-height: 40px; max-height: 120px;
  outline: none; transition: border-color 0.2s; background: #fafaf8;
}
.composer-input-row textarea:focus { border-color: #2d6a4f; box-shadow: 0 0 0 3px rgba(45,106,79,0.08); }

.btn-send {
  width: 40px; height: 40px; border: none; border-radius: 10px;
  background: #2d6a4f; color: #fff; display: flex; align-items: center;
  justify-content: center; cursor: pointer; transition: background 0.15s; flex-shrink: 0;
}
.btn-send:hover { background: #245a42; }

/* ===== VIEW PANELS (full width) ===== */
.view-panel {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  background: #fafaf8;
}

.view-panel-grid {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.panel-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100%; gap: 0.75rem; color: #9ca3af;
}
.panel-placeholder h3 { font-family: 'Public Sans', sans-serif; font-weight: 700; color: #6b7280; }
.panel-placeholder p { font-size: 0.9rem; }

.panel-header {
  padding: 1.25rem 2rem 1rem; background: #fff;
  border-bottom: 1px solid #e5e7eb; position: sticky; top: 0; z-index: 10;
}
.panel-header h2 { font-family: 'Public Sans', sans-serif; font-weight: 800; font-size: 1.2rem; margin-bottom: 0.25rem; }
.panel-subtitle { font-size: 0.82rem; color: #6b7280; margin-bottom: 0.6rem; }

.panel-search {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.4rem 0.7rem; background: #f9faf8; border: 1px solid #e5e7eb; border-radius: 8px;
}
.panel-search svg { flex-shrink: 0; color: #9ca3af; }
.panel-search input { flex: 1; border: none; background: transparent; font-size: 0.82rem; font-family: inherit; outline: none; color: #1a1a1a; }

/* ===== LISTING OPTIMIZER ===== */
.optimizer-shell {
  padding: 1.5rem 2rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.optimizer-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.optimizer-header h2 {
  font-family: 'Public Sans', sans-serif;
  font-weight: 800;
  font-size: 1.3rem;
  margin-bottom: 0.25rem;
}

.optimizer-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.optimizer-filter-bar {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.optimizer-filter-btn,
.optimizer-bulk-btn,
.optimizer-generate-all-btn,
.optimizer-generate-btn,
.optimizer-inline-btn,
.optimizer-apply-btn {
  border: 1px solid #d9dfd5;
  border-radius: 999px;
  background: #fff;
  color: #355245;
  padding: 0.52rem 0.85rem;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.optimizer-filter-btn:hover,
.optimizer-bulk-btn:hover,
.optimizer-generate-all-btn:hover,
.optimizer-generate-btn:hover,
.optimizer-inline-btn:hover,
.optimizer-apply-btn:hover {
  border-color: #2d6a4f;
  color: #1b4332;
}

.optimizer-filter-btn.active {
  background: #1b4332;
  border-color: #1b4332;
  color: #fff;
}

.optimizer-bulk-btn,
.optimizer-generate-all-btn,
.optimizer-generate-btn {
  background: linear-gradient(135deg, #1b4332, #2d6a4f);
  border-color: #1b4332;
  color: #fff;
}

.optimizer-bulk-btn:disabled,
.optimizer-generate-all-btn:disabled,
.optimizer-generate-btn:disabled,
.optimizer-inline-btn:disabled,
.optimizer-apply-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.optimizer-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.optimizer-score-card {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(260px, 0.7fr);
  gap: 1rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 24px;
  padding: 1.4rem;
}

.optimizer-score-wrap {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.optimizer-score-ring {
  --score: 0;
  width: 126px;
  height: 126px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, #fff 58%, transparent 59%),
    conic-gradient(var(--ring-color) calc(var(--score) * 1%), #e8ece7 0);
}

.optimizer-score-ring.is-green { --ring-color: #2d8a57; }
.optimizer-score-ring.is-yellow { --ring-color: #d4a853; }
.optimizer-score-ring.is-red { --ring-color: #cc5b47; }

.optimizer-score-inner {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid #edf1ea;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.optimizer-score-inner strong {
  font-family: 'Public Sans', sans-serif;
  font-size: 2rem;
  line-height: 1;
}

.optimizer-score-inner span {
  font-size: 0.78rem;
  color: #6b7280;
  font-weight: 700;
}

.optimizer-score-copy h3 {
  font-family: 'Public Sans', sans-serif;
  font-size: 1.2rem;
  margin-bottom: 0.45rem;
}

.optimizer-score-copy p {
  color: #4b5563;
  line-height: 1.5;
}

.optimizer-score-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.optimizer-metric-card {
  border-radius: 18px;
  background: linear-gradient(180deg, #f9faf8, #f3f6f1);
  border: 1px solid #e5ebe2;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.optimizer-metric-label {
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #6b7280;
  font-weight: 700;
}

.optimizer-metric-card strong {
  font-family: 'Public Sans', sans-serif;
  font-size: 1.35rem;
}

.optimizer-categories {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.optimizer-category {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  overflow: hidden;
}

.optimizer-category-summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.15rem;
  cursor: pointer;
  background: linear-gradient(180deg, #fcfcfa, #f6f7f3);
}

.optimizer-category-summary::-webkit-details-marker {
  display: none;
}

.optimizer-category-summary h3 {
  font-family: 'Public Sans', sans-serif;
  font-size: 1rem;
  margin-bottom: 0.2rem;
}

.optimizer-category-summary p,
.optimizer-category-score {
  color: #6b7280;
  font-size: 0.8rem;
  font-weight: 700;
}

.optimizer-fields {
  display: flex;
  flex-direction: column;
}

.optimizer-btn {
  padding: 0.4rem 0.8rem;
  border: none;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.optimizer-btn-generate {
  background: #2d6a4f;
  color: #fff;
}

.optimizer-btn-generate:hover {
  background: #1b4332;
}

.optimizer-btn-generate:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.optimizer-btn-clear {
  background: #f3f4f6;
  color: #4b5563;
}

.optimizer-btn-clear:hover {
  background: #e5e7eb;
}

.optimizer-btn-apply {
  background: #d97706;
  color: #fff;
}

.optimizer-btn-apply:hover {
  background: #b45309;
}

.opt-editor-panel {
  position: fixed;
  top: 0;
  right: -480px;
  width: 480px;
  max-width: 90vw;
  height: 100vh;
  background: #fff;
  box-shadow: -4px 0 20px rgba(0,0,0,0.15);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transition: right 0.25s ease;
  overflow-y: auto;
}

.opt-editor-panel.open {
  right: 0;
}

.opt-editor-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}

.opt-editor-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: #6b7280;
  padding: 0.25rem;
}

.opt-editor-close:hover {
  color: #1a1a1a;
}

.opt-editor-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  flex: 1;
}

.opt-editor-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 1.25rem;
  border-bottom: 1px solid #f3f4f6;
  font-size: 0.8rem;
  color: #6b7280;
}

.opt-editor-nav button {
  background: #f3f4f6;
  border: none;
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
}

.opt-editor-nav button:hover {
  background: #e5e7eb;
}

.opt-editor-nav button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.opt-editor-input-container {
  flex: 1;
  margin: 1rem 1.25rem 0.5rem 1.25rem;
}

.opt-editor-textarea,
.opt-editor-input,
.opt-editor-readonly-wrap {
  flex: 1;
  padding: 0.75rem;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-family: 'Nunito Sans', sans-serif;
  font-size: 0.85rem;
  line-height: 1.6;
  color: #1a1a1a;
  background: #fafafa;
  resize: vertical;
  min-height: 200px;
  box-sizing: border-box;
  width: 100%;
}

.opt-editor-input {
  min-height: 48px;
}

.opt-editor-select {
  appearance: none;
  cursor: pointer;
}

.opt-editor-textarea:focus,
.opt-editor-input:focus {
  outline: none;
  border-color: #2d6a4f;
  background: #fff;
}

.opt-editor-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fafafa;
}

.opt-editor-toggle-copy {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  color: #4b5563;
  font-size: 0.83rem;
}

.opt-editor-toggle-copy strong {
  color: #111827;
  font-size: 0.95rem;
}

.opt-editor-toggle {
  position: relative;
  display: inline-flex;
  width: 52px;
  height: 30px;
}

.opt-editor-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.opt-editor-toggle-slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #d1d5db;
  transition: background 0.2s ease;
}

.opt-editor-toggle-slider::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  transition: transform 0.2s ease;
}

.opt-editor-toggle input:checked + .opt-editor-toggle-slider {
  background: #2d6a4f;
}

.opt-editor-toggle input:checked + .opt-editor-toggle-slider::before {
  transform: translateX(22px);
}

.opt-editor-readonly-wrap {
  min-height: 140px;
  background: #f8fafc;
}

.opt-editor-readonly-label {
  display: inline-flex;
  margin-bottom: 0.6rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.opt-editor-readonly-value {
  color: #1f2937;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.opt-editor-readonly-empty {
  color: #9ca3af;
  font-style: italic;
}

.property-pill-link {
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s;
}

.property-pill-link:hover {
  background: #334155;
}

.amenity-group-header {
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.amenity-group-chevron {
  display: inline-block;
  transition: transform 0.15s;
  font-size: 12px;
  color: #94a3b8;
}

.amenity-group.is-collapsed .amenity-group-chevron {
  transform: rotate(-90deg);
}

.amenity-group.is-collapsed .amenity-group-grid {
  display: none;
}

.amenity-group.is-complete .amenity-group-header {
  color: #86efac;
}

.amenity-edit-hint {
  padding: 8px 12px;
  margin: 8px 0 12px;
  background: #1e3a5f;
  border: 1px solid #2563eb;
  border-radius: 6px;
  color: #93c5fd;
  font-size: 13px;
  text-align: center;
}

.opt-editor-link-btn {
  display: inline-block;
  margin-top: 12px;
  padding: 8px 16px;
  background: #1e40af;
  color: #fff;
  border-radius: 6px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: background .15s;
}
.opt-editor-link-btn:hover {
  background: #1d4ed8;
}

.opt-editor-meta {
  display: flex;
  justify-content: space-between;
  padding: 0 1.25rem 0.5rem 1.25rem;
  font-size: 0.75rem;
  color: #6b7280;
}

.opt-char-limit {
  font-weight: 600;
}

.opt-char-over {
  color: #dc2626;
}

.opt-editor-actions {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-top: 1px solid #e5e7eb;
  flex-wrap: wrap;
}

.opt-editor-status {
  padding: 0 1.25rem 0.75rem;
  font-size: 0.78rem;
  color: #6b7280;
}

.opt-field-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 40px;
  padding: 0.6rem 0.75rem;
  cursor: pointer;
  border-top: 1px solid #f3f4f6;
  transition: background 0.1s, border-left-color 0.1s;
  min-width: 0;
}

.opt-field-row:hover {
  background: #f9fafb;
}

.opt-field-row.active {
  background: #ecfdf5;
  border-left: 3px solid #2d6a4f;
  padding-left: calc(0.75rem - 3px);
}

.opt-field-status {
  font-size: 0.85rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.opt-field-status.filled {
  color: #16a34a;
}

.opt-field-status.empty {
  color: #dc2626;
}

.opt-field-label {
  font-weight: 600;
  font-size: 0.85rem;
  min-width: 140px;
  white-space: nowrap;
  flex-shrink: 0;
}

.opt-field-impact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.22rem 0.5rem;
  border-radius: 999px;
  font-size: 0.67rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.opt-field-preview {
  flex: 1;
  min-width: 0;
  font-size: 0.8rem;
  color: #6b7280;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.opt-field-preview.is-empty {
  color: #dc2626;
  font-style: italic;
}

.opt-field-preview.is-amenity {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
  white-space: normal;
  overflow: visible;
  text-overflow: initial;
}

.opt-field-preview-text {
  min-width: 0;
}

.amenity-score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  padding: 0.26rem 0.55rem;
  border-radius: 999px;
  border: 1px solid #334155;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.amenity-score-badge.tone-good {
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.16);
  color: #bbf7d0;
}

.amenity-score-badge.tone-mid {
  border-color: rgba(250, 204, 21, 0.4);
  background: rgba(234, 179, 8, 0.16);
  color: #fde68a;
}

.amenity-score-badge.tone-low {
  border-color: rgba(248, 113, 113, 0.42);
  background: rgba(239, 68, 68, 0.16);
  color: #fecaca;
}

.amenity-grid-editor {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid #334155;
  border-radius: 16px;
  background:
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.18), transparent 32%),
    linear-gradient(180deg, #1e293b, #0f172a);
  color: #e2e8f0;
}

.amenity-score-bar {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid #334155;
  background: rgba(15, 23, 42, 0.9);
  min-height: 48px;
}

.amenity-score-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #ef4444 0%, #facc15 55%, #22c55e 100%);
}

.amenity-score-text {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 0.95rem;
  font-size: 0.88rem;
  font-weight: 800;
  color: #f8fafc;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.amenity-missing-alert {
  padding: 0.9rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(251, 146, 60, 0.3);
  background: linear-gradient(180deg, rgba(124, 45, 18, 0.32), rgba(69, 26, 3, 0.2));
}

.amenity-missing-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: #fdba74;
  margin-bottom: 0.7rem;
}

.amenity-missing-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.amenity-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.34rem 0.7rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
}

.amenity-chip-missing {
  border: 1px solid rgba(248, 113, 113, 0.38);
  background: rgba(127, 29, 29, 0.34);
  color: #fecaca;
}

.amenity-groups {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.amenity-group {
  border: 1px solid #334155;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.52);
  overflow: hidden;
}

.amenity-group-header {
  padding: 0.8rem 0.95rem;
  border-bottom: 1px solid rgba(51, 65, 85, 0.9);
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.9));
  font-size: 0.86rem;
  font-weight: 800;
  color: #f8fafc;
}

.amenity-group-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  padding: 0.9rem;
}

.amenity-toggle {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  padding: 0.7rem 0.8rem;
  border: 1px solid #334155;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.78);
  color: #cbd5e1;
}

.amenity-toggle input {
  margin: 0;
  accent-color: #22c55e;
}

.amenity-toggle.is-present {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(20, 83, 45, 0.25);
  color: #dcfce7;
}

.amenity-toggle.is-missing {
  background: rgba(30, 41, 59, 0.78);
  color: #94a3b8;
}

.amenity-toggle-label {
  flex: 1;
  min-width: 0;
  font-size: 0.8rem;
  font-weight: 700;
}

.amenity-toggle-impact {
  color: #facc15;
  font-size: 0.88rem;
}

.opt-impact-high {
  background: #fce9e5;
  color: #dc2626;
}

.opt-impact-medium {
  background: #fff6dc;
  color: #d97706;
}

.opt-impact-low {
  background: #f1f3f4;
  color: #6b7280;
}

.card-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1rem; padding: 1.25rem 2rem;
}

/* Property + Contact Cards */
.prop-card, .contact-card {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
  padding: 1.1rem; transition: box-shadow 0.2s; cursor: pointer;
}
.prop-card:hover, .contact-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.06); }

.prop-card h3, .contact-card h3 {
  font-family: 'Public Sans', sans-serif; font-weight: 700; font-size: 0.95rem;
  margin-bottom: 0.4rem; color: #1a1a1a;
}

.prop-stats, .contact-stats { display: flex; gap: 1rem; margin-bottom: 0.6rem; }
.prop-stat, .contact-stat { display: flex; flex-direction: column; align-items: center; }
.prop-stat-num, .contact-stat-num { font-family: 'Public Sans', sans-serif; font-weight: 800; font-size: 1.15rem; color: #2d6a4f; }
.prop-stat-label, .contact-stat-label { font-size: 0.65rem; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.prop-meta, .contact-meta { font-size: 0.78rem; color: #6b7280; line-height: 1.5; }
.prop-meta span, .contact-meta span { display: inline-block; margin-right: 0.65rem; }

.contact-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.8rem; color: #fff; flex-shrink: 0;
}
.contact-card-top { display: flex; gap: 0.7rem; align-items: center; margin-bottom: 0.6rem; }
.contact-card-top h3 { margin-bottom: 0; }
.contact-threads { margin-top: 0.4rem; }
.contact-thread-item {
  display: flex; justify-content: space-between;
  padding: 0.3rem 0; border-bottom: 1px solid #f5f5f0;
  font-size: 0.78rem; color: #374151;
}
.contact-thread-item:last-child { border-bottom: none; }
.contact-thread-dates { color: #9ca3af; font-size: 0.72rem; }

/* City Groups */
.city-group {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  grid-column: 1 / -1;
}

.city-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.25rem;
  background: #fafaf8;
  border-bottom: 1px solid #e5e7eb;
}

.city-header-left h3 {
  font-family: 'Public Sans', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  color: #1a1a1a;
  margin-bottom: 0.1rem;
}

.city-region {
  font-size: 0.75rem;
  color: #9ca3af;
}

.city-assign-btn {
  padding: 0.35rem 0.75rem;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  color: #6b7280;
  transition: all 0.15s;
}
.city-assign-btn:hover { border-color: #2d6a4f; color: #2d6a4f; }
.city-assign-btn.assigned { background: #ecfdf5; color: #059669; border-color: #a7f3d0; }
.city-assign-btn.partial { background: #fffbeb; color: #d97706; border-color: #fde68a; }

.city-properties {
  padding: 0;
}

.prop-row {
  display: flex;
  align-items: center;
  padding: 0.6rem 1.25rem;
  border-bottom: 1px solid #f5f5f0;
  transition: background 0.1s;
}
.prop-row:last-child { border-bottom: none; }
.prop-row:hover { background: #fafaf8; }
.prop-row.prop-assigned { border-left: 3px solid #2d6a4f; }

.prop-row-name {
  flex: 1;
  font-weight: 600;
  font-size: 0.88rem;
  color: #1a1a1a;
}

.prop-row-full {
  font-weight: 400;
  color: #9ca3af;
  font-size: 0.78rem;
  margin-left: 0.5rem;
}

.prop-row-stats {
  display: flex;
  gap: 0.75rem;
  font-size: 0.78rem;
  color: #6b7280;
  margin-right: 0.75rem;
}

.prop-row-inactive {
  color: #d1d5db;
  font-style: italic;
}

.prop-assign-btn-sm {
  width: 28px;
  height: 28px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
  font-size: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
}
.prop-assign-btn-sm:hover { border-color: #2d6a4f; color: #2d6a4f; }
.prop-assign-btn-sm.assigned { background: #ecfdf5; border-color: #a7f3d0; }

/* Property Assign Button */
.prop-assign-btn {
  padding: 0.3rem 0.6rem;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  color: #6b7280;
  transition: all 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.prop-assign-btn:hover { border-color: #2d6a4f; color: #2d6a4f; }
.prop-assign-btn.assigned { background: #ecfdf5; color: #059669; border-color: #a7f3d0; }
.prop-card.prop-assigned { border-left: 3px solid #2d6a4f; }

.property-search {
  max-width: 360px;
}

.prop-card-modern {
  padding: 0;
  overflow: hidden;
  border-radius: 18px;
}

.prop-card-hero {
  display: flex;
  gap: 1rem;
  padding: 1.2rem;
  background:
    radial-gradient(circle at top right, rgba(212,168,83,0.22), transparent 34%),
    linear-gradient(135deg, #f7f2e6, #ffffff 68%);
  border-bottom: 1px solid #f0ede4;
}

.prop-photo-placeholder,
.property-detail-photo {
  width: 76px;
  height: 76px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #1b4332, #2d6a4f);
  color: #fff;
  font-size: 2rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.16);
  flex-shrink: 0;
}

.prop-hero-copy {
  min-width: 0;
  flex: 1;
}

.prop-channel-row,
.property-detail-badges {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-bottom: 0.45rem;
}

.prop-channel-badge,
.property-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  background: rgba(27,67,50,0.08);
  color: #1b4332;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.prop-listing-id {
  font-size: 0.72rem;
  color: #6b7280;
}

.prop-address,
.property-detail-main p,
.property-description {
  color: #4b5563;
  line-height: 1.5;
}

.prop-stats-grid,
.property-detail-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.8rem;
  padding: 1rem 1.2rem 1.2rem;
}

.prop-stat-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.8rem 0.9rem;
  border-radius: 14px;
  background: #f8faf7;
  border: 1px solid #edf1ea;
}

.prop-stat-icon {
  font-size: 1rem;
}

.prop-stat-card-label,
.property-info-label {
  font-size: 0.68rem;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}

.prop-stat-card-value,
.property-info-value,
.property-booking-guest,
.pricing-rule-name {
  font-family: 'Public Sans', sans-serif;
  font-weight: 800;
  color: #1a1a1a;
}

#propertyDetail {
  padding: 1.25rem 2rem 2rem;
}

.property-detail-shell {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.property-back-btn {
  align-self: flex-start;
  border: none;
  border-radius: 999px;
  background: #1b4332;
  color: #fff;
  padding: 0.6rem 1rem;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
}

.property-detail-hero {
  display: flex;
  gap: 1.2rem;
  padding: 1.4rem;
  border-radius: 22px;
  background:
    radial-gradient(circle at top right, rgba(212,168,83,0.2), transparent 30%),
    linear-gradient(135deg, #f7f2e6, #ffffff 68%);
  border: 1px solid #ece7da;
}

.property-detail-main h2 {
  font-family: 'Public Sans', sans-serif;
  font-size: 1.6rem;
  margin-bottom: 0.35rem;
}

.property-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.property-optimizer-section {
  grid-column: 1 / -1;
}

.property-section {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 1.1rem 1.15rem;
}

.property-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.property-section-head h3 {
  font-family: 'Public Sans', sans-serif;
  font-size: 1rem;
}

.optimizer-filter-bar-inline {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.property-section-head span,
.property-booking-dates,
.pricing-rule-meta,
.property-muted,
.property-empty {
  color: #6b7280;
  font-size: 0.82rem;
}

.property-booking-list,
.pricing-rule-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.property-booking-item,
.pricing-rule-item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 0.9rem;
  border-radius: 14px;
  background: #f9faf8;
  border: 1px solid #edf1ea;
}

.property-booking-meta,
.pricing-rule-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.18rem;
  text-align: right;
}

.property-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.property-info-item {
  padding: 0.8rem 0.9rem;
  border-radius: 14px;
  background: #f9faf8;
  border: 1px solid #edf1ea;
}

.property-amenities,
.property-channel-list {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.8rem;
}

.property-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.38rem 0.68rem;
  border-radius: 999px;
  background: #eef4ee;
  color: #1b4332;
  font-size: 0.76rem;
  font-weight: 700;
}

/* ===== ONBOARDING ===== */
.onboarding-header {
  padding: 1.25rem 2rem 1rem; background: #fff;
  border-bottom: 1px solid #e5e7eb; position: sticky; top: 0; z-index: 10;
}
.onboarding-header h2 { font-family: 'Public Sans', sans-serif; font-weight: 800; font-size: 1.2rem; margin-bottom: 0.6rem; }

.onboarding-stats { display: flex; gap: 0.5rem; margin-bottom: 0.6rem; }
.stat-pill { display: flex; align-items: center; gap: 0.3rem; padding: 0.3rem 0.65rem; border-radius: 8px; font-size: 0.78rem; font-weight: 600; }
.stat-pill .stat-num { font-family: 'Public Sans', sans-serif; font-weight: 800; font-size: 0.95rem; }
.stat-ready { background: #ecfdf5; color: #059669; }
.stat-pending { background: #fffbeb; color: #d97706; }
.stat-created { background: #eff6ff; color: #2563eb; }

.onboarding-filters { display: flex; gap: 0.3rem; margin-bottom: 0.6rem; }
.ob-filter {
  padding: 0.25rem 0.65rem; border: 1px solid #e5e7eb; border-radius: 20px;
  background: #fff; font-family: inherit; font-size: 0.75rem; font-weight: 600;
  color: #6b7280; cursor: pointer; transition: all 0.15s;
}
.ob-filter:hover { border-color: #2d6a4f; color: #2d6a4f; }
.ob-filter.active { background: #2d6a4f; color: #fff; border-color: #2d6a4f; }

.onboarding-search {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.4rem 0.7rem; background: #f9faf8; border: 1px solid #e5e7eb; border-radius: 8px;
}
.onboarding-search svg { flex-shrink: 0; color: #9ca3af; }
.onboarding-search input { flex: 1; border: none; background: transparent; font-size: 0.82rem; font-family: inherit; outline: none; color: #1a1a1a; }

.owner-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1rem; padding: 1.25rem 2rem;
}

.owner-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; overflow: hidden; transition: box-shadow 0.2s; }
.owner-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.owner-card.ready { border-left: 3px solid #059669; }
.owner-card.pending { border-left: 3px solid #d97706; }
.owner-card.created { border-left: 3px solid #2563eb; }

.oc-header { padding: 0.9rem 1.1rem; border-bottom: 1px solid #f0f0ec; display: flex; justify-content: space-between; align-items: center; }
.oc-header h3 { font-family: 'Public Sans', sans-serif; font-weight: 700; font-size: 0.95rem; color: #1a1a1a; }
.oc-status { padding: 0.18rem 0.5rem; border-radius: 6px; font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.oc-status.ready { background: #ecfdf5; color: #059669; }
.oc-status.pending { background: #fffbeb; color: #d97706; }
.oc-status.created { background: #eff6ff; color: #2563eb; }

.oc-progress { height: 3px; background: #f0f0ec; margin-top: 0.4rem; border-radius: 2px; overflow: hidden; }
.oc-progress-fill { height: 100%; border-radius: 2px; transition: width 0.3s; }
.oc-progress-fill.low { background: #ef4444; width: 25%; }
.oc-progress-fill.mid { background: #d97706; width: 50%; }
.oc-progress-fill.high { background: #059669; width: 75%; }
.oc-progress-fill.done { background: #059669; width: 100%; }

.oc-body { padding: 0.65rem 1.1rem; }
.oc-field { display: flex; justify-content: space-between; align-items: center; padding: 0.4rem 0; border-bottom: 1px solid #f9faf8; }
.oc-field:last-child { border-bottom: none; }
.oc-field-label { font-size: 0.7rem; font-weight: 700; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.04em; }
.oc-field-value { font-size: 0.82rem; color: #374151; display: flex; align-items: center; gap: 0.35rem; }
.oc-field-value .oc-copy { background: #f3f4f6; border: none; color: #9ca3af; cursor: pointer; padding: 0.18rem 0.45rem; border-radius: 4px; font-size: 0.65rem; font-weight: 600; transition: all 0.15s; }
.oc-field-value .oc-copy:hover { background: #2d6a4f; color: #fff; }
.oc-field-value .oc-copy.copied { background: #059669; color: #fff; }
.oc-sensitive { filter: blur(4px); transition: filter 0.2s; cursor: pointer; user-select: none; }
.oc-sensitive:hover, .oc-sensitive.revealed { filter: none; }
.oc-not-submitted { font-size: 0.78rem; color: #d97706; }
.oc-actions { padding: 0.65rem 1.1rem; border-top: 1px solid #f0f0ec; display: flex; gap: 0.35rem; flex-wrap: wrap; }
.oc-btn { padding: 0.4rem 0.75rem; border-radius: 6px; border: none; cursor: pointer; font-size: 0.75rem; font-weight: 600; font-family: inherit; transition: all 0.15s; }
.oc-btn-airbnb { background: #FF5A5F; color: #fff; }
.oc-btn-airbnb:hover { background: #e04e52; }
.oc-btn-vrbo { background: #3B5FC0; color: #fff; }
.oc-btn-vrbo:hover { background: #2f4fa3; }
.oc-btn-done { background: #059669; color: #fff; }
.oc-btn-done:hover { background: #047857; }

/* ===== Review Actions ===== */
.review-actions { display: flex; flex-direction: column; gap: 0.4rem; padding: 0.2rem 0; }
.review-label { font-size: 0.82rem; font-weight: 600; color: #d97706; margin-bottom: 0.2rem; }
.btn-suggest-review, .btn-airbnb-review { padding: 0.6rem 0.9rem; border: none; border-radius: 8px; font-family: 'Public Sans', sans-serif; font-weight: 600; font-size: 0.82rem; cursor: pointer; text-align: center; text-decoration: none; transition: all 0.15s; }
.btn-suggest-review { background: #2d6a4f; color: #fff; }
.btn-suggest-review:hover { background: #245a42; }
.btn-suggest-review:disabled { opacity: 0.6; cursor: wait; }
.btn-airbnb-review { background: #FF5A5F; color: #fff; display: inline-block; }
.btn-airbnb-review:hover { background: #e04e52; }
.review-suggestion { background: #f0f7f4; border: 1px solid #a7f3d0; border-radius: 10px; padding: 0.9rem; margin-top: 0.2rem; }
.review-text { font-size: 0.85rem; line-height: 1.5; color: #1a1a1a; margin-bottom: 0.4rem; }
.review-meta { font-size: 0.7rem; color: #059669; margin-bottom: 0.4rem; }
.btn-copy-review { padding: 0.35rem 0.65rem; background: #fff; border: 1px solid #e5e7eb; border-radius: 6px; font-size: 0.75rem; font-weight: 600; cursor: pointer; font-family: inherit; transition: all 0.15s; }
.btn-copy-review:hover { border-color: #2d6a4f; color: #2d6a4f; }

/* ===== MARCEL CHAT BUBBLE ===== */
.chat-bubble-trigger {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #1b4332;
  color: #fff;
  padding: 0.7rem 1.1rem 0.7rem 0.7rem;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  transition: transform 0.15s, box-shadow 0.15s;
  z-index: 1000;
}

.chat-bubble-trigger:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 28px rgba(0,0,0,0.25);
}

.chat-bubble-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #d4a853;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.chat-bubble-label {
  font-family: 'Public Sans', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
}

/* Chat Window */
.chat-window {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 380px;
  height: 520px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1001;
  transition: all 0.25s ease;
}

.chat-window.chat-expanded {
  width: min(700px, calc(100vw - 3rem));
  height: min(85vh, 800px);
  bottom: 1rem;
  right: 1rem;
}

.chat-window-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: #1b4332;
  color: #fff;
  flex-shrink: 0;
}

.chat-window-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.chat-window-avatar {
  font-size: 1.4rem;
}

.chat-window-name {
  font-family: 'Public Sans', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
}

.chat-window-status {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.6);
}

.chat-window-controls {
  display: flex;
  gap: 0.25rem;
}

.chat-resize, .chat-minimize {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 6px;
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.chat-resize:hover, .chat-minimize:hover {
  background: rgba(255,255,255,0.2);
  color: #fff;
}

/* Chat Messages */
.chat-window-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  background: #fafaf8;
}

.chat-msg {
  max-width: 85%;
}

.chat-msg-marcel {
  align-self: flex-start;
}

.chat-msg-user {
  align-self: flex-end;
}

.chat-msg-text {
  padding: 0.65rem 0.9rem;
  border-radius: 12px;
  font-size: 0.85rem;
  line-height: 1.5;
}

.chat-msg-marcel .chat-msg-text {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-bottom-left-radius: 4px;
  color: #1a1a1a;
}

.chat-msg-user .chat-msg-text {
  background: #2d6a4f;
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-msg-system {
  align-self: center;
}

.chat-msg-system .chat-msg-text {
  background: transparent;
  color: #9ca3af;
  font-size: 0.75rem;
  font-style: italic;
  padding: 0.3rem;
}

.chat-typing {
  display: inline-block;
  color: #9ca3af;
  font-style: italic;
  font-size: 0.82rem;
}

.chat-msg-temp {
  opacity: 0.7;
}

/* Chat Input */
.chat-window-input {
  display: flex;
  gap: 0.4rem;
  padding: 0.7rem 1rem;
  background: #fff;
  border-top: 1px solid #e5e7eb;
  align-items: flex-end;
}

.chat-window-input textarea {
  flex: 1;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  padding: 0.55rem 0.8rem;
  font-family: inherit;
  font-size: 0.85rem;
  resize: none;
  min-height: 38px;
  max-height: 100px;
  outline: none;
  background: #fafaf8;
  transition: border-color 0.2s;
}

.chat-window-input textarea:focus {
  border-color: #2d6a4f;
}

.chat-send {
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 10px;
  background: #1b4332;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}

.chat-send:hover { background: #2d6a4f; }

/* ===== TASKS (Asana-style) ===== */
.tasks-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.tasks-sidebar {
  background: #fff;
  border-right: 1px solid #e5e7eb;
  padding: 1rem 0;
  overflow-y: auto;
}

.tasks-sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 1rem;
}

.tasks-sidebar-header h3 {
  font-family: 'Public Sans', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9ca3af;
}

.tasks-add-section {
  background: none; border: none; color: #9ca3af;
  font-size: 1.1rem; cursor: pointer; padding: 0 0.3rem;
}
.tasks-add-section:hover { color: #2d6a4f; }

.tasks-sidebar-nav { display: flex; flex-direction: column; }

.tasks-nav-item {
  padding: 0.45rem 1rem;
  font-size: 0.82rem;
  color: #374151;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: all 0.1s;
  text-decoration: none;
}
.tasks-nav-item:hover { background: #f9faf8; }
.tasks-nav-item.active {
  background: #f0f7f4;
  border-left-color: #2d6a4f;
  color: #2d6a4f;
  font-weight: 600;
}

/* Tasks Main */
.tasks-main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.tasks-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid #e5e7eb;
  background: #fff;
  flex-shrink: 0;
}

.tasks-toolbar h2 {
  font-family: 'Public Sans', sans-serif;
  font-weight: 800;
  font-size: 1.15rem;
}

.tasks-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tasks-search {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.35rem 0.6rem; background: #f9faf8;
  border: 1px solid #e5e7eb; border-radius: 6px;
}
.tasks-search input {
  border: none; background: transparent; font-size: 0.8rem;
  font-family: inherit; outline: none; width: 140px;
}

.tasks-sort {
  padding: 0.35rem 0.5rem; border: 1px solid #e5e7eb;
  border-radius: 6px; font-size: 0.78rem; font-family: inherit;
  background: #fff; color: #374151; cursor: pointer;
}

.tasks-add-btn {
  padding: 0.4rem 0.9rem; background: #2d6a4f; color: #fff;
  border: none; border-radius: 6px; font-family: 'Public Sans', sans-serif;
  font-weight: 600; font-size: 0.82rem; cursor: pointer;
  transition: background 0.15s;
}
.tasks-add-btn:hover { background: #245a42; }

/* Task List Header */
.tasks-list-header {
  display: grid;
  grid-template-columns: 36px 1fr 130px 100px 90px 110px;
  padding: 0.45rem 1.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid #e5e7eb;
  background: #fafaf8;
  flex-shrink: 0;
}

/* Task Rows */
.tasks-list {
  flex: 1;
  overflow-y: auto;
}

.task-row {
  display: grid;
  grid-template-columns: 36px 1fr 130px 100px 90px 110px;
  padding: 0.5rem 1.5rem;
  border-bottom: 1px solid #f5f5f0;
  align-items: center;
  cursor: pointer;
  transition: background 0.1s;
  font-size: 0.85rem;
}
.task-row:hover { background: #fafaf8; }
.task-row.task-selected { background: #f0f7f4; }
.task-row.task-completed { opacity: 0.5; }
.task-row.task-completed .task-title-text { text-decoration: line-through; }

.task-check {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid #d1d5db; background: #fff;
  cursor: pointer; display: flex; align-items: center;
  justify-content: center; font-size: 0.65rem; color: #fff;
  transition: all 0.15s;
}
.task-check:hover { border-color: #2d6a4f; }
.task-check.checked { background: #2d6a4f; border-color: #2d6a4f; }
.task-check.sm { width: 16px; height: 16px; font-size: 0.55rem; }

.task-col-name { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.task-title-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-subtask-count { font-size: 0.68rem; color: #9ca3af; background: #f3f4f6; padding: 0.1rem 0.35rem; border-radius: 4px; flex-shrink: 0; }

.task-col-assignee { display: flex; align-items: center; gap: 0.35rem; }
.task-avatar-sm {
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.55rem; font-weight: 700; color: #fff;
}
.task-assignee-name { font-size: 0.8rem; color: #374151; }
.task-unassigned { color: #d1d5db; font-size: 0.8rem; }

.task-col-due { font-size: 0.8rem; color: #6b7280; }
.task-col-due.task-overdue { color: #dc2626; font-weight: 600; }

.priority-dot {
  display: inline-block; width: 8px; height: 8px;
  border-radius: 50%; margin-right: 0.25rem;
}
.priority-urgent { background: #dc2626; }
.priority-high { background: #f59e0b; }
.priority-medium { background: #3b82f6; }
.priority-low { background: #9ca3af; }
.priority-none { background: transparent; }

.task-col-priority { font-size: 0.78rem; color: #6b7280; text-transform: capitalize; }
.task-col-section { font-size: 0.75rem; }
.task-section-tag { background: #f3f4f6; padding: 0.15rem 0.4rem; border-radius: 4px; color: #6b7280; font-size: 0.72rem; }

.tasks-empty {
  padding: 3rem; text-align: center; color: #9ca3af;
  font-size: 0.9rem;
}

/* Task Detail Panel */
.task-detail {
  position: absolute; right: 0; top: 0; bottom: 0;
  width: 420px; background: #fff;
  border-left: 1px solid #e5e7eb;
  box-shadow: -4px 0 20px rgba(0,0,0,0.06);
  display: flex; flex-direction: column;
  z-index: 20;
  overflow-y: auto;
}

.task-detail-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.75rem 1rem; border-bottom: 1px solid #f0f0ec;
  flex-shrink: 0;
}

.task-detail-close {
  background: none; border: none; font-size: 1.4rem;
  color: #9ca3af; cursor: pointer; padding: 0 0.3rem;
}
.task-detail-close:hover { color: #1a1a1a; }

.task-detail-action {
  background: none; border: none; font-size: 1rem;
  cursor: pointer; padding: 0.2rem;
}

.task-detail-body { padding: 1rem; flex: 1; }

.task-detail-title {
  width: 100%; border: none; font-family: 'Public Sans', sans-serif;
  font-weight: 700; font-size: 1.15rem; padding: 0.3rem 0;
  outline: none; border-bottom: 2px solid transparent;
  margin-bottom: 1rem;
}
.task-detail-title:focus { border-bottom-color: #2d6a4f; }

.task-detail-fields { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 1.25rem; }

.task-field { display: flex; align-items: center; gap: 0.5rem; }
.task-field label {
  font-size: 0.72rem; font-weight: 700; color: #9ca3af;
  text-transform: uppercase; letter-spacing: 0.04em;
  min-width: 70px;
}
.task-field select, .task-field input[type=date] {
  flex: 1; padding: 0.35rem 0.5rem; border: 1px solid #e5e7eb;
  border-radius: 6px; font-size: 0.82rem; font-family: inherit;
  background: #fff; color: #374151;
}

.task-detail-desc { margin-bottom: 1.25rem; }
.task-detail-desc label, .task-detail-subtasks label, .task-detail-comments label {
  display: block; font-size: 0.72rem; font-weight: 700;
  color: #9ca3af; text-transform: uppercase;
  letter-spacing: 0.04em; margin-bottom: 0.4rem;
}
.task-detail-desc textarea {
  width: 100%; border: 1px solid #e5e7eb; border-radius: 8px;
  padding: 0.6rem; font-family: inherit; font-size: 0.85rem;
  resize: vertical; outline: none;
}
.task-detail-desc textarea:focus { border-color: #2d6a4f; }

.task-detail-subtasks { margin-bottom: 1.25rem; }
.subtask-row {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.25rem 0;
}
.subtask-row input {
  flex: 1; border: none; border-bottom: 1px solid #f0f0ec;
  padding: 0.25rem 0; font-size: 0.85rem; font-family: inherit;
  outline: none;
}
.subtask-row input.subtask-done { text-decoration: line-through; color: #9ca3af; }
.subtask-delete {
  background: none; border: none; color: #d1d5db;
  font-size: 1rem; cursor: pointer; padding: 0 0.2rem;
}
.subtask-delete:hover { color: #dc2626; }
.task-add-subtask {
  background: none; border: none; color: #2d6a4f;
  font-size: 0.82rem; font-weight: 600; cursor: pointer;
  padding: 0.3rem 0;
}
.task-add-subtask:hover { text-decoration: underline; }

.task-detail-comments { margin-bottom: 1rem; }
.task-comment {
  padding: 0.5rem 0; border-bottom: 1px solid #f5f5f0;
}
.task-comment-author { font-weight: 700; font-size: 0.8rem; color: #374151; }
.task-comment-time { font-size: 0.7rem; color: #9ca3af; margin-left: 0.4rem; }
.task-comment-text { font-size: 0.85rem; color: #374151; margin-top: 0.2rem; }
.task-comment-input { display: flex; gap: 0.4rem; margin-top: 0.5rem; }
.task-comment-input textarea {
  flex: 1; border: 1px solid #e5e7eb; border-radius: 6px;
  padding: 0.4rem 0.6rem; font-size: 0.82rem; font-family: inherit;
  resize: none; outline: none;
}
.task-comment-input button {
  padding: 0.4rem 0.75rem; background: #2d6a4f; color: #fff;
  border: none; border-radius: 6px; font-size: 0.78rem;
  font-weight: 600; cursor: pointer;
}

/* Make tasks-main position relative for the detail panel */
.tasks-layout { position: relative; }

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* ===== Mobile ===== */
@media (max-width: 1024px) {
  .view-inbox.view-active { grid-template-columns: 280px 1fr; }
  .brand-name { display: none; }
  .tab { padding: 0.4rem 0.75rem; font-size: 0.72rem; }
}

@media (max-width: 768px) {
  .view-inbox.view-active { grid-template-columns: 1fr; }
  .conversation { display: none; }
  .tab-bar { overflow-x: auto; }
  .tab { font-size: 0.7rem; padding: 0.35rem 0.6rem; }
}

/* ===== TURNOVERS VIEW ===== */
.turnovers-container { padding: 1.25rem; height: 100%; overflow-y: auto; }
.turnovers-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.turnovers-header h2 { font-size: 1.1rem; font-weight: 700; color: #1f2937; margin: 0; }
.turnovers-filters { display: flex; gap: 0.35rem; }
.turnover-filter {
  border: 1px solid #d1d5db; background: #fff; color: #6b7280;
  border-radius: 6px; padding: 0.3rem 0.7rem; font-size: 0.75rem; font-weight: 600;
  cursor: pointer; transition: all 0.15s;
}
.turnover-filter:hover { background: #f3f4f6; }
.turnover-filter.active { background: #1b4332; color: #fff; border-color: #1b4332; }

.turnovers-list-header {
  display: grid; grid-template-columns: 100px 1fr 1fr 140px 130px;
  padding: 0.5rem 0.75rem; font-size: 0.7rem; font-weight: 700;
  color: #9ca3af; text-transform: uppercase; letter-spacing: 0.05em;
  border-bottom: 1px solid #e5e7eb;
}
.turnover-row {
  display: grid; grid-template-columns: 100px 1fr 1fr 140px 130px;
  padding: 0.75rem; border-bottom: 1px solid #f3f4f6;
  align-items: center; font-size: 0.85rem;
  transition: background 0.1s;
}
.turnover-row:hover { background: #f9fafb; }

.to-col-date { font-weight: 600; color: #374151; }
.to-col-property { color: #374151; }
.to-col-guest { color: #6b7280; }
.to-col-cleaner { }
.to-cleaner-name { color: #1b4332; font-weight: 600; font-size: 0.8rem; }
.to-assign-btn {
  border: 1px dashed #d1d5db; background: #fff; color: #6b7280;
  border-radius: 6px; padding: 0.25rem 0.6rem; font-size: 0.75rem;
  cursor: pointer;
}
.to-assign-btn:hover { border-color: #1b4332; color: #1b4332; }
.to-assign-select {
  border: 1px solid #d1d5db; border-radius: 6px; padding: 0.25rem;
  font-size: 0.75rem; width: 100%;
}
.to-status-select {
  border: 1px solid #d1d5db; border-radius: 6px; padding: 0.25rem 0.4rem;
  font-size: 0.72rem; font-weight: 600; cursor: pointer; width: 100%;
}
.to-unassigned { color: #6b7280; background: #f9fafb; }
.to-assigned { color: #1d4ed8; background: #eff6ff; border-color: #bfdbfe; }
.to-inprogress { color: #d97706; background: #fffbeb; border-color: #fde68a; }
.to-completed { color: #059669; background: #ecfdf5; border-color: #a7f3d0; }

/* ===== CALENDAR VIEW ===== */
.calendar-panel {
  padding: 1.25rem;
  height: 100%;
  overflow-y: auto;
}

.calendar-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.calendar-controls select,
.calendar-controls button {
  border: 1px solid #d1d5db;
  background: #fff;
  color: #374151;
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.calendar-controls button:hover,
.calendar-controls select:hover {
  border-color: #9ca3af;
}

.calendar-month-label {
  font-weight: 700;
  font-size: 1.05rem;
  color: #111827;
  min-width: 180px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.6rem;
}

.calendar-dow {
  font-size: 0.75rem;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0 0.15rem;
}

.calendar-day {
  appearance: none;
  width: 100%;
  min-height: 118px;
  border-radius: 12px;
  padding: 0.7rem;
  border: 1px solid #d1d5db;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
  text-align: left;
  font: inherit;
}

.calendar-day.available {
  background: #ecfdf5;
  border-color: #86efac;
}

.calendar-day.booked {
  background: #fef2f2;
  border-color: #fca5a5;
  cursor: pointer;
}

.calendar-day.past {
  background: #f3f4f6;
  border-color: #e5e7eb;
  color: #6b7280;
}

.calendar-day.empty {
  background: transparent;
  border: none;
  box-shadow: none;
}

.calendar-day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}

.calendar-day-number {
  font-size: 0.95rem;
  font-weight: 800;
  color: #111827;
}

.calendar-day.past .calendar-day-number {
  color: #6b7280;
}

.calendar-day-price {
  font-size: 0.76rem;
  font-weight: 700;
  color: #1f2937;
}

.calendar-day-booking {
  margin-top: auto;
  font-size: 0.78rem;
  line-height: 1.3;
  color: #991b1b;
  font-weight: 700;
  overflow: hidden;
}

.calendar-day-meta {
  font-size: 0.72rem;
  color: #4b5563;
}

.calendar-day.past .calendar-day-price,
.calendar-day.past .calendar-day-booking,
.calendar-day.past .calendar-day-meta {
  color: #6b7280;
}

.calendar-popup {
  position: fixed;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  z-index: 100;
  min-width: 250px;
}

.calendar-popup h4 {
  margin-bottom: 0.65rem;
  font-size: 0.95rem;
  color: #111827;
}

.calendar-popup-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.82rem;
  padding: 0.2rem 0;
}

.calendar-popup-label {
  color: #6b7280;
}

.calendar-popup-value {
  color: #111827;
  font-weight: 600;
  text-align: right;
}

/* Contacts sub-tabs — pill style matching top nav */
.contacts-subtabs {
  display: flex;
  gap: 8px;
  padding: 0 1.5rem .75rem;
  margin-bottom: .75rem;
}
.contacts-subtab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid #e0e0e0;
  background-color: #fff;
  color: #555;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s ease;
}
.contacts-subtab:hover {
  background-color: #f5f5f5;
  border-color: #ccc;
  color: #333;
}
.contacts-subtab.active {
  background-color: var(--accent, #c9a227);
  border-color: var(--accent, #c9a227);
  color: #fff;
  font-weight: 600;
}

/* Mini Airbnb link button in composer */
.btn-airbnb-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.28rem 0.55rem;
  font-size: 0.68rem;
  font-weight: 700;
  color: #e1484d;
  background: #fff5f5;
  border: 1px solid #ffd1d3;
  border-radius: 999px;
  text-decoration: none;
  transition: all .15s;
}
.btn-airbnb-mini:hover {
  background: #ffe7e8;
  color: #c53035;
}

@media (max-width: 720px) {
  .calendar-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .calendar-dow {
    display: none;
  }

  .calendar-day.empty {
    display: none;
  }

  .booking-summary-head {
    flex-direction: column;
  }

  .booking-summary-intro {
    max-width: none;
    text-align: left;
  }

  .composer-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Unified composer toolbar */
.composer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px 2px;
  gap: 8px;
}
.composer-bella-actions {
  display: flex;
  gap: 6px;
}
.bella-action-btn {
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 6px;
  background: #f9fafb;
  color: #374151;
  cursor: pointer;
  transition: all .15s;
}
.bella-action-btn:hover {
  background: #eef2ff;
  border-color: #818cf8;
  color: #4338ca;
}
.bella-action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ===== REVIEWS ===== */
.reviews-shell {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 100%;
}

.reviews-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.reviews-header h2 {
  font-family: 'Public Sans', sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
}

.reviews-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.reviews-filter-btn {
  border: 1px solid #d1d5db;
  background: #fff;
  color: #4b5563;
  border-radius: 999px;
  padding: 0.55rem 0.9rem;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.reviews-filter-btn:hover,
.reviews-filter-btn.active {
  background: #1b4332;
  border-color: #1b4332;
  color: #fff;
}

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

.review-stat-card {
  background: linear-gradient(135deg, #fff 0%, #f7f7f3 100%);
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.review-stat-label {
  color: #6b7280;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.review-stat-value {
  color: #111827;
  font-family: 'Public Sans', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
}

.reviews-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-bottom: 1rem;
}

.review-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 1.15rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
}

.review-card-top {
  display: flex;
  gap: 0.9rem;
  margin-bottom: 0.9rem;
}

.review-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #1b4332;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: 800;
}

.review-card-head {
  flex: 1;
  min-width: 0;
}

.review-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.review-card-meta h3 {
  font-size: 1rem;
  font-weight: 800;
}

.review-submeta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  color: #6b7280;
  font-size: 0.82rem;
}

.review-stars {
  color: #d97706;
  letter-spacing: 0.08em;
}

.review-status-badge {
  border-radius: 999px;
  padding: 0.3rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}

.review-status-badge.needs-response {
  background: #fef3c7;
  color: #b45309;
}

.review-status-badge.responded {
  background: #dcfce7;
  color: #166534;
}

.review-body,
.review-response-text {
  white-space: pre-wrap;
  line-height: 1.6;
  color: #1f2937;
  font-size: 0.92rem;
}

.review-actions-row {
  display: flex;
  gap: 0.6rem;
  margin-top: 1rem;
}

.review-ai-btn,
.review-send-btn {
  border: none;
  border-radius: 10px;
  padding: 0.65rem 0.95rem;
  font-family: 'Public Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.review-ai-btn {
  background: #1b4332;
  color: #fff;
}

.review-ai-btn:hover {
  background: #163729;
}

.review-ai-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.review-send-btn {
  background: #f3f4f6;
  color: #374151;
}

.review-send-btn:hover {
  background: #e5e7eb;
}

.review-response-input {
  width: 100%;
  min-height: 112px;
  margin-top: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  padding: 0.85rem 0.95rem;
  background: #fcfcfa;
  font: inherit;
  color: #111827;
  resize: vertical;
}

.review-response-input:focus {
  outline: none;
  border-color: #1b4332;
  box-shadow: 0 0 0 3px rgba(27, 67, 50, 0.12);
}

.review-helper-text {
  margin-top: 0.45rem;
  color: #6b7280;
  font-size: 0.78rem;
}

.review-response-block {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid #edf2f7;
}

.review-response-label {
  color: #166534;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
}

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

  .property-info-grid {
    grid-template-columns: 1fr;
  }

  .optimizer-score-card {
    grid-template-columns: 1fr;
  }

  .optimizer-score-metrics {
    grid-template-columns: 1fr;
  }

  .optimizer-field-row {
    padding: 1rem;
  }
}

@media (max-width: 720px) {
  #propertyDetail,
  .card-grid {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .property-detail-hero,
  .prop-card-hero,
  .property-booking-item,
  .pricing-rule-item {
    flex-direction: column;
  }

  .property-booking-meta,
  .pricing-rule-meta {
    align-items: flex-start;
    text-align: left;
  }

  .reviews-shell {
    padding: 1rem;
  }

  .reviews-header,
  .review-card-meta,
  .review-actions-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .optimizer-shell {
    padding: 1rem;
  }

  .optimizer-score-wrap {
    flex-direction: column;
    align-items: flex-start;
  }

  .opt-editor-panel {
    width: 100vw;
    max-width: 100vw;
    right: -100vw;
  }

  .opt-field-row {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .opt-field-label {
    min-width: 0;
    white-space: normal;
  }

  .opt-field-preview.is-amenity {
    width: 100%;
    justify-content: space-between;
  }
}

@media (min-width: 961px) {
  .amenity-group-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
