/* ── Variables ──────────────────────────────────────── */
:root {
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, .3);
  --secondary: #0ea5e9;
  --secondary-hover: #0284c7;
  --success: #10b981;
  --success-hover: #059669;
  --accent: #f43f5e;
  --bg: #060c1a;
  --surface: rgba(15, 23, 42, .7);
  --card: rgba(20, 30, 50, .8);
  --border: rgba(255, 255, 255, .07);
  --border-active: rgba(99, 102, 241, .5);
  --text: #f1f5f9;
  --text-light: #94a3b8;
  --text-muted: #475569;
  --radius: 16px;
  --radius-lg: 22px;
  --shadow: 0 25px 50px -12px rgba(0, 0, 0, .6);
  --hot: #ef4444;
  --warm: #f59e0b;
  --cold: #3b82f6
}

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

html {
  scroll-behavior: smooth
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 10% -10%, rgba(99, 102, 241, .15) 0%, transparent 60%), radial-gradient(ellipse 60% 50% at 90% 110%, rgba(14, 165, 233, .12) 0%, transparent 60%), radial-gradient(ellipse 40% 40% at 50% 50%, rgba(244, 63, 94, .04) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255, 255, 255, .025) 1px, transparent 1px);
  background-size: 44px 44px;
  pointer-events: none;
  z-index: 0
}

.page-wrap {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh
}

/* ── Topbar ────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(6, 12, 26, .9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px
}

.topbar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0
}

.logo-text {
  font-weight: 800;
  font-size: 1.1rem
}

.logo-imob {
  color: var(--text)
}

.topbar-title {
  font-weight: 700;
  font-size: .95rem;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 8px
}

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

.btn-back {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text-light);
  padding: 8px 16px;
  border-radius: 10px;
  font-size: .82rem;
  font-weight: 600;
  text-decoration: none;
  transition: all .2s
}

.btn-back:hover {
  background: rgba(99, 102, 241, .12);
  border-color: rgba(99, 102, 241, .3);
  color: var(--text)
}

/* ── Main ──────────────────────────────────────────── */
.main {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 28px 72px;
  width: 100%
}

/* ── CRM Mode Toggle ──────────────────────────────── */
.crm-mode-toggle-wrap {
  margin-bottom: 28px;
  display: flex;
  justify-content: center
}

.crm-mode-toggle {
  display: flex;
  background: rgba(0, 0, 0, .3);
  padding: 4px;
  border-radius: 14px;
  border: 1px solid var(--border);
  gap: 4px;
  position: relative;
  overflow: hidden
}

.crm-mode-btn {
  padding: 10px 24px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .3s;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  position: relative;
  z-index: 1
}

.crm-mode-btn.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #fff;
  box-shadow: 0 4px 20px var(--primary-glow)
}

.crm-mode-btn:not(.active):hover {
  color: var(--text-light);
  background: rgba(255, 255, 255, .04)
}

.crm-mode-btn.active[data-mode="vendas"] {
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 4px 20px rgba(16, 185, 129, .3)
}

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

.page-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(99, 102, 241, .1);
  border: 1px solid rgba(99, 102, 241, .22);
  padding: 5px 14px;
  border-radius: 9999px;
  font-size: .72rem;
  font-weight: 700;
  color: #818cf8;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 14px
}

.page-label.vendas {
  background: rgba(16, 185, 129, .1);
  border-color: rgba(16, 185, 129, .22);
  color: #34d399
}

.page-title {
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1.1;
  background: linear-gradient(to right, #f1f5f9, #94a3b8);
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 10px
}

.page-subtitle {
  color: var(--text-light);
  font-size: .95rem;
  max-width: 540px
}

/* ── Stats strip ───────────────────────────────────── */
.crm-stats-strip {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 24px
}

.crm-stat-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 16px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-light);
  transition: all .2s
}

.crm-stat-chip:hover {
  border-color: rgba(99, 102, 241, .2)
}

.crm-stat-chip .stat-value {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text)
}

.crm-stat-chip .stat-label {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  opacity: .7
}

.crm-stat-chip.highlight {
  background: linear-gradient(135deg, rgba(99, 102, 241, .12), rgba(14, 165, 233, .08));
  border-color: rgba(99, 102, 241, .25)
}

/* ── Toolbar ───────────────────────────────────────── */
.crm-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap
}

.crm-toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap
}

.crm-toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px
}

.crm-search-wrap {
  position: relative;
  width: 260px
}

.crm-search-wrap input {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 14px 9px 36px;
  color: var(--text);
  font-family: inherit;
  font-size: .85rem;
  font-weight: 500;
  transition: all .2s
}

.crm-search-wrap input:focus {
  outline: none;
  border-color: rgba(99, 102, 241, .5);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .1)
}

.crm-search-wrap .search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none
}

/* ── Filter chips ──────────────────────────────────── */
.crm-filter-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap
}

