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

/* ── Top nav ─────────────────────────────────────────────────────────── */
.dash-nav {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.dash-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dash-nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
  background: var(--accent);
  color: var(--white);
  border-radius: 8px;
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.02em;
}

.brand-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--fg);
}

.dash-nav-links {
  display: flex;
  gap: 8px;
}

.nav-link {
  padding: 6px 14px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--fg-muted);
  transition: background 0.15s, color 0.15s;
}

.nav-link:hover { background: var(--bg-warm); color: var(--fg); }
.nav-link.active { background: var(--teal-light); color: var(--teal); font-weight: 600; }

/* ── Follow-up banner ────────────────────────────────────────────────── */
.followup-banner {
  background: linear-gradient(135deg, #FFF8ED 0%, #FEF3DC 100%);
  border-bottom: 1px solid var(--accent-light);
}

.followup-banner-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--accent-dark);
  flex-wrap: wrap;
}

.followup-icon { font-size: 1rem; }
.followup-names { color: var(--fg-muted); }

.followup-btn {
  margin-left: auto;
  padding: 5px 14px;
  background: var(--accent);
  color: var(--white);
  border: none;
  border-radius: 100px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.followup-btn:hover { background: var(--accent-dark); }

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

/* ── Page header ─────────────────────────────────────────────────────── */
.dash-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
  flex-wrap: wrap;
}

.dash-title {
  font-family: 'Fraunces', serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--fg);
  line-height: 1.2;
}

.dash-subtitle {
  font-size: 0.95rem;
  color: var(--fg-muted);
  margin-top: 4px;
}

/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn-primary {
  padding: 10px 20px;
  background: var(--accent);
  color: var(--white);
  border: none;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  white-space: nowrap;
}
.btn-primary:hover { background: var(--accent-dark); }
.btn-primary:active { transform: scale(0.98); }

.btn-ghost {
  padding: 10px 20px;
  background: transparent;
  color: var(--fg-muted);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-ghost:hover { background: var(--bg-warm); }

/* ── Pipeline strip ──────────────────────────────────────────────────── */
.pipeline-strip {
  display: flex;
  gap: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
}

.pipeline-step {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  border-right: 1px solid var(--border);
  position: relative;
  transition: background 0.15s;
}
.pipeline-step:last-child { border-right: none; }
.pipeline-step:hover { background: var(--bg); }
.pipeline-step.active { background: var(--teal-light); }

.pipeline-count {
  font-family: 'Fraunces', serif;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
}
.pipeline-label {
  font-size: 0.75rem;
  color: var(--fg-muted);
  font-weight: 500;
  text-align: center;
}
.pipeline-arrow {
  position: absolute;
  right: -1px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--border);
  font-size: 1.2rem;
  z-index: 1;
  pointer-events: none;
}
.pipeline-total .pipeline-arrow { display: none; }

