:root {
  /* Strict Logo Branding Colors */
  --brand-magenta: #d80064;
  --brand-magenta-hover: #b80055;
  --brand-magenta-light: rgba(216, 0, 100, 0.08);
  --brand-magenta-subtle: rgba(216, 0, 100, 0.14);
  --brand-magenta-focus: rgba(216, 0, 100, 0.22);
  --brand-gradient: linear-gradient(135deg, #d80064 0%, #b80055 100%);
  --brand-dual-gradient: linear-gradient(135deg, #d80064 0%, #0070eb 100%);

  --brand-blue: #0070eb;
  --brand-blue-hover: #005bb5;
  --brand-blue-light: rgba(0, 112, 235, 0.08);
  --brand-blue-subtle: rgba(0, 112, 235, 0.14);
  --brand-blue-gradient: linear-gradient(135deg, #0070eb 0%, #005bb5 100%);

  /* Bootstrap / Dasher Theme Overrides */
  --livewire-progress-bar-color: #d80064;
  --ds-primary: #d80064;
  --ds-primary-rgb: 216, 0, 100;
  --ds-primary-text-emphasis: #b80055;
  --ds-primary-bg-subtle: rgba(216, 0, 100, 0.08);
  --ds-primary-border-subtle: rgba(216, 0, 100, 0.25);
  --ds-link-color: #d80064;
  --ds-link-hover-color: #b80055;
  --ds-focus-ring-color: rgba(216, 0, 100, 0.22);

  /* Modern Glass / Hairline Surfaces */
  --app-sidebar-bg: #ffffff;
  --app-sidebar-border: #e2e8f0;
  --app-topbar-bg: rgba(255, 255, 255, 0.88);
  --app-topbar-border: #e2e8f0;
  --app-card-bg: #ffffff;
  --app-card-border: #e2e8f0;
}

[data-bs-theme="dark"] {
  --brand-magenta-light: rgba(216, 0, 100, 0.15);
  --brand-magenta-subtle: rgba(216, 0, 100, 0.25);
  --brand-blue-light: rgba(0, 112, 235, 0.15);
  --brand-blue-subtle: rgba(0, 112, 235, 0.25);

  --ds-primary: #d80064;
  --ds-primary-rgb: 216, 0, 100;
  --ds-primary-text-emphasis: #fca5cf;
  --ds-primary-bg-subtle: rgba(216, 0, 100, 0.2);
  --ds-primary-border-subtle: rgba(216, 0, 100, 0.35);
  --ds-link-color: #f472b6;
  --ds-link-hover-color: #fbcfe8;

  --app-sidebar-bg: #0f172a;
  --app-sidebar-border: #1e293b;
  --app-topbar-bg: rgba(15, 23, 42, 0.88);
  --app-topbar-border: #1e293b;
  --app-card-bg: #111827;
  --app-card-border: #1e293b;
  --ds-body-bg: #0b0f19;
}

#nprogress .spinner {
  display: none;
}

/* ==========================================================================
   SIDEBAR (DESKTOP & OFFCANVAS)
   ========================================================================== */
#miniSidebar {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  bottom: 0 !important;
  height: 100vh !important;
  max-height: 100vh !important;
  z-index: 1040 !important;
  background-color: var(--app-sidebar-bg) !important;
  border-right: 1px solid var(--app-sidebar-border) !important;
  box-shadow: 0 0 24px rgba(0, 0, 0, 0.04);
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

html.expanded #miniSidebar {
  width: 250px !important;
}

html.collapsed #miniSidebar,
html:not(.expanded) #miniSidebar {
  width: 64px !important;
}

.offcanvasNav {
  background-color: var(--app-sidebar-bg) !important;
  border-right: 1px solid var(--app-sidebar-border) !important;
  box-shadow: 0 0 24px rgba(0, 0, 0, 0.04);
}

#miniSidebar .brand-logo,
.offcanvasNav .brand-logo {
  background-color: var(--app-sidebar-bg) !important;
  border-bottom: 1px solid var(--app-sidebar-border) !important;
  height: 64px !important;
  min-height: 64px !important;
  max-height: 64px !important;
  padding: 0 1.25rem !important;
  display: flex !important;
  align-items: center !important;
  box-sizing: border-box !important;
  flex-shrink: 0 !important;
  margin: 0 !important;
}

html.collapsed #miniSidebar .brand-logo,
html:not(.expanded) #miniSidebar .brand-logo {
  padding: 0 !important;
  justify-content: center !important;
}

.brand-logo-full {
  height: 38px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  transition: transform 0.2s ease;
}

.brand-logo-icon {
  height: 32px;
  width: 32px;
  object-fit: contain;
  border-radius: 8px;
}

html.collapsed #miniSidebar .brand-logo-full,
html:not(.expanded) #miniSidebar .brand-logo-full {
  display: none !important;
}

html.collapsed #miniSidebar .brand-logo-icon,
html:not(.expanded) #miniSidebar .brand-logo-icon {
  display: block !important;
}

html.expanded #miniSidebar .brand-logo-full {
  display: block !important;
}

html.expanded #miniSidebar .brand-logo-icon {
  display: none !important;
}

/* Sidebar Menu Scroll Area - Single Slim Scrollbar without double scroll or excess gaps */
.sidebar-menu-scroll {
  flex: 1 1 auto !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding: 0.45rem 0.5rem 0.5rem 0.5rem !important;
  height: calc(100vh - 64px) !important;
  max-height: calc(100vh - 64px) !important;
  margin: 0 !important;
  scrollbar-width: thin !important;
  scrollbar-color: rgba(148, 163, 184, 0.3) transparent !important;
}

.sidebar-menu-scroll::-webkit-scrollbar {
  width: 4px !important;
}

.sidebar-menu-scroll::-webkit-scrollbar-track {
  background: transparent !important;
}

.sidebar-menu-scroll::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3) !important;
  border-radius: 999px !important;
}

.sidebar-menu-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--brand-magenta) !important;
}

html.collapsed #miniSidebar .sidebar-menu-scroll,
html:not(.expanded) #miniSidebar .sidebar-menu-scroll {
  padding: 0.45rem 0 0.5rem 0 !important;
}

/* Eliminate duplicate scrollbar by disabling overflow on inner nav list */
#miniSidebar .navbar-nav,
.offcanvasNav .navbar-nav,
html.expanded #miniSidebar .navbar-nav,
html.collapsed #miniSidebar .navbar-nav,
html:not(.expanded) #miniSidebar .navbar-nav {
  overflow: visible !important;
  height: auto !important;
  max-height: none !important;
  padding: 0 !important;
  margin: 0 !important;
  background-color: transparent !important;
}

#miniSidebar .simplebar-track,
.sidebar-menu-scroll .simplebar-track {
  display: none !important;
}

/* Section Headings in Expanded Mode */
html.expanded #miniSidebar .nav-heading-item,
.offcanvasNav .nav-heading-item {
  display: block !important;
  margin-top: 0.5rem !important;
  margin-bottom: 0.15rem !important;
  list-style: none !important;
}

html.expanded #miniSidebar .nav-heading,
.offcanvasNav .nav-heading {
  font-size: 0.65rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.1em !important;
  text-transform: uppercase !important;
  color: var(--ds-gray-500, #94a3b8) !important;
  padding: 0.45rem 0.75rem 0.15rem 0.75rem !important;
  display: block !important;
  opacity: 0.85;
}

/* Completely Hide Section Headings and Lines in Collapsed / Short Mode */
html.collapsed #miniSidebar .nav-heading-item,
html.collapsed #miniSidebar .nav-heading,
html.collapsed #miniSidebar .nav-line,
html.collapsed #miniSidebar hr,
html:not(.expanded) #miniSidebar .nav-heading-item,
html:not(.expanded) #miniSidebar .nav-heading,
html:not(.expanded) #miniSidebar .nav-line,
html:not(.expanded) #miniSidebar hr {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  max-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  border: 0 !important;
}

/* Nav Link Items - Premium Modern SaaS Architecture */
#miniSidebar .nav-link,
.offcanvasNav .nav-link {
  display: flex !important;
  align-items: center !important;
  gap: 0.65rem !important;
  padding: 0.5rem 0.75rem !important;
  margin: 0.15rem 0 !important;
  border-radius: 9px !important;
  font-weight: 500 !important;
  font-size: 0.84rem !important;
  color: var(--ds-gray-600, #64748b) !important;
  border: 1px solid transparent !important;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1) !important;
  position: relative !important;
  text-decoration: none !important;
  box-sizing: border-box !important;
}

[data-bs-theme="dark"] #miniSidebar .nav-link,
[data-bs-theme="dark"] .offcanvasNav .nav-link {
  color: #94a3b8 !important;
}

#miniSidebar .nav-link .nav-icon,
.offcanvasNav .nav-link .nav-icon {
  width: 28px !important;
  height: 28px !important;
  border-radius: 7px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: inherit !important;
  flex-shrink: 0 !important;
  transition: all 0.18s ease !important;
}

#miniSidebar .nav-link .nav-icon svg,
.offcanvasNav .nav-link .nav-icon svg {
  width: 19px !important;
  height: 19px !important;
  stroke-width: 1.75 !important;
}

#miniSidebar .nav-link .text,
.offcanvasNav .nav-link .text {
  flex: 1 1 auto !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  font-weight: 500 !important;
  transition: color 0.18s ease !important;
}

