/* ============================================================
   LeadFlow — Premium CRM Dashboard
   Custom CSS Theme (DM Sans + Fraunces)
   ============================================================ */

/* ---------- CSS Variables ---------- */
:root {
  --accent: #5046e5;
  --accent-hover: #3e35c4;
  --accent-light: #ede9fc;
  --accent-glow: rgba(80, 70, 229, 0.18);

  --bg-base: #f4f5f8;
  --bg-card: #ffffff;
  --bg-sidebar: #0f0f1a;
  --bg-navbar: #ffffff;
  --bg-input: #f7f8fc;
  --bg-hover: #f0f1f8;

  --text-primary: #0f0f1a;
  --text-secondary: #5c5f72;
  --text-muted: #9fa3b5;
  --text-light: #ffffff;
  --text-accent: #5046e5;

  --border: #e5e7f0;
  --border-focus: #5046e5;

  --shadow-sm: 0 1px 4px rgba(15,15,26,.06);
  --shadow-md: 0 4px 20px rgba(15,15,26,.09);
  --shadow-lg: 0 8px 40px rgba(15,15,26,.13);
  --shadow-accent: 0 4px 20px rgba(80,70,229,.22);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --sidebar-w: 240px;
  --navbar-h: 64px;
  --transition: 0.22s cubic-bezier(.4,0,.2,1);

  /* Status colors */
  --c-new: #3b82f6;
  --c-contacted: #8b5cf6;
  --c-interested: #10b981;
  --c-followup: #f59e0b;
  --c-won: #059669;
  --c-lost: #ef4444;
  --c-high: #ef4444;
  --c-medium: #f59e0b;
  --c-low: #6b7280;
  --c-paid: #10b981;
  --c-pending: #f59e0b;
  --c-partial: #3b82f6;
  --c-na: #9ca3af;
}

/* Dark Mode Variables */
[data-theme="dark"] {
  --bg-base: #0b0b14;
  --bg-card: #14141f;
  --bg-sidebar: #08080f;
  --bg-navbar: #0f0f1c;
  --bg-input: #1c1c2e;
  --bg-hover: #1e1e30;

  --text-primary: #e8e9f3;
  --text-secondary: #9fa3c0;
  --text-muted: #5c5f7a;

  --border: #262636;
  --border-focus: #5046e5;

  --shadow-sm: 0 1px 4px rgba(0,0,0,.3);
  --shadow-md: 0 4px 20px rgba(0,0,0,.4);
  --shadow-lg: 0 8px 40px rgba(0,0,0,.5);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  font-size: 14.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background var(--transition), color var(--transition);
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  color: var(--text-primary);
}

a { text-decoration: none; color: var(--accent); }
a:hover { color: var(--accent-hover); }

.text-accent { color: var(--accent) !important; }

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

/* ============================================================
   NAVBAR
   ============================================================ */
.lf-navbar {
  background: var(--bg-navbar);
  border-bottom: 1px solid var(--border);
  height: var(--navbar-h);
  padding: 0 1rem;
  box-shadow: var(--shadow-sm);
  z-index: 1040;
  transition: background var(--transition), border-color var(--transition);
}

.lf-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text-primary) !important;
  text-decoration: none;
}

.lf-brand-icon {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--accent), #7c6ff7);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-size: 1rem;
  box-shadow: var(--shadow-accent);
  flex-shrink: 0;
}

.lf-brand-text { font-family: 'Fraunces', serif; letter-spacing: -0.3px; }

/* Search */
.lf-search-wrap { flex: 1; max-width: 420px; position: relative; }
.lf-search-box { position: relative; }
.lf-search-icon {
  position: absolute; left: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 13px;
  z-index: 1;
}
.lf-search-input {
  background: var(--bg-input) !important;
  border: 1.5px solid var(--border) !important;
  border-radius: 10px !important;
  padding-left: 38px !important;
  color: var(--text-primary) !important;
  font-size: 13.5px !important;
  transition: border-color var(--transition), box-shadow var(--transition);
  height: 40px;
}
.lf-search-input:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px var(--accent-glow) !important;
  outline: none !important;
  background: var(--bg-card) !important;
}
.lf-search-input::placeholder { color: var(--text-muted); }

.lf-search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  max-height: 340px;
  overflow-y: auto;
  display: none;
}
.lf-search-results.active { display: block; }
.lf-search-result-item {
  padding: 10px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: background var(--transition);
  border-bottom: 1px solid var(--border);
}
.lf-search-result-item:last-child { border-bottom: none; }
.lf-search-result-item:hover { background: var(--bg-hover); }
.lf-search-result-avatar {
  width: 34px; height: 34px;
  background: var(--accent-light);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 13px; color: var(--accent);
  flex-shrink: 0;
}
.lf-search-result-info .lf-sri-name { font-weight: 600; font-size: 13.5px; }
.lf-search-result-info .lf-sri-sub { font-size: 12px; color: var(--text-muted); }

/* Navbar icons */
.lf-icon-btn {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  transition: all var(--transition);
}
.lf-icon-btn:hover {
  background: var(--bg-input);
  color: var(--accent);
  border-color: var(--accent-light);
}

.lf-notif-badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--c-lost);
  color: white; font-size: 9px;
  width: 16px; height: 16px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  border: 2px solid var(--bg-navbar);
  pointer-events: none;
}