.crm-filter-chip {
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: .75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s
}

.crm-filter-chip:hover {
  border-color: rgba(255, 255, 255, .15);
  color: var(--text-light)
}

.crm-filter-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff
}

.crm-filter-chip.active.hot {
  background: var(--hot);
  border-color: var(--hot)
}

.crm-filter-chip.active.warm {
  background: var(--warm);
  border-color: var(--warm);
  color: #000
}

.crm-filter-chip.active.cold {
  background: var(--cold);
  border-color: var(--cold)
}

/* ── View tabs ─────────────────────────────────────── */
.crm-view-tabs {
  display: flex;
  background: rgba(0, 0, 0, .15);
  padding: 3px;
  border-radius: 10px;
  border: 1px solid var(--border)
}

.crm-view-tab {
  padding: 7px 14px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
  display: flex;
  align-items: center;
  gap: 5px
}

.crm-view-tab.active {
  background: var(--primary);
  color: #fff
}

.btn-crm-add {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #fff;
  border: none;
  padding: 9px 18px;
  border-radius: 10px;
  font-family: inherit;
  font-size: .83rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .3s;
  display: flex;
  align-items: center;
  gap: 7px;
  box-shadow: 0 4px 15px var(--primary-glow)
}

.btn-crm-add:hover {
  transform: translateY(-1px);
  filter: brightness(1.1)
}

/* ── Kanban Board ─────────────────────────────────── */
.kanban-board {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 20px;
  min-height: 100vh;
  align-items: flex-start;
  cursor: grab;
  user-select: none;
}

.kanban-board.grabbing {
  cursor: grabbing;
}

.kanban-board.grabbing .lead-card {
  pointer-events: none;
}

.kanban-board::-webkit-scrollbar {
  height: 6px
}

.kanban-board::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, .02);
  border-radius: 3px
}

.kanban-board::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, .3);
  border-radius: 3px
}

.kanban-column {
  min-width: 290px;
  max-width: 330px;
  width: 100%;
  background: rgba(15, 23, 42, .5);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: all .2s
}

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

.kanban-column-title {
  font-size: .75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  display: flex;
  align-items: center;
  gap: 8px
}

.kanban-column-count {
  font-size: .68rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  color: var(--text-muted)
}

.kanban-column-body {
  padding: 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 100px;
  overflow-y: auto;
  max-height: calc(100vh - 180px)
}

.kanban-column-body::-webkit-scrollbar {
  width: 4px
}

.kanban-column-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .08);
  border-radius: 2px
}

/* Column colors */
.kanban-column[data-stage="novo"] .kanban-column-title {
  color: #818cf8
}

.kanban-column[data-stage="novo"] .kanban-column-count {
  background: rgba(99, 102, 241, .15);
  color: #818cf8
}

.kanban-column[data-stage="contato"] .kanban-column-title {
  color: #38bdf8
}

.kanban-column[data-stage="contato"] .kanban-column-count {
  background: rgba(56, 189, 248, .15);
  color: #38bdf8
}

.kanban-column[data-stage="visitou"] .kanban-column-title {
  color: #fbbf24
}

.kanban-column[data-stage="visitou"] .kanban-column-count {
  background: rgba(251, 191, 36, .15);
  color: #fbbf24
}

.kanban-column[data-stage="proposta"] .kanban-column-title {
  color: #f97316
}

.kanban-column[data-stage="proposta"] .kanban-column-count {
  background: rgba(249, 115, 22, .15);
  color: #f97316
}

.kanban-column[data-stage="fechado"] .kanban-column-title {
  color: #34d399
}

.kanban-column[data-stage="fechado"] .kanban-column-count {
  background: rgba(52, 211, 153, .15);
  color: #34d399
}

.kanban-column[data-stage="qualificacao"] .kanban-column-title {
  color: #a78bfa
}

.kanban-column[data-stage="qualificacao"] .kanban-column-count {
  background: rgba(167, 139, 250, .15);
  color: #a78bfa
}

.kanban-column[data-stage="negociacao"] .kanban-column-title {
  color: #fb923c
}

.kanban-column[data-stage="negociacao"] .kanban-column-count {
  background: rgba(251, 146, 60, .15);
  color: #fb923c
}

.kanban-column[data-stage="ganho"] .kanban-column-title {
  color: #34d399
}

.kanban-column[data-stage="ganho"] .kanban-column-count {
  background: rgba(52, 211, 153, .15);
  color: #34d399
}

.kanban-column[data-stage="perdido"] .kanban-column-title {
  color: #fb7185
}

.kanban-column[data-stage="perdido"] .kanban-column-count {
  background: rgba(251, 113, 133, .15);
  color: #fb7185
}

/* ── Lead Card ────────────────────────────────────── */
.lead-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  cursor: grab;
  transition: all .25s cubic-bezier(.4, 0, .2, 1);
  position: relative;
  animation: fadeSlideIn .3s ease both
}