/* Inactive Hover state */
#miniSidebar .nav-link:hover,
.offcanvasNav .nav-link:hover {
  background-color: rgba(216, 0, 100, 0.05) !important;
  color: var(--ds-gray-900, #0f172a) !important;
  transform: translateX(2px) !important;
}

#miniSidebar .nav-link:hover .nav-icon,
.offcanvasNav .nav-link:hover .nav-icon {
  color: var(--brand-magenta) !important;
  background-color: rgba(216, 0, 100, 0.08) !important;
}

[data-bs-theme="dark"] #miniSidebar .nav-link:hover,
[data-bs-theme="dark"] .offcanvasNav .nav-link:hover {
  background-color: rgba(255, 255, 255, 0.05) !important;
  color: #f8fafc !important;
}

[data-bs-theme="dark"] #miniSidebar .nav-link:hover .nav-icon,
[data-bs-theme="dark"] .offcanvasNav .nav-link:hover .nav-icon {
  color: #fca5cf !important;
  background-color: rgba(216, 0, 100, 0.15) !important;
}

/* Modern Dual-Tone Active State (Expanded) */
html.expanded #miniSidebar .nav-link.active,
.offcanvasNav .nav-link.active,
html.expanded #miniSidebar .nav-link[data-current],
.offcanvasNav .nav-link[data-current] {
  background: linear-gradient(90deg, rgba(216, 0, 100, 0.11) 0%, rgba(216, 0, 100, 0.03) 100%) !important;
  color: var(--brand-magenta) !important;
  font-weight: 600 !important;
  border: 1px solid rgba(216, 0, 100, 0.20) !important;
  box-shadow: 0 2px 8px rgba(216, 0, 100, 0.06) !important;
  transform: none !important;
}

html.expanded #miniSidebar .nav-link.active::before,
.offcanvasNav .nav-link.active::before {
  content: '' !important;
  position: absolute !important;
  left: -1px !important;
  top: 7px !important;
  bottom: 7px !important;
  width: 3.5px !important;
  border-radius: 0 3px 3px 0 !important;
  background: var(--brand-magenta) !important;
  box-shadow: 0 0 8px rgba(216, 0, 100, 0.5) !important;
}

html.expanded #miniSidebar .nav-link.active .nav-icon,
.offcanvasNav .nav-link.active .nav-icon {
  color: var(--brand-magenta) !important;
  background-color: rgba(216, 0, 100, 0.12) !important;
}

html.expanded #miniSidebar .nav-link.active .text,
.offcanvasNav .nav-link.active .text {
  color: var(--brand-magenta) !important;
  font-weight: 600 !important;
}

[data-bs-theme="dark"].expanded #miniSidebar .nav-link.active,
[data-bs-theme="dark"] .offcanvasNav .nav-link.active {
  background: linear-gradient(90deg, rgba(216, 0, 100, 0.20) 0%, rgba(216, 0, 100, 0.06) 100%) !important;
  color: #fca5cf !important;
  border: 1px solid rgba(216, 0, 100, 0.32) !important;
  box-shadow: 0 2px 10px rgba(216, 0, 100, 0.12) !important;
}

[data-bs-theme="dark"].expanded #miniSidebar .nav-link.active .nav-icon,
[data-bs-theme="dark"] .offcanvasNav .nav-link.active .nav-icon {
  color: #fca5cf !important;
  background-color: rgba(216, 0, 100, 0.25) !important;
}

[data-bs-theme="dark"].expanded #miniSidebar .nav-link.active .text,
[data-bs-theme="dark"] .offcanvasNav .nav-link.active .text {
  color: #fca5cf !important;
}

/* Collapsed Sidebar adjustments (Short Mode) */
html.collapsed #miniSidebar .nav-link,
html:not(.expanded) #miniSidebar .nav-link {
  width: 42px !important;
  height: 42px !important;
  margin: 0.35rem auto !important;
  padding: 0 !important;
  border-radius: 10px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transform: none !important;
  border: 1px solid transparent !important;
}

html.collapsed #miniSidebar .nav-link .nav-icon,
html:not(.expanded) #miniSidebar .nav-link .nav-icon {
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  border-radius: 10px !important;
  background: transparent !important;
}

html.collapsed #miniSidebar .nav-link .text,
html:not(.expanded) #miniSidebar .nav-link .text {
  display: none !important;
  visibility: hidden !important;
  width: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
  opacity: 0 !important;
}

html.collapsed #miniSidebar .nav-link.active,
html:not(.expanded) #miniSidebar .nav-link.active,
html.collapsed #miniSidebar .nav-link[data-current],
html:not(.expanded) #miniSidebar .nav-link[data-current] {
  background: var(--brand-gradient) !important;
  color: #ffffff !important;
  border: none !important;
  box-shadow: 0 4px 14px rgba(216, 0, 100, 0.35) !important;
}

html.collapsed #miniSidebar .nav-link.active::before,
html:not(.expanded) #miniSidebar .nav-link.active::before {
  display: none !important;
}

html.collapsed #miniSidebar .nav-link.active .nav-icon,
html:not(.expanded) #miniSidebar .nav-link.active .nav-icon {
  color: #ffffff !important;
  background: transparent !important;
}

html.collapsed #miniSidebar .nav-link.active .nav-icon svg,
html:not(.expanded) #miniSidebar .nav-link.active .nav-icon svg {
  stroke: #ffffff !important;
}

/* Toggle mini vs expanded icons */
html.expanded .collapse-mini {
  display: none !important;
}
html.expanded .collapse-expanded {
  display: inline-flex !important;
}
html.collapsed .collapse-mini,
html:not(.expanded) .collapse-mini {
  display: inline-flex !important;
}
html.collapsed .collapse-expanded,
html:not(.expanded) .collapse-expanded {
  display: none !important;
}

/* ==========================================================================
   TOPBAR NAVBAR
   ========================================================================== */
.navbar-glass {
  background-color: var(--app-topbar-bg) !important;
  border-bottom: 1px solid var(--app-topbar-border) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.02) !important;
  height: 64px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Topbar Toggle Button */
.sidebar-toggle {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  background: rgba(100, 116, 139, 0.08);
  color: var(--ds-gray-700, #334155);
  transition: all 0.2s ease;
  cursor: pointer;
}

.sidebar-toggle:hover {
  background: var(--brand-magenta-light);
  color: var(--brand-magenta);
}

/* Topbar Search Pill Button */
.topbar-search-btn {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.08);
  border: 1px solid transparent;
  color: var(--ds-gray-500, #64748b);
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.topbar-search-btn:hover {
  background: rgba(100, 116, 139, 0.12);
  border-color: rgba(216, 0, 100, 0.2);
  color: var(--ds-gray-700, #334155);
}

.topbar-search-kbd {
  font-size: 0.72rem;
  padding: 0.12rem 0.45rem;
  border-radius: 6px;
  background: var(--app-card-bg);
  border: 1px solid var(--app-card-border);
  color: var(--brand-magenta);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

/* Topbar Icon Buttons */
.topbar-icon-btn {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: transparent;
  border: 1px solid transparent;
  color: var(--ds-gray-600, #64748b);
  position: relative;
  transition: all 0.2s ease;
}

.topbar-icon-btn:hover,
.topbar-icon-btn[aria-expanded="true"] {
  background: var(--brand-magenta-light);
  color: var(--brand-magenta);
  border-color: rgba(216, 0, 100, 0.12);
}

/* Notification Pulse Badge */
.topbar-notification-badge {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--brand-magenta);
  box-shadow: 0 0 0 2px var(--app-topbar-bg);
}

/* User Avatar & Dropdown */
.user-avatar-initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--brand-gradient);
  color: #fff;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0;
  font-family: "Public Sans", sans-serif;
  box-shadow: 0 2px 8px rgba(216, 0, 100, 0.25);
}

.user-avatar-sm {
  width: 34px;
  height: 34px;
  font-size: 13px;
}

.user-avatar-md {
  width: 44px;
  height: 44px;
  font-size: 16px;
}

.user-avatar-lg {
  width: 56px;
  height: 56px;
  font-size: 20px;
}

.user-dropdown-card {
  border-radius: 0.85rem !important;
  border: 1px solid var(--app-card-border) !important;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.12) !important;
  overflow: hidden;
}

.user-dropdown-header {
  background: linear-gradient(135deg, rgba(216, 0, 100, 0.08) 0%, rgba(0, 112, 235, 0.05) 100%);
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid var(--app-card-border);
}

.role-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--brand-magenta-light);
  color: var(--brand-magenta);
  border: 1px solid rgba(216, 0, 100, 0.15);
}

/* ==========================================================================
   DASHBOARD REDESIGN
   ========================================================================== */
.dashboard-hero-banner {
  position: relative;
  overflow: hidden;
  padding: 1.75rem 2rem;
  border-radius: 1rem;
  background: linear-gradient(135deg, rgba(216, 0, 100, 0.08) 0%, rgba(0, 112, 235, 0.06) 100%), var(--app-card-bg);
  border: 1px solid rgba(216, 0, 100, 0.15);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.02);
  margin-bottom: 1.5rem;
}

/* Enhanced Dashboard Hero Banner */
.dashboard-hero-banner {
  position: relative;
  border-radius: 1rem;
  padding: 1.4rem 1.75rem;
  background: var(--app-card-bg);
  border: 1px solid var(--app-card-border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
  margin-bottom: 1.5rem;
  overflow: hidden;
}

[data-bs-theme="dark"] .dashboard-hero-banner {
  background: var(--app-card-bg);
  border-color: var(--app-card-border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

/* Urgent Alert Ribbon */
.dashboard-urgent-alert {
  border-radius: 0.85rem;
  padding: 0.9rem 1.25rem;
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.1) 0%, rgba(245, 158, 11, 0.08) 100%);
  border: 1px solid rgba(239, 68, 68, 0.25);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  animation: pulse-border 2.5s infinite;
}

@keyframes pulse-border {
  0%, 100% { border-color: rgba(239, 68, 68, 0.25); }
  50% { border-color: rgba(239, 68, 68, 0.6); }
}

[data-bs-theme="dark"] .dashboard-urgent-alert {
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.2) 0%, rgba(245, 158, 11, 0.15) 100%);
  border-color: rgba(239, 68, 68, 0.4);
}

/* KPI Stat Cards */
.dashboard-kpi-card {
  position: relative;
  border-radius: 1rem !important;
  background: var(--app-card-bg) !important;
  border: 1px solid var(--app-card-border) !important;
  transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
  overflow: hidden;
}

.dashboard-kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: transparent;
  transition: background 0.3s ease;
}

.dashboard-kpi-card:hover {
  transform: translateY(-4px);
  border-color: rgba(216, 0, 100, 0.35) !important;
  box-shadow: 0 14px 32px rgba(216, 0, 100, 0.12) !important;
}

.dashboard-kpi-card:hover::before {
  background: var(--brand-gradient);
}

.dashboard-kpi-icon-box {
  width: 48px;
  height: 48px;
  border-radius: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.45rem;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  flex-shrink: 0;
}

.dashboard-kpi-card:hover .dashboard-kpi-icon-box {
  transform: scale(1.1) rotate(4deg);
}

.kpi-icon-magenta {
  background: var(--brand-magenta-light);
  color: var(--brand-magenta);
}

.kpi-icon-blue {
  background: var(--brand-blue-light);
  color: var(--brand-blue);
}

.kpi-icon-emerald {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}

.kpi-icon-purple {
  background: rgba(139, 92, 246, 0.12);
  color: #8b5cf6;
}

.kpi-icon-cyan {
  background: rgba(6, 182, 212, 0.12);
  color: #06b6d4;
}

.kpi-icon-amber {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
}

.dashboard-kpi-val {
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ds-gray-900, #0f172a);
}

[data-bs-theme="dark"] .dashboard-kpi-val {
  color: #f8fafc;
}

.dashboard-trend-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.trend-badge-positive {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}

.trend-badge-negative {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}

.trend-badge-neutral {
  background: rgba(100, 116, 139, 0.1);
  color: #64748b;
}

/* Modern Elevated Cards */
.dashboard-card-modern {
  border-radius: 1rem !important;
  background: var(--app-card-bg) !important;
  border: 1px solid var(--app-card-border) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.02);
  transition: all 0.2s ease;
}

.dashboard-chart-wrap {
  position: relative;
  height: 320px;
}

.dashboard-donut-wrap {
  position: relative;
  height: 240px;
}

.dashboard-sparkline-wrap {
  position: relative;
  height: 160px;
}

/* Status Distribution Grid */
.dashboard-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.85rem;
}

