/* Dashboard-specific styles — shares design tokens from theme.css */

.dash-body {
  background: var(--bg);
  min-height: 100vh;
}

/* Nav */
.dash-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
}

.dash-brand {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
}

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

.dash-nav-link {
  color: var(--fg-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.dash-nav-link:hover, .dash-nav-link.active {
  color: var(--fg);
}

.dash-nav-sep { color: var(--border); }

/* Main layout */
.dash-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

/* Breadcrumb */
.dash-breadcrumb {
  font-size: 0.85rem;
  color: var(--fg-muted);
  margin-bottom: 24px;
}

.dash-breadcrumb a {
  color: var(--accent);
  text-decoration: none;
}

.dash-breadcrumb a:hover { text-decoration: underline; }

/* Stats row */
.dash-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.dash-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dash-stat-num {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
}

.dash-stat-label {
  font-size: 0.82rem;
  color: var(--fg-muted);
}

/* Grid */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

/* Panels */
.dash-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.dash-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.dash-panel-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--fg);
}

/* Property list */
.dash-property-list { display: flex; flex-direction: column; }

.dash-property-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  transition: background 0.2s;
}

.dash-property-card:last-child { border-bottom: none; }
.dash-property-card:hover { background: var(--bg-subtle); }

.dash-property-info { display: flex; flex-direction: column; gap: 4px; }
.dash-property-name { font-weight: 600; color: var(--fg); font-size: 0.95rem; }
.dash-property-address { font-size: 0.82rem; color: var(--fg-muted); }
.dash-property-meta { display: flex; align-items: center; gap: 12px; }
.dash-rent { font-family: var(--font-display); font-size: 0.9rem; color: var(--accent); font-weight: 600; }

/* Message list */
.dash-message-list { display: flex; flex-direction: column; }

.dash-message-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  transition: background 0.2s;
}

.dash-message-row:last-child { border-bottom: none; }
.dash-message-row:hover { background: var(--bg-subtle); }

.dash-msg-meta { display: flex; align-items: center; gap: 8px; }
.dash-msg-tenant { font-weight: 600; font-size: 0.9rem; color: var(--fg); }
.dash-msg-property { font-size: 0.8rem; color: var(--fg-muted); }
.dash-msg-body { font-size: 0.88rem; color: var(--fg-muted); line-height: 1.5; }
.dash-msg-footer { display: flex; align-items: center; gap: 10px; font-size: 0.78rem; color: var(--fg-muted); }

.dash-msg-dir.inbound { color: #60a5fa; }
.dash-msg-dir.outbound { color: var(--accent); }

/* Pills */
.dash-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  font-family: var(--font-display);
}

.dash-pill-ai {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 100px;
  background: rgba(129, 140, 248, 0.15);
  color: #818cf8;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-display);
  letter-spacing: 0.5px;
}

/* Buttons */
.btn-accent {
  padding: 8px 18px;
  background: var(--accent);
  color: #0a0a0f;
  border: none;
  border-radius: 8px;
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.2s;
}

.btn-accent:hover { opacity: 0.85; }

.btn-ghost {
  padding: 8px 18px;
  background: transparent;
  color: var(--fg-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

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

/* Empty state */
.dash-empty {
  padding: 40px 24px;
  text-align: center;
  color: var(--fg-muted);
  font-size: 0.9rem;
}

/* API Panel */
.dash-api-panel { padding: 0; }
.dash-api-desc { padding: 0 24px; font-size: 0.9rem; color: var(--fg-muted); margin-top: 16px; }

.dash-code {
  margin: 12px 24px;
  padding: 16px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: 'Courier New', monospace;
  font-size: 0.82rem;
  color: var(--accent);
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 1.6;
}

/* Property header */
.dash-property-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}

.dash-page-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--fg);
  margin-bottom: 4px;
}

.dash-page-sub { font-size: 0.9rem; color: var(--fg-muted); }
.dash-property-header-meta { display: flex; gap: 8px; padding-top: 6px; flex-shrink: 0; }

/* Tenant list */
.dash-tenant-list { display: flex; flex-direction: column; }

.dash-tenant-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  transition: background 0.2s;
}

.dash-tenant-card:last-child { border-bottom: none; }
.dash-tenant-card:hover { background: var(--bg-subtle); }

.dash-tenant-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent-dim);
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dash-tenant-avatar.lg {
  width: 56px;
  height: 56px;
  font-size: 1.4rem;
}

.dash-tenant-profile { display: flex; align-items: center; gap: 16px; }

.dash-tenant-info { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.dash-tenant-name { font-weight: 600; color: var(--fg); font-size: 0.95rem; }
.dash-tenant-email, .dash-tenant-phone { font-size: 0.82rem; color: var(--fg-muted); }
.dash-tenant-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.dash-lease-end { font-size: 0.78rem; color: var(--fg-muted); }

/* Conversation thread */
.dash-thread {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 500px;
  overflow-y: auto;
}

.dash-bubble {
  max-width: 75%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dash-bubble.inbound { align-self: flex-start; }
.dash-bubble.outbound { align-self: flex-end; }

.dash-bubble-body {
  padding: 14px 18px;
  border-radius: 14px;
  font-size: 0.9rem;
  line-height: 1.6;
  white-space: pre-wrap;
}

.dash-bubble.inbound .dash-bubble-body {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--fg);
  border-bottom-left-radius: 4px;
}

.dash-bubble.outbound .dash-bubble-body {
  background: var(--accent-dim);
  border: 1px solid rgba(94, 234, 212, 0.2);
  color: var(--fg);
  border-bottom-right-radius: 4px;
}

.dash-bubble-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--fg-muted);
  padding: 0 4px;
}

.dash-bubble.outbound .dash-bubble-meta { justify-content: flex-end; }

/* Send box */
.dash-send-box {
  padding: 20px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg-subtle);
}

.dash-send-title {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--fg-muted);
  margin-bottom: 12px;
}

.dash-textarea {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 12px 16px;
  resize: vertical;
  transition: border-color 0.2s;
}

.dash-textarea:focus {
  outline: none;
  border-color: rgba(94, 234, 212, 0.4);
}

.dash-send-actions { margin-top: 12px; display: flex; justify-content: flex-end; }

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-overlay.open { display: flex; }

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 24px;
}

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

.modal-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.88rem;
  color: var(--fg-muted);
  font-family: var(--font-display);
  font-weight: 500;
}

.modal-form input {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 10px 14px;
  transition: border-color 0.2s;
}

.modal-form input:focus {
  outline: none;
  border-color: rgba(94, 234, 212, 0.4);
}

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

/* Responsive */
@media (max-width: 900px) {
  .dash-stats-row { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .dash-stats-row { grid-template-columns: 1fr 1fr; }
  .dash-nav { padding: 12px 16px; }
  .dash-main { padding: 20px 16px 60px; }
}
