/* ============================================
   SocialMeLab - Client Command Center
   Brand: Dark theme with teal/green accent
   ============================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg-dark: #0a0a0f;
  --bg-surface: #101018;
  --bg-card: #14141e;
  --bg-card-hover: #1a1a28;
  --bg-input: #1a1a26;
  --accent: #00d4aa;
  --accent-hover: #00e8bb;
  --accent-dim: rgba(0, 212, 170, 0.10);
  --accent-border: rgba(0, 212, 170, 0.20);
  --purple: #5a3cdc;
  --purple-dim: rgba(90, 60, 220, 0.10);
  --text-primary: #e8e8ed;
  --text-secondary: #8a8a9a;
  --text-muted: #555566;
  --border: rgba(255,255,255,0.06);
  --border-strong: rgba(255,255,255,0.10);
  --danger: #ff4757;
  --danger-dim: rgba(255, 71, 87, 0.10);
  --warning: #ffa502;
  --warning-dim: rgba(255, 165, 2, 0.10);
  --success: #2ed573;
  --success-dim: rgba(46, 213, 115, 0.10);
  --blue: #3498db;
  --blue-dim: rgba(52, 152, 219, 0.10);
  --sidebar-w: 240px;
  --topbar-h: 60px;
  --radius: 10px;
  --radius-sm: 6px;
}

html, body {
  height: 100%;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.5;
}

h1, h2, h3, h4, h5 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
}

/* ---- Layout ---- */
body {
  display: flex;
  min-height: 100vh;
}

/* ---- Sidebar ---- */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform 0.25s ease;
}

.sidebar-header {
  padding: 1.25rem 1.25rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
}

.sidebar-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s;
  cursor: pointer;
}

.nav-item:hover {
  background: var(--accent-dim);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--accent-dim);
  color: var(--accent);
}

.nav-item.active svg { stroke: var(--accent); }

.nav-item-muted { color: var(--text-muted); }
.nav-item-muted:hover { color: var(--text-secondary); }

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

/* ---- Main ---- */
.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  height: var(--topbar-h);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  background: var(--bg-surface);
  position: sticky;
  top: 0;
  z-index: 50;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
}

.page-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.75rem;
  transition: border-color 0.2s;
}

.search-box:focus-within {
  border-color: var(--accent-border);
}

.search-box svg { color: var(--text-muted); flex-shrink: 0; }

.search-box input {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 0.85rem;
  width: 180px;
  outline: none;
  font-family: inherit;
}

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

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  transition: all 0.15s;
  white-space: nowrap;
}

.btn:hover { background: var(--bg-card-hover); border-color: var(--border-strong); }

.btn-primary {
  background: var(--accent);
  color: #0a0a0f;
  border-color: var(--accent);
  font-weight: 600;
}

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

.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.8rem; }

.btn-danger { color: var(--danger); border-color: var(--danger-dim); }
.btn-danger:hover { background: var(--danger-dim); }

.btn-ghost { background: none; border: none; }
.btn-ghost:hover { background: var(--accent-dim); }

/* ---- Views ---- */
.view-container {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
}

.view { display: none; }
.view.active { display: block; }

/* ---- Stats Grid ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}

.stat-card .stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.stat-card .stat-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
}

/* ---- Card ---- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.card-header h3 {
  font-size: 0.9rem;
  font-weight: 600;
}

/* ---- Dashboard Grid ---- */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

/* ---- Pipeline Visual ---- */
.pipeline-visual {
  padding: 1.25rem;
}

.pipeline-stage-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0;
}

.pipeline-stage-row + .pipeline-stage-row {
  border-top: 1px solid var(--border);
}

.pipeline-stage-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  width: 90px;
  text-transform: capitalize;
}

.pipeline-bar-track {
  flex: 1;
  height: 28px;
  background: var(--bg-dark);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.pipeline-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
  min-width: 2px;
}