.dashboard-status-card-item {
  padding: 0.85rem 1rem;
  border-radius: 0.85rem;
  background: rgba(100, 116, 139, 0.03);
  border: 1px solid var(--app-card-border);
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.dashboard-status-card-item:hover {
  background: var(--brand-magenta-light);
  border-color: rgba(216, 0, 100, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(216, 0, 100, 0.08);
}

.dashboard-status-ring {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
}

/* Lead Temperature Pipeline Cards */
.temp-card {
  padding: 1rem;
  border-radius: 0.85rem;
  border: 1px solid var(--app-card-border);
  background: rgba(100, 116, 139, 0.03);
  transition: all 0.2s ease;
}

.temp-card-hot {
  border-left: 4px solid #ef4444 !important;
}

.temp-card-hot:hover {
  background: rgba(239, 68, 68, 0.05);
}

.temp-card-warm {
  border-left: 4px solid #f59e0b !important;
}

.temp-card-warm:hover {
  background: rgba(245, 158, 11, 0.05);
}

.temp-card-cold {
  border-left: 4px solid #06b6d4 !important;
}

.temp-card-cold:hover {
  background: rgba(6, 182, 212, 0.05);
}

/* Follow-ups Radar Table */
.dashboard-followup-row {
  padding: 0.75rem 0.9rem;
  border-radius: 0.75rem;
  background: rgba(100, 116, 139, 0.03);
  border: 1px solid var(--app-card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  transition: all 0.2s ease;
}

.dashboard-followup-row:hover {
  background: rgba(100, 116, 139, 0.07);
  transform: translateX(3px);
}

.dashboard-followup-row.is-overdue {
  border-left: 4px solid #ef4444;
  background: rgba(239, 68, 68, 0.04);
}

/* Counselor & Course Leaderboard */
.dashboard-leaderboard-rank {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.rank-1 {
  background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

.rank-2 {
  background: linear-gradient(135deg, #cbd5e1 0%, #94a3b8 100%);
  color: #ffffff;
}

.rank-3 {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  color: #ffffff;
}

.rank-default {
  background: rgba(100, 116, 139, 0.1);
  color: var(--ds-gray-700, #475569);
}

/* CRM Activity Feed Timeline */
.dashboard-activity-stream {
  position: relative;
  padding-left: 1.25rem;
}

.dashboard-activity-stream::before {
  content: '';
  position: absolute;
  top: 0.75rem;
  bottom: 0.75rem;
  left: 0.4rem;
  width: 2px;
  background: var(--app-card-border);
}

.dashboard-activity-item {
  position: relative;
  margin-bottom: 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: 0.85rem;
  background: rgba(100, 116, 139, 0.03);
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.dashboard-activity-item:hover {
  background: var(--brand-magenta-light);
  border-color: rgba(216, 0, 100, 0.18);
  transform: translateX(4px);
}

.dashboard-activity-node {
  position: absolute;
  left: -1.25rem;
  top: 1.15rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--brand-magenta);
  border: 2px solid var(--app-card-bg);
  box-shadow: 0 0 0 2px rgba(216, 0, 100, 0.25);
}

/* Strategic Insights & Progress */
.brand-progress-bar {
  background: var(--brand-gradient) !important;
  border-radius: 999px;
}

/* WhatsApp Button */
.btn-whatsapp-pill {
  background: #25d366;
  color: #ffffff;
  border: none;
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-whatsapp-pill:hover {
  background: #1eb954;
  color: #ffffff;
  transform: translateY(-1px);
}

/* Toast Notifications */
.app-toast-stack {
  position: fixed;
  top: 80px;
  right: 24px;
  left: auto;
  z-index: 4000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
}

.app-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 280px;
  max-width: 360px;
  color: #fff;
  font-weight: 500;
  font-size: 0.875rem;
  line-height: 1.45;
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
  padding: 12px 16px;
  opacity: 0;
  transform: translateX(16px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.app-toast.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.app-toast-body {
  flex: 1;
}

.app-toast-close {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 1.25rem;
  line-height: 1;
  opacity: 0.8;
  cursor: pointer;
  padding: 0 2px;
}

.app-toast-success,
.app-toast-primary {
  background: #16a34a;
}

.app-toast-danger,
.app-toast-error {
  background: #dc3545;
}

.app-toast-warning {
  background: #f59e0b;
  color: #1c252e;
}

.app-toast-info {
  background: #0ea5e9;
  color: #fff;
}

[x-persist="overlays"],
.app-overlays {
  position: relative;
  z-index: 2000;
}

.modal {
  z-index: 2000;
}

.modal-dialog {
  margin: 1.75rem auto;
}

.modal-content {
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
}

.modal-backdrop {
  display: none !important;
}

.page-footer {
  position: fixed !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: 10 !important;
  padding: 0.65rem 1.5rem !important;
  text-align: center !important;
  background-color: var(--app-card-bg) !important;
  border-top: 1px solid var(--app-card-border) !important;
  backdrop-filter: blur(8px) !important;
  transition: left 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

html.expanded .page-footer {
  left: 250px !important;
}

html.collapsed .page-footer,
html:not(.expanded) .page-footer {
  left: 64px !important;
}

body.modal-open .page-footer {
  z-index: 0 !important;
}

.page-footer p {
  font-size: 0.78rem !important;
  color: var(--ds-gray-500, #64748b) !important;
  white-space: nowrap !important;
}

@media (max-width: 990px) {
  .page-footer {
    left: 0 !important;
  }
}

.password-field .passwordToggler {
  cursor: pointer;
}

.card-lg .dataTables_wrapper {
  padding: 0 1.5rem 1.5rem;
}

div.dataTables_wrapper .dataTables_length,
div.dataTables_wrapper .dataTables_filter {
  margin-bottom: 1rem;
}

div.dataTables_wrapper .dataTables_info,
div.dataTables_wrapper .dataTables_paginate {
  margin-top: 1rem;
}

div.dataTables_wrapper .dataTables_filter input {
  margin-left: 0.5rem;
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select,
[data-bs-theme="dark"] .form-control-plaintext,
[data-bs-theme="dark"] .dataTables_filter input,
[data-bs-theme="dark"] .dataTables_length select {
  color: var(--ds-gray-800);
  background-color: var(--ds-gray-200);
  -webkit-text-fill-color: var(--ds-gray-800);
  caret-color: var(--ds-gray-800);
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus,
[data-bs-theme="dark"] .dataTables_filter input:focus,
[data-bs-theme="dark"] .dataTables_length select:focus {
  color: var(--ds-gray-800);
  background-color: var(--ds-gray-200);
  -webkit-text-fill-color: var(--ds-gray-800);
  caret-color: var(--ds-gray-800);
}

[data-bs-theme="dark"] .form-control::placeholder,
[data-bs-theme="dark"] .form-select::placeholder,
[data-bs-theme="dark"] .dataTables_filter input::placeholder {
  color: var(--ds-gray-500);
  -webkit-text-fill-color: var(--ds-gray-500);
  opacity: 1;
}

[data-bs-theme="dark"] .form-control:-webkit-autofill,
[data-bs-theme="dark"] .form-control:-webkit-autofill:hover,
[data-bs-theme="dark"] .form-control:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ds-gray-800);
  caret-color: var(--ds-gray-800);
  box-shadow: 0 0 0 1000px var(--ds-gray-200) inset;
  transition: background-color 9999s ease-out;
}

[data-bs-theme="dark"] .modal {
  --ds-modal-color: #f4f6f8;
  --ds-modal-bg: #1c252e;
}

[data-bs-theme="dark"] .modal-content {
  box-shadow: 0 28px 72px rgba(0, 0, 0, 0.55);
  border-color: #454f5b;
}

[data-bs-theme="dark"] .modal-content,
[data-bs-theme="dark"] .modal-header,
[data-bs-theme="dark"] .modal-body,
[data-bs-theme="dark"] .modal-footer,
[data-bs-theme="dark"] .modal-title {
  color: var(--ds-gray-800);
}

.app-confirm-modal .modal-dialog {
  max-width: 380px;
}

.app-confirm-card {
  position: relative;
  padding: 2rem 1.5rem 1.5rem;
  border: 1px solid var(--ds-border-color);
  border-radius: 1rem;
  text-align: center;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16);
}

.app-confirm-close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
}

.app-confirm-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #9a0058;
  background: rgba(154, 0, 88, 0.12);
}

.app-confirm-modal.is-danger .app-confirm-icon {
  color: #ff5630;
  background: rgba(255, 86, 48, 0.12);
}

.app-confirm-title {
  margin-bottom: 0.5rem;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.4;
}

.app-confirm-text {
  margin-bottom: 1.5rem;
  color: var(--ds-gray-600);
}

.app-confirm-actions {
  display: flex;
  gap: 0.75rem;
}

.app-confirm-actions .btn {
  flex: 1;
}

[data-bs-theme="dark"] .app-confirm-card {
  background: #1c252e;
  border-color: #454f5b;
}

[data-bs-theme="dark"] .app-confirm-title,
[data-bs-theme="dark"] .app-confirm-text {
  color: #f4f6f8;
}

[data-bs-theme="dark"] .app-confirm-text {
  color: #c4cdd5;
}

[data-bs-theme="dark"] .app-confirm-icon {
  color: #e070a8;
  background: rgba(224, 112, 168, 0.16);
}

[data-bs-theme="dark"] .app-confirm-modal.is-danger .app-confirm-icon {
  color: #ff8a70;
  background: rgba(255, 86, 48, 0.16);
}

.swal2-container {
  z-index: 20000;
}

.app-swal.swal2-popup {
  background: var(--ds-modal-bg, #fff);
  color: var(--ds-gray-800);
  border: 1px solid var(--ds-border-color);
  border-radius: 1rem !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16);
  padding: 2rem 1.5rem 1.5rem;
}

.app-swal .swal2-title,
.app-swal-title {
  color: var(--ds-gray-800);
  font-weight: 700;
}

.app-swal .swal2-html-container,
.app-swal-text {
  color: var(--ds-gray-600) !important;
}

.app-swal-actions {
  margin-top: 1.25rem !important;
  gap: 0.75rem;
}

.app-swal-actions .btn {
  min-width: 5.5rem;
}

[data-bs-theme="dark"] .swal2-container.swal2-backdrop-show,
[data-bs-theme="dark"] .swal2-container.swal2-noanimation {
  background: rgba(8, 12, 18, 0.72);
}

[data-bs-theme="dark"] .app-swal.swal2-popup {
  background: #1c252e;
  color: #f4f6f8;
  border-color: #454f5b;
  box-shadow: 0 28px 72px rgba(0, 0, 0, 0.55);
}

[data-bs-theme="dark"] .app-swal .swal2-title,
[data-bs-theme="dark"] .app-swal-title {
  color: #f4f6f8;
}

[data-bs-theme="dark"] .app-swal .swal2-html-container,
[data-bs-theme="dark"] .app-swal-text {
  color: #c4cdd5 !important;
}

[data-bs-theme="dark"] .app-swal .swal2-icon.swal2-success {
  border-color: rgba(74, 222, 128, 0.35);
  color: #4ade80;
}

[data-bs-theme="dark"] .app-swal .swal2-icon.swal2-success [class^=swal2-success-line] {
  background-color: #4ade80;
}

[data-bs-theme="dark"] .app-swal .swal2-icon.swal2-success .swal2-success-ring {
  border-color: rgba(74, 222, 128, 0.35);
}

[data-bs-theme="dark"] .app-swal .swal2-icon.swal2-error {
  border-color: rgba(255, 86, 48, 0.4);
  color: #ff8a70;
}

[data-bs-theme="dark"] .app-swal .swal2-icon.swal2-error [class^=swal2-x-mark-line] {
  background-color: #ff8a70;
}

[data-bs-theme="dark"] .app-swal .swal2-icon.swal2-warning {
  border-color: rgba(255, 171, 0, 0.45);
  color: #ffc14d;
}

[data-bs-theme="dark"] .app-swal .swal2-icon.swal2-info {
  border-color: rgba(0, 184, 217, 0.4);
  color: #5ee1f5;
}

.lead-assign-all-check {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--ds-border-color);
  border-radius: 0.75rem;
  background: var(--ds-gray-100);
}

.lead-assign-all-check .form-check-input {
  float: none;
  margin: 0.3rem 0 0;
  flex-shrink: 0;
}

.lead-assign-all-check .form-check-label {
  cursor: pointer;
}

.telecaller-picker {
  border: 1px solid var(--ds-input-border-color, var(--ds-border-color));
  border-radius: 0.5rem;
  background: var(--ds-body-bg);
  max-height: 220px;
  overflow-y: auto;
}

.telecaller-picker-empty {
  padding: 1.15rem 1rem;
  color: var(--ds-gray-600);
  font-size: 0.875rem;
}

.telecaller-picker-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--ds-border-color);
  cursor: pointer;
  font-weight: 500;
}

.telecaller-picker-item:last-child {
  border-bottom: 0;
}

.telecaller-picker-item:hover,
.telecaller-picker-item.is-selected {
  background: var(--ds-gray-200);
}

.telecaller-picker-item .form-check-input {
  float: none;
  margin: 0;
  flex-shrink: 0;
}

.lead-upload-guide {
  border: 1px solid var(--ds-border-color);
  border-radius: 0.75rem;
  background: var(--ds-gray-100);
  padding: 1rem 1.15rem;
  margin-bottom: 1rem;
  color: var(--ds-gray-800);
}

.lead-upload-guide-title {
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.lead-upload-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem 1.25rem;
  margin-bottom: 0.85rem;
}

.lead-upload-col {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  min-width: 0;
}

.lead-upload-col-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  flex-shrink: 0;
  border-radius: 0.35rem;
  background: var(--brand-magenta-light);
  color: var(--brand-magenta);
  font-size: 0.75rem;
  font-weight: 700;
}

.lead-upload-guide-note {
  font-size: 0.8125rem;
  color: var(--ds-gray-600);
}

@media (max-width: 767.98px) {
  .lead-upload-columns {
    grid-template-columns: 1fr;
  }
}

[data-bs-theme="dark"] .lead-assign-all-check,
[data-bs-theme="dark"] .lead-upload-guide,
[data-bs-theme="dark"] .telecaller-picker {
  background: #161c24;
  border-color: #454f5b;
}

[data-bs-theme="dark"] .lead-upload-guide,
[data-bs-theme="dark"] .telecaller-picker-item {
  color: #f4f6f8;
}

[data-bs-theme="dark"] .telecaller-picker-item {
  border-bottom-color: #454f5b;
}

[data-bs-theme="dark"] .telecaller-picker-item:hover,
[data-bs-theme="dark"] .telecaller-picker-item.is-selected {
  background: var(--brand-magenta-subtle);
}

[data-bs-theme="dark"] .lead-upload-col-key {
  background: var(--brand-magenta-subtle);
  color: #fca5cf;
}

[data-bs-theme="dark"] .lead-upload-guide-note,
[data-bs-theme="dark"] .telecaller-picker-empty {
  color: #c4cdd5;
}

/* ==========================================================================
   LEADS HUB & EXECUTIVE PIPELINE STYLING (BRAND ALIGNED)
   ========================================================================== */

/* 5-Column Grid on Extra-Large Screens */
@media (min-width: 1200px) {
  .col-xl-2-4 {
    flex: 0 0 auto;
    width: 20%;
  }
}

/* Leads Stat Cards (Quick Summary & Fast Filter) */
.leads-stat-card {
  border-radius: 0.85rem !important;
  background: var(--app-card-bg) !important;
  border: 1px solid var(--app-card-border) !important;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.leads-stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: transparent;
  transition: all 0.22s ease;
}

.leads-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  border-color: rgba(216, 0, 100, 0.3) !important;
}

.leads-stat-card.is-active {
  border-color: var(--brand-magenta) !important;
  background: var(--app-card-bg) !important;
  box-shadow: 0 4px 16px rgba(216, 0, 100, 0.12);
}

.leads-stat-card.is-active::after {
  background: var(--brand-gradient);
}

.leads-stat-label {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ds-gray-600, #64748b);
}

.leads-stat-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 0.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.leads-stat-icon-total {
  background: rgba(0, 112, 235, 0.1);
  color: var(--brand-blue);
}

.leads-stat-icon-hot {
  background: rgba(216, 0, 100, 0.12);
  color: var(--brand-magenta);
}

.leads-stat-icon-warm {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
}

.leads-stat-icon-today {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}

.leads-stat-icon-followup {
  background: rgba(6, 182, 212, 0.12);
  color: #06b6d4;
}

.leads-stat-hint {
  font-size: 0.72rem;
  color: var(--ds-gray-500, #94a3b8);
}

/* Quick Filter Presets */
.leads-preset-pill {
  font-size: 0.72rem !important;
  font-weight: 600 !important;
  padding: 0.2rem 0.6rem !important;
  border-radius: 999px !important;
  background: rgba(100, 116, 139, 0.08) !important;
  border: 1px solid var(--app-card-border) !important;
  color: var(--ds-gray-700, #475569) !important;
  transition: all 0.15s ease;
}

.leads-preset-pill:hover {
  background: var(--brand-magenta-light) !important;
  border-color: rgba(216, 0, 100, 0.4) !important;
  color: var(--brand-magenta) !important;
  transform: translateY(-1px);
}

/* Active Filter Chips */
.leads-active-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: var(--brand-magenta-light);
  border: 1px solid rgba(216, 0, 100, 0.2);
  color: var(--brand-magenta);
}

/* Form Inputs Focus & Polish */
.leads-input {
  border-radius: 0.55rem !important;
  border: 1px solid var(--app-card-border) !important;
  transition: all 0.2s ease !important;
  font-size: 0.82rem !important;
}

.leads-input:focus {
  border-color: var(--brand-magenta) !important;
  box-shadow: 0 0 0 3px rgba(216, 0, 100, 0.15) !important;
}

/* Fix Bootstrap .input-group with .leads-input */
.input-group > .leads-input:not(:first-child):not(:last-child) {
  border-radius: 0 !important;
}
.input-group > .leads-input:first-child {
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}
.input-group > .leads-input:last-child {
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
}
.input-group > .input-group-text {
  background-color: var(--app-card-bg) !important;
  border-color: var(--app-card-border) !important;
  color: var(--ds-gray-500, #94a3b8) !important;
  font-size: 0.82rem;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.input-group:focus-within > .input-group-text {
  border-color: var(--brand-magenta) !important;
  color: var(--brand-magenta) !important;
}

/* Modern Unified Leads / Filter Search Box */
.leads-search-box {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.leads-search-box .leads-search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ds-gray-500, #94a3b8);
  pointer-events: none;
  font-size: 0.95rem;
  z-index: 4;
  transition: color 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.leads-search-box:focus-within .leads-search-icon {
  color: var(--brand-magenta);
}

.leads-search-box .leads-search-input {
  padding-left: 2.15rem !important;
  padding-right: 2.2rem !important;
  border-radius: 0.55rem !important;
  background-color: var(--app-card-bg) !important;
  border: 1px solid var(--app-card-border) !important;
  color: var(--ds-body-color) !important;
  font-size: 0.82rem !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: all 0.2s ease !important;
  width: 100%;
}

.leads-search-box .leads-search-input:focus {
  border-color: var(--brand-magenta) !important;
  box-shadow: 0 0 0 3px rgba(216, 0, 100, 0.15) !important;
  outline: none;
}

.leads-search-box .leads-search-clear {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--ds-gray-500, #94a3b8);
  padding: 0.2rem;
  font-size: 0.85rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 4;
  line-height: 1;
  transition: all 0.15s ease;
  cursor: pointer;
}

.leads-search-box .leads-search-clear:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

[data-bs-theme="dark"] .leads-search-box .leads-search-clear:hover {
  color: #f87171;
  background: rgba(239, 68, 68, 0.2);
}

.leads-filter-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ds-gray-600, #64748b);
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* Leads Page Main Cards */
.leads-page-card {
  border-radius: 1rem !important;
  background: var(--app-card-bg) !important;
  border: 1px solid var(--app-card-border) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
  overflow: hidden;
}

.leads-filter-container {
  padding: 1.25rem 1.5rem;
}

/* Action Toolbar Buttons */
.btn-lead-action {
  font-weight: 600 !important;
  font-size: 0.82rem !important;
  padding: 0.45rem 0.9rem !important;
  border-radius: 0.65rem !important;
  background: var(--app-card-bg) !important;
  border: 1px solid var(--app-card-border) !important;
  color: var(--ds-gray-700, #475569) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.btn-lead-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
}

.btn-lead-export {
  color: #10b981 !important;
  border-color: rgba(16, 185, 129, 0.3) !important;
  background: rgba(16, 185, 129, 0.06) !important;
}

.btn-lead-export:hover {
  background: #10b981 !important;
  color: #ffffff !important;
  border-color: #10b981 !important;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3) !important;
}

.btn-lead-upload {
  color: #0070eb !important;
  border-color: rgba(0, 112, 235, 0.3) !important;
  background: rgba(0, 112, 235, 0.06) !important;
}

.btn-lead-upload:hover {
  background: #0070eb !important;
  color: #ffffff !important;
  border-color: #0070eb !important;
  box-shadow: 0 4px 14px rgba(0, 112, 235, 0.3) !important;
}

.btn-lead-reassign {
  color: #6366f1 !important;
  border-color: rgba(99, 102, 241, 0.3) !important;
  background: rgba(99, 102, 241, 0.06) !important;
}

.btn-lead-reassign:hover {
  background: #6366f1 !important;
  color: #ffffff !important;
  border-color: #6366f1 !important;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3) !important;
}

.btn-lead-delete {
  color: #ef4444 !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
  background: rgba(239, 68, 68, 0.06) !important;
}

.btn-lead-delete:hover {
  background: #ef4444 !important;
  color: #ffffff !important;
  border-color: #ef4444 !important;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3) !important;
}

.btn-lead-add-primary {
  background: var(--brand-gradient) !important;
  color: #ffffff !important;
  border: none !important;
  font-weight: 700 !important;
  font-size: 0.85rem !important;
  padding: 0.48rem 1.15rem !important;
  border-radius: 0.65rem !important;
  box-shadow: 0 4px 14px rgba(216, 0, 100, 0.35) !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.btn-lead-add-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(216, 0, 100, 0.5) !important;
  opacity: 0.96;
  color: #ffffff !important;
}

.leads-btn-filter {
  background: var(--brand-gradient) !important;
  border: none !important;
  border-radius: 0.55rem !important;
  font-weight: 600 !important;
  transition: all 0.2s ease !important;
}

.leads-btn-filter:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(216, 0, 100, 0.3) !important;
}

/* Action Group & Buttons in Table Rows */
.lead-actions-stacked {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  padding: 0.2rem 0;
}

.lead-action-group {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.lead-action-hr {
  width: 100%;
  margin: 0.25rem 0 !important;
  border: 0 !important;
  border-top: 1px solid var(--app-card-border, rgba(148, 163, 184, 0.2)) !important;
  opacity: 0.7;
}

.lead-act-btn {
  width: 2.15rem !important;
  height: 2.15rem !important;
  border-radius: 0.55rem !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: var(--app-card-bg) !important;
  border: 1px solid var(--app-card-border) !important;
  color: var(--ds-gray-700, #475569) !important;
  font-size: 0.95rem !important;
  padding: 0 !important;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.lead-act-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.lead-act-view:hover {
  border-color: #0070eb !important;
  color: #0070eb !important;
  background: rgba(0, 112, 235, 0.1) !important;
}

.lead-act-edit:hover {
  border-color: #6366f1 !important;
  color: #6366f1 !important;
  background: rgba(99, 102, 241, 0.1) !important;
}

.lead-act-status:hover {
  border-color: var(--brand-magenta) !important;
  color: var(--brand-magenta) !important;
  background: var(--brand-magenta-light) !important;
}

.lead-act-whatsapp {
  color: #16a34a !important;
  border-color: rgba(22, 163, 74, 0.3) !important;
  background: rgba(22, 163, 74, 0.08) !important;
}

.lead-act-whatsapp:hover {
  background: #16a34a !important;
  color: #ffffff !important;
  border-color: #16a34a !important;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3) !important;
}

.lead-act-convert {
  color: #d97706 !important;
  border-color: rgba(217, 119, 6, 0.45) !important;
  background: rgba(217, 119, 6, 0.08) !important;
}

.lead-act-convert:hover {
  background: #d97706 !important;
  color: #ffffff !important;
  border-color: #d97706 !important;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.3) !important;
}

.lead-act-reassign:hover {
  border-color: #06b6d4 !important;
  color: #06b6d4 !important;
  background: rgba(6, 182, 212, 0.1) !important;
}

.lead-act-delete {
  color: #ef4444 !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
  background: rgba(239, 68, 68, 0.08) !important;
}

.lead-act-delete:hover {
  border-color: #ef4444 !important;
  color: #ffffff !important;
  background: #ef4444 !important;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3) !important;
}

.lead-act-reg-open {
  color: #f59e0b !important;
  border-color: rgba(245, 158, 11, 0.4) !important;
  background: rgba(245, 158, 11, 0.08) !important;
}

.lead-act-reg-open:hover {
  background: #f59e0b !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3) !important;
}

.lead-act-reg-copy {
  color: #06b6d4 !important;
  border-color: rgba(6, 182, 212, 0.4) !important;
  background: rgba(6, 182, 212, 0.08) !important;
}

.lead-act-reg-copy:hover {
  background: #06b6d4 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3) !important;
}

/* Registration Status Badges & Action Link */
.lead-reg-badge {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
}

.lead-reg-status-pending {
  color: #b45309;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.lead-reg-status-approved {
  color: #15803d;
  background: rgba(22, 163, 74, 0.12);
  border: 1px solid rgba(22, 163, 74, 0.3);
}

.lead-reg-status-rejected {
  color: #b91c1c;
  background: rgba(220, 38, 38, 0.12);
  border: 1px solid rgba(220, 38, 38, 0.3);
}

.lead-btn-details {
  height: 1.85rem;
  padding: 0 0.65rem !important;
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 999px;
  color: #fff !important;
  background: var(--brand-gradient) !important;
  border: none !important;
  box-shadow: 0 2px 6px rgba(216, 0, 100, 0.2);
  transition: all 0.2s ease;
}

.lead-btn-details:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(216, 0, 100, 0.3);
}

/* Status Pills with Indicator Dot */
.lead-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  white-space: nowrap;
}

.lead-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 0.4rem;
  display: inline-block;
}

.lead-status-primary {
  color: #0070eb;
  background: rgba(0, 112, 235, 0.1);
  border-color: rgba(0, 112, 235, 0.25);
}
.lead-status-primary .lead-status-dot { background: #0070eb; }

.lead-status-success {
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.25);
}
.lead-status-success .lead-status-dot { background: #10b981; }

.lead-status-warning {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.25);
}
.lead-status-warning .lead-status-dot { background: #f59e0b; }

.lead-status-danger {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.25);
}
.lead-status-danger .lead-status-dot { background: #ef4444; }

.lead-status-info {
  color: #06b6d4;
  background: rgba(6, 182, 212, 0.1);
  border-color: rgba(6, 182, 212, 0.25);
}
.lead-status-info .lead-status-dot { background: #06b6d4; }

.lead-status-secondary {
  color: #64748b;
  background: rgba(100, 116, 139, 0.1);
  border-color: rgba(100, 116, 139, 0.25);
}
.lead-status-secondary .lead-status-dot { background: #64748b; }

/* Interest Badges */
.lead-interest-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.lead-interest-hot {
  color: #e11d48;
  background: rgba(225, 29, 72, 0.12);
  border: 1px solid rgba(225, 29, 72, 0.3);
}

.lead-interest-warm {
  color: #d97706;
  background: rgba(217, 119, 6, 0.12);
  border: 1px solid rgba(217, 119, 6, 0.3);
}

.lead-interest-cold {
  color: #0284c7;
  background: rgba(2, 132, 199, 0.12);
  border: 1px solid rgba(2, 132, 199, 0.3);
}

/* Sticky Left Columns for Leads Table (4 columns: #, Actions, Registration, Lead Name) */
#leads-table th.col-index,
#leads-table td.col-index,
.leads-table th.col-index,
.leads-table td.col-index,
#leads-table thead th:nth-child(1),
#leads-table tbody td:nth-child(1),
.dataTables_scrollHead table#leads-table thead th:nth-child(1),
.dataTables_scrollBody table#leads-table tbody td:nth-child(1) {
  position: sticky !important;
  left: 0 !important;
  z-index: 4;
  width: 48px !important;
  min-width: 48px !important;
  max-width: 48px !important;
  text-align: center;
}

#leads-table th.col-actions,
#leads-table td.col-actions,
.leads-table th.col-actions,
.leads-table td.col-actions,
#leads-table thead th:nth-child(2),
#leads-table tbody td:nth-child(2),
.dataTables_scrollHead table#leads-table thead th:nth-child(2),
.dataTables_scrollBody table#leads-table tbody td:nth-child(2) {
  position: sticky !important;
  left: 48px !important;
  z-index: 4;
  width: 175px !important;
  min-width: 175px !important;
  max-width: 175px !important;
  text-align: center;
}

#leads-table th.col-registration,
#leads-table td.col-registration,
.leads-table th.col-registration,
.leads-table td.col-registration,
#leads-table thead th:nth-child(3),
#leads-table tbody td:nth-child(3),
.dataTables_scrollHead table#leads-table thead th:nth-child(3),
.dataTables_scrollBody table#leads-table tbody td:nth-child(3) {
  position: sticky !important;
  left: 223px !important;
  z-index: 4;
  width: 140px !important;
  min-width: 140px !important;
  max-width: 140px !important;
}

#leads-table th.col-name,
#leads-table td.col-name,
.leads-table th.col-name,
.leads-table td.col-name,
#leads-table thead th:nth-child(4),
#leads-table tbody td:nth-child(4),
.dataTables_scrollHead table#leads-table thead th:nth-child(4),
.dataTables_scrollBody table#leads-table tbody td:nth-child(4) {
  position: sticky !important;
  left: 363px !important;
  z-index: 4;
  width: 175px !important;
  min-width: 175px !important;
  max-width: 175px !important;
  box-shadow: 4px 0 10px -2px rgba(0, 0, 0, 0.2) !important;
  border-right: 1px solid var(--app-card-border) !important;
}

/* Background colors for sticky cells to guarantee 100% opacity and prevent bleed-through during horizontal scrolling */
#leads-table thead th:nth-child(1),
#leads-table thead th:nth-child(2),
#leads-table thead th:nth-child(3),
#leads-table thead th:nth-child(4),
.leads-table thead th.col-index,
.leads-table thead th.col-actions,
.leads-table thead th.col-registration,
.leads-table thead th.col-name,
.dataTables_scrollHead table.leads-table thead th:nth-child(1),
.dataTables_scrollHead table.leads-table thead th:nth-child(2),
.dataTables_scrollHead table.leads-table thead th:nth-child(3),
.dataTables_scrollHead table.leads-table thead th:nth-child(4) {
  z-index: 8 !important;
  background-color: #f8fafc !important;
}

[data-bs-theme="dark"] #leads-table thead th:nth-child(1),
[data-bs-theme="dark"] #leads-table thead th:nth-child(2),
[data-bs-theme="dark"] #leads-table thead th:nth-child(3),
[data-bs-theme="dark"] #leads-table thead th:nth-child(4),
[data-bs-theme="dark"] .leads-table thead th.col-index,
[data-bs-theme="dark"] .leads-table thead th.col-actions,
[data-bs-theme="dark"] .leads-table thead th.col-registration,
[data-bs-theme="dark"] .leads-table thead th.col-name,
[data-bs-theme="dark"] .dataTables_scrollHead table.leads-table thead th:nth-child(1),
[data-bs-theme="dark"] .dataTables_scrollHead table.leads-table thead th:nth-child(2),
[data-bs-theme="dark"] .dataTables_scrollHead table.leads-table thead th:nth-child(3),
[data-bs-theme="dark"] .dataTables_scrollHead table.leads-table thead th:nth-child(4) {
  background-color: #1a2234 !important;
}

#leads-table tbody td:nth-child(1),
#leads-table tbody td:nth-child(2),
#leads-table tbody td:nth-child(3),
#leads-table tbody td:nth-child(4),
.leads-table tbody td.col-index,
.leads-table tbody td.col-actions,
.leads-table tbody td.col-registration,
.leads-table tbody td.col-name,
.dataTables_scrollBody table.leads-table tbody td:nth-child(1),
.dataTables_scrollBody table.leads-table tbody td:nth-child(2),
.dataTables_scrollBody table.leads-table tbody td:nth-child(3),
.dataTables_scrollBody table.leads-table tbody td:nth-child(4) {
  background-color: #ffffff !important;
}

[data-bs-theme="dark"] #leads-table tbody td:nth-child(1),
[data-bs-theme="dark"] #leads-table tbody td:nth-child(2),
[data-bs-theme="dark"] #leads-table tbody td:nth-child(3),
[data-bs-theme="dark"] #leads-table tbody td:nth-child(4),
[data-bs-theme="dark"] .leads-table tbody td.col-index,
[data-bs-theme="dark"] .leads-table tbody td.col-actions,
[data-bs-theme="dark"] .leads-table tbody td.col-registration,
[data-bs-theme="dark"] .leads-table tbody td.col-name,
[data-bs-theme="dark"] .dataTables_scrollBody table.leads-table tbody td:nth-child(1),
[data-bs-theme="dark"] .dataTables_scrollBody table.leads-table tbody td:nth-child(2),
[data-bs-theme="dark"] .dataTables_scrollBody table.leads-table tbody td:nth-child(3),
[data-bs-theme="dark"] .dataTables_scrollBody table.leads-table tbody td:nth-child(4) {
  background-color: #111827 !important;
}

/* 100% Solid/Opaque Background Colors on Hover for Sticky Columns to prevent transparency bleed-through */
#leads-table tbody tr:hover td:nth-child(1),
#leads-table tbody tr:hover td:nth-child(2),
#leads-table tbody tr:hover td:nth-child(3),
#leads-table tbody tr:hover td:nth-child(4),
.leads-table tbody tr:hover td.col-index,
.leads-table tbody tr:hover td.col-actions,
.leads-table tbody tr:hover td.col-registration,
.leads-table tbody tr:hover td.col-name,
.dataTables_scrollBody table.leads-table tbody tr:hover td:nth-child(1),
.dataTables_scrollBody table.leads-table tbody tr:hover td:nth-child(2),
.dataTables_scrollBody table.leads-table tbody tr:hover td:nth-child(3),
.dataTables_scrollBody table.leads-table tbody tr:hover td:nth-child(4) {
  background-color: #fcf1f6 !important;
}

[data-bs-theme="dark"] #leads-table tbody tr:hover td:nth-child(1),
[data-bs-theme="dark"] #leads-table tbody tr:hover td:nth-child(2),
[data-bs-theme="dark"] #leads-table tbody tr:hover td:nth-child(3),
[data-bs-theme="dark"] #leads-table tbody tr:hover td:nth-child(4),
[data-bs-theme="dark"] .leads-table tbody tr:hover td.col-index,
[data-bs-theme="dark"] .leads-table tbody tr:hover td.col-actions,
[data-bs-theme="dark"] .leads-table tbody tr:hover td.col-registration,
[data-bs-theme="dark"] .leads-table tbody tr:hover td.col-name,
[data-bs-theme="dark"] .dataTables_scrollBody table.leads-table tbody tr:hover td:nth-child(1),
[data-bs-theme="dark"] .dataTables_scrollBody table.leads-table tbody tr:hover td:nth-child(2),
[data-bs-theme="dark"] .dataTables_scrollBody table.leads-table tbody tr:hover td:nth-child(3),
[data-bs-theme="dark"] .dataTables_scrollBody table.leads-table tbody tr:hover td:nth-child(4) {
  background-color: #23182b !important;
}

/* Balance Columns Widths */
.leads-table th.col-registration { min-width: 140px; }
.leads-table th.col-name { min-width: 175px; }
.leads-table th.col-datetime { min-width: 165px; }
.leads-table th.col-phone { min-width: 160px; }
.leads-table th.col-email { min-width: 195px; }
.leads-table th.col-status { min-width: 155px; }
.leads-table th.col-interest { min-width: 135px; }
.leads-table th.col-source { min-width: 145px; }
.leads-table th.col-course { min-width: 170px; }
.leads-table th.col-team { min-width: 140px; }
.leads-table th.col-telecaller { min-width: 160px; }
.leads-table th.col-place { min-width: 135px; }
.leads-table th.col-followup { min-width: 150px; }
.leads-table th.col-reason { min-width: 180px; }
.leads-table th.col-remarks { min-width: 210px; }
.leads-table th.col-date { min-width: 125px; }
.leads-table th.col-time { min-width: 115px; }

/* Table Structure, Header Strip & Row Highlights */
.leads-table-container {
  border-top: 1px solid var(--app-card-border);
  overflow: hidden;
  width: 100% !important;
}

.leads-table-container table,
.leads-table-container .table-responsive table,
.dataTables_scrollHeadInner,
.dataTables_scrollHeadInner > table,
.dataTables_scrollBody > table {
  width: 100% !important;
  min-width: 100% !important;
  margin-bottom: 0 !important;
}

.leads-table thead th,
.leads-table-container table thead th,
.dataTables_scrollHead table.leads-table thead th {
  font-size: 0.74rem !important;
  font-weight: 700 !important;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ds-gray-700, #334155) !important;
  background: rgba(148, 163, 184, 0.08) !important;
  border-bottom: 2px solid var(--app-card-border) !important;
  padding: 0.9rem 1.85rem 0.9rem 1rem !important;
  vertical-align: middle !important;
  white-space: nowrap !important;
}

/* Fix sorting arrows positioning */
table.dataTable thead > tr > th.sorting,
table.dataTable thead > tr > th.sorting_asc,
table.dataTable thead > tr > th.sorting_desc {
  padding-right: 1.85rem !important;
}

table.dataTable thead > tr > th.sorting:before,
table.dataTable thead > tr > th.sorting_asc:before,
table.dataTable thead > tr > th.sorting_desc:before {
  right: 10px !important;
  bottom: 50% !important;
  font-size: 0.75rem !important;
}

table.dataTable thead > tr > th.sorting:after,
table.dataTable thead > tr > th.sorting_asc:after,
table.dataTable thead > tr > th.sorting_desc:after {
  right: 10px !important;
  top: 50% !important;
  font-size: 0.75rem !important;
}

.leads-table-container table tbody td,
.dataTables_scrollBody table.leads-table tbody td {
  padding: 0.85rem 1rem !important;
  vertical-align: middle !important;
  border-bottom: 1px solid var(--app-card-border);
  font-size: 0.835rem;
  color: var(--ds-body-color);
}

.leads-table-container table td.dataTables_empty {
  text-align: center !important;
  padding: 2.25rem 1rem !important;
  font-size: 0.875rem !important;
  color: var(--ds-gray-500, #64748b) !important;
}

.leads-table-container table tbody tr,
.dataTables_scrollBody table.leads-table tbody tr {
  transition: background-color 0.15s ease;
}

.leads-table-container table tbody tr:hover td,
.dataTables_scrollBody table.leads-table tbody tr:hover td {
  background-color: var(--brand-magenta-light) !important;
}

/* Custom Scrollbar for Horizontal Scroll */
.dataTables_scrollBody::-webkit-scrollbar {
  height: 8px;
  width: 8px;
}
.dataTables_scrollBody::-webkit-scrollbar-track {
  background: rgba(148, 163, 184, 0.08);
  border-radius: 4px;
}
.dataTables_scrollBody::-webkit-scrollbar-thumb {
  background: rgba(216, 0, 100, 0.25);
  border-radius: 4px;
  transition: background 0.2s ease;
}
.dataTables_scrollBody::-webkit-scrollbar-thumb:hover {
  background: var(--brand-magenta);
}

/* Modern Leads Navigation Pills / Tab Bar */
.leads-tab-nav-bar {
  background: rgba(148, 163, 184, 0.05);
  border-bottom: 1px solid var(--app-card-border);
  padding: 0.75rem 1.25rem;
}

.leads-nav-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.leads-nav-pills .nav-link {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ds-gray-700, #475569);
  padding: 0.45rem 1rem;
  border-radius: 0.55rem;
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.leads-nav-pills .nav-link:hover {
  color: var(--brand-magenta);
  background: var(--brand-magenta-light);
}

.leads-nav-pills .nav-link.active {
  color: #ffffff !important;
  background: var(--brand-gradient) !important;
  border-color: transparent !important;
  box-shadow: 0 4px 12px rgba(216, 0, 100, 0.25);
}

.leads-nav-pills .nav-link.active .badge {
  background: rgba(255, 255, 255, 0.25) !important;
  color: #ffffff !important;
}

.leads-nav-pills .nav-link:not(.active) .badge {
  background: rgba(148, 163, 184, 0.15) !important;
  color: var(--ds-body-color) !important;
}

[data-bs-theme="dark"] .leads-tab-nav-bar {
  background: rgba(15, 23, 42, 0.6);
  border-bottom: 1px solid var(--app-card-border);
}

[data-bs-theme="dark"] .leads-nav-pills .nav-link {
  color: #94a3b8;
}

[data-bs-theme="dark"] .leads-nav-pills .nav-link:hover {
  color: #f472b6;
  background: rgba(216, 0, 100, 0.15);
}

[data-bs-theme="dark"] .leads-nav-pills .nav-link.active {
  color: #ffffff !important;
  background: var(--brand-gradient) !important;
}

/* DataTables Controls Ribbon */
.leads-page-card .dataTables_wrapper {
  padding: 0;
}

.leads-page-card .dataTables_wrapper > .row:first-child {
  padding: 1rem 1.4rem;
  margin: 0;
  border-bottom: 1px solid var(--app-card-border);
  background: rgba(148, 163, 184, 0.03);
  align-items: center;
}

.leads-page-card .dataTables_wrapper > .row:last-child {
  padding: 1rem 1.4rem;
  margin: 0;
  border-top: 1px solid var(--app-card-border);
  background: rgba(148, 163, 184, 0.03);
  align-items: center;
}

.leads-page-card .dataTables_wrapper .dataTables_length select {
  border-radius: 0.55rem !important;
  padding: 0.35rem 1.85rem 0.35rem 0.8rem !important;
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  border: 1px solid var(--app-card-border) !important;
  background-color: var(--app-card-bg) !important;
  color: var(--ds-body-color) !important;
  cursor: pointer;
  transition: all 0.2s ease;
}

.leads-page-card .dataTables_wrapper .dataTables_length select:focus {
  border-color: var(--brand-magenta) !important;
  box-shadow: 0 0 0 3px rgba(216, 0, 100, 0.15) !important;
}

.dataTables_wrapper .dataTables_filter,
.leads-page-card .dataTables_wrapper .dataTables_filter {
  margin-bottom: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.dataTables_wrapper .dataTables_filter label,
.leads-page-card .dataTables_wrapper .dataTables_filter label {
  display: inline-flex;
  align-items: center;
  position: relative;
  margin-bottom: 0;
  font-weight: 500;
  font-size: 0.82rem;
  color: var(--ds-gray-600, #64748b);
  width: 100%;
  max-width: 300px;
}

.dataTables_wrapper .dataTables_filter input[type="search"],
.dataTables_wrapper .dataTables_filter input,
.leads-page-card .dataTables_wrapper .dataTables_filter input {
  border-radius: 0.55rem !important;
  padding: 0.42rem 0.95rem 0.42rem 2.15rem !important;
  font-size: 0.82rem !important;
  border: 1px solid var(--app-card-border) !important;
  background-color: var(--app-card-bg) !important;
  color: var(--ds-body-color) !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 0.65rem center;
  background-size: 15px 15px;
  width: 100% !important;
  min-width: 220px;
  margin-left: 0 !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: all 0.2s ease !important;
}

.dataTables_wrapper .dataTables_filter input[type="search"]:focus,
.dataTables_wrapper .dataTables_filter input:focus,
.leads-page-card .dataTables_wrapper .dataTables_filter input:focus {
  border-color: var(--brand-magenta) !important;
  box-shadow: 0 0 0 3px rgba(216, 0, 100, 0.15) !important;
  outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23d80064' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
}

.leads-page-card .dataTables_wrapper .dataTables_info {
  font-size: 0.83rem;
  color: var(--ds-gray-600, #64748b);
  padding-top: 0 !important;
}

.leads-page-card .dataTables_wrapper .dataTables_paginate ul.pagination {
  margin: 0 !important;
}

.leads-page-card .dataTables_wrapper .dataTables_paginate .paginate_button {
  border-radius: 0.5rem !important;
  padding: 0.35rem 0.75rem !important;
  margin: 0 0.15rem !important;
  font-size: 0.8rem !important;
  font-weight: 600 !important;
  border: 1px solid var(--app-card-border) !important;
  background: var(--app-card-bg) !important;
  color: var(--ds-body-color) !important;
  transition: all 0.15s ease;
}

.leads-page-card .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: var(--brand-magenta-light) !important;
  border-color: var(--brand-magenta) !important;
  color: var(--brand-magenta) !important;
  transform: translateY(-1px);
}

.leads-page-card .dataTables_wrapper .dataTables_paginate .paginate_button.current,
.leads-page-card .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  background: var(--brand-gradient) !important;
  border-color: transparent !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(216, 0, 100, 0.35) !important;
}

.leads-page-card .dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
.leads-page-card .dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {
  opacity: 0.45 !important;
  cursor: not-allowed !important;
  transform: none !important;
  box-shadow: none !important;
}

/* Clean Standard Empty State */
.leads-page-card .dataTables_wrapper td.dataTables_empty,
td.dataTables_empty {
  padding: 1.5rem 1rem !important;
  text-align: center !important;
  vertical-align: middle !important;
  color: var(--ds-gray-600, #64748b);
  font-size: 0.84rem;
}

/* Dark Mode Specific Overrides for Leads Hub */
[data-bs-theme="dark"] .btn-lead-action {
  background: #192030 !important;
  border-color: #2a3549 !important;
  color: #e2e8f0 !important;
}

[data-bs-theme="dark"] .btn-lead-export {
  background: rgba(16, 185, 129, 0.12) !important;
  border-color: rgba(16, 185, 129, 0.35) !important;
  color: #34d399 !important;
}

[data-bs-theme="dark"] .btn-lead-upload {
  background: rgba(0, 112, 235, 0.12) !important;
  border-color: rgba(0, 112, 235, 0.35) !important;
  color: #60a5fa !important;
}

[data-bs-theme="dark"] .btn-lead-reassign {
  background: rgba(99, 102, 241, 0.12) !important;
  border-color: rgba(99, 102, 241, 0.35) !important;
  color: #a5b4fc !important;
}

[data-bs-theme="dark"] .btn-lead-delete {
  background: rgba(239, 68, 68, 0.12) !important;
  border-color: rgba(239, 68, 68, 0.35) !important;
  color: #f87171 !important;
}

[data-bs-theme="dark"] .leads-table thead th,
[data-bs-theme="dark"] .leads-table-container table thead th,
[data-bs-theme="dark"] .dataTables_scrollHead table.leads-table thead th {
  background: #171f2f !important;
  color: #f1f5f9 !important;
  border-bottom: 2px solid #2d384e !important;
}

[data-bs-theme="dark"] .leads-table-container table tbody td,
[data-bs-theme="dark"] .dataTables_scrollBody table.leads-table tbody td {
  border-bottom: 1px solid #202b3d;
  color: #cbd5e1;
}

[data-bs-theme="dark"] .leads-table-container table tbody tr:hover td,
[data-bs-theme="dark"] .dataTables_scrollBody table.leads-table tbody tr:hover td {
  background-color: rgba(216, 0, 100, 0.14) !important;
}

[data-bs-theme="dark"] .leads-page-card .dataTables_wrapper > .row:first-child,
[data-bs-theme="dark"] .leads-page-card .dataTables_wrapper > .row:last-child {
  background: rgba(15, 23, 42, 0.6);
  border-color: #243044;
}

[data-bs-theme="dark"] .leads-page-card .dataTables_wrapper .dataTables_length select,
[data-bs-theme="dark"] .leads-page-card .dataTables_wrapper .dataTables_filter input {
  background-color: #171f2f !important;
  border-color: #2c384e !important;
  color: #f8fafc !important;
}

[data-bs-theme="dark"] .leads-page-card .dataTables_wrapper .dataTables_paginate .paginate_button {
  background: #171f2f !important;
  border-color: #2c384e !important;
  color: #e2e8f0 !important;
}

[data-bs-theme="dark"] .dataTables_scrollBody::-webkit-scrollbar-track {
  background: #121824;
}

[data-bs-theme="dark"] .dataTables_scrollBody::-webkit-scrollbar-thumb {
  background: rgba(216, 0, 100, 0.35);
}


[data-bs-theme="dark"] .lead-btn-convert {
  color: #fbbf24 !important;
  border-color: #f59e0b !important;
}

[data-bs-theme="dark"] .lead-btn-convert-pill {
  background: #f59e0b !important;
  border-color: #f59e0b !important;
  color: #1e293b !important;
}

[data-bs-theme="dark"] .lead-btn-convert-pill:hover,
[data-bs-theme="dark"] .lead-btn-convert-pill:focus {
  background: #fbbf24 !important;
  border-color: #fbbf24 !important;
  color: #0f172a !important;
}

[data-bs-theme="dark"] .lead-reg-status-pending {
  color: #fde68a;
  background: rgba(245, 158, 11, 0.22);
}

[data-bs-theme="dark"] .lead-reg-status-approved {
  color: #86efac;
  background: rgba(22, 163, 74, 0.22);
}

[data-bs-theme="dark"] .lead-reg-status-rejected {
  color: #fca5a5;
  background: rgba(220, 38, 38, 0.22);
}

.registration-details .card {
  border-radius: 0.75rem;
}

.reg-details-page {
  width: 100%;
  max-width: none;
}

.reg-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1.25rem 1.4rem;
  border-radius: 1.1rem;
  background:
    linear-gradient(135deg, rgba(154, 0, 88, 0.18), rgba(154, 0, 88, 0.04) 55%, transparent),
    var(--ds-modal-bg, var(--bs-body-bg));
  border: 1px solid rgba(154, 0, 88, 0.18);
}

.reg-toolbar-copy h1 {
  font-size: 1.7rem;
  font-weight: 800;
  margin: 0.35rem 0 0.15rem;
}

.reg-toolbar-copy p {
  margin: 0;
  color: var(--ds-gray-600, #637381);
}

.reg-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: inherit;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0.8;
}

.reg-back:hover {
  opacity: 1;
  color: #9A0058;
}

.reg-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.reg-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 2.1rem;
  padding: 0 0.8rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.reg-status-pending {
  color: #92400e;
  background: #fef3c7;
}

.reg-status-approved {
  color: #166534;
  background: #dcfce7;
}

.reg-status-rejected {
  color: #991b1b;
  background: #fee2e2;
}

[data-bs-theme="dark"] .reg-status-pending {
  color: #fde68a;
  background: rgba(245, 158, 11, 0.22);
}

[data-bs-theme="dark"] .reg-status-approved {
  color: #86efac;
  background: rgba(22, 163, 74, 0.22);
}

[data-bs-theme="dark"] .reg-status-rejected {
  color: #fca5a5;
  background: rgba(220, 38, 38, 0.22);
}

.reg-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.reg-stat {
  display: flex;
  align-items: center;
  gap: 0.95rem;
  padding: 1rem 1.15rem;
  border-radius: 1rem;
  background: var(--ds-modal-bg, var(--bs-body-bg));
  border: 1px solid var(--ds-border-color, rgba(145, 158, 171, 0.18));
  min-height: 88px;
}

.reg-stat-icon {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-magenta-light);
  color: var(--brand-magenta);
  flex-shrink: 0;
}

.reg-stat small,
.reg-review-grid small,
.reg-edit-hint {
  display: block;
  color: var(--ds-gray-600, #637381);
  font-size: 0.75rem;
  font-weight: 600;
}

.reg-stat strong,
.reg-review-grid strong {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.92rem;
  font-weight: 700;
  word-break: break-word;
}

.reg-edit-hint {
  margin: 0 0 1.1rem;
  font-weight: 500;
}

.reg-panel {
  background: var(--ds-modal-bg, var(--bs-body-bg));
  border: 1px solid var(--ds-border-color, rgba(145, 158, 171, 0.18));
  border-radius: 1.15rem;
  padding: 1.15rem 1.2rem 1.25rem;
}

.reg-section-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.1rem;
}

.reg-section-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-gradient);
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(216, 0, 100, 0.25);
}

.reg-section-head h5 {
  margin: 0;
  font-weight: 800;
}

.reg-section-head p {
  margin: 0;
  color: var(--ds-gray-600, #637381);
  font-size: 0.8rem;
}

.reg-field-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
}

.reg-inline-field[data-field="street"] {
  grid-column: 1 / -1;
}

.reg-inline-field {
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--ds-border-color, rgba(145, 158, 171, 0.16));
  border-radius: 0.85rem;
  background: rgba(145, 158, 171, 0.06);
}

.reg-inline-field.is-editable:hover {
  border-color: rgba(216, 0, 100, 0.35);
  background: var(--brand-magenta-light);
}

.reg-inline-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ds-gray-600, #637381);
  margin-bottom: 0.25rem;
}

.reg-inline-display {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 1.75rem;
}

.reg-inline-value {
  flex: 1;
  word-break: break-word;
  font-weight: 600;
}

.reg-inline-icon {
  border: 0;
  background: var(--brand-magenta-light);
  color: var(--brand-magenta);
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.45rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.reg-inline-icon:hover,
.reg-inline-icon:focus {
  background: var(--brand-magenta);
  color: #fff;
}

.reg-inline-editor {
  display: none;
  align-items: flex-start;
  gap: 0.5rem;
}

.reg-inline-field.is-editing .reg-inline-display {
  display: none;
}

.reg-inline-field.is-editing .reg-inline-editor {
  display: flex;
}

.reg-inline-editor .form-control,
.reg-inline-editor .form-select {
  flex: 1;
}

.reg-inline-actions {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}

.reg-inline-phone {
  display: flex;
  gap: 0.5rem;
  flex: 1;
}

.reg-inline-phone .form-select {
  max-width: 5.5rem;
  flex: 0 0 5.5rem;
}

.reg-inline-field.is-saving {
  opacity: 0.65;
  pointer-events: none;
}

.reg-doc-card {
  border: 1px solid var(--ds-border-color, rgba(145, 158, 171, 0.18));
  border-radius: 1rem;
  padding: 1rem;
  background: rgba(145, 158, 171, 0.05);
}

.reg-doc-preview-link {
  display: block;
}

.reg-doc-preview {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 0.75rem;
}

.reg-doc-file,
.reg-doc-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 180px;
  border-radius: 0.75rem;
  background: var(--brand-magenta-light);
  color: var(--ds-gray-600, #637381);
}

.reg-doc-file i {
  font-size: 2rem;
  color: var(--brand-magenta);
}

.reg-review-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.reg-review-grid > div {
  padding: 0.85rem 0.95rem;
  border-radius: 0.85rem;
  background: rgba(145, 158, 171, 0.06);
}

@media (max-width: 1199px) {
  .reg-field-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 991px) {
  .reg-stats,
  .reg-field-grid,
  .reg-review-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 576px) {
  .reg-stats,
  .reg-field-grid,
  .reg-review-grid {
    grid-template-columns: 1fr;
  }

  .reg-inline-editor,
  .reg-inline-phone {
    flex-wrap: wrap;
  }

  .reg-inline-phone .form-select {
    max-width: none;
    flex: 1 1 100%;
  }

  .reg-inline-actions {
    width: 100%;
  }
}

/* ==========================================================================
   MODAL POPUPS & DIALOGS (BRANDED MAGENTA DESIGN SYSTEM)
   ========================================================================== */

/* Modal Backdrop with Modern Glass Blur */
.modal-backdrop {
  --bs-backdrop-bg: #090d16;
  --bs-backdrop-opacity: 0.6;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

/* Modal Content Card */
.modal-content,
.app-modal-content {
  background-color: var(--app-card-bg) !important;
  border: 1px solid var(--app-card-border) !important;
  border-radius: 1rem !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.05) !important;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

[data-bs-theme="dark"] .modal-content,
[data-bs-theme="dark"] .app-modal-content {
  background-color: #111827 !important;
  border-color: #1e293b !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.06) !important;
}

/* Modal Header with Subtle Magenta Brand Ambient Tint */
.modal-header,
.app-modal-header {
  background: linear-gradient(135deg, rgba(216, 0, 100, 0.06) 0%, rgba(0, 112, 235, 0.02) 100%) !important;
  border-bottom: 1px solid var(--app-card-border) !important;
  padding: 1.1rem 1.4rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}

[data-bs-theme="dark"] .modal-header,
[data-bs-theme="dark"] .app-modal-header {
  background: linear-gradient(135deg, rgba(216, 0, 100, 0.14) 0%, rgba(0, 112, 235, 0.05) 100%) !important;
  border-bottom-color: #1e293b !important;
}

/* Header Brand Icon Badge */
.app-modal-header-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--brand-magenta);
  color: #ffffff;
  font-size: 1rem;
  box-shadow: 0 2px 8px rgba(216, 0, 100, 0.3);
  flex-shrink: 0;
}

/* Modal Title */
.modal-title,
.app-modal-title {
  font-size: 1.05rem !important;
  font-weight: 700 !important;
  letter-spacing: -0.01em;
  color: var(--ds-body-color) !important;
  margin: 0 !important;
}

/* Close Button with Subtle Hover Rotation */
.modal-header .btn-close,
.app-modal-close {
  width: 2rem !important;
  height: 2rem !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 50% !important;
  background-color: rgba(148, 163, 184, 0.15) !important;
  opacity: 0.75 !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: none !important;
}

.modal-header .btn-close:hover,
.app-modal-close:hover {
  opacity: 1 !important;
  background-color: var(--brand-magenta-light) !important;
  transform: rotate(90deg) scale(1.08) !important;
}

/* Modal Body */
.modal-body,
.app-modal-body {
  padding: 1.4rem !important;
  color: var(--ds-body-color) !important;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.3) transparent;
}

.modal-body::-webkit-scrollbar,
.app-modal-body::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.modal-body::-webkit-scrollbar-thumb,
.app-modal-body::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border-radius: 999px;
}
.modal-body::-webkit-scrollbar-thumb:hover,
.app-modal-body::-webkit-scrollbar-thumb:hover {
  background: var(--brand-magenta);
}

/* Modal Footer */
.modal-footer,
.app-modal-footer {
  background: rgba(148, 163, 184, 0.04) !important;
  border-top: 1px solid var(--app-card-border) !important;
  padding: 0.9rem 1.4rem !important;
}

[data-bs-theme="dark"] .modal-footer,
[data-bs-theme="dark"] .app-modal-footer {
  background: rgba(15, 23, 42, 0.5) !important;
  border-top-color: #1e293b !important;
}

/* Form Inputs inside Modal */
.modal-body .form-control:focus,
.modal-body .form-select:focus {
  border-color: var(--brand-magenta) !important;
  box-shadow: 0 0 0 3px rgba(216, 0, 100, 0.18) !important;
}

.modal-body .form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ds-gray-700, #334155);
  margin-bottom: 0.35rem;
}

[data-bs-theme="dark"] .modal-body .form-label {
  color: #94a3b8;
}

/* Loader in AJAX Modal */
.app-modal-loader-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  padding: 2.5rem;
}

