/* dashboard.css — Vetted dashboard styles, built on tokens.css design tokens */

/* ── App Shell ──────────────────────────────────────────────────── */
.db-app {
  display: flex;
  min-height: 100vh;
  background: var(--color-bg);
}

/* ── Sidebar ────────────────────────────────────────────────────── */
.db-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
}

.db-sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 16px;
  text-decoration: none;
  border-bottom: 1px solid var(--color-border);
}

.db-sidebar-logo img {
  width: 24px;
  height: 24px;
}

.db-sidebar-logo-text {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 18px;
  color: var(--color-fg);
  letter-spacing: -0.02em;
}

.db-sidebar-badge {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-brand);
  background: rgba(197, 241, 53, 0.12);
  padding: 2px 6px;
  border-radius: var(--radius-full);
}

.db-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.db-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  text-decoration: none;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-fg-dim);
  transition: background var(--duration-fast) var(--ease-out),
              color var(--duration-fast) var(--ease-out);
}

.db-nav-link:hover {
  background: var(--color-surface-2);
  color: var(--color-fg);
}

.db-nav-link.active {
  background: rgba(197, 241, 53, 0.1);
  color: var(--color-brand);
  font-weight: 600;
}

.db-nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.7;
}

.db-nav-link.active .db-nav-icon { opacity: 1; }

.db-sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--color-border);
}

.db-sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius);
  text-decoration: none;
}

.db-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--color-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 13px;
  color: var(--color-bg);
  flex-shrink: 0;
}

.db-user-info { flex: 1; min-width: 0; }
.db-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.db-user-role {
  font-size: 11px;
  color: var(--color-fg-dim);
  letter-spacing: 0.03em;
}

/* ── Main Area ──────────────────────────────────────────────────── */
.db-main {
  flex: 1;
  margin-left: 220px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Header ────────────────────────────────────────────────────── */
.db-header {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg);
  position: sticky;
  top: 0;
  z-index: 50;
}

.db-header-left { display: flex; align-items: center; gap: 16px; }

.db-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--color-fg-dim);
}

.db-breadcrumb-sep { opacity: 0.4; }

.db-header-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 16px;
  color: var(--color-fg);
}

.db-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ── Content Area ────────────────────────────────────────────────── */
.db-content {
  flex: 1;
  padding: 32px;
}

/* ── Page header pattern ─────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.page-title {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 28px;
  color: var(--color-fg);
  letter-spacing: -0.02em;
}

.page-subtitle {
  font-size: 14px;
  color: var(--color-fg-dim);
  margin-top: 4px;
}

/* ── Cards ───────────────────────────────────────────────────────── */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 24px;
}

.card-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 16px;
  color: var(--color-fg);
  margin-bottom: 16px;
}

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

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

.stat-num {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 32px;
  color: var(--color-brand);
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-fg-dim);
}

/* ── Empty state ─────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.empty-icon { font-size: 40px; margin-bottom: 16px; }
.empty-title { font-family: var(--font-head); font-weight: 700; font-size: 18px; color: var(--color-fg); margin-bottom: 8px; }
.empty-desc { font-size: 14px; color: var(--color-fg-dim); max-width: 320px; margin: 0 auto; }

/* ── Buttons ─────────────────────────────────────────────────────── */
.btn-primary {
  padding: 9px 18px;
  background: var(--color-brand);
  color: var(--color-bg);
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background var(--duration-fast) var(--ease-out);
}

.btn-primary:hover { background: var(--color-brand-dim); }

.btn-ghost {
  padding: 9px 18px;
  background: transparent;
  color: var(--color-fg-dim);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: border-color var(--duration-fast) var(--ease-out),
              color var(--duration-fast) var(--ease-out);
}

.btn-ghost:hover { border-color: var(--color-border-2); color: var(--color-fg); }

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .db-sidebar { transform: translateX(-100%); }
  .db-main { margin-left: 0; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
}

.dash-wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 100px var(--gutter) 60px;
}

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

.dash-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.dash-title {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 36px;
  letter-spacing: -0.02em;
  color: var(--fg);
}

.pipeline-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

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

.stat-num {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 32px;
  color: var(--accent);
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-dim);
}

/* Queue */
#emailQueue { margin-top: 8px; }

.queue-empty {
  text-align: center;
  padding: 60px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.queue-empty-icon { font-size: 48px; margin-bottom: 16px; }
.queue-empty-title { font-family: var(--font-head); font-weight: 700; font-size: 20px; color: var(--fg); margin-bottom: 8px; }
.queue-empty-sub { font-size: 15px; color: var(--fg-dim); max-width: 360px; margin: 0 auto; }

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

.email-meta {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.email-person {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 17px;
  color: var(--fg);
}

.email-company {
  font-size: 14px;
  color: var(--fg-dim);
}

.email-subject {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 16px;
  color: var(--fg);
  margin-bottom: 12px;
}

.email-body {
  font-size: 15px;
  line-height: 1.7;
  color: var(--fg-dim);
  white-space: pre-wrap;
  margin-bottom: 20px;
}

.email-actions {
  display: flex;
  gap: 10px;
}

/* Buttons */
.btn-primary {
  padding: 10px 20px;
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: 8px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

.btn-primary:hover { background: var(--accent-dim); }

.btn-approve {
  padding: 8px 20px;
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: 8px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}

.btn-edit {
  padding: 8px 16px;
  background: var(--surface);
  color: var(--fg-dim);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
}

.btn-reject {
  padding: 8px 16px;
  background: transparent;
  color: var(--fg-dim);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
}

.btn-reject:hover { border-color: #ff4444; color: #ff4444; }

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

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

.modal {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 560px;
  padding: 0;
  overflow: hidden;
}

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

.modal-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 17px;
  color: var(--fg);
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--fg-dim);
  cursor: pointer;
}

form { padding: 24px; }

.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; color: var(--fg-dim); margin-bottom: 8px; }
.form-group input, .form-group textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 15px;
  outline: none;
}
.form-group input:focus, .form-group textarea:focus { border-color: var(--accent); }
.form-group textarea { resize: vertical; }

.form-actions { display: flex; justify-content: flex-end; }

/* Responsive */
@media (max-width: 700px) {
  .pipeline-stats { grid-template-columns: repeat(2, 1fr); }
  .dash-title-row { flex-direction: column; align-items: flex-start; gap: 16px; }
  .email-actions { flex-wrap: wrap; }
}