.lead-card:hover {
  border-color: rgba(99, 102, 241, .3);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .3);
  transform: translateY(-2px)
}

.lead-card.sortable-ghost {
  opacity: .4;
  border-color: var(--primary);
  box-shadow: 0 0 20px var(--primary-glow)
}

.lead-card.sortable-drag {
  box-shadow: 0 16px 40px rgba(0, 0, 0, .5);
  z-index: 100
}

.lead-card.selected-for-move {
  border-color: #818cf8;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, .4), 0 8px 24px rgba(99, 102, 241, .2);
  transform: scale(.97);
  animation: pulse-selected 1.5s ease infinite
}

@keyframes pulse-selected {

  0%,
  100% {
    box-shadow: 0 0 0 2px rgba(99, 102, 241, .4), 0 8px 24px rgba(99, 102, 241, .2)
  }

  50% {
    box-shadow: 0 0 0 4px rgba(99, 102, 241, .25), 0 8px 24px rgba(99, 102, 241, .3)
  }
}

.kanban-column.drop-target {
  border-color: rgba(99, 102, 241, .4);
  background: rgba(99, 102, 241, .05)
}

.kanban-column.drop-target .kanban-column-header {
  background: rgba(99, 102, 241, .08)
}

.kanban-column.drop-target .kanban-empty {
  border-color: rgba(99, 102, 241, .3);
  color: #818cf8;
  opacity: 1
}

/* Card internals */
.lead-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px
}

.lead-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0
}

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

.lead-name {
  font-size: .85rem;
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap
}

.lead-card-phone {
  font-size: .73rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px
}

/* Temperature badge */
.temp-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: .65rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
  flex-shrink: 0
}

.temp-badge.quente {
  background: rgba(239, 68, 68, .15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, .25)
}

.temp-badge.morno {
  background: rgba(245, 158, 11, .15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, .25)
}

.temp-badge.frio {
  background: rgba(59, 130, 246, .15);
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, .25)
}

.lead-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0
}

.lead-tag {
  font-size: .65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(99, 102, 241, .1);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, .2)
}

.lead-tag.source {
  background: rgba(14, 165, 233, .1);
  color: #38bdf8;
  border-color: rgba(14, 165, 233, .2)
}

.lead-tag.prop-type {
  background: rgba(167, 139, 250, .1);
  color: #a78bfa;
  border-color: rgba(167, 139, 250, .2)
}

.lead-card-value {
  font-size: .72rem;
  color: var(--text-light);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 6px
}

.lead-card-value svg {
  color: var(--success)
}

.lead-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, .05)
}

.lead-card-date {
  font-size: .68rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px
}

.lead-followup-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: .65rem;
  font-weight: 700;
  color: var(--text-muted)
}

.lead-followup-indicator.has-followup {
  color: #fbbf24
}

.lead-card-actions {
  display: flex;
  gap: 3px
}

.lead-card-btn {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s
}

.lead-card-btn:hover {
  background: rgba(99, 102, 241, .1);
  border-color: rgba(99, 102, 241, .3);
  color: #818cf8
}

.lead-card-btn.btn-archive:hover {
  background: rgba(244, 63, 94, .1);
  border-color: rgba(244, 63, 94, .3);
  color: #fb7185
}

.lead-card-btn.btn-wa:hover {
  background: rgba(37, 211, 102, .1);
  border-color: rgba(37, 211, 102, .3);
  color: #25d366
}

.lead-card-btn.btn-move {
  display: none
}

@media(max-width:768px) {
  .lead-card-btn.btn-move {
    display: flex
  }
}

/* ── List view ────────────────────────────────────── */
.list-view {
  display: flex;
  flex-direction: column;
  gap: 6px
}

.list-view-header {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr 120px;
  gap: 12px;
  padding: 10px 16px;
  font-size: .7rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  border-bottom: 1px solid var(--border)
}

.list-view-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr 120px;
  gap: 12px;
  padding: 12px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  align-items: center;
  font-size: .82rem;
  cursor: pointer;
  transition: all .2s
}

.list-view-row:hover {
  border-color: rgba(99, 102, 241, .3);
  transform: translateX(2px)
}

.list-row-name {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  min-width: 0
}

.list-row-name .lead-avatar {
  width: 30px;
  height: 30px;
  font-size: .65rem
}

.list-row-name span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap
}

.list-row-stage {
  font-size: .72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 6px;
  text-align: center;
  white-space: nowrap
}

.list-row-phone {
  color: var(--text-light);
  font-size: .78rem
}

.list-row-value {
  color: var(--success);
  font-weight: 700;
  font-size: .78rem
}

.list-row-date {
  color: var(--text-muted);
  font-size: .72rem
}

.list-row-actions {
  display: flex;
  gap: 4px;
  justify-content: flex-end
}