.app-modal-spinner-ring {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.app-modal-spinner-ring::after {
  content: '';
  position: absolute;
  width: 3.75rem;
  height: 3.75rem;
  border-radius: 50%;
  background: rgba(216, 0, 100, 0.12);
  animation: pulse-ring 1.8s infinite cubic-bezier(0.4, 0, 0.6, 1);
}

@keyframes pulse-ring {
  0% { transform: scale(0.85); opacity: 0.8; }
  50% { transform: scale(1.25); opacity: 0.3; }
  100% { transform: scale(0.85); opacity: 0.8; }
}

.app-modal-loader-text {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ds-gray-600, #64748b);
  letter-spacing: 0.02em;
}

/* Confirm & SweetAlert Card Styling */
.app-confirm-card {
  padding: 1.75rem !important;
  text-align: center;
  position: relative;
}

.app-confirm-close {
  position: absolute !important;
  top: 1rem !important;
  right: 1rem !important;
}

.app-confirm-icon {
  width: 58px;
  height: 58px;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(216, 0, 100, 0.12);
  color: var(--brand-magenta);
}

.app-confirm-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ds-body-color);
  margin-bottom: 0.5rem;
}

.app-confirm-text {
  font-size: 0.875rem;
  color: var(--ds-gray-600, #64748b);
  margin-bottom: 1.5rem;
}

.app-confirm-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

/* SweetAlert2 Modal Upgrades */
.app-swal {
  background-color: var(--app-card-bg) !important;
  border: 1px solid var(--app-card-border) !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.3) !important;
  padding: 1.75rem !important;
}

