/* Meld App Dashboard Styles */

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

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

.dash-nav .logo {
  font-family: 'Instrument Serif', serif;
  font-size: 20px;
  letter-spacing: -0.02em;
  color: var(--fg);
  text-decoration: none;
}

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

.dash-nav .status-badge {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 2px;
  background: var(--surface);
  color: var(--muted);
}

.dash-nav .status-badge.ready {
  background: #d4edda;
  color: #155724;
}

.dash-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 48px 40px;
}

.dash-header {
  margin-bottom: 40px;
}

.dash-header h1 {
  font-family: 'Instrument Serif', serif;
  font-size: 36px;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.dash-header p {
  color: var(--muted);
  font-size: 15px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 24px;
  margin-bottom: 16px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.card-from {
  font-size: 13px;
  font-weight: 500;
  color: var(--fg);
}

.card-subject {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.card-meta {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.05em;
}

.draft-body {
  font-size: 14px;
  line-height: 1.7;
  color: var(--fg);
  white-space: pre-wrap;
  margin-bottom: 20px;
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 2px;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 2px;
  border: none;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: opacity 0.15s;
}

.btn:hover { opacity: 0.85; }

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

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

.btn-danger {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn:disabled:hover { opacity: 0.4; }

.status-tag {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 2px;
  font-weight: 600;
}

.status-tag.pending { background: #fff3cd; color: #856404; }
.status-tag.approved { background: #d4edda; color: #155724; }
.status-tag.rejected { background: #f8d7da; color: #721c24; }

/* Connect Gmail CTA */
.connect-section {
  text-align: center;
  padding: 60px 40px;
  max-width: 500px;
  margin: 0 auto;
}

.connect-section h2 {
  font-family: 'Instrument Serif', serif;
  font-size: 28px;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.connect-section p {
  color: var(--muted);
  font-size: 15px;
  margin-bottom: 32px;
  line-height: 1.7;
}

.btn-connect {
  background: var(--accent);
  color: white;
  padding: 14px 28px;
  font-size: 15px;
  font-weight: 500;
}

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

/* Learning state */
.learning-section {
  padding: 40px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  margin-bottom: 32px;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
  margin-bottom: 12px;
}

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

.progress-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin-top: 16px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.3s ease;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 40px;
  color: var(--muted);
}

.empty-state p {
  font-size: 14px;
  margin-top: 8px;
}

/* Toast notification */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--fg);
  color: var(--bg);
  padding: 12px 20px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  z-index: 1000;
  animation: slideUp 0.2s ease;
}

@keyframes slideUp {
  from { transform: translateY(10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Edit mode */
.draft-textarea {
  width: 100%;
  min-height: 120px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  line-height: 1.7;
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--accent);
  border-radius: 2px;
  color: var(--fg);
  resize: vertical;
}

/* Profile stats */
.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 16px;
  text-align: center;
}

.stat-value {
  font-family: 'Instrument Serif', serif;
  font-size: 28px;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Tab navigation */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}

.tab {
  padding: 12px 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  text-decoration: none;
  display: block;
}

.tab:hover { color: var(--fg); }
.tab.active {
  color: var(--fg);
  border-bottom-color: var(--accent);
}

/* History section */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.history-item:last-child { border-bottom: none; }