/* App-wide styles for authenticated pages — dashboard, property setup, auth */

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

.app-nav {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.app-nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent);
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  color: var(--fg-muted);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 6px 12px;
  border-radius: var(--radius);
  transition: color 0.15s, background 0.15s;
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
}

.nav-link:hover,
.nav-link.active {
  color: var(--fg);
  background: rgba(255,255,255,0.05);
}

.nav-link.active {
  color: var(--accent);
}

.nav-logout {
  color: var(--fg-muted);
}

.app-main {
  min-height: calc(100vh - 56px);
}

/* ===== PAGE HEADER ===== */
.page-header {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  padding: 36px 0 32px;
}

.page-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.page-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 100px;
  background: var(--accent-glow);
  border: 1px solid rgba(240, 165, 0, 0.25);
  color: var(--accent);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.page-title {
  font-size: 1.9rem;
  color: var(--fg);
  margin-bottom: 6px;
}

.page-sub {
  color: var(--fg-muted);
  font-size: 0.95rem;
}

/* ===== DASHBOARD HEADER ===== */
.dash-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
}

.dash-stats {
  display: flex;
  gap: 32px;
}

.dash-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dash-stat-number {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent-soft);
  line-height: 1;
}

.dash-stat-label {
  font-size: 0.8rem;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  text-decoration: none;
  white-space: nowrap;
}

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

.btn-primary:hover {
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--fg-muted);
  border: 1px solid var(--border);
}

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

.btn-full { width: 100%; }

.btn-sm {
  padding: 6px 14px;
  font-size: 0.82rem;
}

/* ===== AUTH PAGES ===== */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: var(--bg);
  background-image: radial-gradient(circle at 50% 20%, var(--accent-glow) 0%, transparent 60%);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
}

.auth-brand {
  display: block;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent);
  text-decoration: none;
  margin-bottom: 28px;
}

.auth-title {
  font-size: 1.7rem;
  margin-bottom: 8px;
}

.auth-sub {
  color: var(--fg-muted);
  font-size: 0.95rem;
  margin-bottom: 28px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 0.9rem;
  color: var(--fg-muted);
}

.auth-footer a {
  color: var(--accent);
  text-decoration: none;
}

/* ===== FORM FIELDS ===== */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.field-hint {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

.required {
  color: var(--accent);
}

.field-input {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 14px;
  color: var(--fg);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
  resize: vertical;
}

.field-input:focus {
  border-color: rgba(240, 165, 0, 0.4);
}

.field-input::placeholder {
  color: rgba(138,138,154,0.6);
}

/* ===== ALERTS ===== */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.alert-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}

.alert-success {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.2);
  color: #86efac;
}

/* ===== PROPERTY SETUP ===== */
.setup-container {
  max-width: 800px;
  margin: 40px auto;
  padding: 0 24px;
}

.setup-form {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.setup-section {
  padding: 36px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.setup-section:last-child {
  border-bottom: none;
}

.setup-section-title {
  font-size: 1.05rem;
  color: var(--fg);
  display: flex;
  align-items: center;
  gap: 10px;
}

.setup-section-badge {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--fg-muted);
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.setup-section-sub {
  color: var(--fg-muted);
  font-size: 0.9rem;
  margin-top: -8px;
}

.fields-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.setup-actions {
  display: flex;
  gap: 12px;
  padding-top: 32px;
  padding-bottom: 60px;
}

/* ===== FAQs ===== */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.faq-row {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
}

.btn-faq-remove {
  align-self: flex-start;
  background: none;
  border: none;
  color: var(--fg-muted);
  font-size: 0.82rem;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.btn-faq-remove:hover { color: #fca5a5; }

/* ===== DASHBOARD CONVERSATION LIST ===== */
.dash-container {
  max-width: 1100px;
  margin: 32px auto;
  padding: 0 24px;
}

.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--fg-muted);
}

.empty-icon { font-size: 3rem; margin-bottom: 20px; }
.empty-title { font-size: 1.5rem; color: var(--fg); margin-bottom: 10px; }
.empty-sub { font-size: 0.95rem; margin-bottom: 28px; }

.conv-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.conv-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, background 0.15s;
  gap: 16px;
}

.conv-card:hover {
  border-color: rgba(240, 165, 0, 0.2);
  background: rgba(255,255,255,0.02);
}

.conv-card-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.conv-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-glow);
  border: 1px solid rgba(240, 165, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  color: var(--accent);
  font-size: 1rem;
  flex-shrink: 0;
}