[data-bs-theme="dark"] .app-swal {
  background-color: #111827 !important;
  border-color: #1e293b !important;
}

.app-swal .swal2-title {
  font-size: 1.25rem !important;
  font-weight: 700 !important;
  color: var(--ds-body-color) !important;
}

.app-swal .swal2-html-container {
  font-size: 0.9rem !important;
  color: var(--ds-gray-600, #64748b) !important;
}

.app-swal .swal2-icon.swal2-success {
  border-color: #10b981 !important;
  color: #10b981 !important;
}

.app-swal .swal2-icon.swal2-warning {
  border-color: var(--brand-magenta) !important;
  color: var(--brand-magenta) !important;
}

.app-swal .swal2-icon.swal2-error {
  border-color: #ef4444 !important;
  color: #ef4444 !important;
}

.lead-view {
  padding: 0.25rem 0.15rem 0.5rem;
}

.lead-view-hero {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding: 1.15rem 1.25rem;
  border-radius: 1.1rem;
  background:
    linear-gradient(135deg, rgba(216, 0, 100, 0.12), rgba(216, 0, 100, 0.03) 55%, transparent),
    var(--ds-modal-bg, var(--bs-body-bg));
  border: 1px solid rgba(216, 0, 100, 0.18);
}

.lead-view-kicker {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brand-magenta);
}

