/* ============ APP SHELL ============ */
.app-body { background: var(--bg-primary); min-height: 100vh; }

.app-nav {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.app-nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-brand {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
}
.nav-links { display: flex; align-items: center; gap: 24px; }
.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 15px;
  transition: color 0.2s;
}
.nav-link:hover { color: var(--text-primary); }

.app-main { max-width: var(--max-width); margin: 0 auto; padding: 40px 24px; }

/* ============ BUTTONS ============ */
.btn-primary {
  background: var(--accent);
  color: #0a0e1a;
  border: none;
  border-radius: var(--radius);
  padding: 12px 24px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: opacity 0.2s, transform 0.1s;
}
.btn-primary:hover { opacity: 0.9; }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-sm { padding: 8px 16px; font-size: 13px; }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 12px 24px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: border-color 0.2s, color 0.2s;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--text-primary); }

/* ============ PAGE LAYOUT ============ */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 40px;
}
.page-header h1 { font-size: 32px; color: var(--text-primary); margin-bottom: 4px; }
.page-sub { color: var(--text-secondary); font-size: 15px; }
.header-actions { display: flex; gap: 12px; align-items: center; }
.back-link {
  color: var(--text-muted);
  font-size: 14px;
  text-decoration: none;
  display: block;
  margin-bottom: 8px;
  transition: color 0.2s;
}
.back-link:hover { color: var(--accent); }

/* ============ CARDS ============ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

/* ============ PROPERTY GRID ============ */
.property-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.property-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  text-decoration: none;
  display: block;
  transition: border-color 0.2s, transform 0.2s;
}
.property-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.property-card-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  border-style: dashed;
  color: var(--text-muted);
  gap: 12px;
}
.property-card-add:hover { border-color: var(--accent); color: var(--accent); }
.add-icon { font-size: 32px; font-weight: 300; }
.property-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.property-icon { font-size: 28px; }
.property-status { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-muted); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; }
.property-name { font-size: 18px; font-weight: 600; color: var(--text-primary); margin-bottom: 6px; }
.property-address { font-size: 14px; color: var(--text-muted); margin-bottom: 12px; }
.property-meta { font-size: 14px; color: var(--text-secondary); display: flex; gap: 8px; margin-bottom: 20px; }
.property-footer { border-top: 1px solid var(--border); padding-top: 16px; }
.property-link { color: var(--accent); font-size: 14px; font-weight: 500; }

/* ============ PROPERTY DETAIL ============ */
.property-detail-grid { display: grid; grid-template-columns: 320px 1fr; gap: 24px; margin-bottom: 40px; }
.property-info-card h3 { font-size: 16px; margin-bottom: 20px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.06em; font-size: 12px; }
.info-row { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 15px; }
.info-row:last-child { border-bottom: none; }
.info-label { color: var(--text-muted); }

/* ============ CONVERSATIONS ============ */
.conversations-section { margin-top: 8px; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.section-header h2 { font-size: 22px; }
.conversations-list { display: flex; flex-direction: column; gap: 4px; }
.conversation-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color 0.2s;
}
.conversation-row:hover { border-color: var(--accent); }
.conv-avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--accent-dim); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 16px;
  flex-shrink: 0;
}
.conv-info { flex: 1; min-width: 0; }
.conv-name { font-weight: 600; color: var(--text-primary); font-size: 15px; margin-bottom: 4px; }
.conv-last { color: var(--text-muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-meta { font-size: 13px; color: var(--text-muted); }

/* ============ FORMS ============ */
.setup-form { max-width: 760px; }
.form-section { margin-bottom: 40px; }
.form-section-title { font-size: 18px; margin-bottom: 20px; color: var(--text-primary); padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { grid-template-columns: 2fr 1fr 1fr; }
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 14px; font-weight: 500; color: var(--text-secondary); margin-bottom: 8px; }
.form-hint { font-size: 14px; color: var(--text-muted); margin-bottom: 12px; }
.form-input, .form-textarea {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  padding: 12px 16px;
  outline: none;
  transition: border-color 0.2s;
  resize: vertical;
}
.form-input:focus, .form-textarea:focus { border-color: var(--accent); }
.form-textarea { line-height: 1.6; }
.form-actions { display: flex; gap: 12px; justify-content: flex-end; padding-top: 24px; border-top: 1px solid var(--border); }

/* ============ EMPTY STATE ============ */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-muted);
}
.empty-state.small { padding: 40px 24px; }
.empty-icon { font-size: 48px; margin-bottom: 20px; }
.empty-state h2 { font-size: 24px; color: var(--text-primary); margin-bottom: 12px; }
.empty-state p { font-size: 16px; color: var(--text-secondary); margin-bottom: 28px; max-width: 420px; margin-left: auto; margin-right: auto; }

