/* ============================================================
   INSTACRM — MAIN STYLESHEET
   Framework: Bootstrap 5 + Custom
   Theme: Deep Indigo + Instagram Gradient
   Font: Sora + Inter
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600&display=swap');

/* ---- CSS VARIABLES ---- */
:root {
  --ig-grad:         linear-gradient(135deg, #833ab4, #fd1d1d, #fcb045);
  --ig-grad-soft:    linear-gradient(135deg, #a855f7 0%, #ec4899 50%, #f97316 100%);
  --primary:         #6366f1;
  --primary-dark:    #4f46e5;
  --primary-light:   #eef2ff;
  --secondary:       #ec4899;
  --success:         #10b981;
  --warning:         #f59e0b;
  --danger:          #ef4444;
  --info:            #3b82f6;
  --sidebar-w:       268px;
  --sidebar-bg:      #0f0f1a;
  --sidebar-text:    #8b8fa8;
  --sidebar-active:  rgba(99,102,241,0.18);
  --topbar-h:        64px;
  --body-bg:         #f6f7fb;
  --card-bg:         #ffffff;
  --text-dark:       #111827;
  --text-mid:        #374151;
  --text-muted:      #9ca3af;
  --border:          #e5e7eb;
  --shadow-sm:       0 2px 8px rgba(0,0,0,0.06);
  --shadow:          0 4px 24px rgba(99,102,241,0.10);
  --shadow-md:       0 8px 40px rgba(99,102,241,0.16);
  --radius:          12px;
  --radius-lg:       18px;
  --radius-xl:       24px;
  --transition:      all 0.22s cubic-bezier(0.4,0,0.2,1);
}

/* ---- RESET & BASE ---- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--body-bg);
  color: var(--text-dark);
  font-size: 14.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
h1,h2,h3,h4,h5,h6 { font-family: 'Sora', sans-serif; }
a { text-decoration: none; }
img { max-width: 100%; }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* ============================================================
   SIDEBAR
   ============================================================ */
#sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--sidebar-bg);
  position: fixed;
  top: 0; left: 0;
  z-index: 1050;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  overflow: hidden;
}

/* Brand */
.sidebar-brand {
  padding: 24px 22px 20px;
  display: flex;
  align-items: center;
  gap: 13px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  text-decoration: none;
}
.brand-logo-wrap {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: var(--ig-grad);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(236,72,153,0.4);
}
.brand-logo-wrap i { color: #fff; font-size: 18px; }
.brand-text { line-height: 1.2; }
.brand-name {
  font-family: 'Sora', sans-serif;
  font-size: 17px;
  font-weight: 700;
  background: var(--ig-grad-soft);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.brand-sub { font-size: 11px; color: var(--sidebar-text); font-weight: 400; }

/* Connected account pill */
.sidebar-account-pill {
  margin: 14px 16px;
  background: rgba(255,255,255,0.05);
  border-radius: 10px;
  padding: 10px 13px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.account-pill-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--ig-grad);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.account-pill-avatar img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.account-pill-info { flex: 1; min-width: 0; }
.account-pill-name { color: #fff; font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-pill-status { color: var(--sidebar-text); font-size: 11px; display: flex; align-items: center; gap: 4px; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); display: inline-block; }

/* Nav */
.sidebar-nav { padding: 8px 0; flex: 1; overflow-y: auto; }
.nav-section-label {
  padding: 14px 22px 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: rgba(139,143,168,0.5);
}
.sidebar-nav .nav-item { margin: 2px 10px; }
.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 14px;
  border-radius: 10px;
  color: var(--sidebar-text);
  font-size: 13.5px;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
}
.sidebar-nav .nav-link:hover {
  color: #fff;
  background: rgba(255,255,255,0.07);
}
.sidebar-nav .nav-link.active {
  color: #fff;
  background: var(--sidebar-active);
}
.sidebar-nav .nav-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 60%;
  background: var(--ig-grad-soft);
  border-radius: 0 3px 3px 0;
}
.nav-icon-wrap {
  width: 34px; height: 34px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.06);
  font-size: 15px;
  flex-shrink: 0;
  transition: var(--transition);
}
.sidebar-nav .nav-link.active .nav-icon-wrap {
  background: var(--ig-grad-soft);
  box-shadow: 0 4px 12px rgba(168,85,247,0.4);
}
.sidebar-nav .nav-link:hover .nav-icon-wrap { background: rgba(255,255,255,0.1); }
.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 5px;
  animation: pulse-badge 2s infinite;
}
@keyframes pulse-badge {
  0%,100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.4); }
  50% { box-shadow: 0 0 0 5px rgba(239,68,68,0); }
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.sidebar-user-btn {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px;
  border-radius: 11px;
  background: rgba(255,255,255,0.05);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}