.conv-info { min-width: 0; }

.conv-guest-name {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--fg);
  margin-bottom: 3px;
}

.conv-last-msg {
  font-size: 0.85rem;
  color: var(--fg-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 500px;
}

.conv-card-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.conv-status {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.conv-status-open {
  background: rgba(34, 197, 94, 0.1);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.conv-status-closed {
  background: rgba(255,255,255,0.05);
  color: var(--fg-muted);
  border: 1px solid var(--border);
}

.conv-time {
  font-size: 0.78rem;
  color: var(--fg-muted);
}

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

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  width: 100%;
  max-width: 500px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.modal-title {
  font-size: 1.2rem;
}

.modal-close {
  background: none;
  border: none;
  color: var(--fg-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius);
}

.modal-close:hover { color: var(--fg); background: rgba(255,255,255,0.05); }

.modal-sub {
  color: var(--fg-muted);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

/* ===== CONVERSATION PAGE ===== */
.conv-page {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 56px);
}

.conv-page-header {
  padding: 24px 0 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.back-link {
  font-size: 0.85rem;
  color: var(--fg-muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.back-link:hover { color: var(--fg); }

.conv-page-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.conv-page-title {
  font-size: 1.4rem;
  font-family: 'Space Grotesk', sans-serif;
}

.conv-page-contact {
  font-size: 0.85rem;
  color: var(--fg-muted);
}

.conv-page-actions {
  display: flex;
  gap: 8px;
}

.msg-thread {
  flex: 1;
  padding: 24px 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
}

.msg-row { display: flex; }
.msg-row-guest { justify-content: flex-start; }
.msg-row-assistant { justify-content: flex-end; }

.msg-bubble {
  max-width: 80%;
  padding: 14px 18px;
  border-radius: 16px;
  position: relative;
}

.msg-guest {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.msg-ai {
  background: var(--bg-elevated);
  border: 1px solid rgba(240, 165, 0, 0.2);
  border-bottom-right-radius: 4px;
}

.msg-sender {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.msg-sender-ai {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.ai-badge, .override-badge, .pending-badge {
  padding: 1px 7px;
  border-radius: 100px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.ai-badge {
  background: var(--accent-glow);
  color: var(--accent);
  border: 1px solid rgba(240, 165, 0, 0.2);
}

.override-badge {
  background: rgba(167, 139, 250, 0.1);
  color: #c4b5fd;
  border: 1px solid rgba(167, 139, 250, 0.2);
}

.pending-badge {
  background: rgba(251, 191, 36, 0.1);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.2);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.msg-content {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--fg);
  white-space: pre-wrap;
}

.msg-content-display {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--fg);
  white-space: pre-wrap;
}

.msg-edit-input {
  margin-top: 8px;
  font-size: 0.92rem;
}

.msg-time {
  font-size: 0.72rem;
  color: var(--fg-muted);
  margin-top: 8px;
}

.msg-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.btn-msg-approve, .btn-msg-edit {
  font-size: 0.78rem;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid;
  transition: all 0.15s;
}

.btn-msg-approve {
  background: rgba(34, 197, 94, 0.1);
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.2);
}

.btn-msg-approve:hover {
  background: rgba(34, 197, 94, 0.2);
}

.btn-msg-edit {
  background: transparent;
  color: var(--fg-muted);
  border-color: var(--border);
}

.btn-msg-edit:hover {
  color: var(--fg);
  background: rgba(255,255,255,0.05);
}

.msg-save-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

/* ===== MESSAGE INPUT AREA ===== */
.msg-input-area {
  border-top: 1px solid var(--border);
  padding: 20px 0 32px;
  background: var(--bg);
  position: sticky;
  bottom: 0;
}

.msg-input-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.msg-textarea {
  flex: 1;
  resize: none;
}

.msg-input-hint {
  font-size: 0.78rem;
  color: var(--fg-muted);
  margin-top: 8px;
}

/* ===== LANDING PAGE — add Get Started button ===== */
.hero-cta {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 40px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .fields-grid { grid-template-columns: 1fr; }
  .dash-header-top { flex-direction: column; }
  .dash-stats { gap: 20px; }
  .conv-last-msg { max-width: 200px; }
  .msg-bubble { max-width: 95%; }
  .modal { padding: 24px; }
  .auth-card { padding: 28px 24px; }
}
