/* ─── DASHBOARD LAYOUT ─── */
.dash-body {
  background: var(--bg-deep);
  min-height: 100vh;
}

.dash-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 60px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.dash-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
  text-decoration: none;
}

.dash-brand-icon {
  font-size: 1.3rem;
}

.dash-nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.dash-nav-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 500;
}

.dash-layout {
  display: flex;
  min-height: calc(100vh - 60px);
}

/* ─── SIDEBAR ─── */
.dash-sidebar {
  width: 240px;
  min-width: 240px;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: 1.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.dash-sidebar-section {
  padding: 0 1rem;
}

.dash-sidebar-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 0.6rem;
  padding: 0 0.5rem;
}

.dash-sidebar-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  text-decoration: none;
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  transition: background 0.15s, color 0.15s;
  font-family: 'Outfit', sans-serif;
}

.dash-sidebar-item:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.dash-sidebar-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.dash-sidebar-empty {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 0.4rem 0.75rem;
  font-style: italic;
}

.dash-sidebar-add {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  font-size: 0.88rem;
  color: var(--accent);
  background: var(--accent-glow);
  border: 1px solid rgba(245,158,11,0.2);
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: background 0.15s;
  font-family: 'Outfit', sans-serif;
  font-weight: 500;
}

.dash-sidebar-add:hover {
  background: rgba(245,158,11,0.2);
}

.dash-action {
  font-family: 'Outfit', sans-serif;
}

/* ─── MAIN ─── */
.dash-main {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* ─── STATS ROW ─── */
.dash-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.dash-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
  text-align: center;
}

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

.dash-stat-highlight {
  color: var(--accent);
}

.dash-stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}

/* ─── SECTIONS ─── */
.dash-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

.dash-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1.5rem 1.75rem;
  border-bottom: 1px solid var(--border);
}

.dash-section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
}

.dash-section-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.dash-prop-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-shrink: 0;
}

.dash-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--accent-glow);
  border: 1px solid rgba(245,158,11,0.3);
  color: var(--accent-warm);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.7rem;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ─── SUMMARIES ─── */
.dash-summaries {
  padding: 1.25rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.dash-summary-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
}

.dash-summary-fresh {
  border-color: rgba(245,158,11,0.25);
  background: rgba(245,158,11,0.04);
}

.dash-summary-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.dash-summary-property {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-primary);
}

.dash-summary-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.dash-summary-count {
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 500;
}

.dash-summary-content {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.65;
  font-weight: 300;
}

.dash-summary-loading {
  font-size: 0.9rem;
  color: var(--text-muted);
  padding: 1rem;
  font-style: italic;
}

.dash-summary-placeholder {
  padding: 0 1.75rem 1.5rem;
}

/* ─── MESSAGE THREAD ─── */
.dash-thread {
  padding: 1.25rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 500px;
  overflow-y: auto;
}

.dash-thread-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 2rem;
  color: var(--text-muted);
  text-align: center;
}

.dash-thread-empty-icon {
  font-size: 1.8rem;
}

.dash-thread-empty p {
  font-size: 0.88rem;
  max-width: 340px;
}

.dash-message {
  max-width: 80%;
  border-radius: 12px;
  padding: 1rem 1.25rem;
}

.dash-message-inbound {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  align-self: flex-start;
}

.dash-message-outbound {
  background: rgba(245,158,11,0.07);
  border: 1px solid rgba(245,158,11,0.18);
  align-self: flex-end;
}

.dash-message-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
}

.dash-message-sender {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.dash-message-ai {
  color: var(--accent);
}

.dash-message-time {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.dash-message-content {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  white-space: pre-wrap;
}

/* ─── BUTTONS ─── */
.dash-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--accent);
  color: #0a0e1a;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.65rem 1.4rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s;
  text-decoration: none;
}

.dash-btn-primary:hover {
  opacity: 0.88;
}

.dash-btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.dash-btn-ghost {
  display: inline-flex;
  align-items: center;
  background: transparent;
  color: var(--text-secondary);
  font-family: 'Outfit', sans-serif;
  font-size: 0.88rem;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  text-decoration: none;
}

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

.dash-btn-sm {
  font-size: 0.8rem;
  padding: 0.4rem 0.8rem;
}

/* ─── FORM ELEMENTS ─── */
.dash-input {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  padding: 0.7rem 1rem;
  transition: border-color 0.15s;
  outline: none;
  appearance: none;
}

.dash-input:focus {
  border-color: rgba(245,158,11,0.4);
}

.dash-input::placeholder {
  color: var(--text-muted);
}

.dash-textarea {
  min-height: 90px;
  resize: vertical;
  line-height: 1.5;
}

select.dash-input {
  cursor: pointer;
}

.dash-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.dash-form-group label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ─── MODALS ─── */
.dash-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 2rem;
}

.dash-modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 2rem;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
}

.dash-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.dash-modal-header h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
}

.dash-modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.25rem;
}

.dash-modal-close:hover {
  color: var(--text-primary);
}

.dash-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* ─── AI RESULT ─── */
.dash-ai-result {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.dash-ai-result-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.dash-ai-reply-bubble {
  background: rgba(245,158,11,0.07);
  border: 1px solid rgba(245,158,11,0.2);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.65;
  white-space: pre-wrap;
}

/* ─── TOKEN GATE ─── */
.dash-gate {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
}

.dash-gate-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3rem;
  max-width: 460px;
  width: 100%;
  text-align: center;
}

.dash-gate-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.dash-gate-card h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.dash-gate-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 300;
  line-height: 1.65;
  margin-bottom: 1.5rem;
}

.dash-gate-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.dash-gate-hint {
  margin-top: 1rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

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

/* ─── ERROR / EMPTY ─── */
.dash-error {
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.2);
  color: #f87171;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.88rem;
  margin-bottom: 1rem;
}

.dash-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 4rem 2rem;
  text-align: center;
}

.dash-empty-icon {
  font-size: 3rem;
}

.dash-empty-state h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.3rem;
  font-weight: 600;
}

.dash-empty-state p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  max-width: 380px;
  font-weight: 300;
  margin-bottom: 0.5rem;
}

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

@media (max-width: 600px) {
  .dash-main {
    padding: 1rem;
  }
  .dash-stats-row {
    grid-template-columns: 1fr 1fr;
  }
  .dash-message {
    max-width: 95%;
  }
}