.lf-avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--accent), #7c6ff7);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 13px;
  cursor: pointer;
  box-shadow: var(--shadow-accent);
  flex-shrink: 0;
}

.lf-menu-btn {
  border: 1.5px solid var(--border);
  background: transparent;
  border-radius: 10px;
  color: var(--text-secondary);
  width: 38px; height: 38px;
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
}

.lf-mobile-search { background: var(--bg-navbar); }

/* ============================================================
   LAYOUT
   ============================================================ */
.lf-layout {
  display: flex;
  min-height: calc(100vh - var(--navbar-h));
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.lf-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-sidebar);
  position: sticky;
  top: var(--navbar-h);
  height: calc(100vh - var(--navbar-h));
  overflow-y: auto;
  padding: 20px 0 0;
  border-right: 1px solid rgba(255,255,255,0.05);
  transition: background var(--transition);
}

.lf-nav-group-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.25);
  padding: 0 20px;
  margin-bottom: 6px;
  margin-top: 6px;
}

.lf-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: rgba(255,255,255,0.55);
  font-weight: 500;
  font-size: 14px;
  border-radius: 0;
  transition: all var(--transition);
  cursor: pointer;
  position: relative;
  text-decoration: none;
}
.lf-nav-item:hover {
  color: rgba(255,255,255,0.9);
  background: rgba(255,255,255,0.06);
}
.lf-nav-item.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(80,70,229,0.25) 0%, rgba(80,70,229,0.08) 100%);
}
.lf-nav-item.active::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}
.lf-nav-item i {
  font-size: 15px;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

.lf-nav-badge {
  margin-left: auto;
  background: rgba(80,70,229,0.3);
  color: #a5a0f5;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
  min-width: 22px;
  text-align: center;
}
.lf-badge-warn { background: rgba(245,158,11,0.2); color: #fbbf24; }

.lf-nav-divider {
  height: 1px;
  background: rgba(255,255,255,0.07);
  margin: 12px 20px;
}

.lf-sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.07);
  margin-top: auto;
}
.lf-sidebar-footer-brand {
  display: flex; align-items: center; gap: 8px;
  color: rgba(255,255,255,0.45);
  font-size: 12.5px;
  font-weight: 600;
}
.lf-sidebar-footer small {
  display: block;
  color: rgba(255,255,255,0.2);
  font-size: 11px;
  margin-top: 3px;
}

/* Offcanvas sidebar */
.lf-offcanvas { background: var(--bg-sidebar); border-right: 1px solid rgba(255,255,255,0.06); }
.lf-offcanvas-header { border-bottom: 1px solid rgba(255,255,255,0.07); padding: 16px 20px; }
.lf-offcanvas .lf-brand { color: white !important; }

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.lf-main {
  flex: 1;
  overflow-x: hidden;
  padding: 32px 32px 80px;
  min-width: 0;
}

@media (max-width: 768px) {
  .lf-main { padding: 20px 16px 80px; }
}

/* ============================================================
   SECTIONS ROUTING
   ============================================================ */
.lf-section {
  display: none;
  animation: sectionIn 0.3s cubic-bezier(.4,0,.2,1);
}
.lf-section.active { display: block; }

@keyframes sectionIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   SECTION HEADER
   ============================================================ */
.lf-section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 16px;
}
.lf-section-title {
  font-family: 'Fraunces', serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 4px;
  letter-spacing: -0.5px;
}
.lf-section-sub { color: var(--text-muted); margin: 0; font-size: 14px; }

/* ============================================================
   WELCOME BANNER
   ============================================================ */
.lf-welcome-banner {
  background: linear-gradient(135deg, #5046e5 0%, #7c6ff7 50%, #a78bfa 100%);
  border-radius: var(--radius-xl);
  padding: 32px 36px;
  margin-bottom: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-accent);
}
.lf-welcome-banner::after {
  content: '';
  position: absolute;
  right: -60px; top: -60px;
  width: 260px; height: 260px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  pointer-events: none;
}
.lf-welcome-banner::before {
  content: '';
  position: absolute;
  right: 80px; bottom: -80px;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  pointer-events: none;
}
.lf-welcome-greeting {
  color: rgba(255,255,255,0.75);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin: 0 0 4px;
}
.lf-welcome-title {
  font-family: 'Fraunces', serif;
  font-size: 1.85rem;
  font-weight: 700;
  color: white;
  margin: 0 0 6px;
  letter-spacing: -0.3px;
}
.lf-welcome-sub { color: rgba(255,255,255,0.7); margin: 0; font-size: 14px; }
.lf-welcome-actions { display: flex; gap: 10px; flex-wrap: wrap; position: relative; z-index: 1; }

/* ============================================================
   CARDS
   ============================================================ */
.lf-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow var(--transition), border-color var(--transition), background var(--transition);
}
.lf-card:hover { box-shadow: var(--shadow-md); }

.lf-card-header {
  padding: 20px 24px 0;
}
.lf-card-body { padding: 20px 24px; }
.lf-card-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 16px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
}
.lf-card-sub { color: var(--text-muted); font-size: 13px; margin: 0; }

/* ============================================================
   KPI STAT CARDS
   ============================================================ */