.sidebar-user-btn:hover { background: rgba(255,255,255,0.1); }
.sidebar-user-btn img {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(99,102,241,0.5);
  flex-shrink: 0;
}
.sidebar-user-btn .u-name { color: #fff; font-size: 13px; font-weight: 600; display: block; }
.sidebar-user-btn .u-role {
  font-size: 11px;
  background: var(--ig-grad-soft);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 600;
}

/* ============================================================
   MAIN LAYOUT
   ============================================================ */
#main-wrapper {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.3s cubic-bezier(0.4,0,0.2,1);
}

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 900;
  box-shadow: 0 1px 0 rgba(0,0,0,0.04);
}
.topbar-toggle {
  background: none; border: none;
  width: 38px; height: 38px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 18px;
  transition: var(--transition);
}
.topbar-toggle:hover { background: var(--primary-light); color: var(--primary); }

.topbar-breadcrumb { flex: 1; }
.topbar-breadcrumb .page-label {
  font-family: 'Sora', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1;
}
.topbar-breadcrumb .page-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.topbar-icon-btn {
  background: none; border: none;
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 17px;
  position: relative;
  transition: var(--transition);
}
.topbar-icon-btn:hover { background: var(--primary-light); color: var(--primary); }
.topbar-icon-btn .notif-dot {
  position: absolute; top: 7px; right: 7px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--danger);
  border: 2px solid #fff;
}

/* Search */
.topbar-search {
  position: relative;
  max-width: 300px;
  flex: 1;
}
.topbar-search input {
  width: 100%;
  padding: 8px 14px 8px 38px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--body-bg);
  font-family: 'Inter', sans-serif;
  font-size: 13.5px;
  color: var(--text-dark);
  outline: none;
  transition: var(--transition);
}
.topbar-search input:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}
.topbar-search .si {
  position: absolute; left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
}

/* Avatar dropdown */
.topbar-avatar-wrap { position: relative; }
.topbar-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  object-fit: cover;
  cursor: pointer;
  border: 2px solid var(--border);
  transition: var(--transition);
  display: flex; align-items: center; justify-content: center;
  background: var(--ig-grad-soft);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  font-family: 'Sora', sans-serif;
}
.topbar-avatar:hover { border-color: var(--primary); transform: scale(1.05); }

/* ============================================================
   PAGE CONTENT WRAPPER
   ============================================================ */
.page-content {
  padding: 28px 30px;
  flex: 1;
}

/* Page Header */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
  flex-wrap: wrap;
}
.page-header-left {}
.page-title {
  font-family: 'Sora', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0 0 4px;
}
.page-subtitle { color: var(--text-muted); font-size: 13.5px; }
.page-header-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ============================================================
   STAT CARDS
   ============================================================ */