/* ── Archived ─────────────────────────────────────── */
.archived-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px
}

.archived-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  transition: all .2s
}

.archived-card:hover {
  border-color: rgba(99, 102, 241, .3)
}

.archived-card .lead-avatar {
  width: 40px;
  height: 40px
}

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

.archived-card-name {
  font-size: .88rem;
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap
}

.archived-card-meta {
  font-size: .75rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  row-gap: 4px;
  column-gap: 6px;
  margin-top: 4px
}

.archived-card-actions {
  display: flex;
  gap: 6px;
  margin-left: auto
}

.btn-restore {
  background: rgba(16, 185, 129, .1);
  border: 1px solid rgba(16, 185, 129, .2);
  color: #34d399;
  padding: 6px 12px;
  border-radius: 8px;
  font-family: inherit;
  font-size: .75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s
}

.btn-restore:hover {
  background: rgba(16, 185, 129, .2)
}

.btn-delete-perm {
  background: rgba(244, 63, 94, .08);
  border: 1px solid rgba(244, 63, 94, .15);
  color: #fb7185;
  padding: 6px 12px;
  border-radius: 8px;
  font-family: inherit;
  font-size: .75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s
}

.btn-delete-perm:hover {
  background: rgba(244, 63, 94, .15)
}

/* ── Empty state ──────────────────────────────────── */
.kanban-empty {
  color: var(--text-muted);
  font-size: .8rem;
  text-align: center;
  padding: 30px 10px;
  opacity: .6;
  border: 2px dashed rgba(255, 255, 255, .06);
  border-radius: 10px;
  transition: all .2s
}

.kanban-column-body:hover .kanban-empty {
  border-color: rgba(99, 102, 241, .15)
}

.archived-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted)
}

.archived-empty svg {
  margin-bottom: 12px;
  opacity: .4
}

.archived-empty strong {
  display: block;
  font-size: 1.05rem;
  color: var(--text-light);
  margin-bottom: 4px
}

/* ── Modals ────────────────────────────────────────── */
.lead-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .6);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px
}

.lead-modal-backdrop.open {
  display: flex
}

.lead-detail-modal {
  background: rgba(15, 23, 42, .95);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
  animation: fadeSlideIn .3s ease both
}

.lead-detail-modal::-webkit-scrollbar {
  width: 4px
}

.lead-detail-modal::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .1);
  border-radius: 2px
}

.ldm-header {
  padding: 20px 24px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between
}

.ldm-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0
}

.ldm-header-right {
  display: flex;
  align-items: center;
  gap: 10px
}

.ldm-avatar {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .95rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0
}

.ldm-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text)
}

.ldm-phone {
  font-size: .8rem;
  color: var(--text-muted);
  margin-top: 2px
}

.ldm-temp-badge {
  font-size: .75rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 8px;
  background: rgba(245, 158, 11, .12);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, .2)
}

.ldm-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
  flex-shrink: 0
}

.ldm-close:hover {
  background: rgba(244, 63, 94, .1);
  border-color: rgba(244, 63, 94, .3);
  color: #fb7185
}

/* Detail Tabs */
.ldm-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  padding: 0 24px
}

.ldm-tab {
  padding: 10px 18px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px
}

.ldm-tab:hover {
  color: var(--text-light)
}

.ldm-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary)
}

.ldm-body {
  padding: 20px 24px
}

.ldm-tab-content {
  display: none
}

.ldm-tab-content.active {
  display: block
}

/* Stage selector */
.ldm-stage-selector {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap
}

.ldm-stage-btn {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: .73rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
  display: flex;
  align-items: center;
  gap: 4px
}

.ldm-stage-btn:hover {
  border-color: rgba(99, 102, 241, .3);
  color: var(--text-light)
}

.ldm-stage-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff
}

/* Form fields */
.ldm-section-title {
  font-size: .72rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px
}

.ldm-field-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 14px;
  flex: 1;
  min-width: 0
}

.ldm-field-row {
  display: flex;
  gap: 12px
}

.ldm-field-group label {
  font-size: .7rem;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: .06em
}

.ldm-field-group input,
.ldm-field-group textarea,
.ldm-field-group select {
  width: 100%;
  background: rgba(6, 12, 26, .5);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 12px;
  color: var(--text);
  font-family: inherit;
  font-size: .83rem;
  font-weight: 500;
  transition: all .2s
}

.ldm-field-group input:focus,
.ldm-field-group textarea:focus,
.ldm-field-group select:focus {
  outline: none;
  border-color: rgba(99, 102, 241, .5);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .1)
}

.ldm-field-group textarea {
  resize: vertical;
  min-height: 60px
}

.ldm-field-group select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px
}

.ldm-field-group select option {
  background: #0f172a;
  color: var(--text)
}

/* Activities */
.activity-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 16px
}