.lf-stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
}
.lf-stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--accent-light);
  color: inherit;
}
.lf-stat-icon {
  width: 48px; height: 48px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.lf-stat-content { flex: 1; min-width: 0; }
.lf-stat-count {
  font-family: 'Fraunces', serif;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 2px;
}
.lf-stat-label { font-size: 12.5px; color: var(--text-muted); font-weight: 500; }

/* Stat color variants */
.lf-stat-blue .lf-stat-icon { background: #eff6ff; color: #3b82f6; }
.lf-stat-purple .lf-stat-icon { background: #f3f0ff; color: #8b5cf6; }
.lf-stat-green .lf-stat-icon { background: #ecfdf5; color: #10b981; }
.lf-stat-amber .lf-stat-icon { background: #fffbeb; color: #f59e0b; }
.lf-stat-emerald .lf-stat-icon { background: #d1fae5; color: #059669; }
.lf-stat-red .lf-stat-icon { background: #fef2f2; color: #ef4444; }
.lf-stat-indigo .lf-stat-icon { background: #eef2ff; color: #6366f1; }
.lf-stat-orange .lf-stat-icon { background: #fff7ed; color: #f97316; }
.lf-stat-teal .lf-stat-icon { background: #f0fdfa; color: #14b8a6; }

[data-theme="dark"] .lf-stat-blue .lf-stat-icon { background: rgba(59,130,246,.15); }
[data-theme="dark"] .lf-stat-purple .lf-stat-icon { background: rgba(139,92,246,.15); }
[data-theme="dark"] .lf-stat-green .lf-stat-icon { background: rgba(16,185,129,.15); }
[data-theme="dark"] .lf-stat-amber .lf-stat-icon { background: rgba(245,158,11,.15); }
[data-theme="dark"] .lf-stat-emerald .lf-stat-icon { background: rgba(5,150,105,.15); }
[data-theme="dark"] .lf-stat-red .lf-stat-icon { background: rgba(239,68,68,.15); }
[data-theme="dark"] .lf-stat-indigo .lf-stat-icon { background: rgba(99,102,241,.15); }
[data-theme="dark"] .lf-stat-orange .lf-stat-icon { background: rgba(249,115,22,.15); }
[data-theme="dark"] .lf-stat-teal .lf-stat-icon { background: rgba(20,184,166,.15); }

/* Pipeline Progress */
.lf-pipeline-item {
  margin-bottom: 16px;
}
.lf-pipeline-item:last-child { margin-bottom: 0; }
.lf-pipeline-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 500;
}
.lf-pipeline-bar {
  height: 8px;
  border-radius: 99px;
  background: var(--bg-input);
  overflow: hidden;
}
.lf-pipeline-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.6s cubic-bezier(.4,0,.2,1);
}

/* ============================================================
   RECENT LEADS LIST
   ============================================================ */
.lf-recent-lead-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
  cursor: pointer;
}
.lf-recent-lead-item:last-child { border-bottom: none; }
.lf-recent-lead-item:hover { background: var(--bg-hover); }
.lf-lead-avatar {
  width: 38px; height: 38px;
  background: var(--accent-light);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
  color: var(--accent);
  flex-shrink: 0;
}
.lf-lead-info { flex: 1; min-width: 0; }
.lf-lead-name { font-weight: 600; font-size: 14px; }
.lf-lead-sub { font-size: 12px; color: var(--text-muted); }
.lf-lead-meta { text-align: right; }
.lf-lead-date { font-size: 11.5px; color: var(--text-muted); }

/* ============================================================
   BUTTONS
   ============================================================ */
.lf-btn-primary {
  background: linear-gradient(135deg, var(--accent), #7c6ff7);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 9px 20px;
  font-weight: 600;
  font-size: 14px;
  transition: all var(--transition);
  box-shadow: 0 2px 8px rgba(80,70,229,.25);
  display: inline-flex; align-items: center;
}
.lf-btn-primary:hover {
  background: linear-gradient(135deg, var(--accent-hover), #6454e8);
  box-shadow: var(--shadow-accent);
  transform: translateY(-1px);
  color: white;
}
.lf-btn-primary:active { transform: translateY(0); }

.lf-btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-secondary);
  border-radius: 10px;
  padding: 9px 20px;
  font-weight: 600;
  font-size: 14px;
  transition: all var(--transition);
  display: inline-flex; align-items: center;
}
.lf-btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

.lf-btn-ghost {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  border-radius: 8px;
  padding: 6px 12px;
  font-weight: 500;
  font-size: 13.5px;
  transition: all var(--transition);
  display: inline-flex; align-items: center;
}
.lf-btn-ghost:hover { background: var(--bg-hover); color: var(--accent); }

.lf-btn-danger { border-radius: 10px; font-weight: 600; }

/* Action icon buttons in table */
.lf-action-btn {
  width: 30px; height: 30px;
  border-radius: 7px;
  border: 1.5px solid var(--border);
  background: transparent;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px;
  color: var(--text-secondary);
  transition: all var(--transition);
  cursor: pointer;
  padding: 0;
}
.lf-action-btn:hover {
  background: var(--accent-light);
  border-color: var(--accent-light);
  color: var(--accent);
}
.lf-action-btn.btn-view:hover { background: #eff6ff; border-color: #dbeafe; color: #3b82f6; }
.lf-action-btn.btn-edit:hover { background: #fef9c3; border-color: #fef08a; color: #ca8a04; }
.lf-action-btn.btn-delete:hover { background: #fef2f2; border-color: #fecaca; color: #ef4444; }
.lf-action-btn.btn-whatsapp:hover { background: #dcfce7; border-color: #bbf7d0; color: #16a34a; }
.lf-action-btn.btn-call:hover { background: #eff6ff; border-color: #bfdbfe; color: #2563eb; }
.lf-action-btn.btn-won:hover { background: #d1fae5; border-color: #a7f3d0; color: #059669; }
.lf-action-btn.btn-lost:hover { background: #fef2f2; border-color: #fecaca; color: #dc2626; }

/* Welcome banner buttons */
.lf-welcome-banner .lf-btn-primary {
  background: rgba(255,255,255,0.2);
  border: 1.5px solid rgba(255,255,255,0.3);
  box-shadow: none;
  backdrop-filter: blur(10px);
}
.lf-welcome-banner .lf-btn-primary:hover {
  background: rgba(255,255,255,0.3);
  transform: translateY(-1px);
}
.lf-welcome-banner .lf-btn-outline {
  background: transparent;
  border: 1.5px solid rgba(255,255,255,0.4);
  color: white;
}
.lf-welcome-banner .lf-btn-outline:hover {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.6);
  color: white;
}

/* ============================================================
   BADGES
   ============================================================ */
.lf-badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.lf-badge-blue { background: #eff6ff; color: #3b82f6; }
.lf-badge-purple { background: #f3f0ff; color: #8b5cf6; }
.lf-badge-green { background: #ecfdf5; color: #10b981; }
.lf-badge-amber { background: #fffbeb; color: #d97706; }
.lf-badge-emerald { background: #d1fae5; color: #059669; }
.lf-badge-red { background: #fef2f2; color: #ef4444; }
.lf-badge-gray { background: #f3f4f6; color: #6b7280; }
.lf-badge-orange { background: #fff7ed; color: #ea580c; }
.lf-badge-teal { background: #f0fdfa; color: #0d9488; }
.lf-badge-indigo { background: #eef2ff; color: #4f46e5; }
.lf-badge-rose { background: #fff1f2; color: #e11d48; }

[data-theme="dark"] .lf-badge-blue { background: rgba(59,130,246,.15); }
[data-theme="dark"] .lf-badge-purple { background: rgba(139,92,246,.15); }
[data-theme="dark"] .lf-badge-green { background: rgba(16,185,129,.15); }
[data-theme="dark"] .lf-badge-amber { background: rgba(245,158,11,.15); }
[data-theme="dark"] .lf-badge-emerald { background: rgba(5,150,105,.15); }
[data-theme="dark"] .lf-badge-red { background: rgba(239,68,68,.15); }
[data-theme="dark"] .lf-badge-gray { background: rgba(107,114,128,.15); }
[data-theme="dark"] .lf-badge-orange { background: rgba(249,115,22,.15); }
[data-theme="dark"] .lf-badge-teal { background: rgba(20,184,166,.15); }
[data-theme="dark"] .lf-badge-indigo { background: rgba(99,102,241,.15); }
[data-theme="dark"] .lf-badge-rose { background: rgba(225,29,72,.15); }

/* ============================================================
   TABLE
   ============================================================ */
.lf-table-wrap { overflow-x: auto; }

.lf-table {
  margin: 0;
  font-size: 13.5px;
  min-width: 900px;
}
.lf-table thead th {
  background: var(--bg-input);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  border-bottom: 1.5px solid var(--border);
  padding: 12px 16px;
  white-space: nowrap;
  position: sticky; top: 0; z-index: 2;
}
.lf-table tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text-primary);
}
.lf-table tbody tr:last-child td { border-bottom: none; }
.lf-table tbody tr:hover td { background: var(--bg-hover); }
.lf-table tbody tr { transition: background var(--transition); }

.lf-table .td-name { font-weight: 600; }
.lf-table .td-phone { font-family: monospace; font-size: 13px; color: var(--text-secondary); }
.lf-table .td-actions { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; }

.lf-table-footer { background: var(--bg-input); border-top: 1px solid var(--border); }
.lf-table-info { font-size: 13px; color: var(--text-muted); }

/* Pagination */
.lf-page-btn {
  width: 32px; height: 32px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  display: flex; align-items: center; justify-content: center;
}
.lf-page-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
.lf-page-btn.active { background: var(--accent); border-color: var(--accent); color: white; }

/* ============================================================
   FORMS
   ============================================================ */
.lf-label { font-weight: 600; font-size: 13.5px; color: var(--text-secondary); margin-bottom: 6px; display: block; }
.lf-label-sm { font-weight: 600; font-size: 11.5px; color: var(--text-muted); margin-bottom: 5px; display: block; text-transform: uppercase; letter-spacing: 0.5px; }

.lf-input {
  background: var(--bg-input) !important;
  border: 1.5px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  color: var(--text-primary) !important;
  font-size: 14px !important;
  padding: 10px 14px !important;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition) !important;
}
.lf-input:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px var(--accent-glow) !important;
  outline: none !important;
  background: var(--bg-card) !important;
}
.lf-input::placeholder { color: var(--text-muted) !important; }
.lf-input.is-invalid { border-color: #ef4444 !important; }

.lf-input-sm { height: 36px !important; padding: 6px 12px !important; font-size: 13px !important; }
.form-select.lf-input-sm { height: 36px !important; padding: 6px 12px !important; font-size: 13px !important; }

.lf-input-icon { position: relative; }
.lf-input-icon i {
  position: absolute; left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted); font-size: 13px;
  z-index: 1;
}
.lf-input-icon .lf-input { padding-left: 34px !important; }

.lf-error { color: #ef4444; font-size: 12px; margin-top: 4px; display: none; }
.lf-error.visible { display: block; }

.lf-helper-text { color: var(--text-muted); font-size: 12px; margin: 4px 0 0; }

.lf-form-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; padding-top: 16px; border-top: 1px solid var(--border); }

/* ============================================================
   QUICK ACTIONS GRID
   ============================================================ */
.lf-quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.lf-quick-action {
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all var(--transition);
  font-weight: 600;
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
}
.lf-quick-action i { font-size: 22px; color: var(--accent); }
.lf-quick-action:hover {
  background: var(--accent-light);
  border-color: var(--accent-light);
  color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ============================================================
   TIPS LIST
   ============================================================ */
.lf-tips-card { border-color: #fef9c3; }
[data-theme="dark"] .lf-tips-card { border-color: rgba(245,158,11,.2); }

.lf-tips-list { list-style: none; padding: 0; margin: 0; }
.lf-tips-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--text-secondary);
}
.lf-tips-list li:last-child { border-bottom: none; }
.lf-tips-list li i { color: #10b981; flex-shrink: 0; margin-top: 2px; }

/* ============================================================
   FOLLOW-UP TABS
   ============================================================ */
.lf-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 5px;
  list-style: none;
  width: fit-content;
}
.lf-tab {
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 18px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}
.lf-tab:hover { color: var(--text-primary); background: var(--bg-hover); }
.lf-tab.active {
  background: var(--accent);
  color: white;
  box-shadow: 0 2px 8px rgba(80,70,229,.25);
}
.lf-tab-badge {
  background: rgba(255,255,255,0.2);
  border-radius: 99px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 700;
}
.lf-tab:not(.active) .lf-tab-badge { background: var(--bg-input); color: var(--text-secondary); }
.lf-tab-badge-red { background: var(--c-lost); color: white; }

.followup-tab-content { display: none; }
.followup-tab-content.active { display: block; }

/* Follow-up cards */
.lf-followup-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}
.lf-followup-card:hover { box-shadow: var(--shadow-md); border-color: var(--accent-light); }
.lf-followup-card.overdue { border-color: #fecaca; background: #fff5f5; }
[data-theme="dark"] .lf-followup-card.overdue { border-color: rgba(239,68,68,.25); background: rgba(239,68,68,.05); }
.lf-followup-card.today { border-color: #bfdbfe; }

.lf-fc-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
  gap: 10px;
}
.lf-fc-name { font-weight: 700; font-size: 15px; }
.lf-fc-meta { font-size: 12.5px; color: var(--text-muted); margin: 2px 0; }
.lf-fc-badges { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 10px; }
.lf-fc-notes {
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--bg-input);
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
}
.lf-fc-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.lf-fc-action-btn {
  padding: 5px 12px;
  border-radius: 7px;
  border: 1.5px solid var(--border);
  background: transparent;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  display: flex; align-items: center; gap: 5px;
}
.lf-fc-action-btn:hover { background: var(--accent-light); color: var(--accent); border-color: var(--accent-light); }
.lf-fc-action-btn.green:hover { background: #dcfce7; color: #16a34a; border-color: #bbf7d0; }
.lf-fc-action-btn.red:hover { background: #fef2f2; color: #dc2626; border-color: #fecaca; }
.lf-fc-action-btn.blue:hover { background: #eff6ff; color: #2563eb; border-color: #bfdbfe; }

/* ============================================================
   EMPTY STATES
   ============================================================ */
.lf-empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-muted);
}
.lf-empty-icon {
  width: 72px; height: 72px;
  background: var(--bg-input);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  margin: 0 auto 16px;
  color: var(--text-muted);
}
.lf-empty-state h3 { font-size: 17px; margin-bottom: 6px; color: var(--text-secondary); }
.lf-empty-state p { font-size: 13.5px; color: var(--text-muted); }

/* ============================================================
   IMPORT / EXPORT
   ============================================================ */
.lf-export-card {
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
}
.lf-export-card:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.lf-export-card i { font-size: 30px; }
.lf-export-card span { font-weight: 700; font-size: 14px; }
.lf-export-card small { color: var(--text-muted); font-size: 12px; }

.lf-drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg-input);
  color: var(--text-secondary);
}
.lf-drop-zone:hover, .lf-drop-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
}
.lf-drop-icon { font-size: 36px; display: block; margin-bottom: 12px; }
.lf-drop-zone p { margin: 0 0 6px; font-weight: 500; font-size: 14.5px; }
.lf-drop-zone small { color: var(--text-muted); font-size: 12px; }

/* ============================================================
   SETTINGS
   ============================================================ */
.lf-theme-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-secondary);
  transition: all var(--transition);
}
.lf-theme-option:hover, .lf-theme-option.active {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
}
.lf-settings-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
  border-radius: 8px;
  padding: 14px 12px;
  margin: 0 -12px;
}
.lf-settings-action:last-child { border-bottom: none; }
.lf-settings-action:hover { background: var(--bg-hover); }
.lf-settings-action p { font-size: 12.5px; color: var(--text-muted); margin: 2px 0 0; }
.lf-settings-action strong { font-size: 14px; }
.lf-settings-danger:hover { background: #fef2f2; }

.lf-about-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--text-secondary);
}
.lf-about-item:last-child { border-bottom: none; }
.lf-about-item i { font-size: 15px; }

/* ============================================================
   HELP
   ============================================================ */
.lf-accordion { border: none; }
.lf-accordion-item {
  background: var(--bg-card) !important;
  border: 1.5px solid var(--border) !important;
  border-radius: var(--radius-md) !important;
  margin-bottom: 10px;
  overflow: hidden;
}
.lf-accordion-btn {
  background: var(--bg-card) !important;
  color: var(--text-primary) !important;
  font-weight: 600 !important;
  font-size: 14.5px !important;
  padding: 16px 20px !important;
  border: none !important;
  box-shadow: none !important;
  display: flex; align-items: center;
}
.lf-accordion-btn:not(.collapsed) { color: var(--accent) !important; }
.lf-accordion-btn::after { filter: none !important; }
.lf-accordion-body {
  padding: 0 20px 18px !important;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.7;
}

.lf-help-contact-card {
  background: linear-gradient(135deg, var(--accent), #7c6ff7);
  border: none;
  color: white;
}
.lf-help-contact-card .lf-card-body { color: white; }
.lf-help-icon {
  width: 60px; height: 60px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  margin: 0 auto 16px;
}
.lf-help-contact-card h3 { color: white; font-size: 1.2rem; }
.lf-help-contact-card p { color: rgba(255,255,255,0.8); font-size: 13.5px; }
.lf-help-features { text-align: left; margin-top: 16px; }
.lf-help-features > div {
  padding: 7px 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex; align-items: center; gap: 8px;
  font-size: 13.5px;
  color: rgba(255,255,255,0.9);
}
.lf-help-features > div:last-child { border-bottom: none; }
.lf-help-features i { color: #6ee7b7; }

/* ============================================================
   MODALS
   ============================================================ */
.lf-modal-content {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}
.lf-modal-header {
  background: var(--bg-input);
  border-bottom: 1.5px solid var(--border);
  padding: 18px 24px;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}
.lf-modal-title { font-weight: 700; font-size: 16px; display: flex; align-items: center; }
.lf-modal-body { padding: 24px; color: var(--text-primary); }
.lf-modal-footer { border-top: 1.5px solid var(--border); padding: 16px 24px; background: var(--bg-input); }

/* Lead detail sections in modal */
.lf-detail-section { margin-bottom: 24px; }
.lf-detail-section-title {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.lf-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.lf-detail-item {}
.lf-detail-label { font-size: 12px; color: var(--text-muted); font-weight: 500; margin-bottom: 3px; }
.lf-detail-value { font-size: 14.5px; font-weight: 600; color: var(--text-primary); }
.lf-detail-value.muted { font-weight: 400; color: var(--text-secondary); }

/* Timeline */
.lf-timeline { list-style: none; padding: 0; margin: 0; }
.lf-timeline-item {
  display: flex;
  gap: 14px;
  padding-bottom: 16px;
  position: relative;
}
.lf-timeline-item::before {
  content: '';
  position: absolute;
  left: 15px; top: 30px;
  width: 1.5px; height: calc(100% - 14px);
  background: var(--border);
}
.lf-timeline-item:last-child::before { display: none; }
.lf-timeline-dot {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
  z-index: 1;
}
.lf-timeline-body {}
.lf-timeline-text { font-size: 13.5px; font-weight: 500; color: var(--text-primary); }
.lf-timeline-time { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }

/* ============================================================
   TOASTS
   ============================================================ */
.lf-toast {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 14px 18px;
  min-width: 300px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 500;
  animation: toastIn 0.3s cubic-bezier(.4,0,.2,1);
}
@keyframes toastIn {
  from { transform: translateX(60px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
.lf-toast-icon { font-size: 18px; flex-shrink: 0; }
.lf-toast-body { flex: 1; }
.lf-toast-title { font-weight: 700; font-size: 13.5px; }
.lf-toast-msg { font-size: 13px; color: var(--text-muted); }
.lf-toast-close {
  background: none; border: none;
  color: var(--text-muted); cursor: pointer;
  font-size: 16px;
  padding: 0; flex-shrink: 0;
}
.lf-toast.success { border-left: 4px solid #10b981; }
.lf-toast.success .lf-toast-icon { color: #10b981; }
.lf-toast.error { border-left: 4px solid #ef4444; }
.lf-toast.error .lf-toast-icon { color: #ef4444; }
.lf-toast.warning { border-left: 4px solid #f59e0b; }
.lf-toast.warning .lf-toast-icon { color: #f59e0b; }
.lf-toast.info { border-left: 4px solid #3b82f6; }
.lf-toast.info .lf-toast-icon { color: #3b82f6; }

/* ============================================================
   SCROLL TO TOP
   ============================================================ */
.lf-scroll-top {
  position: fixed;
  bottom: 28px; right: 28px;
  width: 44px; height: 44px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 50%;
  box-shadow: var(--shadow-accent);
  display: none;
  align-items: center; justify-content: center;
  font-size: 17px;
  cursor: pointer;
  z-index: 999;
  transition: all var(--transition);
}
.lf-scroll-top.visible { display: flex; }
.lf-scroll-top:hover { background: var(--accent-hover); transform: translateY(-2px); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 991px) {
  .lf-main { padding: 24px 20px 80px; }
  .lf-welcome-banner { padding: 24px 24px; }
  .lf-welcome-title { font-size: 1.5rem; }
}

@media (max-width: 768px) {
  .lf-welcome-banner { flex-direction: column; align-items: flex-start; }
  .lf-quick-actions-grid { grid-template-columns: repeat(2, 1fr); }
  .lf-detail-grid { grid-template-columns: 1fr; }
  .lf-tabs { width: 100%; }
  .lf-tab { flex: 1; justify-content: center; }
}

@media (max-width: 480px) {
  .lf-main { padding: 16px 12px 80px; }
  .lf-section-title { font-size: 1.4rem; }
  .lf-stat-count { font-size: 1.6rem; }
  .lf-welcome-title { font-size: 1.3rem; }
}

/* ============================================================
   DARK MODE OVERRIDES
   ============================================================ */
[data-theme="dark"] .lf-accordion-btn { background: var(--bg-card) !important; }
[data-theme="dark"] .lf-help-contact-card { background: linear-gradient(135deg, #3730a3, #5046e5); }
[data-theme="dark"] .btn-close { filter: invert(1); }
[data-theme="dark"] .lf-table thead th { background: var(--bg-input); }
[data-theme="dark"] .lf-tips-card { border-color: rgba(245,158,11,.2); }
[data-theme="dark"] .lf-export-card:hover { background: rgba(80,70,229,.15); }
[data-theme="dark"] .modal-backdrop { background: rgba(0,0,0,0.7); }
[data-theme="dark"] .form-select option { background: var(--bg-input); }

/* ============================================================
   META ADS, KANBAN & WHATSAPP REMINDERS — NEW MODULES
   ============================================================ */

/* Meta brand badge used in nav + section headers */
.lf-badge-meta-nav {
  background: linear-gradient(90deg, #1877f2, #c13584);
  color: #fff;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
}
.lf-meta-source-badge i { color: #1877f2; }
.lf-meta-source-badge:has(+ *) {}

.lf-meta-subfields {
  background: var(--bg-input);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

/* ---------- View toggle (List / Kanban) ---------- */
.lf-view-toggle {
  display: inline-flex;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
  gap: 4px;
}
.lf-view-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 999px;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}
.lf-view-btn:hover { color: var(--text-primary); }
.lf-view-btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-accent);
}

/* ---------- Kanban board ---------- */
.lf-kanban-wrap { overflow-x: auto; padding-bottom: 8px; }
.lf-kanban-board {
  display: flex;
  gap: 16px;
  min-width: 900px;
}
.lf-kanban-col {
  flex: 1;
  min-width: 220px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  max-height: 620px;
}
.lf-kanban-col.drag-over {
  border-color: var(--accent);
  background: var(--accent-light);
}
[data-theme="dark"] .lf-kanban-col.drag-over { background: rgba(80,70,229,.12); }
.lf-kanban-col-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 13.5px;
  padding: 4px 4px 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
}
.lf-kanban-col-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  flex: 1;
}
.lf-kanban-card {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  cursor: grab;
  transition: var(--transition);
}
.lf-kanban-card:hover { box-shadow: var(--shadow-md); border-color: var(--accent-light); transform: translateY(-1px); }
.lf-kanban-card:active { cursor: grabbing; }
.lf-kanban-card-top { display: flex; align-items: center; gap: 8px; }
.lf-kanban-card-name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lf-kanban-card-meta { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.lf-kanban-empty { text-align: center; color: var(--text-muted); font-size: 12.5px; padding: 20px 4px; }

/* ---------- WhatsApp Reminder cards ---------- */
.lf-reminder-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  background: var(--bg-input);
  transition: var(--transition);
}
.lf-reminder-card:last-child { margin-bottom: 0; }
.lf-reminder-card.overdue { border-color: #fecaca; }
[data-theme="dark"] .lf-reminder-card.overdue { border-color: rgba(239,68,68,.3); }
.lf-reminder-info { flex: 1; min-width: 0; }
.lf-reminder-name { font-weight: 700; font-size: 14.5px; }
.lf-reminder-meta { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.lf-reminder-preview {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-style: italic;
}
.lf-reminder-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

@media (max-width: 576px) {
  .lf-reminder-card { flex-direction: column; }
  .lf-reminder-actions { flex-direction: row; width: 100%; }
  .lf-reminder-actions .btn { flex: 1; }
}

/* ============================================================
   WHATSAPP CHAT LOG + CHANNEL TOGGLE + POLISH
   ============================================================ */

.lf-channel-toggle { width: fit-content; }
.lf-fc-chat { border-left: 3px solid #25D366; }

.lf-chat-section {
  margin-top: 4px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0;
  overflow: hidden;
}

.lf-chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #075E54;
  color: #fff;
}
[data-theme="dark"] .lf-chat-header { background: #0b3d36; }
.lf-chat-header-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
  flex-shrink: 0;
}
.lf-chat-header-info { flex: 1; min-width: 0; }
.lf-chat-header-name { font-weight: 700; font-size: 14px; color: #fff; }
.lf-chat-header-status { font-size: 11.5px; color: rgba(255,255,255,.75); }
.lf-chat-header .lf-badge { flex-shrink: 0; }

.lf-chat-thread {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
  padding: 16px;
  background: #e5ddd5;
  background-image:
    radial-gradient(rgba(0,0,0,0.035) 1px, transparent 1px),
    radial-gradient(rgba(0,0,0,0.035) 1px, transparent 1px);
  background-size: 26px 26px;
  background-position: 0 0, 13px 13px;
}
[data-theme="dark"] .lf-chat-thread {
  background: #0b141a;
  background-image:
    radial-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    radial-gradient(rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 26px 26px;
  background-position: 0 0, 13px 13px;
}

.lf-chat-input-row { display: flex; gap: 8px; margin: 14px 16px 10px; }
.lf-chat-input-row input { flex: 1; }
.lf-chat-send-btn { background: #075E54; border-color: #075E54; }

.lf-chat-followup-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  padding: 0 16px 16px;
}
.lf-chat-followup-row input[type="date"],
.lf-chat-followup-row input[type="time"] { max-width: 150px; }

@media (max-width: 576px) {
  .lf-chat-input-row { flex-wrap: wrap; margin-left: 12px; margin-right: 12px; }
  .lf-chat-followup-row { flex-direction: column; align-items: stretch; padding: 0 12px 14px; }
  .lf-chat-followup-row .ms-auto { margin-left: 0 !important; }
}

/* ---------- Modern / clean visual polish pass ---------- */

.lf-card {
  transition: box-shadow .25s ease, transform .25s ease, border-color .25s ease;
}
.lf-card:hover {
  box-shadow: var(--shadow-md);
}

.lf-section-title {
  position: relative;
  padding-left: 14px;
}
.lf-section-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 4px;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--accent), #8b5cf6);
}

.lf-kpi-card, .lf-stat-card {
  transition: transform .2s ease, box-shadow .2s ease;
}
.lf-kpi-card:hover, .lf-stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.lf-badge {
  letter-spacing: .1px;
}

.btn.lf-btn-primary, .btn.lf-btn-outline {
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn.lf-btn-primary:hover { transform: translateY(-1px); }
.btn.lf-btn-outline:hover { transform: translateY(-1px); }

.lf-chat-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 30px 12px;
  font-size: 13px;
}
.lf-chat-empty i { font-size: 24px; display: block; margin-bottom: 8px; color: #25D366; opacity: .7; }
.lf-chat-empty p { margin: 0; }

.lf-chat-bubble {
  max-width: 78%;
  padding: 7px 9px 6px;
  border-radius: 8px;
  font-size: 13.5px;
  line-height: 1.4;
  position: relative;
  box-shadow: 0 1px 1px rgba(0,0,0,.08);
}
.lf-chat-bubble.out {
  align-self: flex-end;
  background: #d9fdd3;
  color: #111b21;
  border-top-right-radius: 2px;
}
[data-theme="dark"] .lf-chat-bubble.out {
  background: #005c4b;
  color: #e9edef;
}
.lf-chat-bubble.in {
  align-self: flex-start;
  background: #ffffff;
  color: #111b21;
  border-top-left-radius: 2px;
}
[data-theme="dark"] .lf-chat-bubble.in {
  background: #202c33;
  color: #e9edef;
}
.lf-chat-bubble-text { white-space: pre-wrap; word-break: break-word; }
.lf-chat-bubble-time {
  font-size: 10.5px;
  color: rgba(17,27,33,.55);
  margin-top: 3px;
  text-align: right;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 3px;
}
[data-theme="dark"] .lf-chat-bubble-time { color: rgba(233,237,239,.55); }
.lf-chat-tick { color: #53bdeb; font-size: 13px; }

.lf-badge-whatsapp {
  background: #075E54;
  color: #fff;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
}

.text-whatsapp { color: #25D366 !important; }

/* ============================================================
   AUTH / LOGIN (added for Laravel MVC conversion)
   ============================================================ */
.lf-auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top left, var(--accent-light), var(--bg-base) 60%);
  padding: 24px;
}

.lf-auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
}

.lf-auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: 1.3rem;
  margin-bottom: 24px;
  color: var(--text-primary);
}

.lf-auth-title {
  font-family: 'Fraunces', serif;
  font-size: 1.6rem;
  margin-bottom: 4px;
}

.lf-auth-sub {
  color: var(--text-secondary);
  font-size: 13.5px;
  margin-bottom: 24px;
}

.lf-auth-demo {
  margin-top: 24px;
  padding: 14px 16px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.8;
}

/* Dropdown avatar menu tweaks */
.dropdown-menu { border-radius: var(--radius-md); border: 1px solid var(--border); box-shadow: var(--shadow-md); }
.dropdown-item-text { font-size: 13px; }

/* Permission checkbox grid (admin roles) */
.lf-permission-group { margin-bottom: 18px; }
.lf-permission-group h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); margin-bottom: 8px; }
.lf-permission-item { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 13.5px; }

/* Kanban drag-over highlight */
.lf-kanban-col.drag-over { outline: 2px dashed var(--accent); outline-offset: -4px; }

/* Table avatar-name cell */
.text-inherit { color: inherit; }