/* ============ MODAL ============ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 500;
  backdrop-filter: blur(4px);
}
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 440px;
}
.modal h3 { font-size: 22px; margin-bottom: 8px; }
.modal-brand { color: var(--accent); font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 14px; margin-bottom: 16px; text-transform: uppercase; letter-spacing: 0.06em; }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 24px; }

/* ============ CHAT ============ */
.chat-container {
  display: flex; flex-direction: column;
  height: calc(100vh - 60px);
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
}
.chat-header {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 24px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.chat-header .back-link { margin: 0; white-space: nowrap; }
.chat-guest-info { display: flex; align-items: center; gap: 12px; flex: 1; }
.chat-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--accent-dim); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 15px;
  flex-shrink: 0;
}
.chat-guest-name { font-weight: 600; font-size: 15px; color: var(--text-primary); }
.chat-guest-sub { font-size: 13px; color: var(--text-muted); }
.chat-ai-badge {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.2);
  border-radius: 100px;
  font-size: 13px; color: #4ade80;
  font-family: 'Space Grotesk', sans-serif; font-weight: 500;
  white-space: nowrap;
}
.ai-dot { width: 7px; height: 7px; border-radius: 50%; background: #4ade80; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }

.chat-messages {
  flex: 1; overflow-y: auto;
  padding: 24px;
  display: flex; flex-direction: column; gap: 12px;
}
.chat-empty { color: var(--text-muted); font-size: 14px; text-align: center; padding: 40px 0; }
.message { display: flex; flex-direction: column; max-width: 75%; }
.message-guest { align-self: flex-end; }
.message-assistant { align-self: flex-start; }
.message-bubble {
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 15px;
  line-height: 1.65;
}
.message-guest .message-bubble {
  background: var(--accent);
  color: #0a0e1a;
  border-bottom-right-radius: 4px;
  font-weight: 500;
}
.message-assistant .message-bubble {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.message-time { font-size: 11px; color: var(--text-muted); margin-top: 4px; padding: 0 4px; }
.message-guest .message-time { text-align: right; }

/* Typing indicator */
.typing-indicator .message-bubble { padding: 16px 20px; }
.typing-indicator span {
  display: inline-block; width: 8px; height: 8px;
  border-radius: 50%; background: var(--text-muted);
  margin: 0 2px; animation: bounce 1.2s infinite;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce { 0%,60%,100%{transform:translateY(0)} 30%{transform:translateY(-8px)} }

.chat-input-area {
  padding: 16px 24px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
  flex-shrink: 0;
}
.chat-input-row { display: flex; gap: 12px; align-items: flex-end; }
.chat-input {
  flex: 1;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  padding: 12px 16px;
  outline: none;
  resize: none;
  transition: border-color 0.2s;
  line-height: 1.5;
}
.chat-input:focus { border-color: var(--accent); }
.send-btn { flex-shrink: 0; }
.chat-hint { font-size: 12px; color: var(--text-muted); margin-top: 8px; text-align: center; }

/* Suggestion chips */
.chat-suggestions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.suggestion-chip {
  padding: 8px 14px;
  border-radius: 100px;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(212,162,84,0.2);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s;
  font-family: 'DM Sans', sans-serif;
}
.suggestion-chip:hover { background: rgba(212,162,84,0.25); }

/* ============ DEMO PAGE ============ */
.demo-page { max-width: 900px; margin: 0 auto; padding: 60px 24px; }
.demo-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 60px; }
.demo-hero { margin-bottom: 56px; }
.demo-hero h1 { font-size: clamp(36px, 5vw, 60px); margin-bottom: 16px; }
.demo-property-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; margin-bottom: 56px; }
.demo-property-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  text-decoration: none;
  display: block;
  transition: border-color 0.2s, transform 0.2s;
}
.demo-property-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.demo-property-icon { font-size: 32px; margin-bottom: 16px; }
.demo-property-card h3 { font-size: 18px; color: var(--text-primary); margin-bottom: 8px; }
.demo-property-card p { font-size: 14px; color: var(--text-muted); margin-bottom: 12px; }
.demo-property-meta { font-size: 13px; color: var(--text-secondary); }
.demo-footer-note { text-align: center; color: var(--text-muted); font-size: 15px; }
.demo-footer-note p { margin-bottom: 12px; }
.demo-chat-page { height: calc(100vh - 0px); display: flex; flex-direction: column; }
.demo-chat-container { height: 100vh; border-radius: 0; border: none; }

/* welcome msg */
.welcome-msg .message-bubble ul { margin-top: 8px; padding-left: 20px; line-height: 1.8; }

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
  .app-main { padding: 24px 16px; }
  .page-header { flex-direction: column; gap: 16px; }
  .property-detail-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .form-row-3 { grid-template-columns: 1fr; }
  .message { max-width: 90%; }
  .chat-suggestions { display: none; }
}