.activity-item {
  position: relative;
  padding: 10px 0 10px 32px;
  border-left: 2px solid rgba(255, 255, 255, .06)
}

.activity-item::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 14px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid var(--bg)
}

.activity-item:last-child {
  border-left-color: transparent
}

.activity-item[data-type="ligacao"]::before {
  background: #38bdf8
}

.activity-item[data-type="whatsapp"]::before {
  background: #25d366
}

.activity-item[data-type="visita"]::before {
  background: #fbbf24
}

.activity-item[data-type="reuniao"]::before {
  background: #a78bfa
}

.activity-item[data-type="email"]::before {
  background: #f97316
}

.activity-item[data-type="proposta"]::before {
  background: #fb7185
}

.activity-type-label {
  font-size: .68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 2px
}

.activity-text {
  font-size: .82rem;
  color: var(--text-light);
  line-height: 1.4;
  word-break: break-word
}

.activity-date {
  font-size: .66rem;
  color: var(--text-muted);
  margin-top: 3px
}

.activity-add-wrap {
  display: flex;
  gap: 8px;
  flex-wrap: wrap
}

.activity-add-wrap select {
  background: rgba(6, 12, 26, .5);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--text);
  font-family: inherit;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer
}

.activity-add-wrap input {
  flex: 1;
  min-width: 150px;
  background: rgba(6, 12, 26, .5);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text);
  font-family: inherit;
  font-size: .82rem
}

.activity-add-wrap input:focus,
.activity-add-wrap select:focus {
  outline: none;
  border-color: rgba(99, 102, 241, .5)
}

.btn-activity-add {
  background: var(--primary);
  border: none;
  color: #fff;
  padding: 8px 14px;
  border-radius: 8px;
  font-family: inherit;
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px
}

.btn-activity-add:hover {
  filter: brightness(1.1)
}

/* Followups */
.followup-timeline {
  display: flex;
  flex-direction: column;
  gap: 0
}

.followup-item {
  position: relative;
  padding: 10px 0 10px 28px;
  border-left: 2px solid rgba(255, 255, 255, .06)
}

.followup-item::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 16px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid var(--bg)
}

.followup-item:last-child {
  border-left-color: transparent
}

.followup-date {
  font-size: .68rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 3px
}

.followup-text {
  font-size: .82rem;
  color: var(--text-light);
  line-height: 1.4;
  word-break: break-word
}

.followup-add-wrap {
  display: flex;
  gap: 8px;
  margin-top: 12px
}

.followup-add-wrap input {
  flex: 1;
  background: rgba(6, 12, 26, .5);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text);
  font-family: inherit;
  font-size: .82rem
}

.followup-add-wrap input:focus {
  outline: none;
  border-color: rgba(99, 102, 241, .5)
}

.btn-followup-add {
  background: var(--primary);
  border: none;
  color: #fff;
  padding: 8px 14px;
  border-radius: 8px;
  font-family: inherit;
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap
}

.btn-followup-add:hover {
  filter: brightness(1.1)
}

/* Modal footer */
.ldm-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px
}

.btn-ldm-save {
  background: linear-gradient(135deg, var(--success), var(--success-hover));
  color: #fff;
  border: none;
  padding: 10px 22px;
  border-radius: 10px;
  font-family: inherit;
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .3s;
  box-shadow: 0 4px 15px rgba(16, 185, 129, .3)
}

.btn-ldm-save:hover {
  filter: brightness(1.1);
  transform: translateY(-1px)
}

.btn-ldm-archive {
  background: rgba(244, 63, 94, .08);
  border: 1px solid rgba(244, 63, 94, .15);
  color: #fb7185;
  padding: 10px 18px;
  border-radius: 10px;
  font-family: inherit;
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s
}

.btn-ldm-archive:hover {
  background: rgba(244, 63, 94, .15)
}

/* Add Lead Modal */
.add-lead-modal {
  width: 100%;
  max-width: 560px;
  background: rgba(15, 23, 42, .95);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
  animation: fadeSlideIn .3s ease both
}

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

.add-lead-header h3 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px
}

.add-lead-body {
  padding: 20px 24px
}

.add-lead-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px
}

.btn-add-lead-cancel {
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--border);
  color: var(--text-light);
  padding: 10px 20px;
  border-radius: 10px;
  font-family: inherit;
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s
}

.btn-add-lead-cancel:hover {
  background: rgba(255, 255, 255, .08)
}

.btn-add-lead-submit {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #fff;
  border: none;
  padding: 10px 22px;
  border-radius: 10px;
  font-family: inherit;
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .3s;
  box-shadow: 0 4px 15px var(--primary-glow);
  display: flex;
  align-items: center;
  gap: 6px
}

.btn-add-lead-submit:hover {
  filter: brightness(1.1);
  transform: translateY(-1px)
}

/* ── Toast ─────────────────────────────────────────── */
.crm-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 20px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .4);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateY(100px);
  opacity: 0;
  transition: all .4s cubic-bezier(.4, 0, .2, 1)
}