.pipeline-bar-fill.stage-new { background: linear-gradient(90deg, #3498db, #2980b9); }
.pipeline-bar-fill.stage-contacted { background: linear-gradient(90deg, #f39c12, #e67e22); }
.pipeline-bar-fill.stage-qualified { background: linear-gradient(90deg, #9b59b6, #8e44ad); }
.pipeline-bar-fill.stage-closed { background: linear-gradient(90deg, var(--accent), #00b894); }

.pipeline-stage-count {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  width: 36px;
  text-align: right;
  color: var(--text-primary);
}

/* ---- Activity Feed ---- */
.activity-list {
  max-height: 340px;
  overflow-y: auto;
}

.activity-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}

.activity-item:hover { background: var(--bg-card-hover); }
.activity-item:last-child { border-bottom: none; }

.activity-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.activity-icon.lead_created { background: var(--blue-dim); color: var(--blue); }
.activity-icon.stage_changed { background: var(--purple-dim); color: var(--purple); }
.activity-icon.outreach_sent { background: var(--warning-dim); color: var(--warning); }
.activity-icon.outreach_updated { background: var(--success-dim); color: var(--success); }
.activity-icon.task_created { background: var(--accent-dim); color: var(--accent); }
.activity-icon.task_updated { background: var(--success-dim); color: var(--success); }
.activity-icon.lead_deleted { background: var(--danger-dim); color: var(--danger); }

.activity-text {
  flex: 1;
  min-width: 0;
}

.activity-detail {
  font-size: 0.82rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.activity-empty, .deadline-empty {
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ---- Deadlines ---- */
.deadlines-card {
  margin-bottom: 1.5rem;
}

.deadline-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

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

.deadline-date {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--bg-dark);
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  color: var(--text-secondary);
}

.deadline-date.overdue {
  background: var(--danger-dim);
  color: var(--danger);
}

.deadline-date.soon {
  background: var(--warning-dim);
  color: var(--warning);
}

.deadline-info { flex: 1; }

.deadline-title {
  font-size: 0.85rem;
  font-weight: 500;
}

.deadline-client {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ---- Pipeline Board (Kanban) ---- */
.pipeline-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  min-height: calc(100vh - var(--topbar-h) - 4rem);
}

.pipeline-column {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
}

.column-header {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.column-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.column-title.stage-new { color: var(--blue); }
.column-title.stage-contacted { color: var(--warning); }
.column-title.stage-qualified { color: #9b59b6; }
.column-title.stage-closed { color: var(--accent); }

.column-count {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--bg-dark);
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: var(--text-secondary);
}

.column-body {
  flex: 1;
  padding: 0.75rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pipeline-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  cursor: pointer;
  transition: all 0.15s;
}

.pipeline-card:hover {
  border-color: var(--accent-border);
  transform: translateY(-1px);
}

.pipeline-card-name {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.pipeline-card-contact {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.pipeline-card-services {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.5rem;
}

.service-tag {
  font-size: 0.65rem;
  padding: 0.15rem 0.45rem;
  border-radius: 3px;
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 500;
}

/* ---- Leads Table ---- */
.leads-toolbar {
  margin-bottom: 1rem;
}

.filter-chips {
  display: flex;
  gap: 0.5rem;
}

.chip {
  padding: 0.4rem 0.85rem;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  transition: all 0.15s;
}

.chip:hover { border-color: var(--border-strong); color: var(--text-primary); }
.chip.active { background: var(--accent-dim); border-color: var(--accent-border); color: var(--accent); }

.leads-table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.leads-table {
  width: 100%;
  border-collapse: collapse;
}

.leads-table th {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: left;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
}

.leads-table td {
  padding: 0.85rem 1rem;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.leads-table tbody tr {
  cursor: pointer;
  transition: background 0.15s;
}

.leads-table tbody tr:hover { background: var(--bg-card-hover); }
.leads-table tbody tr:last-child td { border-bottom: none; }

.lead-name-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lead-business {
  font-weight: 600;
  color: var(--text-primary);
}

.lead-source {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.stage-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: capitalize;
}

.stage-badge.new { background: var(--blue-dim); color: var(--blue); }
.stage-badge.contacted { background: var(--warning-dim); color: var(--warning); }
.stage-badge.qualified { background: var(--purple-dim); color: #9b59b6; }
.stage-badge.closed { background: var(--success-dim); color: var(--success); }

.empty-state {
  padding: 3rem;
  text-align: center;
  color: var(--text-muted);
}

.empty-state p { margin-top: 1rem; font-size: 0.9rem; }

/* ---- Lead Detail ---- */
.detail-header {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.detail-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.detail-name {
  font-size: 1.5rem;
  font-weight: 700;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.detail-meta-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.detail-meta-item svg { width: 14px; height: 14px; color: var(--text-muted); }

.detail-notes {
  font-size: 0.85rem;
  color: var(--text-secondary);
  background: var(--bg-dark);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  margin-top: 0.75rem;
  line-height: 1.6;
  white-space: pre-wrap;
}

.detail-services {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.detail-service-tag {
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-weight: 500;
}

.detail-service-tag.interested {
  background: var(--blue-dim);
  color: var(--blue);
}

.detail-service-tag.sold {
  background: var(--success-dim);
  color: var(--success);
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* ---- Outreach List ---- */
.outreach-item {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

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

.outreach-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}

.outreach-type {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  background: var(--accent-dim);
  color: var(--accent);
}

.outreach-date {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.outreach-subject {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.outreach-body-preview {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.outreach-footer {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.response-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  text-transform: capitalize;
}

.response-badge.no_reply { background: var(--bg-dark); color: var(--text-muted); }
.response-badge.responded { background: var(--success-dim); color: var(--success); }
.response-badge.follow_up_needed { background: var(--warning-dim); color: var(--warning); }
.response-badge.bounced { background: var(--danger-dim); color: var(--danger); }

.outreach-followup {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.outreach-notes {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
  font-style: italic;
}

/* ---- Tasks List ---- */
.task-item {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

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

.task-check {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  border: 2px solid var(--border-strong);
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 2px;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.task-check:hover { border-color: var(--accent); }

.task-check.completed {
  background: var(--accent);
  border-color: var(--accent);
}

.task-check.completed::after {
  content: '';
  width: 6px;
  height: 10px;
  border: 2px solid #0a0a0f;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translateY(-1px);
}

.task-check.in_progress {
  border-color: var(--warning);
  background: var(--warning-dim);
}

.task-body { flex: 1; min-width: 0; }

.task-title {
  font-size: 0.85rem;
  font-weight: 500;
}

.task-title.completed {
  text-decoration: line-through;
  color: var(--text-muted);
}

.task-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.3rem;
}

.task-priority {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
}

.task-priority.high { background: var(--danger-dim); color: var(--danger); }
.task-priority.medium { background: var(--warning-dim); color: var(--warning); }
.task-priority.low { background: var(--bg-dark); color: var(--text-muted); }

.task-deadline {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.task-deliverables {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 0.3rem;
}

.task-actions {
  display: flex;
  gap: 0.3rem;
  flex-shrink: 0;
}

.task-action-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.15s;
}

.task-action-btn:hover { background: var(--bg-dark); color: var(--text-primary); }

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

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

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  width: 95%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-size: 1rem;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}

.modal-close:hover { color: var(--text-primary); }

.modal-body { padding: 1.5rem; }

/* ---- Form ---- */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.55rem 0.75rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

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

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

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238a8a9a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.form-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.35rem;
}

.form-tag {
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  background: var(--accent-dim);
  color: var(--accent);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
}

.form-tag:hover { border-color: var(--accent-border); }
.form-tag.selected { background: var(--accent); color: #0a0a0f; }

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* ---- Toast ---- */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1.25rem;
  font-size: 0.85rem;
  color: var(--text-primary);
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
  animation: slideIn 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toast.success { border-left: 3px solid var(--accent); }
.toast.error { border-left: 3px solid var(--danger); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ---- Mobile ---- */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open { transform: translateX(0); }

  .main { margin-left: 0; }

  .menu-toggle { display: block; }

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

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

  .pipeline-board {
    grid-template-columns: 1fr;
  }

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

  .search-box { display: none; }

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

@media (max-width: 1024px) {
  .pipeline-board {
    grid-template-columns: repeat(2, 1fr);
  }
}