.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 22px 22px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  cursor: default;
}
.stat-card::after {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 100px; height: 100px;
  border-radius: 50%;
  opacity: 0.05;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.stat-icon {
  width: 54px; height: 54px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  color: #fff;
  flex-shrink: 0;
}
.stat-icon.ig  { background: var(--ig-grad); box-shadow: 0 6px 20px rgba(236,72,153,0.35); }
.stat-icon.indigo { background: linear-gradient(135deg, #6366f1, #818cf8); box-shadow: 0 6px 20px rgba(99,102,241,0.35); }
.stat-icon.emerald { background: linear-gradient(135deg, #10b981, #34d399); box-shadow: 0 6px 20px rgba(16,185,129,0.35); }
.stat-icon.amber { background: linear-gradient(135deg, #f59e0b, #fbbf24); box-shadow: 0 6px 20px rgba(245,158,11,0.35); }
.stat-icon.rose { background: linear-gradient(135deg, #ef4444, #f87171); box-shadow: 0 6px 20px rgba(239,68,68,0.35); }
.stat-icon.blue { background: linear-gradient(135deg, #3b82f6, #60a5fa); box-shadow: 0 6px 20px rgba(59,130,246,0.35); }

.stat-body { flex: 1; }
.stat-value {
  font-family: 'Sora', sans-serif;
  font-size: 28px;
  font-weight: 800;
  color: var(--text-dark);
  line-height: 1;
  margin-bottom: 4px;
}
.stat-label { color: var(--text-muted); font-size: 13px; margin-bottom: 8px; }
.stat-trend {
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 20px;
}
.stat-trend.up   { color: #065f46; background: #d1fae5; }
.stat-trend.down { color: #991b1b; background: #fee2e2; }

/* ============================================================
   CARDS
   ============================================================ */
.crm-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.crm-card-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.crm-card-title {
  font-family: 'Sora', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.crm-card-title i { color: var(--primary); }
.crm-card-body { padding: 22px; }
.crm-card-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  background: #fafafa;
}

/* ============================================================
   TABLES
   ============================================================ */
.crm-table-wrapper { overflow-x: auto; }
.crm-table {
  width: 100%;
  border-collapse: collapse;
}
.crm-table thead th {
  background: var(--body-bg);
  padding: 11px 16px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.crm-table tbody tr {
  border-bottom: 1px solid #f3f4f6;
  transition: var(--transition);
}
.crm-table tbody tr:hover { background: var(--primary-light); }
.crm-table tbody td { padding: 13px 16px; font-size: 14px; vertical-align: middle; }
.crm-table tbody tr:last-child { border-bottom: none; }

/* ============================================================
   BADGES
   ============================================================ */
.badge-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.badge-pill.green   { background: #d1fae5; color: #065f46; }
.badge-pill.red     { background: #fee2e2; color: #991b1b; }
.badge-pill.amber   { background: #fef3c7; color: #92400e; }
.badge-pill.blue    { background: #dbeafe; color: #1e40af; }
.badge-pill.purple  { background: #ede9fe; color: #5b21b6; }
.badge-pill.gray    { background: #f3f4f6; color: #374151; }
.badge-pill.ig {
  background: var(--ig-grad);
  color: #fff;
  box-shadow: 0 2px 8px rgba(236,72,153,0.3);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px;
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  text-decoration: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 4px 15px rgba(99,102,241,0.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 22px rgba(99,102,241,0.45); color: #fff; }

.btn-ig {
  background: var(--ig-grad);
  color: #fff;
  box-shadow: 0 4px 15px rgba(236,72,153,0.35);
}
.btn-ig:hover { transform: translateY(-2px); box-shadow: 0 6px 22px rgba(236,72,153,0.5); color: #fff; }

.btn-fb {
  background: #1877f2;
  color: #fff;
  box-shadow: 0 4px 15px rgba(24,119,242,0.35);
}
.btn-fb:hover { background: #166fe5; transform: translateY(-2px); color: #fff; }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-outline:hover { background: var(--primary-light); color: var(--primary); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover { background: var(--body-bg); color: var(--text-dark); }

.btn-danger { background: linear-gradient(135deg, #ef4444, #f87171); color: #fff; }
.btn-danger:hover { transform: translateY(-2px); color: #fff; }

.btn-sm { padding: 6px 13px; font-size: 12.5px; border-radius: 8px; gap: 5px; }
.btn-xs { padding: 4px 10px; font-size: 12px; border-radius: 7px; }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: 9px; justify-content: center; }

/* ============================================================
   FORMS
   ============================================================ */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--text-mid);
}
.form-label .required { color: var(--danger); margin-left: 3px; }
.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--text-dark);
  transition: var(--transition);
  outline: none;
  -webkit-appearance: none;
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}
.form-control.is-invalid { border-color: var(--danger); }
.form-control::placeholder { color: #d1d5db; }
.invalid-feedback { color: var(--danger); font-size: 12px; margin-top: 5px; display: flex; align-items: center; gap: 4px; }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 100px; }
.form-icon-wrap { position: relative; }
.form-icon-wrap .form-control { padding-left: 40px; }
.form-icon-wrap .fi { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 15px; pointer-events: none; }

/* ============================================================
   AVATAR
   ============================================================ */
.avatar {
  border-radius: 50%;
  object-fit: cover;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-family: 'Sora', sans-serif;
  color: #fff;
  flex-shrink: 0;
}
.avatar-sm  { width: 32px; height: 32px; font-size: 12px; }
.avatar-md  { width: 40px; height: 40px; font-size: 14px; }
.avatar-lg  { width: 52px; height: 52px; font-size: 18px; }
.avatar-xl  { width: 68px; height: 68px; font-size: 24px; }
.avatar-ig  { background: var(--ig-grad); }
.avatar-indigo { background: linear-gradient(135deg, #6366f1, #818cf8); }

/* ============================================================
   CONVERSATION LIST ITEM
   ============================================================ */
.conv-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  color: inherit;
  position: relative;
}
.conv-item:hover { background: var(--body-bg); }
.conv-item.active { background: var(--primary-light); }
.conv-item.unread .conv-name { font-weight: 700; color: var(--text-dark); }
.conv-item.unread .conv-preview { color: var(--text-mid); font-weight: 500; }
.conv-meta { flex: 1; min-width: 0; }
.conv-name { font-size: 14px; font-weight: 600; color: var(--text-dark); margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-preview { font-size: 13px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-time { font-size: 11px; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }
.conv-unread-badge {
  position: absolute; right: 14px; bottom: 13px;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 5px;
}
.ig-badge {
  position: absolute;
  bottom: -2px; right: -2px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--ig-grad);
  border: 2px solid #fff;
  display: flex; align-items: center; justify-content: center;
}
.ig-badge i { font-size: 7px; color: #fff; }

/* ============================================================
   CHAT MESSAGES
   ============================================================ */
.chat-bubble {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 14px;
}
.chat-bubble.outgoing { flex-direction: row-reverse; }
.chat-bubble-content {
  max-width: 68%;
  padding: 11px 15px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
  position: relative;
}
.chat-bubble.incoming .chat-bubble-content {
  background: #fff;
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
  color: var(--text-dark);
}
.chat-bubble.outgoing .chat-bubble-content {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-time { font-size: 11px; color: var(--text-muted); text-align: right; margin-top: 4px; }
.chat-bubble.outgoing .chat-time { color: rgba(255,255,255,0.7); }

/* ============================================================
   LEAD KANBAN / STATUS PIPELINE
   ============================================================ */
.pipeline-col {
  background: var(--body-bg);
  border-radius: var(--radius-lg);
  padding: 16px;
  min-width: 240px;
  flex: 1;
}
.pipeline-col-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.pipeline-col-title {
  font-family: 'Sora', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-mid);
  display: flex; align-items: center; gap: 7px;
}
.pipeline-count {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}
.lead-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  transition: var(--transition);
  cursor: pointer;
}
.lead-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.lead-card-name { font-size: 13.5px; font-weight: 600; color: var(--text-dark); margin-bottom: 5px; }
.lead-card-sub { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 5px; margin-bottom: 8px; }
.lead-card-footer { display: flex; align-items: center; justify-content: space-between; }

/* ============================================================
   NOTIFICATION DROPDOWN
   ============================================================ */
.notif-dropdown {
  width: 340px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.notif-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.notif-title { font-family: 'Sora', sans-serif; font-size: 15px; font-weight: 700; }
.notif-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 13px 18px;
  border-bottom: 1px solid #f3f4f6;
  transition: var(--transition);
  cursor: pointer;
}
.notif-item:hover { background: var(--primary-light); }
.notif-item.unread { background: #f5f6ff; }
.notif-dot-unread {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
  margin-top: 5px;
}
.notif-msg { font-size: 13px; color: var(--text-mid); line-height: 1.4; }
.notif-time { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ============================================================
   CONNECT ACCOUNT CARD
   ============================================================ */
.connect-card {
  background: var(--card-bg);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  padding: 32px;
  text-align: center;
  transition: var(--transition);
}
.connect-card:hover { box-shadow: var(--shadow-md); transform: translateY(-4px); }
.connect-icon {
  width: 72px; height: 72px;
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px;
  margin: 0 auto 18px;
  color: #fff;
}
.connect-icon.fb { background: #1877f2; box-shadow: 0 8px 24px rgba(24,119,242,0.35); }
.connect-icon.ig { background: var(--ig-grad); box-shadow: 0 8px 24px rgba(236,72,153,0.35); }
.connect-title { font-family: 'Sora', sans-serif; font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.connect-desc { color: var(--text-muted); font-size: 13.5px; margin-bottom: 22px; }

/* ============================================================
   MODAL
   ============================================================ */
.modal-content {
  border: none;
  border-radius: var(--radius-xl);
  box-shadow: 0 25px 80px rgba(0,0,0,0.2);
}
.modal-header { border-bottom: 1px solid var(--border); padding: 20px 24px; }
.modal-title { font-family: 'Sora', sans-serif; font-size: 17px; font-weight: 700; }
.modal-body { padding: 24px; }
.modal-footer { border-top: 1px solid var(--border); padding: 16px 24px; }

/* ============================================================
   ALERTS / FLASH MESSAGES
   ============================================================ */
.alert-crm {
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: none;
  font-size: 14px;
}
.alert-crm.success { background: #d1fae5; color: #065f46; }
.alert-crm.error   { background: #fee2e2; color: #991b1b; }
.alert-crm.info    { background: #dbeafe; color: #1e40af; }
.alert-crm.warning { background: #fef3c7; color: #92400e; }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  position: relative;
  overflow: hidden;
}
.login-left {
  width: 52%;
  background: linear-gradient(145deg, #0f0f1a 0%, #1a1040 40%, #2d1b69 70%, #4c1d95 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px;
  position: relative;
  overflow: hidden;
}
.login-left::before {
  content: '';
  position: absolute;
  top: -100px; left: -100px;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99,102,241,0.2) 0%, transparent 70%);
  pointer-events: none;
}
.login-left::after {
  content: '';
  position: absolute;
  bottom: -100px; right: -100px;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(236,72,153,0.15) 0%, transparent 70%);
  pointer-events: none;
}
.login-left-content { position: relative; z-index: 1; max-width: 400px; }
.login-hero-icon {
  width: 80px; height: 80px;
  border-radius: 22px;
  background: var(--ig-grad);
  display: flex; align-items: center; justify-content: center;
  font-size: 36px;
  color: #fff;
  margin-bottom: 28px;
  box-shadow: 0 16px 40px rgba(236,72,153,0.4);
}
.login-hero-title {
  font-family: 'Sora', sans-serif;
  font-size: 36px;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 16px;
}
.login-hero-title span {
  background: var(--ig-grad-soft);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.login-hero-desc { color: rgba(255,255,255,0.6); font-size: 15px; line-height: 1.6; margin-bottom: 36px; }
.login-feature {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 16px;
}
.login-feature-icon {
  width: 36px; height: 36px;
  border-radius: 9px;
  background: rgba(255,255,255,0.1);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 16px;
  flex-shrink: 0;
}
.login-feature-text { color: rgba(255,255,255,0.75); font-size: 14px; }

.login-right {
  width: 48%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 70px;
}
.login-form-wrap { width: 100%; max-width: 380px; }
.login-form-title {
  font-family: 'Sora', sans-serif;
  font-size: 28px;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 6px;
}
.login-form-sub { color: var(--text-muted); font-size: 14px; margin-bottom: 32px; }

.divider-or {
  position: relative;
  text-align: center;
  margin: 24px 0;
}
.divider-or::before {
  content: '';
  position: absolute;
  top: 50%; left: 0; right: 0;
  height: 1px;
  background: var(--border);
}
.divider-or span {
  position: relative;
  background: #fff;
  padding: 0 14px;
  color: var(--text-muted);
  font-size: 13px;
}

.login-footer-link { color: var(--text-muted); font-size: 13.5px; text-align: center; margin-top: 24px; }
.login-footer-link a { color: var(--primary); font-weight: 600; }

/* ============================================================
   SETUP / ONBOARDING STEPPER
   ============================================================ */
.stepper {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 36px;
}
.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  position: relative;
}
.step::after {
  content: '';
  position: absolute;
  top: 18px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: var(--border);
  z-index: 0;
}
.step:last-child::after { display: none; }
.step.done::after { background: var(--primary); }
.step-circle {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--body-bg);
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  position: relative;
  z-index: 1;
  transition: var(--transition);
}
.step.done .step-circle { background: var(--primary); border-color: var(--primary); color: #fff; }
.step.active .step-circle { background: #fff; border-color: var(--primary); color: var(--primary); box-shadow: 0 0 0 4px rgba(99,102,241,0.15); }
.step-label { font-size: 11.5px; font-weight: 600; color: var(--text-muted); margin-top: 7px; text-align: center; }
.step.active .step-label { color: var(--primary); }
.step.done .step-label { color: var(--text-mid); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  #sidebar { transform: translateX(-100%); }
  #sidebar.open { transform: translateX(0); }
  #main-wrapper { margin-left: 0; }
  .login-left { display: none; }
  .login-right { width: 100%; padding: 40px 24px; }
}
@media (max-width: 768px) {
  .page-content { padding: 20px 16px; }
  .topbar { padding: 0 16px; }
  .topbar-search { display: none; }
}

/* ============================================================
   UTILITIES
   ============================================================ */
.text-gradient {
  background: var(--ig-grad-soft);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.cursor-pointer { cursor: pointer; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: 6px;
}
@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Pulse animation */
@keyframes pulse {
  0%,100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.animate-pulse { animation: pulse 2s infinite; }

/* Fade in */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.3s ease forwards; }