/* ========== APP SHELL ========== */
.app-body {
  display: flex;
  min-height: 100vh;
  background: var(--bg-primary);
}

/* ========== SIDEBAR ========== */
.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
}

.brand-mark {
  font-size: 22px;
  color: var(--gold);
  line-height: 1;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: background 0.15s, color 0.15s;
}

.nav-item:hover {
  background: rgba(255,255,255,0.04);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--gold-glow);
  color: var(--gold-light);
  border: 1px solid rgba(212, 160, 67, 0.18);
}

.sidebar-client {
  margin: 0 12px;
  padding: 12px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.sidebar-client-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.sidebar-client-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.3;
}

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

.sidebar-hint {
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}
.sidebar-hint:hover { color: var(--text-secondary); }

/* ========== MAIN CONTENT ========== */
.app-main {
  flex: 1;
  min-width: 0;
  padding: 0 32px 40px;
  max-width: 980px;
}

.app-main--wide {
  max-width: 1200px;
  padding: 0 24px 40px;
}

/* ========== TOPBAR ========== */
.app-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 0 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
  gap: 16px;
}

.topbar-left {
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.page-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text-primary);
}

.topbar-client {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 400;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 8px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
  line-height: 1;
  white-space: nowrap;
}

.btn-primary {
  background: var(--gold);
  color: #0a0a0f;
  border-color: var(--gold);
}
.btn-primary:hover {
  background: var(--gold-light);
  border-color: var(--gold-light);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}
.btn-ghost:hover {
  background: rgba(255,255,255,0.04);
  color: var(--text-primary);
  border-color: rgba(255,255,255,0.1);
}

.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 13px 28px; font-size: 16px; }
.btn-full { width: 100%; justify-content: center; }

/* ========== KPI STRIP ========== */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}

.kpi-card {
  padding: 20px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  transition: border-color 0.2s;
}
.kpi-card:hover { border-color: rgba(212, 160, 67, 0.15); }

.kpi-num {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
  margin-bottom: 6px;
}
.kpi-gold { color: var(--gold); }
.kpi-green { color: #3dbb6e; }
.kpi-muted { color: var(--text-muted); }

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

/* ========== FUNNEL ========== */
.funnel-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 28px;
}

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

.section-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.section-action {
  font-size: 13px;
  color: var(--gold-dim);
  text-decoration: none;
  transition: color 0.15s;
}
.section-action:hover { color: var(--gold); }

.funnel-bars { display: flex; flex-direction: column; gap: 12px; }

.funnel-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.funnel-label {
  font-size: 13px;
  color: var(--text-secondary);
  width: 80px;
  flex-shrink: 0;
}

.funnel-track {
  flex: 1;
  height: 8px;
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
  overflow: hidden;
}

.funnel-fill {
  height: 100%;
  border-radius: 4px;
  min-width: 2px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.funnel-count {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  width: 28px;
  text-align: right;
}

/* ========== DASHBOARD GRID ========== */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 20px;
}

.dash-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

/* ========== LEADS LIST ========== */
.leads-list { display: flex; flex-direction: column; gap: 2px; }

.lead-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  border-radius: 8px;
  transition: background 0.15s;
  cursor: default;
}
.lead-row:hover { background: rgba(255,255,255,0.025); }

.lead-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

.lead-info { flex: 1; min-width: 0; }

.lead-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lead-anon { color: var(--text-muted); font-style: italic; font-weight: 400; }

.lead-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px;
}

.lead-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.stage-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 100px;
  border: 1px solid;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.score-badge {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  min-width: 28px;
  text-align: right;
}

/* ========== ACTIVITY FEED ========== */
.activity-feed { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }

.activity-item { display: flex; align-items: flex-start; gap: 12px; }

.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}

.activity-content { flex: 1; }

.activity-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.activity-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ========== PROFILE CARD ========== */
.profile-card {
  margin-top: 20px;
  padding: 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.profile-card-title {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.profile-field {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  gap: 12px;
}
.profile-field:last-of-type { border-bottom: none; }

.field-label { font-size: 12px; color: var(--text-muted); }
.field-val { font-size: 13px; color: var(--text-secondary); font-weight: 500; text-align: right; text-transform: capitalize; }

.mt-12 { margin-top: 12px; }
.mt-20 { margin-top: 20px; }

/* ========== KANBAN ========== */
.kanban {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  align-items: start;
}

.kanban-col {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.kanban-col-header {
  padding: 16px 16px 12px;
  border-top: 3px solid;
  border-bottom: 1px solid var(--border);
}

.kanban-col-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.col-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.col-count {
  margin-left: auto;
  background: rgba(255,255,255,0.06);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 100px;
}

.kanban-col-sub {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.kanban-cards {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 100px;
}

.kanban-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  font-size: 13px;
  color: var(--text-muted);
  border: 1px dashed rgba(255,255,255,0.06);
  border-radius: 8px;
}

.kanban-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  transition: border-color 0.2s, transform 0.15s;
}
.kanban-card:hover {
  border-color: rgba(212,160,67,0.15);
  transform: translateY(-1px);
}

.kcard-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}

.kcard-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.kcard-info { flex: 1; min-width: 0; }

.kcard-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}
.kcard-anon { color: var(--text-muted); font-weight: 400; font-style: italic; }