.lead-view-name {
  margin: 0.2rem 0 0.45rem;
  font-weight: 800;
}

.lead-view-contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  color: var(--ds-gray-600, #637381);
  font-size: 0.9rem;
}

.lead-view-contacts a {
  color: #1d7a46;
  text-decoration: none;
  font-weight: 600;
}

.lead-view-hero-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.7rem;
}

.lead-view-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-end;
}

.lead-view-panel {
  background: var(--ds-modal-bg, var(--bs-body-bg));
  border: 1px solid var(--ds-border-color, rgba(145, 158, 171, 0.18));
  border-radius: 1.1rem;
  padding: 1.05rem 1.15rem 1.15rem;
  margin-bottom: 1rem;
}

.lead-view-section-head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.95rem;
}

.lead-view-section-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-gradient);
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(216, 0, 100, 0.25);
}

.lead-view-section-head h6 {
  margin: 0;
  font-weight: 800;
}

.lead-view-section-head p {
  margin: 0;
  color: var(--ds-gray-600, #637381);
  font-size: 0.78rem;
}

.lead-view-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.lead-view-grid > div,
.lead-view-notes {
  padding: 0.7rem 0.8rem;
  border-radius: 0.8rem;
  background: rgba(145, 158, 171, 0.08);
}

.lead-view-span,
.lead-view-notes {
  grid-column: 1 / -1;
}

.lead-view-grid small,
.lead-view-notes small {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ds-gray-600, #637381);
}

.lead-view-grid strong,
.lead-view-notes p {
  display: block;
  margin: 0.15rem 0 0;
  font-size: 0.92rem;
  font-weight: 600;
  word-break: break-word;
}

.lead-view-notes {
  margin-top: 0.7rem;
}

.lead-view-history {
  max-height: 72vh;
  overflow: auto;
}

.lead-view-timeline {
  position: relative;
  padding-left: 1.15rem;
}

.lead-view-timeline::before {
  content: '';
  position: absolute;
  top: 0.4rem;
  bottom: 0.4rem;
  left: 0.28rem;
  width: 2px;
  background: rgba(216, 0, 100, 0.25);
}

.lead-view-activity {
  position: relative;
  margin-bottom: 0.85rem;
}

.lead-view-dot {
  position: absolute;
  left: -1.02rem;
  top: 0.85rem;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: var(--brand-magenta);
  border: 2px solid var(--ds-modal-bg, var(--bs-body-bg));
  box-shadow: 0 0 0 2px rgba(216, 0, 100, 0.25);
}

.lead-view-activity-card {
  padding: 0.8rem 0.9rem;
  border-radius: 0.85rem;
  background: rgba(145, 158, 171, 0.08);
}

.lead-view-activity-top {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
}

.lead-view-activity-top small,
.lead-view-activity-by {
  color: var(--ds-gray-600, #637381);
}

.lead-view-activity-desc {
  margin: 0.3rem 0 0;
  font-size: 0.9rem;
}

.lead-view-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.45rem;
}

.lead-view-chips span {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(216, 0, 100, 0.12);
  color: var(--brand-magenta);
}

.lead-view-activity-note {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  color: var(--ds-gray-600, #637381);
}

.lead-view-activity-by {
  display: block;
  margin-top: 0.45rem;
  font-size: 0.75rem;
}

.lead-view-empty {
  text-align: center;
  color: var(--ds-gray-600, #637381);
  padding: 2rem 0;
}

@media (max-width: 767px) {
  .lead-view-hero-side {
    align-items: flex-start;
  }

  .lead-view-badges {
    justify-content: flex-start;
  }

  .lead-view-grid {
    grid-template-columns: 1fr;
  }
}
