/* ============ DASHBOARD ============ */
.dashboard-body {
  min-height: 100vh;
}

.dash-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 2rem 4rem;
}

.dash-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
  padding-top: 1rem;
}

.dash-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

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

/* ============ STAT CARDS ============ */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.stat-card--accent {
  border-color: rgba(240, 165, 0, 0.3);
  background: linear-gradient(135deg, var(--bg-card), rgba(240,165,0,0.05));
}

.stat-card-num {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.stat-card-label {
  font-size: 0.8rem;
  color: var(--fg-muted);
  line-height: 1.4;
}

/* ============ LEADS TABLE ============ */
.leads-section {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: var(--radius);
  overflow: hidden;
}

.leads-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.leads-header h2 {
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font-display);
}

.leads-count {
  font-size: 0.8rem;
  color: var(--fg-muted);
}

.leads-table-wrap {
  overflow-x: auto;
}

.leads-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.leads-table th {
  text-align: left;
  padding: 0.75rem 1.25rem;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.leads-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  vertical-align: middle;
}

.lead-row:last-child td {
  border-bottom: none;
}

.lead-row:hover {
  background: rgba(255,255,255,0.02);
}

.lead-phone {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--fg);
}

.lead-biz {
  color: var(--fg-muted);
  text-transform: capitalize;
}

.lead-appt {
  color: var(--accent);
  font-size: 0.8rem;
}

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

/* Status badges */
.status-badge {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.status-new {
  background: rgba(138,138,154,0.15);
  color: var(--fg-muted);
  border: 1px solid rgba(138,138,154,0.2);
}

.status-qualified {
  background: rgba(240,165,0,0.12);
  color: var(--accent);
  border: 1px solid rgba(240,165,0,0.25);
}

.status-booked {
  background: rgba(52,211,153,0.12);
  color: var(--green);
  border: 1px solid rgba(52,211,153,0.25);
}

.status-lost {
  background: rgba(255,77,77,0.1);
  color: var(--red);
  border: 1px solid rgba(255,77,77,0.2);
}

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

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

.empty-state h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--fg-muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

/* View convo button */
.btn-view-convo {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--fg-muted);
  padding: 0.4rem 0.9rem;
  border-radius: 8px;
  font-size: 0.78rem;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 500;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.btn-view-convo:hover {
  border-color: rgba(240,165,0,0.4);
  color: var(--accent);
}

/* ============ MODAL ============ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 100;
  backdrop-filter: blur(4px);
}

.convo-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 101;
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  width: 480px;
  max-width: 92vw;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.modal-header h3 {
  font-size: 1rem;
  font-family: var(--font-display);
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--fg-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
  transition: color 0.2s;
}

.modal-close:hover { color: var(--fg); }

.modal-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.modal-loading {
  text-align: center;
  color: var(--fg-muted);
  font-size: 0.875rem;
  padding: 2rem;
}

.modal-msg {
  padding: 0.8rem 1rem;
  border-radius: 12px;
  font-size: 0.85rem;
  line-height: 1.5;
  max-width: 85%;
}

.modal-msg .msg-sender {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.modal-msg .msg-time {
  display: block;
  font-size: 0.65rem;
  color: var(--fg-muted);
  margin-top: 0.4rem;
  text-align: right;
}

.modal-msg--assistant {
  background: rgba(240,165,0,0.08);
  border: 1px solid rgba(240,165,0,0.15);
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}

.modal-msg--user {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-bottom-right-radius: 4px;
  align-self: flex-end;
}

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

@media (max-width: 600px) {
  .stats-row {
    grid-template-columns: 1fr 1fr;
  }

  .dash-header {
    flex-direction: column;
    align-items: flex-start;
  }
}
