/* CRM Dashboard — Roofing Demo */

.crm-wrapper { max-width: 1200px; margin: 0 auto; padding: 0 60px 80px; }

/* ─── Pipeline Header ─── */
.pipeline-header { padding: 60px 0 40px; border-bottom: 1px solid var(--border); }
.pipeline-title-row { display: flex; align-items: baseline; gap: 32px; margin: 8px 0; }
.pipeline-title-row h1 { font-size: clamp(28px, 4vw, 44px); }
.pipeline-sub { font-size: 15px; color: var(--muted); margin-top: 8px; }
.pipeline-actions { display: flex; gap: 12px; margin-left: auto; }
.pipeline-actions .btn-ghost { font-size: 13px; }

/* ─── Pipeline Stages ─── */
.pipeline-stages { display: flex; align-items: stretch; gap: 0; padding: 40px 0; border-bottom: 1px solid var(--border); }
.stage-col { flex: 1; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.stage-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); background: rgba(245,240,232,0.03); }
.stage-name { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--fg); }
.stage-count { font-family: 'Playfair Display', serif; font-size: 24px; font-weight: 700; color: var(--accent); }
.stage-arrow { display: flex; align-items: center; padding: 0 16px; color: var(--muted); font-size: 20px; }
.stage-dropzone { min-height: 200px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }

/* ─── Lead Cards ─── */
.lead-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; cursor: grab; transition: border-color 0.15s, box-shadow 0.15s; }
.lead-card:hover { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-dim); }
.lead-card-name { font-weight: 600; font-size: 14px; margin-bottom: 4px; color: var(--fg); }
.lead-card-meta { font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 2px; }
.lead-card-email { font-size: 12px; color: var(--accent); }
.lead-card-actions { display: flex; gap: 6px; margin-top: 10px; }
.lead-card-actions button { font-size: 11px; padding: 4px 10px; border-radius: 3px; cursor: pointer; border: 1px solid var(--border); background: transparent; color: var(--fg); }
.lead-card-actions button:hover { border-color: var(--accent); color: var(--accent); }
.lead-card-badge { display: inline-block; font-size: 10px; padding: 2px 6px; border-radius: 2px; background: var(--accent-dim); color: var(--accent); text-transform: uppercase; letter-spacing: 0.08em; }

/* ─── Sequence Section ─── */
.sequence-section { padding: 48px 0; border-bottom: 1px solid var(--border); }
.sequence-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; }
.sequence-header h2 { font-size: 24px; }
.seq-status { font-size: 12px; color: var(--accent); background: var(--accent-dim); padding: 4px 12px; border-radius: 3px; }
.sequence-steps { display: flex; gap: 16px; }
.seq-step { flex: 1; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; position: relative; }
.seq-step-channel { font-size: 10px; text-transform: uppercase; letter-spacing: 0.15em; color: var(--muted); margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.seq-step-num { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; background: var(--accent-dim); color: var(--accent); font-size: 11px; font-weight: 700; }
.seq-step-subject { font-size: 15px; font-weight: 600; color: var(--fg); margin-bottom: 10px; line-height: 1.3; }
.seq-step-body { font-size: 13px; color: var(--muted); line-height: 1.6; margin-bottom: 14px; }
.seq-step-delay { font-size: 11px; color: var(--accent); }
.seq-step-sent { font-size: 12px; color: #4ade80; }
.seq-step-icon { position: absolute; top: 16px; right: 16px; font-size: 18px; }

/* ─── Chatbot Preview ─── */
.chatbot-preview { padding: 48px 0; }
.chatbot-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; }
.chatbot-header h2 { font-size: 24px; }
.chatbot-demo { display: flex; flex-direction: column; gap: 16px; max-width: 600px; }
.chat-window { background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; padding: 20px; min-height: 140px; display: flex; flex-direction: column; gap: 12px; }
.chat-msg { display: flex; gap: 12px; align-items: flex-start; }
.bot-msg .chat-bubble { background: #1e1e1e; border: 1px solid var(--border); border-radius: 12px 12px 12px 4px; padding: 12px 16px; max-width: 85%; }
.bot-msg .chat-bubble p { font-size: 14px; line-height: 1.5; color: var(--fg); margin: 0; }
.chat-avatar { font-size: 18px; }
.chat-time { display: block; font-size: 11px; color: var(--muted); margin-top: 4px; }
.chat-input-bar { display: flex; align-items: center; gap: 12px; }
.chat-input-bar input { flex: 1; background: var(--bg-card); border: 1px solid var(--border); border-radius: 24px; padding: 10px 16px; color: var(--fg); font-size: 14px; }
.chat-hint { font-size: 12px; color: var(--muted); }
.chat-hint a { color: var(--accent); }

/* ─── Buttons ─── */
.btn-primary { background: var(--accent); color: #0d0d0d; font-weight: 600; font-size: 13px; padding: 8px 18px; border-radius: var(--radius); border: none; cursor: pointer; transition: opacity 0.15s; }
.btn-primary:hover { opacity: 0.85; }
.btn-ghost { background: transparent; color: var(--muted); font-size: 13px; padding: 8px 14px; border-radius: var(--radius); border: 1px solid var(--border); cursor: pointer; text-decoration: none; display: inline-block; }
.btn-ghost:hover { border-color: var(--fg); color: var(--fg); }

/* ─── Modal ─── */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.7); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal-box { background: var(--bg-card); border: 1px solid var(--border); border-radius: 6px; padding: 32px; max-width: 560px; width: 90%; }
.modal-box h3 { font-size: 20px; margin-bottom: 24px; }
#lead-form { display: flex; flex-direction: column; gap: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
input, select { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 12px; color: var(--fg); font-size: 14px; width: 100%; }
input:focus, select:focus { outline: none; border-color: var(--accent); }
.checkbox-label { flex-direction: row; align-items: center; font-size: 13px; color: var(--fg); text-transform: none; letter-spacing: 0; }
.checkbox-label input { width: auto; }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 8px; }

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .crm-wrapper { padding: 0 24px 60px; }
  .pipeline-stages { flex-direction: column; gap: 12px; }
  .stage-arrow { display: none; }
  .form-row { grid-template-columns: 1fr; }
  .sequence-steps { flex-direction: column; }
  .pipeline-actions { flex-direction: column; }
}