.crm-toast.show {
  transform: translateY(0);
  opacity: 1
}

.crm-toast.success {
  border-color: rgba(16, 185, 129, .3)
}

.crm-toast.error {
  border-color: rgba(244, 63, 94, .3)
}

/* ── Animation ─────────────────────────────────────── */
@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(16px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

/* ── Responsive ────────────────────────────────────── */
@media(max-width:768px) {
  .topbar {
    padding: 0 14px;
    gap: 8px
  }

  .topbar-title {
    display: none
  }

  .main {
    padding: 20px 14px 60px
  }

  .page-title {
    font-size: 1.6rem
  }

  .crm-mode-toggle {
    flex-direction: row;
    width: 100%
  }

  .crm-mode-btn {
    flex: 1;
    justify-content: center;
    padding: 10px 12px;
    font-size: .78rem
  }

  .crm-mode-toggle-wrap {
    margin-bottom: 20px
  }

  .crm-stats-strip {
    gap: 6px
  }

  .crm-stat-chip {
    padding: 8px 10px;
    font-size: .72rem
  }

  .crm-toolbar {
    flex-direction: column;
    align-items: stretch
  }

  .crm-toolbar-left {
    flex-direction: column
  }

  .crm-search-wrap {
    width: 100%
  }

  .crm-filter-chips {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px
  }

  .crm-toolbar-right {
    justify-content: stretch
  }

  .btn-crm-add {
    width: 100%;
    justify-content: center
  }

  .kanban-board {
    gap: 12px;
    min-height: auto
  }

  .kanban-column {
    min-width: 260px;
    max-width: 280px
  }

  .kanban-column-body {
    max-height: calc(100vh - 200px);
    min-height: 80px
  }

  .lead-detail-modal,
  .add-lead-modal {
    max-width: 100%
  }

  .ldm-field-row {
    flex-direction: column;
    gap: 0
  }

  .list-view-header,
  .list-view-row {
    grid-template-columns: 2fr 1fr 100px;
    font-size: .75rem
  }

  .list-view-row .list-row-phone,
  .list-view-row .list-row-value {
    display: none
  }

  .kanban-column.drop-target {
    border-color: rgba(99, 102, 241, .6);
    background: rgba(99, 102, 241, .1);
    cursor: pointer
  }
}

@media(max-width:480px) {
  .logo-text {
    display: none
  }

  .btn-back {
    font-size: 0;
    padding: 8px 10px
  }

  .kanban-column {
    min-width: 230px;
    max-width: 260px
  }

  .crm-mode-btn svg {
    display: none
  }

  .crm-stat-chip .stat-label {
    display: none
  }
}

/* ── Modals ────────────────────────────────────────── */
.lead-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .6);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.lead-modal-backdrop.open {
  display: flex;
}

.lead-detail-modal,
.add-lead-modal {
  background: rgba(15, 23, 42, .95);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
  animation: fadeSlideIn .3s ease both;
  scrollbar-width: thin;
  scrollbar-color: rgba(99, 102, 241, .3) transparent;
}

.lead-detail-modal {
  max-width: 620px;
}

.add-lead-modal {
  max-width: 560px;
}

/* Custom scrollbar for modals */
.lead-detail-modal::-webkit-scrollbar,
.add-lead-modal::-webkit-scrollbar {
  width: 6px;
}

.lead-detail-modal::-webkit-scrollbar-track,
.add-lead-modal::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 3px;
}

.lead-detail-modal::-webkit-scrollbar-thumb,
.add-lead-modal::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, .25);
  border-radius: 3px;
}

.lead-detail-modal::-webkit-scrollbar-thumb:hover,
.add-lead-modal::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, .45);
}

/* Modal header */
.ldm-header {
  padding: 20px 24px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.ldm-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.ldm-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ldm-avatar {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .95rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

.ldm-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
}

.ldm-phone {
  font-size: .8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.ldm-temp-badge {
  font-size: .75rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 8px;
  background: rgba(245, 158, 11, .12);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, .2);
}

.ldm-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
  flex-shrink: 0;
}

.ldm-close:hover {
  background: rgba(244, 63, 94, .1);
  border-color: rgba(244, 63, 94, .3);
  color: #fb7185;
}

/* Detail Tabs */
.ldm-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
}

