/* ==========================================================================
   CRAFZIO ENTERPRISE DASHBOARD & LEAD MANAGEMENT SYSTEM
   ========================================================================== */

.crafzio-layout {
  display: flex;
  height: 100vh;
  width: 100vw;
  max-width: 100vw;
  overflow: hidden;
  background-color: #f1f6fc;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  box-sizing: border-box;
}

/* ==========================================================================
   SIDEBAR (DEEP NAVY WITH GLOWING ABSTRACT WAVE)
   ========================================================================== */
.crafzio-sidebar {
  width: 244px;
  height: 100vh;
  background: linear-gradient(180deg, #071126 0%, #0b1936 55%, #060f22 100%);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
  z-index: 50;
}

.sidebar-top {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: none;
}
.sidebar-top::-webkit-scrollbar { display: none; }

.brand-header {
  padding: 18px 20px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-emblem {
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.brand-portal-badge {
  font-size: 0.6rem;
  font-weight: 700;
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
  background: rgba(56, 189, 248, 0.12);
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.05em;
  margin-left: 2px;
}

.menu-group-label {
  padding: 14px 20px 8px;
  font-size: 0.65rem;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.08em;
}

.sidebar-menu {
  padding: 0 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 14px;
  border-radius: 8px;
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 600;
  transition: all 0.16s ease;
  cursor: pointer;
  position: relative;
}

.menu-item:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.menu-item.active {
  background: linear-gradient(135deg, #0284c7 0%, #0066ff 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.45);
}

.menu-icon {
  flex-shrink: 0;
}

.active-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffffff;
  margin-left: auto;
  box-shadow: 0 0 8px #ffffff;
}

/* Accordion Submenu for Lead Management */
.menu-accordion {
  display: flex;
  flex-direction: column;
}

.menu-parent {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  border: 1px solid transparent;
}

.menu-parent.active {
  background: rgba(56, 189, 248, 0.14);
  color: #ffffff;
  border-color: rgba(56, 189, 248, 0.28);
  box-shadow: none;
}

.chevron-icon {
  margin-left: auto;
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.menu-accordion.open .chevron-icon,
.menu-parent.open .chevron-icon {
  transform: rotate(180deg);
}

.sub-menu-list {
  display: none;
  flex-direction: column;
  margin: 4px 0 6px 19px;
  padding: 2px 0 2px 12px;
  border-left: 1.5px solid rgba(56, 189, 248, 0.22);
  gap: 3px;
  overflow: hidden;
}

.sub-menu-list.open,
.menu-accordion.open .sub-menu-list {
  display: flex;
}

.sub-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border-radius: 6px;
  color: #94a3b8;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  border: 1px solid transparent;
  position: relative;
}

.sub-menu-item:hover {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.08);
}

.sub-menu-item.active {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.35) 0%, rgba(0, 102, 255, 0.25) 100%);
  border-color: rgba(56, 189, 248, 0.45);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.25);
}

.sub-active-pip {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #38bdf8;
  margin-left: auto;
  box-shadow: 0 0 6px #38bdf8;
  display: inline-block;
}

/* User Card floating over bottom wave image */
.sidebar-footer-wrap {
  padding: 16px;
  position: relative;
  z-index: 2;
}

.user-profile-badge {
  width: 100%;
  background: rgba(0, 18, 48, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.user-avatar-badge,
.user-avatar-jg {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #0284c7;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  color: #ffffff;
  flex-shrink: 0;
}

.user-meta {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  line-height: 1.25;
  flex: 1;
}

.user-meta-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-meta-role {
  font-size: 0.62rem;
  font-weight: 700;
  color: #38bdf8;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.user-logout-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 5px;
  border-radius: 6px;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
}

.user-logout-btn:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.2);
}

/* ==========================================================================
   TOPBAR & MAIN LAYOUT
   ========================================================================== */
.crafzio-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-width: 0;
  max-width: calc(100vw - 244px);
  overflow: hidden;
  background-color: #f1f6fc;
}

