/* ---- APP SHELL ---- */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--midnight);
}

.app-nav {
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(212, 168, 85, 0.12);
  background: rgba(26, 26, 46, 0.95);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.app-logo {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--cream);
  text-decoration: none;
}

.app-logo span {
  color: var(--gold);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.4rem;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--terracotta), var(--burnt));
  color: var(--cream);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(194, 112, 62, 0.35);
}

.btn-secondary {
  background: rgba(212, 168, 85, 0.12);
  color: var(--gold);
  border: 1px solid rgba(212, 168, 85, 0.3);
}

.btn-secondary:hover {
  background: rgba(212, 168, 85, 0.2);
}

.btn-ghost {
  background: transparent;
  color: rgba(250, 246, 240, 0.6);
}

.btn-ghost:hover {
  color: var(--cream);
  background: rgba(255,255,255,0.05);
}

.btn-sm {
  padding: 0.4rem 0.9rem;
  font-size: 0.82rem;
}

/* ---- CARDS ---- */
.card {
  background: linear-gradient(145deg, rgba(45, 45, 68, 0.8), rgba(26, 26, 46, 0.9));
  border: 1px solid rgba(212, 168, 85, 0.1);
  border-radius: 12px;
  padding: 1.75rem;
  transition: border-color 0.25s, transform 0.25s;
}

.card:hover {
  border-color: rgba(212, 168, 85, 0.25);
}

.card-clickable {
  cursor: pointer;
  text-decoration: none;
  display: block;
  color: inherit;
}

.card-clickable:hover {
  transform: translateY(-2px);
}

/* ---- FORM ---- */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-family: 'Space Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(250, 246, 240, 0.5);
  margin-bottom: 0.5rem;
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  background: rgba(26, 26, 46, 0.8);
  border: 1px solid rgba(212, 168, 85, 0.15);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: var(--cream);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  transition: border-color 0.2s;
  outline: none;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: rgba(212, 168, 85, 0.5);
  box-shadow: 0 0 0 3px rgba(212, 168, 85, 0.08);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: rgba(250, 246, 240, 0.25);
}

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

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* ---- PAGE LAYOUT ---- */
.page-container {
  flex: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 2rem;
  width: 100%;
}

.page-header {
  margin-bottom: 2rem;
}

.page-title {
  font-family: 'Syne', sans-serif;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 0.4rem;
}

.page-subtitle {
  color: rgba(250, 246, 240, 0.5);
  font-size: 0.95rem;
}

.page-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.page-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

/* ---- EMPTY STATE ---- */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.4;
}