.ldm-tab {
  padding: 10px 18px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.ldm-tab:hover {
  color: var(--text-light);
}

.ldm-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.ldm-body {
  padding: 20px 24px;
}

.ldm-tab-content {
  display: none;
}

.ldm-tab-content.active {
  display: block;
}

/* Stage selector */
.ldm-stage-selector {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.ldm-stage-btn {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: .73rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
  display: flex;
  align-items: center;
  gap: 4px;
}

.ldm-stage-btn:hover {
  border-color: rgba(99, 102, 241, .3);
  color: var(--text-light);
}

.ldm-stage-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* Form fields */
.ldm-section-title {
  font-size: .72rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ldm-field-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 14px;
  flex: 1;
  min-width: 0;
}

.ldm-field-row {
  display: flex;
  gap: 12px;
}

.ldm-field-group label {
  font-size: .7rem;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.ldm-field-group input,
.ldm-field-group textarea,
.ldm-field-group select {
  width: 100%;
  background: rgba(6, 12, 26, .5);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 12px;
  color: var(--text);
  font-family: inherit;
  font-size: .83rem;
  font-weight: 500;
  transition: all .2s;
}

.ldm-field-group input:focus,
.ldm-field-group textarea:focus,
.ldm-field-group select:focus {
  outline: none;
  border-color: rgba(99, 102, 241, .5);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .1);
}

.ldm-field-group textarea {
  resize: vertical;
  min-height: 60px;
}

.ldm-field-group select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}

.ldm-field-group select option {
  background: #0f172a;
  color: var(--text);
}

/* Activities */
.activity-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 16px;
}

.activity-item {
  position: relative;
  padding: 10px 0 10px 32px;
  border-left: 2px solid rgba(255, 255, 255, .06);
}

.activity-item::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 14px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid var(--bg);
}

.activity-item:last-child {
  border-left-color: transparent;
}

.activity-item[data-type="ligacao"]::before {
  background: #38bdf8;
}

.activity-item[data-type="whatsapp"]::before {
  background: #25d366;
}

.activity-item[data-type="visita"]::before {
  background: #fbbf24;
}

.activity-item[data-type="reuniao"]::before {
  background: #a78bfa;
}

.activity-item[data-type="email"]::before {
  background: #f97316;
}

.activity-item[data-type="proposta"]::before {
  background: #fb7185;
}

.activity-type-label {
  font-size: .68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 2px;
}

.activity-text {
  font-size: .82rem;
  color: var(--text-light);
  line-height: 1.4;
  word-break: break-word;
}

.activity-date {
  font-size: .66rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.activity-add-wrap {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.activity-add-wrap select {
  background: rgba(6, 12, 26, .5);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--text);
  font-family: inherit;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
}

.activity-add-wrap input {
  flex: 1;
  min-width: 150px;
  background: rgba(6, 12, 26, .5);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text);
  font-family: inherit;
  font-size: .82rem;
}

.activity-add-wrap input:focus,
.activity-add-wrap select:focus {
  outline: none;
  border-color: rgba(99, 102, 241, .5);
}

.btn-activity-add {
  background: var(--primary);
  border: none;
  color: #fff;
  padding: 8px 14px;
  border-radius: 8px;
  font-family: inherit;
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-activity-add:hover {
  filter: brightness(1.1);
}

/* Followups */
.followup-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.followup-item {
  position: relative;
  padding: 10px 0 10px 28px;
  border-left: 2px solid rgba(255, 255, 255, .06);
}

.followup-item::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 16px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid var(--bg);
}

.followup-item:last-child {
  border-left-color: transparent;
}

.followup-date {
  font-size: .68rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.followup-text {
  font-size: .82rem;
  color: var(--text-light);
  line-height: 1.4;
  word-break: break-word;
}

.followup-add-wrap {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.followup-add-wrap input {
  flex: 1;
  background: rgba(6, 12, 26, .5);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text);
  font-family: inherit;
  font-size: .82rem;
}

.followup-add-wrap input:focus {
  outline: none;
  border-color: rgba(99, 102, 241, .5);
}

.btn-followup-add {
  background: var(--primary);
  border: none;
  color: #fff;
  padding: 8px 14px;
  border-radius: 8px;
  font-family: inherit;
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}

.btn-followup-add:hover {
  filter: brightness(1.1);
}

/* Modal footer */
.ldm-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.btn-ldm-save {
  background: linear-gradient(135deg, var(--success), var(--success-hover));
  color: #fff;
  border: none;
  padding: 10px 22px;
  border-radius: 10px;
  font-family: inherit;
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .3s;
  box-shadow: 0 4px 15px rgba(16, 185, 129, .3);
}

.btn-ldm-save:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-ldm-archive {
  background: rgba(244, 63, 94, .08);
  border: 1px solid rgba(244, 63, 94, .15);
  color: #fb7185;
  padding: 10px 18px;
  border-radius: 10px;
  font-family: inherit;
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
}

.btn-ldm-archive:hover {
  background: rgba(244, 63, 94, .15);
}

/* Add Lead Modal header/footer */
.add-lead-header {
  padding: 20px 24px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.add-lead-header h3 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.add-lead-body {
  padding: 20px 24px;
}

.add-lead-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.btn-add-lead-cancel {
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--border);
  color: var(--text-light);
  padding: 10px 20px;
  border-radius: 10px;
  font-family: inherit;
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
}

.btn-add-lead-cancel:hover {
  background: rgba(255, 255, 255, .08);
}

.btn-add-lead-submit {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #fff;
  border: none;
  padding: 10px 22px;
  border-radius: 10px;
  font-family: inherit;
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .3s;
  box-shadow: 0 4px 15px var(--primary-glow);
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-add-lead-submit:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

/* ── Toast ─────────────────────────────────────────── */
.crm-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 20px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .4);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateY(100px);
  opacity: 0;
  transition: all .4s cubic-bezier(.4, 0, .2, 1);
}