.kcard-loc { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.kcard-score {
  flex-shrink: 0;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
}

/* Score ring — CSS custom property trick */
.score-ring {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: conic-gradient(var(--score-color, #6b6560) calc(var(--score-pct, 0%) * 3.6 / 3.6), rgba(255,255,255,0.05) 0);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.score-ring::before {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-card);
}
.score-ring span {
  position: relative;
  z-index: 1;
  font-size: 11px;
  font-weight: 700;
}

.kcard-notes {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 10px;
  padding: 8px 10px;
  background: rgba(255,255,255,0.02);
  border-radius: 6px;
  border-left: 2px solid rgba(212,160,67,0.2);
}

.kcard-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.contact-chip {
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 8px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kcard-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.04);
}

.btn-advance {
  flex: 1;
  padding: 6px 10px;
  background: var(--gold-glow);
  color: var(--gold-light);
  border: 1px solid rgba(212,160,67,0.2);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.btn-advance:hover { background: rgba(212,160,67,0.2); }

.btn-disqualify {
  padding: 6px 8px;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-disqualify:hover { background: rgba(255,80,80,0.08); color: #ff5050; border-color: rgba(255,80,80,0.2); }

/* ========== INTAKE FORM ========== */
.intake-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 28px;
  align-items: start;
}

.intake-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
}

.intake-form { display: flex; flex-direction: column; gap: 28px; }

.form-section { display: flex; flex-direction: column; gap: 16px; }

.form-section-title {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.form-group { display: flex; flex-direction: column; gap: 7px; }

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

.form-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

.required { color: var(--gold-dim); }

.form-input {
  background: var(--bg-secondary);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 15px;
  padding: 11px 14px;
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
}

.form-input:focus {
  border-color: rgba(212, 160, 67, 0.4);
  box-shadow: 0 0 0 3px rgba(212, 160, 67, 0.08);
}

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

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b6560' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
  cursor: pointer;
}

.form-textarea { resize: vertical; min-height: 100px; }

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.form-error {
  background: rgba(255, 80, 80, 0.08);
  border: 1px solid rgba(255, 80, 80, 0.2);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 14px;
  color: #ff6b6b;
  margin-bottom: 8px;
}

.form-submit { padding-top: 4px; }

/* ========== INTAKE INFO COL ========== */
.intake-info-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.info-badge {
  display: inline-block;
  padding: 4px 12px;
  background: var(--gold-glow);
  border: 1px solid rgba(212, 160, 67, 0.2);
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--gold-light);
  margin-bottom: 20px;
}

.info-steps { display: flex; flex-direction: column; gap: 20px; }

.info-step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.info-step-num {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--gold-dim);
  flex-shrink: 0;
  line-height: 1.2;
  padding-top: 1px;
}

.info-step-content { flex: 1; }

.info-step-content strong {
  display: block;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.info-step-content p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ========== SUCCESS / EMPTY STATES ========== */
.success-state, .empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 80px 40px;
  max-width: 480px;
  margin: 0 auto;
}

.success-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(61, 187, 110, 0.12);
  color: #3dbb6e;
  font-size: 28px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  border: 1px solid rgba(61, 187, 110, 0.2);
}

.empty-icon {
  font-size: 40px;
  color: var(--gold-dim);
  margin-bottom: 20px;
  opacity: 0.5;
}

.success-state h2, .empty-state h2 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.success-state p, .empty-state p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 28px;
}

.success-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

.empty-text {
  font-size: 13px;
  color: var(--text-muted);
  padding: 20px 0;
  font-style: italic;
}

/* ========== SELECT INPUT ========== */
.select-input {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 13px;
  padding: 7px 28px 7px 12px;
  outline: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236b6560' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  -webkit-appearance: none;
  appearance: none;
}
.select-input:focus { border-color: rgba(212,160,67,0.3); }

/* ========== RESPONSIVE ========== */
@media (max-width: 1100px) {
  .kanban { grid-template-columns: repeat(2, 1fr); }
  .kpi-strip { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .intake-layout { grid-template-columns: 1fr; }
  .app-main { padding: 0 20px 40px; }
}

@media (max-width: 720px) {
  .sidebar { display: none; }
  .kpi-strip { grid-template-columns: repeat(2, 1fr); }
  .kanban { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .app-topbar { flex-direction: column; align-items: flex-start; gap: 12px; }
}