/* Pipeline count colors */
.pipeline-teal   { color: var(--teal); }
.pipeline-accent { color: var(--accent); }
.pipeline-amber  { color: #D4A017; }
.pipeline-blue   { color: #4A7CB4; }
.pipeline-green  { color: #4A9E5C; }
.pipeline-gold   { color: var(--accent-dark); }
.pipeline-muted  { color: var(--fg-muted); }

/* ── Table card ──────────────────────────────────────────────────────── */
.table-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.table-toolbar {
  padding: 16px 20px;
  display: flex;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 200px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  background: var(--white);
  color: var(--fg);
  outline: none;
  transition: border-color 0.15s;
}
.search-input:focus { border-color: var(--accent); }

.status-select {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  background: var(--white);
  color: var(--fg);
  cursor: pointer;
  outline: none;
}

/* ── Table ───────────────────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; }

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

.leads-table th {
  padding: 10px 14px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--fg-muted);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.leads-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--fg);
}

.lead-row:last-child td { border-bottom: none; }
.lead-row:hover td { background: #FFFDF9; }

.lead-name { font-weight: 600; }
.lead-name-text { margin-right: 4px; }
.lead-note-indicator { cursor: pointer; font-size: 0.85rem; }

.phone-link {
  color: var(--teal);
  text-decoration: none;
  font-weight: 500;
}
.phone-link:hover { text-decoration: underline; }

.text-muted { color: var(--border); font-style: italic; font-size: 0.85rem; }

/* ── Status pill (inline select) ─────────────────────────────────────── */
.status-pill {
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  outline: none;
}

.status-new       { background: var(--teal-light);              color: var(--teal); }
.status-contacted { background: rgba(196,136,58,0.12);          color: var(--accent-dark); }
.status-quoted    { background: rgba(212,160,23,0.12);          color: #8B6A0A; }
.status-applied   { background: rgba(74,124,180,0.12);          color: #2A5A9A; }
.status-approved  { background: rgba(74,158,92,0.12);           color: #2A7A40; }
.status-placed    { background: rgba(154,106,42,0.15);          color: var(--accent-dark); }

/* ── Touch button ────────────────────────────────────────────────────── */
.touch-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--fg-muted);
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.touch-btn:hover { background: var(--teal-light); color: var(--teal); border-color: var(--teal); }

.touch-count { font-weight: 700; font-size: 0.85rem; }

/* ── Follow-up date ──────────────────────────────────────────────────── */
.followup-date { font-size: 0.85rem; color: var(--fg-muted); }
.followup-date.overdue { color: #C0392B; font-weight: 600; }

/* ── Action buttons ──────────────────────────────────────────────────── */
.actions-cell { white-space: nowrap; }

.action-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
  border-radius: 6px;
  font-size: 1rem;
  transition: background 0.15s;
  opacity: 0.6;
}
.action-btn:hover { opacity: 1; }
.edit-btn:hover { background: var(--teal-light); }
.delete-btn:hover { background: rgba(192, 57, 43, 0.08); }

/* ── Empty state ─────────────────────────────────────────────────────── */
.empty-state {
  padding: 80px 24px;
  text-align: center;
}
.empty-icon { font-size: 3rem; margin-bottom: 16px; }
.empty-state h3 {
  font-family: 'Fraunces', serif;
  font-size: 1.4rem;
  color: var(--fg);
  margin-bottom: 8px;
}
.empty-state p { color: var(--fg-muted); margin-bottom: 24px; }

/* ── Modal ───────────────────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(44, 36, 23, 0.45);
  z-index: 500;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--white);
  border-radius: 16px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(44, 36, 23, 0.18);
}

.modal-header {
  padding: 24px 28px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-family: 'Fraunces', serif;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--fg);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--fg-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s;
}
.modal-close:hover { background: var(--bg); }

/* ── Form ────────────────────────────────────────────────────────────── */
#leadForm { padding: 24px 28px; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full-width { margin-bottom: 0; }

.form-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-group.required label::after { content: ' *'; color: var(--accent); }

.form-group input,
.form-group select,
.form-group textarea {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: 'DM Sans', sans-serif;
  color: var(--fg);
  background: var(--white);
  outline: none;
  transition: border-color 0.15s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--accent); }

.form-group textarea { resize: vertical; }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  margin-top: 20px;
}

/* ── Sidebar (future expansion) ──────────────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(44, 36, 23, 0.35);
  z-index: 400;
}
.sidebar-overlay.open { display: block; }

.sidebar {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  width: 360px;
  background: var(--white);
  box-shadow: -8px 0 32px rgba(44, 36, 23, 0.12);
  padding: 24px;
  overflow-y: auto;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.sidebar-header h3 {
  font-family: 'Fraunces', serif;
  font-size: 1.2rem;
  color: var(--fg);
}

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .pipeline-strip {
    flex-wrap: wrap;
  }
  .pipeline-step {
    flex: 0 0 calc(33.33% - 1px);
    border-bottom: 1px solid var(--border);
  }
  .pipeline-arrow { display: none; }

  .form-grid { grid-template-columns: 1fr; }

  .dash-header { flex-direction: column; }
  .dash-header .btn-primary { align-self: flex-start; }

  .leads-table th:nth-child(4),
  .leads-table td:nth-child(4),
  .leads-table th:nth-child(8),
  .leads-table td:nth-child(8) { display: none; }
}
