/* =======================================================
   VyalaApp - Clean, Neat & High-Performance Enterprise CRM
   ======================================================= */

:root {
  --primary-color: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-glow: rgba(37, 99, 235, 0.2);
  --secondary-color: #64748b;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --danger-color: #ef4444;
  --info-color: #06b6d4;
  --bg-body: #f8fafc;
  --card-bg: #ffffff;
  --text-dark: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --border-subtle: #e2e8f0;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
  background-color: var(--bg-body);
  color: var(--text-dark);
  font-family: var(--font-family);
  min-height: 100vh;
  padding-bottom: 70px;
  -webkit-font-smoothing: antialiased;
}

@media (min-width: 768px) {
  body {
    padding-bottom: 24px;
  }
}

/* Professional Enterprise Navbar */
.navbar-custom {
  background: #0f172a;
  border-bottom: 1px solid #1e293b;
  position: relative;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.brand-title {
  font-weight: 700;
  letter-spacing: -0.3px;
  color: #ffffff !important;
  background: none !important;
  -webkit-text-fill-color: #ffffff !important;
}

/* Navbar Brand Logo Presentation Badge */
.navbar-logo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  padding: 3px 8px;
  border-radius: 6px;
  max-height: 34px;
  border: 1px solid #334155;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.navbar-logo-badge img,
.custom-app-logo {
  max-height: 26px;
  max-width: 120px;
  object-fit: contain;
  display: block;
}

/* Company Logo White Card */
.company-logo-card {
  background: #ffffff;
  padding: 5px 14px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.company-logo-card img {
  max-height: 38px;
  max-width: 180px;
  object-fit: contain;
  display: block;
}

/* Live Pulse Animation */
.live-pulse-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #10b981;
  margin-right: 6px;
  vertical-align: middle;
}

/* Nav Pills / Tabs */
.nav-custom-pills .nav-link {
  color: #94a3b8;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.86rem;
  padding: 0.4rem 0.85rem;
  transition: background 0.15s ease, color 0.15s ease;
  border: 1px solid transparent;
}

.nav-custom-pills .nav-link:hover {
  color: #f8fafc;
  background: #1e293b;
  border-color: transparent;
}

.nav-custom-pills .nav-link.active {
  color: #ffffff;
  background: #2563eb;
  font-weight: 600;
  box-shadow: none;
  border-color: transparent;
}

/* Subscription Alert Banners */
.subscription-alert-banner {
  border-radius: 0;
  margin-bottom: 0;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 1.25rem;
}

/* Stat KPI Cards - Clean & Neat */
.stat-card {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  transition: border-color 0.15s ease;
  position: relative;
  overflow: hidden;
}

.stat-card:hover {
  border-color: #cbd5e1;
}

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.stat-icon.total { background: #eff6ff; color: #2563eb; }
.stat-icon.today { background: #fef3c7; color: #d97706; }
.stat-icon.overdue { background: #fee2e2; color: #dc2626; }
.stat-icon.active { background: #e0e7ff; color: #4338ca; }
.stat-icon.converted { background: #dcfce7; color: #15803d; }

/* Filter Bar & Cards */
.filter-card, .chart-card, .report-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.chart-card-header, .report-card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  background-color: #ffffff;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

/* Bulk Actions Toolbar */
.bulk-toolbar {
  background: #1e293b;
  color: #ffffff;
  border-radius: 10px;
  padding: 0.65rem 1rem;
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  animation: fadeIn 0.2s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Leads & Reports Table */
.leads-table-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  overflow: hidden;
}

/* Conversion Dashboard & Analytics Enhancements */
.conversion-hero-card {
  background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.conversion-hero-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.15);
}
.btn-xs {
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  line-height: 1.3;
}

.leads-table thead th, .report-table thead th {
  background-color: #f1f5f9;
  color: #334155;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
  vertical-align: middle;
}

.leads-table tbody td, .report-table tbody td {
  vertical-align: middle;
  padding: 0.85rem 0.75rem;
  border-bottom: 1px solid #f1f5f9;
}

.leads-table tbody tr:hover, .report-table tbody tr:hover {
  background-color: #f8fafc;
}

/* Badges */
.badge-status {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border-radius: 50rem;
  white-space: nowrap;
}

.badge-status-new { background-color: #dbeafe; color: #1e40af; }
.badge-status-contacted { background-color: #e0f2fe; color: #0369a1; }
.badge-status-interested { background-color: #fef3c7; color: #92400e; }
.badge-status-follow-up { background-color: #fef08a; color: #854d0e; }
.badge-status-converted { background-color: #dcfce7; color: #166534; }
.badge-status-lost { background-color: #fee2e2; color: #991b1b; }

.badge-type {
  background-color: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  white-space: nowrap;
}

.badge-employee {
  background-color: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
  font-size: 0.75rem;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  font-weight: 500;
  white-space: nowrap;
}

.badge-unassigned {
  background-color: #f3f4f6;
  color: #9ca3af;
  border: 1px dashed #d1d5db;
  font-size: 0.75rem;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  white-space: nowrap;
}

/* Follow-up indicators */
.followup-pill {
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  white-space: nowrap;
}

.followup-pill.today {
  background-color: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.followup-pill.overdue {
  background-color: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
  animation: pulse-danger 2s infinite;
}

.followup-pill.upcoming {
  background-color: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.followup-pill.none, .followup-pill.closed {
  background-color: #f3f4f6;
  color: #6b7280;
}

@keyframes pulse-danger {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  70% { box-shadow: 0 0 0 5px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Contact actions */
.contact-link {
  color: var(--text-dark);
  text-decoration: none;
  font-weight: 500;
}

.contact-quick-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  margin-left: 5px;
  text-decoration: none;
  transition: transform 0.15s, opacity 0.15s;
}

.contact-quick-btn:hover {
  opacity: 0.9;
  transform: scale(1.08);
}

.btn-whatsapp { background-color: #25d366; color: #fff; }
.btn-call { background-color: #0284c7; color: #fff; }
.btn-mail { background-color: #ea4335; color: #fff; }

/* Truncated remarks */
.remarks-text {
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  color: #475569;
}

.remarks-text:hover {
  color: #0f172a;
  text-decoration: underline;
}

/* Progress bar inside reports */
.progress-slim {
  height: 6px;
  border-radius: 4px;
  background-color: #e2e8f0;
}

/* Performance rank badge */
.perf-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 50rem;
}

/* Paywall Card */
.paywall-box {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: #ffffff;
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
}

.payment-method-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 0.85rem;
  text-align: left;
}

/* PWA Install Banner */
.install-banner {
  position: fixed;
  bottom: 80px;
  left: 20px;
  right: 20px;
  max-width: 460px;
  margin: 0 auto;
  background: #1e293b;
  color: #ffffff;
  border-radius: 14px;
  padding: 1rem 1.25rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
  z-index: 1080;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  animation: slideUp 0.3s ease-out;
}

@media (min-width: 768px) {
  .install-banner {
    bottom: 24px;
    right: 24px;
    left: auto;
    margin: 0;
  }
}

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

.ios-step-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Mobile Bottom Navigation */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: #1e293b;
  border-top: 1px solid #334155;
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 990;
  padding: 0 8px;
}

/* Hide mobile bottom navigation completely whenever any modal is open */
body.modal-open .mobile-bottom-nav,
.modal.show ~ .mobile-bottom-nav,
.modal.show + .mobile-bottom-nav {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

@media (min-width: 768px) {
  .mobile-bottom-nav {
    display: none !important;
  }
}

.mobile-nav-item {
  color: #94a3b8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  text-decoration: none;
  background: transparent;
  border: none;
  padding: 4px 8px;
  border-radius: 8px;
  transition: all 0.15s ease;
}

.mobile-nav-item i {
  font-size: 1.25rem;
  margin-bottom: 2px;
}

.mobile-nav-item.active, .mobile-nav-item:hover {
  color: #3b82f6;
}

/* Mobile Cards View */
.lead-mobile-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 0.85rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
  transition: border-color 0.2s;
}

.lead-mobile-card:hover {
  border-color: #cbd5e1;
}

.view-switcher-btn {
  padding: 0.25rem 0.6rem;
  font-size: 0.8rem;
}

/* Toast container */
.toast-container-custom {
  position: fixed;
  bottom: 74px;
  right: 16px;
  z-index: 1090;
}

@media (min-width: 768px) {
  .toast-container-custom {
    bottom: 24px;
    right: 24px;
  }
}

/* Call History & Interaction Timeline */
.call-timeline-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 4px;
}

.call-item-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-left: 4px solid #0ea5e9;
  border-radius: 8px;
  padding: 0.85rem;
  transition: box-shadow 0.15s ease;
}

.call-item-card:hover {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.call-item-card.call-type-whatsapp {
  border-left-color: #25d366;
}

.call-item-card.call-type-demo {
  border-left-color: #8b5cf6;
}

.call-item-card.call-type-email {
  border-left-color: #f59e0b;
}

.call-item-card.call-type-status {
  border-left-color: #64748b;
}

.call-outcome-badge {
  font-size: 0.75rem;
  padding: 0.2rem 0.55rem;
  border-radius: 12px;
  font-weight: 600;
}

/* =======================================================
   FUTURISTIC APP INSTALL POP-UP MODAL & BADGES
   ======================================================= */
.modal-install-futuristic .modal-dialog {
  max-width: 620px;
  margin: 1.25rem auto;
}

.modal-install-futuristic .modal-content {
  background: linear-gradient(165deg, #0a0f1d 0%, #0f172a 45%, #050811 100%);
  border: 1px solid rgba(99, 102, 241, 0.4);
  border-radius: 22px;
  color: #f8fafc;
  box-shadow: 0 0 50px rgba(99, 102, 241, 0.28), 0 25px 60px -10px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  position: relative;
}

.modal-install-futuristic .modal-body {
  max-height: 85vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(99, 102, 241, 0.5) transparent;
}

.modal-install-futuristic .modal-body::-webkit-scrollbar {
  width: 6px;
}

.modal-install-futuristic .modal-body::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.4);
  border-radius: 999px;
}

.modal-install-futuristic .modal-content::before {
  content: '';
  position: absolute;
  top: -40%;
  left: -20%;
  width: 140%;
  height: 140%;
  background: radial-gradient(circle at 50% 15%, rgba(99, 102, 241, 0.2), transparent 45%),
              radial-gradient(circle at 80% 80%, rgba(6, 182, 212, 0.15), transparent 40%);
  pointer-events: none;
}

.install-glow-icon-wrap {
  position: relative;
  width: 84px;
  height: 84px;
  margin: 0 auto 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.install-glow-icon-wrap img {
  width: 74px;
  height: 74px;
  object-fit: cover;
  border-radius: 18px;
  position: relative;
  z-index: 2;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.install-glow-ring {
  position: absolute;
  inset: -5px;
  border-radius: 24px;
  background: linear-gradient(135deg, #4f46e5, #06b6d4, #10b981);
  filter: blur(10px);
  opacity: 0.85;
  animation: pulseGlow 2.8s ease-in-out infinite alternate;
}

@keyframes pulseGlow {
  0% { transform: scale(0.95); opacity: 0.6; filter: blur(8px); }
  100% { transform: scale(1.06); opacity: 1; filter: blur(14px); }
}

.btn-install-glow {
  background: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
  border: none;
  color: #ffffff;
  font-weight: 700;
  padding: 0.75rem 1.6rem;
  border-radius: 12px;
  font-size: 0.98rem;
  box-shadow: 0 4px 22px rgba(79, 70, 229, 0.5);
  transition: all 0.25s ease;
  letter-spacing: -0.2px;
}

.btn-install-glow:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(6, 182, 212, 0.65);
  color: #ffffff;
}

.feature-pill-futuristic {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 0.65rem 0.8rem;
  transition: background 0.2s, border-color 0.2s;
  text-align: left;
  min-height: 82px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.feature-pill-futuristic:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(99, 102, 241, 0.35);
}

.install-tab-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  border-radius: 10px;
  padding: 0.45rem 0.9rem;
  font-weight: 600;
  font-size: 0.82rem;
  transition: all 0.2s;
}

.install-tab-btn.active {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.4), rgba(6, 182, 212, 0.4));
  border-color: rgba(99, 102, 241, 0.7);
  color: #ffffff;
  box-shadow: 0 0 18px rgba(99, 102, 241, 0.4);
}

/* =======================================================
   UNIVERSAL CLEAN & PROFESSIONAL MODAL SYSTEM
   ======================================================= */
.modal-content {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  box-shadow: 0 20px 45px -10px rgba(15, 23, 42, 0.3);
  overflow: hidden;
}

.modal-header {
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  padding: 0.9rem 1.35rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-header.bg-dark {
  background: linear-gradient(135deg, #090e1a 0%, #0f172a 100%) !important;
}

.modal-title {
  font-weight: 700;
  letter-spacing: -0.2px;
}

.modal-body {
  padding: 1.25rem 1.4rem;
}

.modal-footer {
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
  padding: 0.75rem 1.35rem;
  border-top: 1px solid #f1f5f9;
}

.modal-dialog-compact {
  max-width: 440px;
  margin: 1.75rem auto;
}

.modal-dialog-medium {
  max-width: 520px;
  margin: 1.75rem auto;
}

.modal-dialog-wide {
  max-width: 760px;
  margin: 1.75rem auto;
}

/* Modal Form Controls */
.modal .form-control,
.modal .form-select {
  border-radius: 9px;
  border: 1px solid #cbd5e1;
  padding: 0.5rem 0.8rem;
  font-size: 0.9rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.modal .form-control:focus,
.modal .form-select:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.modal .form-label {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 0.3rem;
  color: #475569;
}

/* Table Column Widths & Fitting */
.leads-table th {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #64748b;
  background-color: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  padding: 0.75rem 0.65rem;
  white-space: nowrap;
}

.leads-table td {
  padding: 0.75rem 0.65rem;
  vertical-align: middle;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.86rem;
}

.leads-table tbody tr:hover {
  background-color: #f8fafc;
}

/* ========================================================
   GLOBAL APP FOOTER (Vyala Software Signature)
   ======================================================== */
.app-footer {
  margin-top: 3rem;
  padding: 1.5rem 1rem;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  color: #64748b;
  font-size: 0.84rem;
  text-align: center;
  position: relative;
  z-index: 10;
}

.app-footer .footer-brand {
  font-weight: 700;
  color: #0f172a;
}

.app-footer .developer-credit {
  color: #0284c7;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.app-footer .developer-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: rgba(2, 132, 199, 0.08);
  border: 1px solid rgba(2, 132, 199, 0.2);
  color: #0284c7;
  font-weight: 700;
  font-size: 0.8rem;
  transition: all 0.2s ease;
}

.app-footer .developer-badge:hover {
  background: rgba(2, 132, 199, 0.15);
  border-color: rgba(2, 132, 199, 0.4);
}

@media (max-width: 767px) {
  .app-footer {
    margin-top: 2rem;
    margin-bottom: 55px; /* Clear fixed mobile bottom nav */
    padding: 1.25rem 0.75rem;
    font-size: 0.78rem;
  }
}

/* ========================================================
   RESPONSIVE SCROLLABLE MODAL SYSTEM (Mobile Lead Entry)
   ======================================================== */
.modal-dialog-scrollable .modal-content {
  max-height: calc(100vh - 2rem);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Support <form> as direct child of .modal-content */
.modal-dialog-scrollable .modal-content > form {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: calc(100vh - 2rem);
  min-height: 0;
  overflow: hidden;
}

.modal-dialog-scrollable .modal-content > form > .modal-header {
  flex-shrink: 0;
}

.modal-dialog-scrollable .modal-content > form > .modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.modal-dialog-scrollable .modal-content > form > .modal-body::-webkit-scrollbar {
  width: 6px;
}

.modal-dialog-scrollable .modal-content > form > .modal-body::-webkit-scrollbar-thumb {
  background-color: #cbd5e1;
  border-radius: 999px;
}

.modal-dialog-scrollable .modal-content > form > .modal-footer {
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  z-index: 10;
  background-color: #f8fafc;
  border-top: 1px solid #e2e8f0;
}

@media (max-width: 767px) {
  /* Hide mobile bottom navigation whenever any modal is open */
  body.modal-open .mobile-bottom-nav,
  .modal.show ~ .mobile-bottom-nav,
  .modal.show + .mobile-bottom-nav {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }

  .mobile-bottom-nav {
    z-index: 990 !important;
  }

  /* Responsive Lead Modal styling */
  #leadModal .modal-dialog {
    margin: 0.5rem auto 1rem auto;
    max-width: calc(100% - 1rem);
    height: auto;
    max-height: calc(100dvh - 1.5rem);
    display: flex;
    flex-direction: column;
  }

  #leadModal .modal-content {
    max-height: calc(100dvh - 1.5rem);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  #leadModal .modal-header {
    flex-shrink: 0;
    padding: 0.85rem 1.15rem;
  }

  #leadModal .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    max-height: calc(100dvh - 170px);
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-y: contain;
    padding: 1.1rem 1.15rem 3.5rem 1.15rem !important; /* Generous bottom clearance past Remarks */
  }

  #leadModal .modal-footer {
    flex-shrink: 0;
    padding: 0.85rem 1.15rem;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
    display: flex;
    gap: 0.65rem;
    position: relative;
    z-index: 5;
  }

  #leadModal .modal-footer .btn {
    flex: 1;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: 10px;
  }
}

/* ========================================================
   EXPLICIT SEARCH ACTION GROUP STYLES
   ======================================================== */
.search-action-group {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.search-action-group .form-control:focus {
  z-index: 3;
}

.search-action-group #doSearchBtn {
  background-color: #0284c7;
  border-color: #0284c7;
  color: #ffffff;
  font-weight: 600;
  font-size: 0.82rem;
  white-space: nowrap;
  letter-spacing: 0.2px;
  transition: all 0.2s ease;
  z-index: 4;
}

.search-action-group #doSearchBtn:hover {
  background-color: #0369a1;
  border-color: #0369a1;
}

.search-action-group #clearSearchBtn {
  z-index: 4;
  border-color: #cbd5e1;
  color: #64748b;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.search-action-group #clearSearchBtn:hover {
  background-color: #f1f5f9;
  color: #0f172a;
}

/* ========================================================
   STYLISH PROFESSIONAL FILTER TOOLBAR & ACTION BUTTONS
   ======================================================== */
.filter-toolbar-row {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.65rem 0.85rem;
  margin-top: 0.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.btn-filter-apply {
  background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%) !important;
  border: none !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  font-size: 0.8125rem !important;
  padding: 0.4rem 1.05rem !important;
  border-radius: 8px !important;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.28) !important;
  letter-spacing: 0.2px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
}

.btn-filter-apply:hover {
  background: linear-gradient(135deg, #0369a1 0%, #1d4ed8 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4) !important;
  transform: translateY(-1px);
}

.btn-filter-apply:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(37, 99, 235, 0.25) !important;
}

.btn-filter-clear {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #64748b !important;
  font-weight: 600 !important;
  font-size: 0.8125rem !important;
  padding: 0.4rem 0.85rem !important;
  border-radius: 8px !important;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
}

.btn-filter-clear:hover {
  background: #fef2f2 !important;
  border-color: #fca5a5 !important;
  color: #dc2626 !important;
  box-shadow: 0 1px 3px rgba(220, 38, 38, 0.1);
}

.btn-filter-reset {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #475569;
  font-weight: 600;
  font-size: 0.8125rem;
  padding: 0.4rem 0.65rem;
  border-radius: 8px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-filter-reset:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
  transform: translateY(-1px);
}

.btn-filter-export {
  background: #f0fdf4;
  border: 1px solid #86efac;
  color: #166534;
  font-weight: 600;
  font-size: 0.8125rem;
  padding: 0.4rem 0.65rem;
  border-radius: 8px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-filter-export:hover {
  background: #16a34a;
  border-color: #16a34a;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.3);
  transform: translateY(-1px);
}

.date-filter-input {
  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
  background-color: #ffffff !important;
  font-size: 0.8125rem !important;
  font-weight: 500 !important;
  color: #1e293b !important;
  padding: 0.38rem 0.65rem !important;
  transition: all 0.2s ease;
}

.date-filter-input:focus {
  background-color: #ffffff !important;
  border-color: #0284c7 !important;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15) !important;
}

/* Super Admin Column Rename Trigger in Table Headers */
.col-rename-trigger {
  opacity: 0.5;
  transition: all 0.2s ease;
  vertical-align: middle;
  cursor: pointer;
}

th:hover .col-rename-trigger,
.col-rename-trigger:hover {
  opacity: 1;
  transform: scale(1.15);
  color: #2563eb !important;
}

.col-rename-badge {
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.2);
  color: #1d4ed8;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 6px;
  font-weight: 600;
}

/* User Profile Photo & Avatar System */
.user-avatar-img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  vertical-align: middle;
  background-color: #f1f5f9;
}

.user-avatar-placeholder {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 700;
  font-size: 13px;
  background: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  vertical-align: middle;
  user-select: none;
}

.user-avatar-sm {
  width: 24px;
  height: 24px;
  font-size: 10px;
}

.user-avatar-lg {
  width: 80px;
  height: 80px;
  font-size: 30px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: 3px solid #ffffff;
}

.avatar-upload-box {
  position: relative;
  display: inline-block;
  cursor: pointer;
}

.avatar-upload-box .avatar-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.55);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  font-size: 1.25rem;
}

.avatar-upload-box:hover .avatar-overlay {
  opacity: 1;
}

/* Leads CRM Table Column Fit & Compact Styling */
.leads-table th.col-name, .leads-table td.col-name {
  max-width: 175px;
  min-width: 130px;
  word-break: break-word;
}

.leads-table th.col-contact, .leads-table td.col-contact {
  max-width: 145px;
  white-space: nowrap;
}

.leads-table th.col-location, .leads-table td.col-location {
  max-width: 135px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leads-table th.col-pincode, .leads-table td.col-pincode {
  max-width: 90px;
  white-space: nowrap;
}

.leads-table th.col-business_type, .leads-table td.col-business_type {
  max-width: 135px;
  white-space: nowrap;
}

.leads-table th.col-type, .leads-table td.col-type {
  max-width: 120px;
  white-space: nowrap;
}

.leads-table th.col-status, .leads-table td.col-status {
  max-width: 120px;
  white-space: nowrap;
}

.leads-table th.col-assigned_to, .leads-table td.col-assigned_to {
  max-width: 150px;
  white-space: nowrap;
}

.leads-table th.col-followup_date, .leads-table td.col-followup_date {
  max-width: 125px;
  white-space: nowrap;
}

.leads-table th.col-remarks, .leads-table td.col-remarks {
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leads-table th.col-actions, .leads-table td.col-actions {
  white-space: nowrap;
  min-width: 105px;
}

/* Column Visibility Dropdown Menu */
.dropdown-column-visibility {
  min-width: 230px;
  padding: 0.6rem 0.8rem;
  max-height: 380px;
  overflow-y: auto;
}

.dropdown-column-visibility .form-check {
  margin-bottom: 0.45rem;
}

.dropdown-column-visibility .form-check-label {
  font-size: 0.83rem;
  font-weight: 500;
  cursor: pointer;
  color: #334155;
}

/* ==========================================================================
   CLIENTS & PROJECTS CRM STYLING
   ========================================================================== */
.client-hero-card {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #ffffff;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.client-progress-gauge-wrap {
  position: relative;
  width: 100%;
}

.client-progress-circle-val {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #38bdf8;
}

.phase-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.phase-pill.active,
.phase-pill.status-completed {
  background-color: #dcfce7;
  color: #166534;
  border-color: #86efac;
}

.phase-pill.status-in-progress {
  background-color: #fef3c7;
  color: #92400e;
  border-color: #fcd34d;
}

.phase-pill.inactive,
.phase-pill.status-yet-to-start {
  background-color: #f1f5f9;
  color: #64748b;
  border-color: #e2e8f0;
}

.phase-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(0,0,0,0.06);
}

.phase-pill.active:hover,
.phase-pill.status-completed:hover {
  background-color: #bbf7d0;
}

.phase-pill.status-in-progress:hover {
  background-color: #fde68a;
}

.phase-pill.inactive:hover,
.phase-pill.status-yet-to-start:hover {
  background-color: #e2e8f0;
  color: #334155;
}

.phase-status-badge {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 700;
  text-transform: uppercase;
}

.phase-date {
  font-size: 10px;
  color: #475569;
  background: rgba(255, 255, 255, 0.7);
  padding: 1px 4px;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  font-weight: 500;
}

/* Department Badges */
.dept-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
}
.dept-badge-sales {
  background-color: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}
.dept-badge-frontend {
  background-color: #eef2ff;
  color: #4338ca;
  border: 1px solid #c7d2fe;
}
.dept-badge-backend {
  background-color: #faf5ff;
  color: #7e22ce;
  border: 1px solid #e9d5ff;
}
.dept-badge-testing {
  background-color: #f0fdfa;
  color: #0f766e;
  border: 1px solid #99f6e4;
}

.payment-summary-box {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px;
}

.installment-chip {
  display: inline-flex;
  align-items: center;
  font-size: 0.73rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 5px;
  background-color: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.installment-chip.advance {
  background-color: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}

.installment-chip.custom {
  background-color: #f3e8ff;
  color: #7e22ce;
  border-color: #e9d5ff;
}

.bug-count-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}

.bug-count-pill.has-open {
  background-color: #fee2e2;
  color: #dc2626;
  border: 1px solid #fca5a5;
}

.bug-count-pill.all-clear {
  background-color: #dcfce7;
  color: #16a34a;
  border: 1px solid #86efac;
}

.clients-table th {
  background-color: #f8fafc;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #475569;
  letter-spacing: 0.5px;
  border-bottom: 2px solid #e2e8f0;
  white-space: nowrap;
}

.clients-table td {
  vertical-align: middle;
  font-size: 0.85rem;
  border-bottom: 1px solid #f1f5f9;
}

.scope-preview-cell {
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.scope-preview-cell:hover {
  color: #0284c7;
}

.demo-status-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.demo-status-badge.given {
  background-color: #dcfce7;
  color: #15803d;
}

.demo-status-badge.not-yet {
  background-color: #f1f5f9;
  color: #64748b;
}

.demo-status-badge.to-be-given {
  background-color: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}