.crm-toast.show {
  transform: translateY(0);
  opacity: 1;
}

.crm-toast.success {
  border-color: rgba(16, 185, 129, .3);
}

.crm-toast.error {
  border-color: rgba(244, 63, 94, .3);
}

/* ── Animation ─────────────────────────────────────── */
@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Global custom scrollbar ───────────────────────── */
.kanban-board::-webkit-scrollbar {
  height: 6px;
}

.kanban-board::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, .02);
  border-radius: 3px;
}

.kanban-board::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, .3);
  border-radius: 3px;
}

.kanban-column-body::-webkit-scrollbar {
  width: 4px;
}

.kanban-column-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .08);
  border-radius: 2px;
}

.kanban-column-body {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .08) transparent;
}

/* ── Real In-App Notifications & Follow-ups ──────────────── */

/* Highlight cards with overdue followups */
.lead-card.has-overdue-followup {
  border-color: rgba(244, 63, 94, 0.6);
  box-shadow: 0 0 12px rgba(244, 63, 94, 0.2);
  animation: pulse-overdue 2s infinite ease-in-out;
}

@keyframes pulse-overdue {

  0%,
  100% {
    box-shadow: 0 0 12px rgba(244, 63, 94, 0.2);
  }

  50% {
    box-shadow: 0 0 18px rgba(244, 63, 94, 0.4), inset 0 0 8px rgba(244, 63, 94, 0.1);
  }
}

/* Highlight cards with followups today */
.lead-card.has-today-followup {
  border-color: rgba(245, 158, 11, 0.6);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.2);
  animation: pulse-today 2s infinite ease-in-out;
}

@keyframes pulse-today {

  0%,
  100% {
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.2);
  }

  50% {
    box-shadow: 0 0 18px rgba(245, 158, 11, 0.4), inset 0 0 8px rgba(245, 158, 11, 0.1);
  }
}

/* Notification Container */
.crm-notification-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

/* Real Notification Toast */
.crm-real-notification {
  pointer-events: auto;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 300px;
  max-width: 400px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transform: translateX(120%) scale(0.9);
  opacity: 0;
  animation: slideInNotif 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  transition: all 0.3s ease;
}

.crm-real-notification:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.1);
  background: rgba(20, 30, 50, 0.95);
}

.crm-real-notification.hide {
  animation: slideOutNotif 0.3s ease forwards;
}

@keyframes slideInNotif {
  to {
    transform: translateX(0) scale(1);
    opacity: 1;
  }
}

@keyframes slideOutNotif {
  to {
    transform: translateX(120%) scale(0.9);
    opacity: 0;
  }
}

.crm-notif-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.crm-notif-icon.overdue {
  background: rgba(244, 63, 94, 0.15);
  color: #f43f5e;
  box-shadow: inset 0 0 0 1px rgba(244, 63, 94, 0.3);
  animation: ring-shake 1.5s infinite;
}

.crm-notif-icon.imminent {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.3);
}

@keyframes ring-shake {

  0%,
  100% {
    transform: rotate(0deg);
  }

  10%,
  30%,
  50%,
  70%,
  90% {
    transform: rotate(-8deg);
  }

  20%,
  40%,
  60%,
  80% {
    transform: rotate(8deg);
  }
}

.crm-notif-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.crm-notif-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.crm-notif-badge {
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

.crm-notif-badge.overdue {
  background: rgba(244, 63, 94, 0.2);
  color: #fb7185;
}

*::-webkit-scrollbar {
  width: 6px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

*::-webkit-scrollbar-thumb:hover {
  background: rgba(16, 185, 129, 0.3);
}

.crm-notif-text {
  font-size: 0.8rem;
  color: #94a3b8;
  line-height: 1.4;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

select {
  background-color: rgba(6, 12, 26, 0.5) !important;
}

.crm-notif-close {
  background: none;
  border: none;
  color: #64748b;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0 4px;
  align-self: flex-start;
  transition: color 0.2s;
  margin-top: -4px;
  margin-right: -4px;
}

.crm-notif-close:hover {
  color: #f1f5f9;
}

/* Quick Date Buttons */
.btn-quick-date {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  flex: 1;
  text-align: center;
  min-width: 70px;
}

.btn-quick-date:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.3);
  color: #818cf8;
}

.btn-quick-date.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}