.empty-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.empty-desc {
  color: rgba(250, 246, 240, 0.5);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

/* ---- PROPERTY GRID ---- */
.property-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.property-name {
  font-family: 'Syne', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.property-addr {
  font-size: 0.85rem;
  color: rgba(250, 246, 240, 0.5);
  margin-bottom: 0.75rem;
}

.property-meta {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.badge {
  font-family: 'Space Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  padding: 0.2rem 0.6rem;
  border-radius: 2rem;
  text-transform: uppercase;
}

.badge-gold {
  background: rgba(212, 168, 85, 0.12);
  color: var(--gold);
  border: 1px solid rgba(212, 168, 85, 0.25);
}

.badge-sage {
  background: rgba(122, 139, 111, 0.15);
  color: var(--sage);
  border: 1px solid rgba(122, 139, 111, 0.3);
}

.badge-coral {
  background: rgba(224, 115, 86, 0.12);
  color: var(--coral);
  border: 1px solid rgba(224, 115, 86, 0.25);
}

/* ---- ONBOARDING FORM ---- */
.onboard-container {
  max-width: 720px;
}

.form-section {
  margin-bottom: 2.5rem;
}

.form-section-title {
  font-family: 'Syne', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(212, 168, 85, 0.12);
}

/* ---- DASHBOARD ---- */
.prop-detail-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 1.5rem;
  align-items: start;
}

.convo-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.convo-item {
  padding: 1rem 1.25rem;
  background: rgba(26, 26, 46, 0.7);
  border: 1px solid rgba(212, 168, 85, 0.08);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  color: inherit;
  display: block;
}

.convo-item:hover, .convo-item.active {
  border-color: rgba(212, 168, 85, 0.3);
  background: rgba(45, 45, 68, 0.7);
}

.convo-guest {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
}

.convo-date {
  font-size: 0.78rem;
  color: rgba(250, 246, 240, 0.4);
  font-family: 'Space Mono', monospace;
}

/* ---- CHAT ---- */
.chat-pane {
  display: flex;
  flex-direction: column;
  height: 600px;
  background: rgba(26, 26, 46, 0.5);
  border: 1px solid rgba(212, 168, 85, 0.1);
  border-radius: 12px;
  overflow: hidden;
}

.chat-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(212, 168, 85, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(26, 26, 46, 0.8);
}

.chat-guest-name {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1rem;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar {
  width: 4px;
}
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(212, 168, 85, 0.2);
  border-radius: 2px;
}

.msg {
  max-width: 80%;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-size: 0.92rem;
  line-height: 1.6;
  white-space: pre-wrap;
}

.msg-ai {
  background: rgba(45, 45, 68, 0.9);
  border: 1px solid rgba(212, 168, 85, 0.12);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.msg-guest {
  background: linear-gradient(135deg, rgba(194, 112, 62, 0.25), rgba(139, 69, 19, 0.2));
  border: 1px solid rgba(194, 112, 62, 0.2);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.msg-role {
  font-size: 0.68rem;
  font-family: 'Space Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.35rem;
  opacity: 0.45;
}

.maintenance-alert {
  background: rgba(224, 115, 86, 0.1);
  border: 1px solid rgba(224, 115, 86, 0.3);
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  font-size: 0.82rem;
  color: var(--coral);
  display: flex;
  gap: 0.4rem;
  align-items: center;
  margin: 0 1.25rem;
}

.chat-input-row {
  padding: 1rem 1.25rem;
  display: flex;
  gap: 0.75rem;
  border-top: 1px solid rgba(212, 168, 85, 0.08);
  background: rgba(26, 26, 46, 0.8);
}

.chat-input {
  flex: 1;
  background: rgba(26, 26, 46, 0.8);
  border: 1px solid rgba(212, 168, 85, 0.15);
  border-radius: 8px;
  padding: 0.65rem 1rem;
  color: var(--cream);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.2s;
  resize: none;
  max-height: 120px;
  min-height: 44px;
}

.chat-input:focus {
  border-color: rgba(212, 168, 85, 0.4);
}

/* ---- START CONVERSATION MODAL ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal {
  background: var(--slate);
  border: 1px solid rgba(212, 168, 85, 0.2);
  border-radius: 16px;
  padding: 2rem;
  max-width: 480px;
  width: 100%;
}

.modal-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

/* ---- ALERT / TOAST ---- */
.alert {
  padding: 0.85rem 1.1rem;
  border-radius: 8px;
  font-size: 0.88rem;
  margin-bottom: 1.25rem;
}

.alert-error {
  background: rgba(224, 115, 86, 0.1);
  border: 1px solid rgba(224, 115, 86, 0.3);
  color: var(--coral);
}

.alert-success {
  background: rgba(122, 139, 111, 0.15);
  border: 1px solid rgba(122, 139, 111, 0.3);
  color: var(--sage);
}

/* ---- SPINNER ---- */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(212, 168, 85, 0.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Thinking dots in chat */
.typing-dots {
  display: flex;
  gap: 4px;
  padding: 8px 4px;
  align-items: center;
}
.typing-dots span {
  width: 6px;
  height: 6px;
  background: rgba(212, 168, 85, 0.5);
  border-radius: 50%;
  animation: bounce 1.2s ease-in-out infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}

/* ---- BREADCRUMB ---- */
.breadcrumb {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.82rem;
  color: rgba(250, 246, 240, 0.4);
  margin-bottom: 1.5rem;
}

.breadcrumb a {
  color: rgba(250, 246, 240, 0.4);
  text-decoration: none;
  transition: color 0.15s;
}

.breadcrumb a:hover { color: var(--gold); }
.breadcrumb-sep { opacity: 0.3; }
.breadcrumb-current { color: rgba(250, 246, 240, 0.7); }

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  .prop-detail-grid {
    grid-template-columns: 1fr;
  }
  .chat-pane { height: 450px; }
  .form-row { grid-template-columns: 1fr; }
  .page-container { padding: 1.5rem 1rem; }
}