.crafzio-topbar {
  height: 60px;
  min-height: 60px;
  background: linear-gradient(90deg, #071126 0%, #0d1f42 60%, #0a1833 100%);
  border-bottom: 1px solid rgba(56, 189, 248, 0.14);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  z-index: 40;
  box-sizing: border-box;
}

.crafzio-content,
.content-canvas {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 22px 26px 36px;
  background-color: #f1f6fc;
  box-sizing: border-box;
  width: 100%;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
}

.home-icon {
  color: #38bdf8;
  display: flex;
  align-items: center;
}

.tb-sep { color: #94a3b8; }
.tb-arrow { color: #475569; font-size: 0.75rem; }
.tb-active { color: #ffffff; font-weight: 600; }

.topbar-search {
  position: relative;
  display: flex;
  align-items: center;
  width: 320px;
}

.topbar-search svg {
  position: absolute;
  left: 12px;
  pointer-events: none;
}

.search-input {
  width: 100%;
  background: rgba(0, 18, 52, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  padding: 6px 14px 6px 34px;
  font-size: 0.78rem;
  color: #ffffff;
  outline: none;
  transition: all 0.15s ease;
  backdrop-filter: blur(4px);
}

.search-input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.3);
}

.search-input::placeholder { color: #64748b; }

.kbd-badge {
  position: absolute;
  right: 8px;
  background: rgba(0, 12, 34, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 4px;
  pointer-events: none;
}

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

.badge-online {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(6, 78, 59, 0.8);
  border: 1px solid #059669;
  color: #34d399;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
}

.status-dot-green {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

.topbar-icon-btn {
  background: rgba(0, 26, 71, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #94a3b8;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
}

.topbar-icon-btn:hover { color: #ffffff; border-color: #38bdf8; }

.notif-pip {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 5px;
  height: 5px;
  background: #38bdf8;
  border-radius: 50%;
}

.user-avatar-top,
.user-circle-avatar,
.user-circle-jg {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #0284c7;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
}

/* ==========================================================================
   PAGE VIEWS & DASHBOARD STAT CARDS
   ========================================================================== */
.leads-pipeline-view,
.dashboard-view,
.lead-page-view {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
  box-sizing: border-box;
}

.dashboard-stats-grid,
.stat-deck {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 1100px) {
  .dashboard-stats-grid,
  .stat-deck { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .dashboard-stats-grid,
  .stat-deck { grid-template-columns: 1fr; }
}

.stat-card,
.stat-card-crafzio {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 14px !important;
  padding: 18px 22px !important;
  position: relative !important;
  overflow: hidden !important;
  box-shadow: 0 4px 16px -2px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.02) !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  min-height: 88px !important;
  box-sizing: border-box !important;
  transition: transform 0.15s ease, box-shadow 0.15s ease !important;
}

.stat-card:hover,
.stat-card-crafzio:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px -2px rgba(0, 0, 0, 0.08) !important;
}

.stat-card.glow-blue {
  box-shadow: 0 6px 20px -3px rgba(2, 132, 199, 0.18), 0 2px 6px rgba(0, 0, 0, 0.04) !important;
}
.stat-card.glow-red {
  box-shadow: 0 6px 20px -3px rgba(220, 38, 38, 0.18), 0 2px 6px rgba(0, 0, 0, 0.04) !important;
}
.stat-card.glow-purple {
  box-shadow: 0 6px 20px -3px rgba(147, 51, 234, 0.18), 0 2px 6px rgba(0, 0, 0, 0.04) !important;
}
.stat-card.glow-green {
  box-shadow: 0 6px 20px -3px rgba(22, 163, 74, 0.18), 0 2px 6px rgba(0, 0, 0, 0.04) !important;
}

.stat-card-inner {
  display: flex !important;
  align-items: center !important;
  gap: 16px !important;
  position: relative !important;
  z-index: 2 !important;
}

.stat-icon-wrap {
  width: 44px !important;
  height: 44px !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
}

.stat-info {
  display: flex !important;
  flex-direction: column !important;
  gap: 3px !important;
}

.stat-label {
  font-size: 0.7rem !important;
  font-weight: 700 !important;
  color: #64748b !important;
  letter-spacing: 0.05em !important;
  text-transform: uppercase !important;
}

.stat-value {
  font-size: 1.6rem !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  line-height: 1.1 !important;
  letter-spacing: -0.02em !important;
}

.stat-value.healthy-badge {
  font-size: 1.1rem !important;
  color: #16a34a !important;
  font-weight: 800 !important;
  letter-spacing: 0.02em !important;
}

.stat-card-glow {
  position: absolute;
  bottom: -20px;
  right: -20px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
}

/* Dashboard Split Grid (Registered Accounts + Audit Stream) */
.dashboard-grid-layout,
.crafzio-split-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 18px;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 1050px) {
  .dashboard-grid-layout,
  .crafzio-split-grid {
    grid-template-columns: 1fr;
  }
}

.content-panel,
.panel-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-sizing: border-box;
  min-width: 0;
}

.stat-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 2;
}

.stat-icon-circ {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon-circ.blue { background: #e0f2fe; color: #0284c7; }
.stat-icon-circ.green { background: #ecfdf5; color: #059669; }
.stat-icon-circ.indigo { background: #eef2ff; color: #4f46e5; }
.stat-icon-circ.cyan { background: #f0fdfa; color: #0d9488; }
.stat-icon-circ.red { background: #fef2f2; color: #dc2626; }

.stat-info { display: flex; flex-direction: column; gap: 2px; }
.stat-title {
  font-size: 0.65rem;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.stat-num {
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.1;
}

.stat-num.healthy { font-size: 1.1rem; color: #16a34a; font-weight: 800; }
.text-danger { color: #dc2626 !important; }
.text-success { color: #16a34a !important; }

.stat-check-badge { margin-left: auto; display: flex; align-items: center; }

.card-wave {
  width: 100%;
  height: 18px;
  border-radius: 0 0 10px 10px;
  position: relative;
  z-index: 1;
}

.wave-blue { background: radial-gradient(ellipse at bottom, rgba(56, 189, 248, 0.3) 0%, rgba(224, 242, 254, 0.08) 75%); }
.wave-cyan { background: radial-gradient(ellipse at bottom, rgba(45, 212, 191, 0.3) 0%, rgba(204, 251, 241, 0.08) 75%); }
.wave-purple { background: radial-gradient(ellipse at bottom, rgba(129, 140, 248, 0.3) 0%, rgba(238, 242, 255, 0.08) 75%); }
.wave-green { background: radial-gradient(ellipse at bottom, rgba(74, 222, 128, 0.3) 0%, rgba(220, 252, 231, 0.08) 75%); }

/* Split Grid */
.crafzio-split-grid {
  display: grid;
  grid-template-columns: 2.1fr 1fr;
  gap: 16px;
}

@media (max-width: 1050px) {
  .crafzio-split-grid { grid-template-columns: 1fr; }
}

.panel-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-title-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-icon-bubble {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #e0f2fe;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.panel-title-text {
  font-size: 0.92rem;
  font-weight: 700;
  color: #0f172a;
}

.panel-subtitle-text {
  font-size: 0.7rem;
  color: #64748b;
}

.btn-rbac-action {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f8fafc;
  border: 1px solid #0284c7;
  color: #0284c7;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-rbac-action:hover { background: #0284c7; color: #ffffff; }

.btn-filter-icon {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #64748b;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* ==========================================================================
   LEAD MANAGEMENT TOOLBAR & CONTROLS
   ========================================================================== */
.leads-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-bottom: 4px;
}

.lead-filter-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #f1f5f9;
  padding: 3px;
  border-radius: 8px;
}

.filter-tab {
  background: transparent;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-tab:hover { color: #0f172a; }

.filter-tab.active {
  background: #ffffff;
  color: #0284c7;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.leads-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-action-primary {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #0284c7;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-action-primary:hover { background: #0369a1; }

.btn-action-outline {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  color: #475569;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 6px 13px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-action-outline:hover {
  border-color: #0284c7;
  color: #0284c7;
}

/* ==========================================================================
   TABLE DESIGN & STATUS PILLS
   ========================================================================== */
.panel-table-wrap {
  overflow-x: auto;
}

.crafzio-table {
  width: 100%;
  border-collapse: collapse;
}

.crafzio-table th {
  text-align: left;
  padding: 9px 12px;
  background: #f1f6fd;
  color: #475569;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-bottom: 1px solid #e2e8f0;
}

.crafzio-table th:first-child { border-radius: 6px 0 0 6px; }
.crafzio-table th:last-child { border-radius: 0 6px 6px 0; }

.crafzio-table td {
  padding: 11px 12px;
  border-bottom: 1px solid #f1f5f9;
}

.user-row-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar-cell,
.avatar-cell-jg {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #bae6fd;
  color: #0284c7;
  font-weight: 700;
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.role-pill-general {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.status-pill-inactive {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #fef2f2;
  color: #dc2626;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
}

.status-red-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ef4444;
}

.user-text-wrap {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.user-cell-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: #0f172a;
}

.user-cell-email {
  font-size: 0.72rem;
  color: #64748b;
}

.badge-lang {
  display: inline-block;
  background: #f1f5f9;
  color: #334155;
  font-weight: 700;
  font-size: 0.66rem;
  padding: 2px 6px;
  border-radius: 4px;
  width: fit-content;
}

.badge-source {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  width: fit-content;
}
.src-wa { background: #dcfce7; color: #15803d; }
.src-meta { background: #dbeafe; color: #1d4ed8; }
.src-manual { background: #f1f5f9; color: #64748b; }

.score-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
}
.score-badge.hot { background: #fee2e2; color: #b91c1c; }
.score-badge.warm { background: #fef3c7; color: #b45309; }
.score-badge.cold { background: #e0f2fe; color: #0369a1; }

.lead-status-pill {
  display: inline-block;
  font-size: 0.66rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.03em;
}
.status-new { background: #dbeafe; color: #1e40af; }
.status-assigned { background: #fef3c7; color: #92400e; }
.status-contacted { background: #e0e7ff; color: #3730a3; }
.status-followup { background: #ffedd5; color: #9a3412; }
.status-converted { background: #dcfce7; color: #166534; }
.status-lost { background: #fee2e2; color: #991b1b; }

.role-pill-super {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  color: #4338ca;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
}

.status-pill-active {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #ecfdf5;
  color: #065f46;
  font-size: 0.66rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
}

.status-green-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #10b981;
}

.date-cell {
  font-size: 0.76rem;
  color: #0f172a;
  font-weight: 500;
}

/* Action button icons in table */
.table-actions-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.action-btn-circle {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}
.action-btn-circle.call { background: #dcfce7; color: #15803d; }
.action-btn-circle.call:hover { background: #bbf7d0; }
.action-btn-circle.wa { background: #ecfdf5; color: #059669; }
.action-btn-circle.wa:hover { background: #a7f3d0; }
.action-btn-circle.transfer { background: #e0f2fe; color: #0284c7; }
.action-btn-circle.transfer:hover { background: #bae6fd; }

/* Timeline for Audit */
.audit-timeline-container { display: flex; flex-direction: column; }
.timeline-row { display: flex; align-items: stretch; gap: 12px; }
.timeline-line-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 14px;
  flex-shrink: 0;
}
.timeline-node {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2563eb;
  box-shadow: 0 0 6px rgba(37, 99, 235, 0.5);
  margin-top: 4px;
  flex-shrink: 0;
}
.timeline-vertical-line {
  width: 1px;
  background: #e2e8f0;
  flex: 1;
  margin: 4px 0;
}
.timeline-row:last-child .timeline-vertical-line { display: none; }
.timeline-content {
  display: flex;
  flex-direction: column;
  padding-bottom: 14px;
  gap: 2px;
}
.timeline-action-title { font-size: 0.78rem; font-weight: 700; color: #0f172a; }
.timeline-user-info { font-size: 0.7rem; color: #64748b; }
.timeline-timestamp { font-size: 0.66rem; color: #94a3b8; }

/* ==========================================================================
   MODALS (ADD LEAD & TRANSFER LEADS)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 14, 38, 0.65);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-container {
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  animation: modalFadeIn 0.2s ease-out;
}

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

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-icon-bubble {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #e0f2fe;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.modal-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
}

.modal-subtitle {
  font-size: 0.7rem;
  color: #64748b;
  margin-top: 1px;
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 1.3rem;
  color: #94a3b8;
  cursor: pointer;
  line-height: 1;
}

.modal-close-btn:hover { color: #0f172a; }

.modal-form {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

@media (max-width: 580px) {
  .form-grid-2, .form-grid-3 {
    grid-template-columns: 1fr;
  }
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: #334155;
}

.field-input, .field-select, .field-textarea {
  width: 100%;
  padding: 8px 11px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.8rem;
  color: #0f172a;
  outline: none;
  transition: all 0.15s ease;
  font-family: inherit;
}

.field-input:focus, .field-select:focus, .field-textarea:focus {
  border-color: #0284c7;
  background: #ffffff;
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.15);
}

.field-textarea { resize: vertical; }

.form-error-banner {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-size: 0.75rem;
  padding: 8px 12px;
  border-radius: 6px;
  font-weight: 500;
}

.modal-footer {
  padding-top: 8px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid #f1f5f9;
  margin-top: 6px;
}

.btn-cancel {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #475569;
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary-action {
  background: #0284c7;
  border: none;
  color: #ffffff;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-primary-action:hover { background: #0369a1; }
.btn-primary-action:disabled { opacity: 0.6; cursor: not-allowed; }

/* ==========================================================================
   STEP WIZARD INDICATOR
   ========================================================================== */
.step-wizard-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 16px;
  margin-bottom: 8px;
}

.step-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748b;
}

.step-indicator.active {
  color: #0284c7;
}

.step-pill-number {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #cbd5e1;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
}

.step-indicator.active .step-pill-number {
  background: #0284c7;
}

.step-divider-line {
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}

/* ==========================================================================
   FULL-PAGE VIEWS (ADD LEAD & TRANSFER LEADS SEPARATE SCREENS)
   ========================================================================== */
.lead-page-view {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 1100px;
  margin: 0 auto;
  animation: pageFadeIn 0.2s ease-out;
}

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

.page-head-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 18px 24px;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.page-head-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.page-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
  color: #0284c7;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.15);
  flex-shrink: 0;
}

.page-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
}

.page-subtitle {
  font-size: 0.78rem;
  color: #64748b;
  margin-top: 2px;
}

.btn-back-pipeline {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  color: #334155;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}

.btn-back-pipeline:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.full-page-card {
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.section-group-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 4px;
}

.section-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #0284c7;
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Transfer Page Grid */
.transfer-page-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 18px;
}

@media (max-width: 900px) {
  .transfer-page-grid {
    grid-template-columns: 1fr;
  }
}

.lead-preview-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lead-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.lead-preview-name {
  font-weight: 700;
  font-size: 0.88rem;
  color: #0f172a;
}

.lead-preview-phone {
  font-family: monospace;
  font-size: 0.8rem;
  color: #0284c7;
  font-weight: 600;
}

.lead-preview-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.queue-pill-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.8rem;
}

.queue-lang-badge {
  font-weight: 700;
  color: #0284c7;
  background: #e0f2fe;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.72rem;
}

.queue-staff-count {
  font-size: 0.75rem;
  color: #16a34a;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ==========================================================================
   QUALIFICATION SCORE RADIO BUTTONS (HOT, WARM, COLD)
   ========================================================================== */
.score-radio-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
}

.score-radio-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  position: relative;
}

.score-radio-btn input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.custom-radio-circle {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid #94a3b8;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.custom-radio-circle::after {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: transparent;
  transition: all 0.15s ease;
}

.radio-emoji {
  font-size: 1.05rem;
  line-height: 1;
}

.radio-text-col {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.radio-title {
  font-size: 0.76rem;
  font-weight: 700;
  color: #334155;
  transition: color 0.15s ease;
}

.radio-desc {
  font-size: 0.64rem;
  font-weight: 500;
  color: #64748b;
  transition: color 0.15s ease;
}

/* HOT (High Intent) */
.score-radio-btn.radio-hot:hover {
  border-color: #fca5a5;
  background: #fff5f5;
}
.score-radio-btn.radio-hot.active {
  border-color: #ef4444;
  background: #fef2f2;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.15);
}
.score-radio-btn.radio-hot.active .custom-radio-circle {
  border-color: #ef4444;
}
.score-radio-btn.radio-hot.active .custom-radio-circle::after {
  background: #ef4444;
}
.score-radio-btn.radio-hot.active .radio-title {
  color: #b91c1c;
}
.score-radio-btn.radio-hot.active .radio-desc {
  color: #ef4444;
}

/* WARM (General Inquiry) */
.score-radio-btn.radio-warm:hover {
  border-color: #fde68a;
  background: #fffbeb;
}
.score-radio-btn.radio-warm.active {
  border-color: #f59e0b;
  background: #fffbeb;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.15);
}
.score-radio-btn.radio-warm.active .custom-radio-circle {
  border-color: #f59e0b;
}
.score-radio-btn.radio-warm.active .custom-radio-circle::after {
  background: #f59e0b;
}
.score-radio-btn.radio-warm.active .radio-title {
  color: #b45309;
}
.score-radio-btn.radio-warm.active .radio-desc {
  color: #d97706;
}

/* COLD (Browsing / Low) */
.score-radio-btn.radio-cold:hover {
  border-color: #bae6fd;
  background: #f0f9ff;
}
.score-radio-btn.radio-cold.active {
  border-color: #0284c7;
  background: #f0f9ff;
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.15);
}
.score-radio-btn.radio-cold.active .custom-radio-circle {
  border-color: #0284c7;
}
.score-radio-btn.radio-cold.active .custom-radio-circle::after {
  background: #0284c7;
}
.score-radio-btn.radio-cold.active .radio-title {
  color: #0369a1;
}
.score-radio-btn.radio-cold.active .radio-desc {
  color: #0284c7;
}

@media (max-width: 640px) {
  .score-radio-group {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   STEP WIZARD PANELS & STEP 2 SERVICE INTERESTS & RICH TEXT BOX
   ========================================================================== */
.step-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: stepFadeIn 0.22s ease-out;
}

.step-panel.hidden {
  display: none !important;
}

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

/* 4 Checkbox Cards for Interested In: Excel, Application, Website, Custom */
.interest-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  width: 100%;
}

@media (max-width: 900px) {
  .interest-checkbox-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 520px) {
  .interest-checkbox-grid {
    grid-template-columns: 1fr;
  }
}

.interest-checkbox-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  user-select: none;
}

.interest-checkbox-card input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.custom-checkbox-square {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 2px solid #94a3b8;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #ffffff;
  transition: all 0.15s ease;
  pointer-events: none;
}

.custom-checkbox-square svg {
  opacity: 0;
  transform: scale(0.6);
  transition: all 0.15s ease;
  pointer-events: none;
}

.interest-checkbox-card:hover {
  border-color: #94a3b8;
  background: #f8fafc;
  transform: translateY(-1px);
}

.interest-card-icon {
  font-size: 1.25rem;
  line-height: 1;
  pointer-events: none;
}

.interest-card-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  pointer-events: none;
}

.interest-card-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #1e293b;
  transition: color 0.15s ease;
  pointer-events: none;
}

.interest-card-sub {
  font-size: 0.67rem;
  font-weight: 500;
  color: #64748b;
  transition: color 0.15s ease;
  pointer-events: none;
}

/* Excel (Emerald Green) */
.interest-checkbox-card[data-interest="excel"]:has(input:checked),
.interest-checkbox-card[data-interest="excel"].active {
  border-color: #10b981;
  background: #ecfdf5;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.16);
}
.interest-checkbox-card[data-interest="excel"]:has(input:checked) .custom-checkbox-square,
.interest-checkbox-card[data-interest="excel"].active .custom-checkbox-square {
  background: #10b981;
  border-color: #10b981;
}
.interest-checkbox-card[data-interest="excel"]:has(input:checked) .custom-checkbox-square svg,
.interest-checkbox-card[data-interest="excel"].active .custom-checkbox-square svg {
  opacity: 1 !important;
  transform: scale(1) !important;
}
.interest-checkbox-card[data-interest="excel"]:has(input:checked) .interest-card-title,
.interest-checkbox-card[data-interest="excel"].active .interest-card-title {
  color: #065f46;
}

/* Application (Indigo) */
.interest-checkbox-card[data-interest="application"]:has(input:checked),
.interest-checkbox-card[data-interest="application"].active {
  border-color: #4f46e5;
  background: #eef2ff;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.16);
}
.interest-checkbox-card[data-interest="application"]:has(input:checked) .custom-checkbox-square,
.interest-checkbox-card[data-interest="application"].active .custom-checkbox-square {
  background: #4f46e5;
  border-color: #4f46e5;
}
.interest-checkbox-card[data-interest="application"]:has(input:checked) .custom-checkbox-square svg,
.interest-checkbox-card[data-interest="application"].active .custom-checkbox-square svg {
  opacity: 1 !important;
  transform: scale(1) !important;
}
.interest-checkbox-card[data-interest="application"]:has(input:checked) .interest-card-title,
.interest-checkbox-card[data-interest="application"].active .interest-card-title {
  color: #3730a3;
}

/* Website (Sky Blue) */
.interest-checkbox-card[data-interest="website"]:has(input:checked),
.interest-checkbox-card[data-interest="website"].active {
  border-color: #0284c7;
  background: #f0f9ff;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.16);
}
.interest-checkbox-card[data-interest="website"]:has(input:checked) .custom-checkbox-square,
.interest-checkbox-card[data-interest="website"].active .custom-checkbox-square {
  background: #0284c7;
  border-color: #0284c7;
}
.interest-checkbox-card[data-interest="website"]:has(input:checked) .custom-checkbox-square svg,
.interest-checkbox-card[data-interest="website"].active .custom-checkbox-square svg {
  opacity: 1 !important;
  transform: scale(1) !important;
}
.interest-checkbox-card[data-interest="website"]:has(input:checked) .interest-card-title,
.interest-checkbox-card[data-interest="website"].active .interest-card-title {
  color: #0369a1;
}

/* Custom (Purple) */
.interest-checkbox-card[data-interest="custom"]:has(input:checked),
.interest-checkbox-card[data-interest="custom"].active {
  border-color: #9333ea;
  background: #faf5ff;
  box-shadow: 0 2px 8px rgba(147, 51, 234, 0.16);
}
.interest-checkbox-card[data-interest="custom"]:has(input:checked) .custom-checkbox-square,
.interest-checkbox-card[data-interest="custom"].active .custom-checkbox-square {
  background: #9333ea;
  border-color: #9333ea;
}
.interest-checkbox-card[data-interest="custom"]:has(input:checked) .custom-checkbox-square svg,
.interest-checkbox-card[data-interest="custom"].active .custom-checkbox-square svg {
  opacity: 1 !important;
  transform: scale(1) !important;
}
.interest-checkbox-card[data-interest="custom"]:has(input:checked) .interest-card-title,
.interest-checkbox-card[data-interest="custom"].active .interest-card-title {
  color: #6b21a8;
}

/* ==========================================================================
   DYNAMIC CUSTOM SERVICES & REQUIREMENT CATALOG (STEP 2)
   ========================================================================== */
.custom-services-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #faf5ff;
  border: 1.5px solid #d8b4fe;
  border-radius: 12px;
  padding: 16px 18px;
  margin-top: 12px;
  box-shadow: 0 4px 14px -2px rgba(147, 51, 234, 0.08);
  animation: slideDownIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  box-sizing: border-box;
}

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

.custom-services-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.custom-head-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.custom-head-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.custom-head-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: #581c87;
  display: block;
}

.custom-head-sub {
  font-size: 0.7rem;
  color: #7e22ce;
  display: block;
}

.custom-count-badge {
  font-size: 0.72rem;
  font-weight: 700;
  background: #9333ea;
  color: #ffffff;
  padding: 3px 10px;
  border-radius: 20px;
  box-shadow: 0 2px 6px rgba(147, 51, 234, 0.25);
}

.custom-input-bar {
  display: flex;
  gap: 10px;
  width: 100%;
}

@media (max-width: 600px) {
  .custom-input-bar {
    flex-direction: column;
  }
}

.custom-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  border: 1.5px solid #c084fc;
  border-radius: 8px;
  padding: 0 14px;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.custom-input-wrap:focus-within {
  border-color: #9333ea;
  box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.15);
}

.custom-service-field {
  flex: 1;
  border: none;
  outline: none;
  padding: 10px 0;
  font-size: 0.82rem;
  color: #0f172a;
  background: transparent;
}

.custom-service-field::placeholder {
  color: #a855f7;
  opacity: 0.75;
}

.btn-add-custom {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #9333ea;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 0 18px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-add-custom:hover {
  background: #7e22ce;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(147, 51, 234, 0.3);
}

.btn-add-custom:active {
  transform: translateY(0);
}

.custom-chips-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.custom-chips-prompt {
  font-size: 0.72rem;
  font-weight: 700;
  color: #6b21a8;
  letter-spacing: 0.02em;
}

.custom-chips-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.custom-chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.76rem;
  font-weight: 600;
  border: 1.5px solid #d8b4fe;
  background: #ffffff;
  color: #6b21a8;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.custom-chip-btn:hover {
  border-color: #9333ea;
  background: #f3e8ff;
  transform: translateY(-1px);
}

.custom-chip-btn.active {
  background: #9333ea;
  color: #ffffff;
  border-color: #9333ea;
  box-shadow: 0 2px 8px rgba(147, 51, 234, 0.25);
}

.custom-chip-btn .chip-check {
  display: none;
  width: 12px;
  height: 12px;
}

.custom-chip-btn.active .chip-check {
  display: inline-block;
}

.custom-active-bar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #ffffff;
  border: 1px dashed #c084fc;
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 2px;
}

.custom-active-title {
  font-size: 0.68rem;
  font-weight: 800;
  color: #7e22ce;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.custom-active-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.active-pill-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f3e8ff;
  color: #581c87;
  border: 1px solid #d8b4fe;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
}

.active-pill-remove {
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 800;
  color: #9333ea;
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.active-pill-remove:hover {
  color: #dc2626;
}

/* ==========================================================================
   RICH TEXT BOX COMPONENT (WYSIWYG FORMATTING)
   ========================================================================== */
.rich-box-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.rich-editor-wrap {
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  background: #ffffff;
  overflow: hidden;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.rich-editor-wrap:focus-within {
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
}

.rich-editor-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  flex-wrap: wrap;
}

.rich-toolbar-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  padding: 4px 8px;
  font-size: 0.76rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  justify-content: center;
  transition: all 0.15s ease;
  user-select: none;
}

.rich-toolbar-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.rich-toolbar-btn.active {
  background: #e0f2fe;
  color: #0284c7;
  border-color: #bae6fd;
}

.rich-toolbar-divider {
  width: 1px;
  height: 18px;
  background: #cbd5e1;
  margin: 0 4px;
}

.rich-editor-content {
  min-height: 150px;
  max-height: 280px;
  overflow-y: auto;
  padding: 12px 14px;
  font-size: 0.82rem;
  line-height: 1.6;
  color: #1e293b;
  outline: none;
  font-family: inherit;
}

.rich-editor-content[contenteditable="true"]:empty:before {
  content: attr(data-placeholder);
  color: #94a3b8;
  pointer-events: none;
  display: block;
}

.rich-editor-content ul, .rich-editor-content ol {
  padding-left: 20px;
  margin: 6px 0;
}

.rich-editor-content li {
  margin-bottom: 3px;
}

.rich-editor-content b, .rich-editor-content strong {
  font-weight: 700;
  color: #0f172a;
}

.rich-box-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px;
  font-size: 0.7rem;
  color: #64748b;
}

.rich-char-counter {
  font-family: monospace;
  font-weight: 600;
  color: #0284c7;
}

/* Secondary Navigation Buttons */
.btn-nav-prev,
.btn-nav-back {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  color: #334155;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.btn-nav-prev:hover,
.btn-nav-back:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

.btn-nav-next {
  background: #0284c7;
  border: 1.5px solid #0284c7;
  color: #ffffff;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.2);
}

.btn-nav-next:hover {
  background: #0369a1;
  border-color: #0369a1;
}

.btn-whatsapp-invite {
  background: #16a34a;
  border: 1.5px solid #16a34a;
  color: #ffffff;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all 0.15s ease;
  box-shadow: 0 2px 6px rgba(22, 163, 74, 0.22);
}

.btn-whatsapp-invite:hover {
  background: #15803d;
  border-color: #15803d;
  transform: translateY(-1px);
}


/* ==========================================================================
   TRANSFER LEADS SEAT-MAP GRID, DETAIL MODAL & CONTEXT MENU
   ========================================================================== */
.transfer-seat-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.transfer-seat-search-wrap {
  position: relative;
  flex: 1;
  min-width: 210px;
  display: flex;
  align-items: center;
}

.transfer-seat-search-wrap svg {
  position: absolute;
  left: 12px;
  pointer-events: none;
}

.transfer-seat-search {
  width: 100%;
  padding: 8px 12px 8px 34px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.8rem;
  color: #0f172a;
  background: #f8fafc;
  outline: none;
}

.transfer-seat-search:focus {
  border-color: #4f46e5;
  background: #ffffff;
}

.seat-filter-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.seat-pill-btn {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
}

.seat-pill-btn.active {
  background: #eef2ff;
  border-color: #6366f1;
  color: #4338ca;
}

.seat-pill-btn.pill-hot.active { background: #fee2e2; border-color: #ef4444; color: #b91c1c; }
.seat-pill-btn.pill-warm.active { background: #fef3c7; border-color: #f59e0b; color: #b45309; }
.seat-pill-btn.pill-cold.active { background: #e0f2fe; border-color: #0284c7; color: #0369a1; }

.seat-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.76rem;
  color: #475569;
  font-weight: 600;
  padding: 2px 0;
}

.seat-cards-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

@media (max-width: 1300px) {
  .seat-cards-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .seat-cards-grid { grid-template-columns: repeat(2, 1fr); }
}

.lead-seat-card {
  border-radius: 10px;
  padding: 10px;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  cursor: pointer;
  position: relative;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.lead-seat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.14);
}

.lead-seat-card.score-hot { background: linear-gradient(145deg, #ef4444 0%, #dc2626 100%); }
.lead-seat-card.score-warm { background: linear-gradient(145deg, #f59e0b 0%, #d97706 100%); }
.lead-seat-card.score-cold { background: linear-gradient(145deg, #0284c7 0%, #2563eb 100%); }

.lead-seat-card.selected {
  outline: 3px solid #4f46e5;
  outline-offset: 2px;
}

.seat-card-top {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.seat-checkbox {
  position: absolute;
  left: 0;
  top: 0;
  width: 16px;
  height: 16px;
  accent-color: #4f46e5;
  cursor: pointer;
}

.seat-num-pill {
  background: #ffffff;
  color: #0f172a;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 1px 10px;
  border-radius: 6px;
  min-width: 28px;
}

.seat-lead-name {
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seat-lead-company {
  font-size: 0.67rem;
  opacity: 0.9;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seat-card-bottom {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
}

.seat-lang-badge {
  background: rgba(0, 0, 0, 0.25);
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 0.65rem;
  font-weight: 700;
}

.seat-score-pill {
  background: rgba(255, 255, 255, 0.22);
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 0.65rem;
  font-weight: 700;
}

.seat-footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
}

.seat-selected-pill {
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  color: #4338ca;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
}

/* Right-Click Context Menu */
.telecaller-context-menu {
  position: fixed;
  z-index: 9999;
  width: 260px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
  padding: 6px;
  display: none;
  flex-direction: column;
  gap: 3px;
}

.context-menu-header {
  padding: 6px 10px;
  font-size: 0.72rem;
  font-weight: 800;
  color: #4f46e5;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 2px;
}

.context-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: #0f172a;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  width: 100%;
}

.context-menu-item:hover {
  background: #eef2ff;
  color: #4338ca;
}

.context-lang-tag {
  font-size: 0.65rem;
  font-weight: 700;
  background: #f1f5f9;
  color: #475569;
  padding: 2px 6px;
  border-radius: 4px;
}

/* Left-Click Complete Lead Detail Modal */
.lead-detail-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(3px);
  z-index: 9000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.lead-detail-modal {
  background: #ffffff;
  border-radius: 14px;
  width: 100%;
  max-width: 640px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.25);
  border: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
}

.lead-detail-head {
  padding: 16px 20px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
}

.lead-detail-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.detail-kv-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.detail-kv-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 12px;
}

.detail-kv-label {
  font-size: 0.66rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.detail-kv-val {
  font-size: 0.84rem;
  font-weight: 700;
  color: #0f172a;
  margin-top: 2px;
}


/* ==========================================================================
   PERSISTENT SHELL POLISH, PAGE HEADERS & PROJECT CHAT + IMAGE UPLOAD
   ========================================================================== */
.page-head-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

.page-head-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.page-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.page-title {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.01em;
}

.page-subtitle {
  margin: 3px 0 0;
  font-size: 0.8rem;
  color: #64748b;
}

.full-page-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 20px 22px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

.project-chat-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 18px;
  align-items: start;
}

@media (max-width: 1080px) {
  .project-chat-grid {
    grid-template-columns: 1fr;
  }
}

.project-chat-feed {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 520px;
  overflow-y: auto;
  padding: 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

.chat-bubble {
  max-width: 86%;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 0.83rem;
  line-height: 1.45;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.05);
}

.chat-bubble-dev {
  align-self: flex-start;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #0f172a;
}

.chat-bubble-client {
  align-self: flex-end;
  background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%);
  color: #ffffff;
}

.chat-bubble-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 0.7rem;
  font-weight: 700;
  margin-bottom: 5px;
  opacity: 0.82;
}

.chat-stage-img {
  margin-top: 8px;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  cursor: pointer;
}

.chat-upload-zone {
  border: 1.5px dashed #cbd5e1;
  border-radius: 10px;
  padding: 12px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.chat-upload-preview {
  width: 64px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  display: none;
}


/* ==========================================================================
   SIDEBAR TASK COUNT BADGES, EDITABLE ROLE MATRIX & CHAT-APP WORKSPACE
   ========================================================================== */
.nav-count-badge {
  margin-left: auto;
  min-width: 20px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.22);
  color: #7dd3fc;
  font-size: 0.68rem;
  font-weight: 800;
  align-items: center;
  justify-content: center;
}

.nav-count-badge.badge-warn {
  background: rgba(245, 158, 11, 0.24);
  color: #fcd34d;
}

.role-matrix-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-surface) !important;
  color: var(--text-main) !important;
  font-size: 0.74rem;
}

.role-matrix-table th {
  padding: 9px 10px;
  text-align: left;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-secondary) !important;
  background: var(--bg-secondary) !important;
  border-bottom: 1px solid var(--border-color) !important;
  white-space: nowrap;
}

.role-matrix-table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--border-color) !important;
  vertical-align: middle;
}

.role-matrix-table tr:hover td {
  background: var(--bg-hover) !important;
}

.rm-parent-cell {
  font-weight: 700;
  font-size: 0.74rem;
  color: var(--text-main) !important;
  white-space: nowrap;
}

.rm-route-cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  white-space: nowrap;
}

.rm-route-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.66rem;
  background: var(--bg-secondary) !important;
  color: var(--primary) !important;
  border: 1px solid var(--border-color);
  padding: 1px 6px;
  border-radius: 4px;
}

.rm-cell-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  padding: 3px 6px;
  cursor: pointer;
  transition: var(--transition);
}

.rm-badge {
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
}

.rm-cell-btn:not(.locked):hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(148, 163, 184, 0.35);
}

.rm-cell-btn.locked {
  cursor: default;
  opacity: 0.75;
}

.rm-badge {
  font-size: 0.76rem;
  font-weight: 700;
}

.rm-allow { color: #34d399; }
.rm-own { color: #4ade80; }
.rm-view { color: #cbd5e1; }
.rm-deny { color: #f43f5e; }

/* Chat-App Project Workspace */
.chat-app-shell {
  display: grid;
  grid-template-columns: 290px 1fr;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  overflow: hidden;
  height: calc(100vh - 200px);
  min-height: 520px;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.05);
}

@media (max-width: 960px) {
  .chat-app-shell {
    grid-template-columns: 1fr;
    height: auto;
  }
}

.chat-sidebar-pane {
  border-right: 1px solid #e2e8f0;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.chat-sidebar-search {
  padding: 12px;
  border-bottom: 1px solid #e2e8f0;
  background: #ffffff;
}

.chat-client-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chat-client-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.14s ease;
}

.chat-client-item:hover {
  background: #ffffff;
  border-color: #e2e8f0;
}

.chat-client-item.active {
  background: #eef2ff;
  border-color: #a5b4fc;
}

.chat-main-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #ffffff;
}

.chat-main-header {
  padding: 12px 18px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #ffffff;
}

.chat-messages-area {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  background: #f1f5f9;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-preview-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
}

.chat-preview-strip img {
  width: 48px;
  height: 36px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
}

.chat-composer-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid #e2e8f0;
  background: #ffffff;
}

.chat-attach-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.chat-attach-btn:hover {
  border-color: #4f46e5;
  color: #4f46e5;
}

.chat-composer-input {
  flex: 1;
  border: 1px solid #e2e8f0;
  border-radius: 22px;
  padding: 10px 16px;
  font-size: 0.84rem;
  outline: none;
  background: #f8fafc;
}

.chat-composer-input:focus {
  border-color: #4f46e5;
  background: #ffffff;
}

.chat-send-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 22px;
  border: none;
  background: #4f46e5;
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}

.chat-send-btn:hover {
  background: #4338ca;
}


/* ==========================================================================
   CRAFZIO OS 2.0 — PREMIUM VANILLA ENTERPRISE LIGHT THEME OVERRIDES
   ========================================================================== */
body, .crafzio-layout, .crafzio-main, .crafzio-content {
  background-color: var(--bg-body) !important;
  color: var(--text-main) !important;
  font-family: var(--font-sans);
  font-size: var(--text-base);
}

/* Vanilla Cream Sidebar (#EEE8DC) + Collapsible Support */
.crafzio-sidebar {
  width: 248px !important;
  background: var(--bg-sidebar) !important;
  border-right: 1px solid var(--border-color) !important;
  color: var(--text-secondary) !important;
  transition: width 0.18s ease, left 0.18s ease;
}

.crafzio-layout.sidebar-collapsed .crafzio-sidebar {
  width: 0 !important;
  min-width: 0 !important;
  border-right: none !important;
  overflow: hidden !important;
}

.crafzio-layout.sidebar-collapsed .crafzio-main {
  max-width: 100vw !important;
  width: 100vw !important;
}

.brand-header {
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--border-color);
}

.brand-title {
  color: var(--text-main) !important;
  font-size: 1.05rem;
  font-weight: 800;
}

.brand-portal-badge {
  background: var(--bg-selected) !important;
  color: var(--primary) !important;
  border: 1px solid var(--primary-border) !important;
}

.menu-group-label {
  padding: 12px 18px 5px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.menu-item {
  padding: 8px 12px;
  border-radius: var(--radius-md);
  color: var(--text-secondary) !important;
  font-size: 0.84rem;
  font-weight: 500;
  border: 1px solid transparent;
}

.menu-item:hover {
  background: var(--bg-hover) !important;
  color: var(--text-main) !important;
}

.menu-item.active,
.menu-parent.active {
  background: var(--bg-selected) !important;
  color: var(--primary) !important;
  border-color: transparent !important;
  box-shadow: none !important;
  font-weight: 600;
}

.active-dot, .sub-active-pip {
  background: var(--primary) !important;
  box-shadow: none !important;
}

.sub-menu-list {
  margin: 2px 0 6px 18px;
  padding: 2px 0 2px 10px;
  border-left: 1.5px solid var(--border-strong);
}

.sub-menu-item {
  padding: 6px 10px;
  font-size: 0.81rem;
  color: var(--text-secondary) !important;
  border-radius: var(--radius-sm);
}

.sub-menu-item:hover {
  background: var(--bg-hover) !important;
  color: var(--text-main) !important;
}

.sub-menu-item.active {
  background: var(--bg-selected) !important;
  color: var(--primary) !important;
  border-color: transparent !important;
  box-shadow: none !important;
  font-weight: 600;
}

.sidebar-footer-wrap {
  padding: 12px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-sidebar);
}

.user-profile-badge {
  background: var(--bg-secondary) !important;
  border: 1px solid var(--border-color) !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

.user-avatar-badge, .user-avatar-top {
  background: var(--primary) !important;
  color: #ffffff !important;
}

.user-meta-name { color: var(--text-main) !important; font-weight: 600; }
.user-meta-role { color: var(--text-secondary) !important; font-size: 0.7rem; }

/* Crisp White Topbar (#FFFFFF) */
.crafzio-topbar {
  height: 58px !important;
  min-height: 58px !important;
  background: var(--bg-topbar) !important;
  border-bottom: 1px solid var(--border-color) !important;
  padding: 0 22px !important;
}

.tb-sep { color: var(--text-secondary) !important; }
.tb-arrow { color: var(--text-muted) !important; }
.tb-active { color: var(--text-main) !important; font-weight: 600; }
.home-icon { color: var(--primary) !important; }

.topbar-btn-primary, .btn-action-primary, .btn-primary-action, .chat-send-btn {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: #ffffff !important;
}

.topbar-btn-primary:hover, .btn-action-primary:hover, .btn-primary-action:hover, .chat-send-btn:hover {
  background: var(--primary-hover) !important;
}

.btn-action-outline, .btn-back-pipeline {
  background: var(--bg-surface) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-main) !important;
}

.btn-action-outline:hover, .btn-back-pipeline:hover {
  background: var(--bg-hover) !important;
}

/* Cards, Secondary Surfaces & Role Matrix in Vanilla Enterprise Theme */
.full-page-card, .page-head-card, .content-panel, .stat-card {
  background: var(--bg-surface) !important;
  border: 1px solid var(--border-color) !important;
  box-shadow: var(--shadow-xs) !important;
  border-radius: var(--radius-lg) !important;
}

.kanban-col, .chat-sidebar-pane, .chat-messages-area, .detail-kv-box {
  background: var(--bg-secondary) !important;
  border-color: var(--border-color) !important;
}

.chat-client-item.active {
  background: var(--bg-selected) !important;
  border-color: var(--primary-border) !important;
}

.chat-bubble-client {
  background: var(--primary) !important;
  color: #ffffff !important;
}

.chat-bubble-dev {
  background: var(--bg-surface) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-main) !important;
}

.role-matrix-table {
  background: var(--bg-surface) !important;
  color: var(--text-main) !important;
}

.role-matrix-table th {
  background: var(--bg-secondary) !important;
  color: var(--text-secondary) !important;
  border-bottom: 1px solid var(--border-color) !important;
}

.role-matrix-table td {
  border-bottom: 1px solid var(--border-color) !important;
}

.role-matrix-table tr:hover td {
  background: var(--bg-hover) !important;
}

.rm-parent-cell { color: var(--text-main) !important; }
.rm-route-code { background: var(--bg-secondary) !important; color: var(--primary) !important; border: 1px solid var(--border-color); }
.rm-allow, .rm-own { color: var(--success) !important; }
.rm-view { color: var(--info) !important; }
.rm-deny { color: var(--danger) !important; }

.topbar-search {
  position: relative;
  width: 340px;
}

.search-input {
  background: var(--bg-body) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-main) !important;
  border-radius: var(--radius-md) !important;
  padding: 7px 64px 7px 34px !important;
  font-size: 0.82rem !important;
}

.search-input:focus {
  background: var(--bg-surface) !important;
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12) !important;
}

.kbd-badge {
  background: var(--bg-surface) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-muted) !important;
}

.topbar-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  max-height: 380px;
  overflow-y: auto;
  display: none;
}

.topbar-popover.open { display: block; }

.topbar-btn-clean {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  transition: var(--transition);
}

.topbar-btn-clean:hover {
  background: var(--bg-hover);
  color: var(--text-main);
}

.topbar-btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.topbar-btn-primary:hover {
  background: var(--primary-hover);
  color: #ffffff;
}

.notif-count-pip {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--danger);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
}

/* Remove Glows & Oversized Decorations on Cards */
.stat-card {
  background: var(--bg-surface) !important;
  border: 1px solid var(--border-color) !important;
  box-shadow: var(--shadow-xs) !important;
  border-radius: var(--radius-lg) !important;
  padding: 18px 20px !important;
}

.stat-card-glow { display: none !important; }
.stat-value { font-size: 1.5rem !important; font-weight: 700 !important; color: var(--text-main); }
.stat-label { font-size: 0.72rem !important; font-weight: 600 !important; color: var(--text-muted) !important; letter-spacing: 0.03em; }

.full-page-card, .page-head-card, .content-panel {
  background: var(--bg-surface) !important;
  border: 1px solid var(--border-color) !important;
  box-shadow: var(--shadow-xs) !important;
  border-radius: var(--radius-lg) !important;
}

/* View Switcher (Table vs Kanban) */
.view-toggle-group {
  display: inline-flex;
  background: var(--bg-subtle);
  padding: 3px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.view-toggle-btn {
  padding: 5px 12px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
}

.view-toggle-btn.active {
  background: var(--bg-surface);
  color: var(--text-main);
  box-shadow: var(--shadow-xs);
}

/* Kanban Board */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  align-items: start;
}

.kanban-col {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 12px;
  min-height: 360px;
}

.kanban-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
}

.kanban-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: var(--transition);
}

.kanban-card:hover {
  border-color: var(--primary-border);
  box-shadow: var(--shadow-sm);
}

/* Slide-Over Workspace Drawer */
.os-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  z-index: 300;
  display: none;
  justify-content: flex-end;
}

.os-drawer-backdrop.open { display: flex; }

.os-drawer-panel {
  width: min(560px, 100vw);
  height: 100vh;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.os-drawer-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.os-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 22px;
}

/* Project Command Center Tabs */
.os-tabs-bar {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border-color);
  padding: 0 4px;
  overflow-x: auto;
}

.os-tab-btn {
  padding: 10px 14px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

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

/* Responsive Sidebar */
.mobile-menu-btn { display: none; }

@media (max-width: 960px) {
  .crafzio-sidebar {
    position: fixed;
    left: -260px;
    top: 0;
    bottom: 0;
    transition: left 0.2s ease;
    z-index: 250;
  }
  .crafzio-sidebar.mobile-open { left: 0; }
  .crafzio-main { max-width: 100vw !important; width: 100vw !important; }
  .mobile-menu-btn { display: inline-flex; }
  .topbar-search { width: 200px; }
}


/* ==========================================================================
   DUAL-RAIL ICON BAR + CONTEXT SUB-BAR (SAGEPILOT / LINEAR STYLE - VANILLA)
   ========================================================================== */
.crafzio-dual-sidebar {
  display: flex;
  height: 100vh;
  flex-shrink: 0;
  z-index: 60;
  border-right: 1px solid var(--border-color);
  background: var(--bg-sidebar);
}

.crafzio-icon-rail {
  width: 56px;
  height: 100vh;
  background: #e6dfd1;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 0;
  gap: 6px;
  flex-shrink: 0;
}

.rail-brand-btn {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  margin-bottom: 8px;
  text-decoration: none;
}

.rail-divider {
  width: 28px;
  height: 1px;
  background: var(--border-strong);
  margin: 4px 0;
}

.rail-btn {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: var(--transition);
}

.rail-btn[data-tooltip]:hover::after,
.rail-brand-btn[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--primary);
  color: #ffffff;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 6px;
  white-space: nowrap;
  z-index: 500;
  pointer-events: none;
  box-shadow: var(--shadow-md);
}

.rail-btn[data-tooltip]:hover::before,
.rail-brand-btn[data-tooltip]:hover::before {
  content: "";
  position: absolute;
  left: calc(100% + 4px);
  top: 50%;
  transform: translateY(-50%);
  border: 4px solid transparent;
  border-right-color: var(--primary);
  z-index: 500;
  pointer-events: none;
}

.rail-btn:hover {
  background: var(--bg-hover);
  color: var(--text-main);
}

.rail-btn.active {
  background: var(--bg-surface);
  color: var(--primary);
  border-color: var(--border-color);
  box-shadow: var(--shadow-xs);
}

.rail-badge-dot {
  position: absolute;
  top: 5px;
  right: 5px;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  border-radius: 999px;
  background: var(--danger);
  color: #ffffff;
  font-size: 0.62rem;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
}

.rail-spacer { flex: 1; }

.crafzio-sub-sidebar {
  width: 224px;
  height: 100vh;
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width 0.18s ease;
}

.crafzio-layout.sidebar-collapsed .crafzio-sub-sidebar {
  width: 0;
  overflow: hidden;
}

.crafzio-layout.sidebar-collapsed .crafzio-main {
  max-width: calc(100vw - 56px) !important;
  width: calc(100vw - 56px) !important;
}

.crafzio-main {
  max-width: calc(100vw - 280px) !important;
}

.sub-bar-header {
  height: 54px;
  padding: 0 12px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-shrink: 0;
}

.sub-bar-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sub-bar-header .brand-portal-badge {
  font-size: 0.55rem !important;
  padding: 2px 6px !important;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.03em;
}

.sub-bar-body {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sub-bar-body::-webkit-scrollbar,
.crafzio-icon-rail::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.sub-search-input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-main);
  font-size: 0.8rem;
  outline: none;
}

.sub-search-input:focus {
  border-color: var(--primary);
}

.sub-notif-card {
  padding: 9px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  margin-bottom: 6px;
  cursor: pointer;
}

.sub-notif-card.unread {
  background: var(--bg-secondary);
  border-left: 3px solid var(--primary);
}

@media (max-width: 960px) {
  .crafzio-dual-sidebar {
    position: fixed;
    left: -290px;
    top: 0;
    bottom: 0;
    transition: left 0.2s ease;
  }
  .crafzio-dual-sidebar.mobile-open {
    left: 0;
  }
  .crafzio-main {
    max-width: 100vw !important;
    width: 100vw !important;
  }
}


/* Leads Toolbar Horizontal Alignment & Vanilla Tabs */
.leads-toolbar-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.filter-tabs-group {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  flex-wrap: wrap;
  gap: 6px;
}

.leads-actions-group {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-tab.active {
  background: var(--bg-selected) !important;
  color: var(--primary) !important;
  border-color: var(--primary-border) !important;
}
