:root {
  --crm-sidebar-width: 260px;
  --crm-sidebar-collapsed-width: 84px;
  --crm-brand-navy: #082d5d;
  --crm-brand-navy-deep: #041a38;
  --crm-brand-blue: #0d4c8f;
  --crm-brand-blue-soft: #eaf2fb;
  --crm-brand-orange: #ff6500;
  --crm-brand-orange-soft: #fff1e8;
  --crm-sidebar-bg: #082d5d;
  --crm-sidebar-bg-strong: #041a38;
  --crm-sidebar-text: #e8f0fb;
  --crm-sidebar-muted: #a9bdd8;
  --crm-sidebar-active: #ff6500;
  --crm-border: #dce4ee;
  --crm-content-bg: #f4f7fb;
  --crm-surface: #ffffff;
  --crm-text: #13233d;
  --crm-muted: #64748b;
  --crm-font-xs: 0.75rem;
  --crm-font-sm: 0.8125rem;
  --crm-font-body: 0.875rem;
  --crm-font-md: 1rem;
  --crm-font-lg: 1.25rem;
  --crm-font-xl: 1.5rem;
  --crm-status-positive: #147a50;
  --crm-status-positive-bg: #eaf7f0;
  --crm-status-positive-border: #b9e3cd;
  --crm-status-info: #0d4c8f;
  --crm-status-info-bg: #eaf2fb;
  --crm-status-info-border: #bfd6ee;
  --crm-status-warning: #a94708;
  --crm-status-warning-bg: #fff1e8;
  --crm-status-warning-border: #ffd0ad;
  --crm-status-critical: #b42318;
  --crm-status-critical-bg: #fef3f2;
  --crm-status-critical-border: #f4c7c3;
  --crm-status-neutral: #526175;
  --crm-status-neutral-bg: #eef2f6;
  --crm-status-neutral-border: #d7dfe8;
  --bs-primary: #0d4c8f;
  --bs-primary-rgb: 13, 76, 143;
  --bs-link-color: #0d4c8f;
  --bs-link-hover-color: #082d5d;
}

html {
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}

html.crm-scroll-active {
  scrollbar-color: rgba(13, 76, 143, .62) transparent;
}

html::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

html::-webkit-scrollbar-track {
  background: transparent;
}

html::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: transparent;
}

html.crm-scroll-active::-webkit-scrollbar-thumb {
  background: rgba(13, 76, 143, .62);
}

.whatsapp-inbox-grid {
  align-items: stretch;
}

.whatsapp-thread {
  min-height: 460px;
  max-height: 62vh;
  overflow-y: auto;
  padding-right: .25rem;
}

.whatsapp-bubble {
  max-width: min(78%, 560px);
  border-radius: .5rem;
  padding: .75rem .9rem;
  overflow-wrap: anywhere;
}

.whatsapp-bubble-in {
  background: #f1f5f9;
  color: #0f172a;
}

.whatsapp-bubble-out {
  background: #dcfce7;
  color: #052e16;
}

@media (max-width: 991.98px) {
  .whatsapp-thread {
    min-height: 360px;
    max-height: none;
  }

  .whatsapp-bubble {
    max-width: 90%;
  }
}

.crm-body {
  min-height: 100vh;
  margin: 0;
  background: var(--crm-content-bg);
  color: var(--crm-text);
  font-family: "Montserrat", "Segoe UI", Arial, sans-serif;
}

.crm-body .btn-primary {
  --bs-btn-bg: var(--crm-brand-blue);
  --bs-btn-border-color: var(--crm-brand-blue);
  --bs-btn-hover-bg: var(--crm-brand-navy);
  --bs-btn-hover-border-color: var(--crm-brand-navy);
  --bs-btn-active-bg: var(--crm-brand-navy-deep);
  --bs-btn-active-border-color: var(--crm-brand-navy-deep);
}

.crm-body .btn-outline-primary {
  --bs-btn-color: var(--crm-brand-blue);
  --bs-btn-border-color: var(--crm-brand-blue);
  --bs-btn-hover-bg: var(--crm-brand-blue);
  --bs-btn-hover-border-color: var(--crm-brand-blue);
  --bs-btn-active-bg: var(--crm-brand-navy);
  --bs-btn-active-border-color: var(--crm-brand-navy);
}

.crm-body .text-primary {
  color: var(--crm-brand-blue) !important;
}

.crm-body .bg-primary-subtle {
  background-color: var(--crm-brand-blue-soft) !important;
}

.crm-body .text-bg-primary {
  color: #ffffff !important;
  background-color: var(--crm-brand-blue) !important;
}

.status-badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  padding: 3px 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: var(--crm-font-xs);
  font-weight: 650;
  line-height: 1.25;
  white-space: nowrap;
}

.status-badge--positive,
.crm-body .text-bg-success {
  border-color: var(--crm-status-positive-border) !important;
  color: var(--crm-status-positive) !important;
  background-color: var(--crm-status-positive-bg) !important;
}

.status-badge--info,
.crm-body .text-bg-info {
  border-color: var(--crm-status-info-border) !important;
  color: var(--crm-status-info) !important;
  background-color: var(--crm-status-info-bg) !important;
}

.status-badge--warning,
.crm-body .text-bg-warning {
  border-color: var(--crm-status-warning-border) !important;
  color: var(--crm-status-warning) !important;
  background-color: var(--crm-status-warning-bg) !important;
}

.status-badge--critical,
.crm-body .text-bg-danger {
  border-color: var(--crm-status-critical-border) !important;
  color: var(--crm-status-critical) !important;
  background-color: var(--crm-status-critical-bg) !important;
}

.status-badge--neutral,
.crm-body .text-bg-secondary,
.crm-body .text-bg-light {
  border-color: var(--crm-status-neutral-border) !important;
  color: var(--crm-status-neutral) !important;
  background-color: var(--crm-status-neutral-bg) !important;
}

.crm-body .badge[class*="text-bg-"] {
  border-style: solid;
  border-width: 1px;
  font-size: var(--crm-font-xs);
  font-weight: 650;
}

.crm-body .page-link {
  color: var(--crm-brand-blue);
}

.crm-body .active > .page-link,
.crm-body .page-link.active,
.crm-body .nav-pills .nav-link.active {
  border-color: var(--crm-brand-blue);
  background-color: var(--crm-brand-blue);
}

.crm-body .form-control:focus,
.crm-body .form-select:focus {
  border-color: #8bb2dc;
  box-shadow: 0 0 0 .2rem rgba(13, 76, 143, .12);
}

.crm-shell {
  display: flex;
  min-height: 100vh;
  background: var(--crm-content-bg);
}

.crm-shell,
.crm-sidebar,
.crm-main-panel {
  transition: width 180ms ease, flex-basis 180ms ease, margin 180ms ease;
}

.crm-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex: 0 0 var(--crm-sidebar-width);
  flex-direction: column;
  width: var(--crm-sidebar-width);
  height: 100vh;
  overflow: hidden;
  background: linear-gradient(180deg, var(--crm-sidebar-bg-strong) 0%, var(--crm-sidebar-bg) 46%, #0a386e 100%);
  color: var(--crm-sidebar-text);
  box-shadow: 12px 0 30px rgba(15, 23, 42, 0.12);
  z-index: 1040;
}

body.crm-sidebar-collapsed .crm-sidebar {
  flex-basis: var(--crm-sidebar-collapsed-width);
  width: var(--crm-sidebar-collapsed-width);
}

.crm-sidebar-brand {
  position: sticky;
  top: 0;
  padding: 18px 18px 16px;
  background: rgba(4, 26, 56, .94);
  border-bottom: 1px solid rgba(255, 101, 0, .42);
  z-index: 1;
}

.crm-brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #ffffff;
  text-decoration: none;
}

.crm-brand-link:hover {
  color: #ffffff;
}

.crm-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  overflow: hidden;
  border-radius: 11px;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .18);
}

.crm-brand-mark img {
  display: block;
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.crm-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

body.crm-sidebar-collapsed .crm-brand-text {
  display: none;
}

.crm-brand-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: .035em;
}

.crm-brand-subtitle {
  color: #ff9c5c;
  font-size: var(--crm-font-xs);
  font-weight: 700;
  letter-spacing: .16em;
}

.crm-sidebar-nav {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 4px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 12px 24px;
  scrollbar-color: transparent transparent;
  scrollbar-width: thin;
}

.crm-sidebar-nav:hover,
.crm-sidebar-nav:focus-within {
  scrollbar-color: rgba(255, 255, 255, .38) transparent;
}

.crm-sidebar-nav::-webkit-scrollbar,
.crm-notification-list::-webkit-scrollbar,
.table-responsive::-webkit-scrollbar,
.whatsapp-thread::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.crm-sidebar-nav::-webkit-scrollbar-track,
.crm-notification-list::-webkit-scrollbar-track,
.table-responsive::-webkit-scrollbar-track,
.whatsapp-thread::-webkit-scrollbar-track {
  background: transparent;
}

.crm-sidebar-nav::-webkit-scrollbar-thumb,
.crm-notification-list::-webkit-scrollbar-thumb,
.table-responsive::-webkit-scrollbar-thumb,
.whatsapp-thread::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: transparent;
}

.crm-sidebar-nav:hover::-webkit-scrollbar-thumb,
.crm-sidebar-nav:focus-within::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .38);
}

.crm-notification-list:hover::-webkit-scrollbar-thumb,
.crm-notification-list:focus-within::-webkit-scrollbar-thumb,
.table-responsive:hover::-webkit-scrollbar-thumb,
.table-responsive:focus-within::-webkit-scrollbar-thumb,
.whatsapp-thread:hover::-webkit-scrollbar-thumb,
.whatsapp-thread:focus-within::-webkit-scrollbar-thumb {
  background: rgba(13, 76, 143, .45);
}

.table-responsive {
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-color: rgba(13, 76, 143, .24) transparent;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}

.table-responsive::-webkit-scrollbar-thumb {
  background: rgba(13, 76, 143, .24);
}

.table-responsive:hover,
.table-responsive:focus,
.table-responsive:focus-within {
  scrollbar-color: rgba(13, 76, 143, .52) transparent;
}

.table-responsive:focus::-webkit-scrollbar-thumb,
.table-responsive:hover::-webkit-scrollbar-thumb,
.table-responsive:focus-within::-webkit-scrollbar-thumb {
  background: rgba(13, 76, 143, .52);
}

.table-responsive:focus-visible {
  border-radius: 6px;
  outline: 2px solid rgba(13, 76, 143, .24);
  outline-offset: 2px;
}

.crm-nav-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.crm-nav-group-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 34px;
  margin: 14px 8px 4px;
  padding: 5px 7px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--crm-sidebar-muted);
  font-size: var(--crm-font-xs);
  font-weight: 700;
  letter-spacing: 0.08rem;
  text-transform: uppercase;
  transition: background-color 160ms ease, color 160ms ease;
}

.crm-nav-group-toggle:hover,
.crm-nav-group-toggle:focus {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.crm-nav-group-toggle .bi-chevron-down {
  font-size: 0.76rem;
  transition: transform 160ms ease;
}

.crm-nav-group.collapsed .crm-nav-group-toggle .bi-chevron-down {
  transform: rotate(-90deg);
}

.crm-nav-group-items {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.crm-nav-group.collapsed .crm-nav-group-items {
  display: none;
}

body.crm-sidebar-collapsed .crm-nav-group-toggle {
  justify-content: center;
  margin: 12px 8px 4px;
  padding: 7px;
}

body.crm-sidebar-collapsed .crm-nav-group-label,
body.crm-sidebar-collapsed .crm-nav-group-toggle .bi-chevron-down,
body.crm-sidebar-collapsed .crm-nav-text {
  display: none;
}

body.crm-sidebar-collapsed .crm-nav-group-items {
  display: flex;
}

.crm-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--crm-sidebar-text);
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

body.crm-sidebar-collapsed .crm-nav-link {
  justify-content: center;
  padding-inline: 10px;
}

.crm-nav-link i {
  width: 20px;
  color: var(--crm-sidebar-muted);
  font-size: 1rem;
  transition: color 160ms ease;
}

body.crm-sidebar-collapsed .crm-nav-link i {
  width: auto;
}

.crm-nav-link:hover,
.crm-nav-link:focus {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  transform: translateX(2px);
}

body.crm-sidebar-collapsed .crm-nav-link:hover,
body.crm-sidebar-collapsed .crm-nav-link:focus {
  transform: none;
}

.crm-nav-link:hover i,
.crm-nav-link:focus i {
  color: #ffffff;
}

.crm-nav-link.active {
  background: linear-gradient(90deg, rgba(255, 101, 0, .2), rgba(24, 100, 180, .18));
  color: #ffffff;
  box-shadow: inset 3px 0 0 var(--crm-sidebar-active);
}

.crm-nav-link.active i {
  color: #ff9a58;
}

.crm-main-panel {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
}

.crm-topbar {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 68px;
  padding: 11px 24px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid #d6e1ee;
  box-shadow: 0 5px 18px rgba(4, 26, 56, .055);
  backdrop-filter: blur(10px);
  z-index: 1030;
}

.crm-topbar-start,
.crm-topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.crm-topbar-start {
  flex: 0 0 auto;
  min-width: 0;
}

.crm-mobile-brand {
  display: none;
  align-items: center;
  gap: 8px;
  color: var(--crm-brand-navy);
  font-weight: 700;
  text-decoration: none;
}

.crm-mobile-brand img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.crm-topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.crm-header-logo {
  display: block;
  width: clamp(92px, 12vw, 150px);
  max-height: 34px;
  object-fit: contain;
}

.crm-header-mark {
  display: none;
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.crm-topbar-title {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}

.crm-topbar-kicker {
  color: var(--crm-muted);
  font-size: var(--crm-font-xs);
  font-weight: 600;
}

.crm-topbar-heading {
  color: var(--crm-text);
  font-size: 1.05rem;
  font-weight: 700;
}

.crm-icon-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--crm-border);
  border-radius: 8px;
  background: var(--crm-surface);
  color: #344054;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.crm-icon-button:hover,
.crm-icon-button:focus {
  background: var(--crm-brand-blue-soft);
  border-color: #a9c5e3;
  color: var(--crm-brand-blue);
}

.crm-topbar-search {
  position: relative;
  flex: 1 1 420px;
  max-width: 620px;
}

.crm-topbar-search i {
  position: absolute;
  top: 50%;
  left: 14px;
  color: var(--crm-muted);
  transform: translateY(-50%);
  z-index: 1;
}

.crm-topbar-search .form-control {
  min-height: 42px;
  padding-left: 40px;
  border-color: var(--crm-border);
  border-radius: 10px;
  background: #f7f9fc;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.crm-topbar-search .form-control:focus {
  border-color: #8bb2dc;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(13, 76, 143, .1);
}

.crm-topbar-actions {
  margin-left: auto;
}

.crm-notification-dot {
  display: none;
}

.crm-notification-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  color: #ffffff;
  background: var(--crm-brand-orange);
  font-size: var(--crm-font-xs);
  font-weight: 700;
  line-height: 1;
}

.crm-notification-badge[hidden] {
  display: none;
}

.crm-notification-menu {
  width: min(400px, calc(100vw - 24px));
  margin-top: 10px !important;
  padding: 0;
  overflow: hidden;
  border: 1px solid #d7e1ed;
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(4, 26, 56, .18);
}

.crm-notification-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid #e7edf4;
  background: linear-gradient(120deg, #f8fbff, #fffaf6);
}

.crm-notification-menu-header strong,
.crm-notification-menu-header small {
  display: block;
}

.crm-notification-menu-header strong {
  color: var(--crm-brand-navy);
  font-size: .95rem;
}

.crm-notification-menu-header small {
  margin-top: 2px;
  color: var(--crm-muted);
  font-size: var(--crm-font-xs);
}

.crm-notification-menu-header a {
  color: var(--crm-brand-blue);
  font-size: var(--crm-font-xs);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.crm-notification-list {
  max-height: min(420px, 62vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: transparent transparent;
  scrollbar-width: thin;
}

.crm-notification-list:hover,
.crm-notification-list:focus-within {
  scrollbar-color: rgba(13, 76, 143, .45) transparent;
}

.crm-notification-item {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  padding: 14px 17px;
  border-bottom: 1px solid #edf1f6;
  color: var(--crm-text);
  text-decoration: none;
  transition: background-color 150ms ease;
}

.crm-notification-item:last-child {
  border-bottom: 0;
}

.crm-notification-item:hover,
.crm-notification-item:focus {
  color: var(--crm-text);
  background: #f7faff;
}

.crm-notification-item.is-overdue::before {
  position: absolute;
  inset: 14px auto 14px 0;
  width: 3px;
  border-radius: 0 999px 999px 0;
  background: var(--crm-brand-orange);
  content: "";
}

.crm-notification-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 12px;
  color: var(--crm-brand-blue);
  background: var(--crm-brand-blue-soft);
}

.crm-notification-item.is-overdue .crm-notification-icon {
  color: #c84f00;
  background: var(--crm-brand-orange-soft);
}

.crm-notification-copy,
.crm-notification-title-row,
.crm-notification-meta {
  min-width: 0;
}

.crm-notification-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.crm-notification-title-row strong {
  overflow: hidden;
  font-size: .78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-notification-title-row time {
  flex: 0 0 auto;
  color: var(--crm-brand-blue);
  font-size: var(--crm-font-xs);
  font-weight: 700;
}

.crm-notification-title-row time.is-overdue {
  color: #c84f00;
}

.crm-notification-message {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 3px;
  color: var(--crm-muted);
  font-size: var(--crm-font-xs);
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.crm-notification-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  color: #8090a5;
  font-size: var(--crm-font-xs);
  font-weight: 600;
}

.crm-notification-priority {
  padding: 2px 7px;
  border-radius: 999px;
  color: var(--crm-brand-navy);
  background: #edf2f8;
}

.crm-notification-loading,
.crm-notification-error,
.crm-notification-empty {
  display: flex;
  min-height: 150px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 26px;
  color: var(--crm-muted);
  font-size: .76rem;
  text-align: center;
}

.crm-notification-loading .spinner-border {
  color: var(--crm-brand-blue);
}

.crm-notification-error {
  flex-direction: column;
}

.crm-notification-error i {
  color: var(--crm-brand-orange);
  font-size: 1.4rem;
}

.crm-notification-error button {
  padding: 4px 10px;
  border: 1px solid #b9cce1;
  border-radius: 8px;
  color: var(--crm-brand-blue);
  background: #ffffff;
  font-size: var(--crm-font-xs);
  font-weight: 700;
}

.crm-notification-empty {
  flex-direction: column;
}

.crm-notification-empty > span {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 50%;
  color: var(--crm-brand-blue);
  background: var(--crm-brand-blue-soft);
  font-size: 1.25rem;
}

.crm-notification-empty strong,
.crm-notification-empty small {
  display: block;
}

.crm-user-menu {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 5px 11px 5px 6px;
  border: 1px solid var(--crm-border);
  border-radius: 8px;
  background: var(--crm-surface);
  color: #344054;
  transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}

.crm-user-menu:hover,
.crm-user-menu:focus-visible,
.crm-user-menu[aria-expanded="true"] {
  border-color: #a9c5e3;
  background: #f8fbff;
  box-shadow: 0 0 0 3px rgba(13, 76, 143, 0.08);
}

.crm-user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid #c6d9ec;
  background: var(--crm-brand-blue-soft);
  color: var(--crm-brand-blue);
  font-weight: 700;
}

.crm-user-copy {
  display: grid;
  min-width: 0;
  max-width: 230px;
  text-align: left;
}

.crm-user-name-line {
  display: flex;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
  font-size: 0.82rem;
  line-height: 1.2;
  white-space: nowrap;
}

.crm-user-greeting {
  flex: 0 0 auto;
  color: var(--crm-brand-blue);
  font-weight: 500;
}

.crm-user-display-name {
  min-width: 0;
  overflow: hidden;
  color: var(--crm-brand-navy);
  font-weight: 700;
  text-overflow: ellipsis;
}

.crm-user-role {
  margin-top: 3px;
  color: var(--crm-muted);
  font-size: var(--crm-font-xs);
  font-weight: 500;
  line-height: 1.2;
}

.crm-account-menu {
  min-width: 220px;
  margin-top: 8px !important;
  padding: 6px;
  border: 1px solid #d7e0ea;
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(9, 30, 66, 0.14);
}

.crm-account-menu-item {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding: 5px 8px;
  border-radius: 8px;
  color: #344054;
  font-size: var(--crm-font-sm);
  font-weight: 500;
  line-height: 1.25;
  transition: color 140ms ease, background-color 140ms ease;
}

.crm-account-menu-item:hover,
.crm-account-menu-item:focus-visible {
  color: var(--crm-brand-blue);
  background: #f2f7fc;
}

.crm-account-menu-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: #edf5fd;
  color: var(--crm-brand-blue);
  font-size: 0.9rem;
  transition: color 140ms ease, background-color 140ms ease;
}

.crm-account-menu-item:hover .crm-account-menu-icon,
.crm-account-menu-item:focus-visible .crm-account-menu-icon {
  background: #dcecfb;
}

.crm-account-menu .dropdown-divider {
  margin: 5px 7px;
  border-color: #e6ebf1;
  opacity: 1;
}

.crm-account-menu-form {
  margin: 0;
}

.crm-account-menu-logout {
  color: #b42318;
}

.crm-account-menu-logout .crm-account-menu-icon {
  color: #b42318;
  background: #fff1f0;
}

.crm-account-menu-logout:hover,
.crm-account-menu-logout:focus-visible {
  color: #912018;
  background: #fff5f4;
}

.crm-account-menu-logout:hover .crm-account-menu-icon,
.crm-account-menu-logout:focus-visible .crm-account-menu-icon {
  color: #912018;
  background: #ffe4e1;
}

.crm-auth-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.crm-mobile-login-button {
  display: none;
}

.crm-content {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
}

.crm-breadcrumb-bar {
  padding: 16px 24px 0;
}

.crm-breadcrumb-bar .breadcrumb {
  display: inline-flex;
  padding: 10px 14px;
  border: 1px solid var(--crm-border);
  border-radius: 8px;
  background: var(--crm-surface);
  font-size: 0.86rem;
}

.crm-breadcrumb-bar a {
  color: var(--crm-brand-blue);
  text-decoration: none;
}

.crm-content-container {
  flex: 1 1 auto;
  width: 100%;
  padding: 24px;
}

.crm-footer {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  min-height: 58px;
  padding: 9px 24px;
  border-top: 1px solid var(--crm-border);
  background: var(--crm-surface);
  color: var(--crm-muted);
  font-size: 0.86rem;
}

.crm-footer-powered {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--crm-muted);
  font-size: var(--crm-font-xs);
  font-weight: 600;
}

.crm-footer-solaris-logo {
  display: block;
  width: 126px;
  max-height: 32px;
  object-fit: contain;
}

.crm-sidebar-backdrop {
  position: fixed;
  inset: 0;
  display: none;
  background: rgba(15, 23, 42, 0.45);
  z-index: 1035;
}

body.crm-sidebar-open .crm-sidebar-backdrop {
  display: block;
}

@media (max-width: 1199.98px) {
  body.crm-sidebar-collapsed .crm-sidebar {
    flex-basis: var(--crm-sidebar-width);
    width: var(--crm-sidebar-width);
  }

  body.crm-sidebar-collapsed .crm-brand-text,
  body.crm-sidebar-collapsed .crm-nav-text,
  body.crm-sidebar-collapsed .crm-nav-group-label,
  body.crm-sidebar-collapsed .crm-nav-group-toggle .bi-chevron-down {
    display: initial;
  }

  body.crm-sidebar-collapsed .crm-nav-group-toggle {
    justify-content: space-between;
  }

  body.crm-sidebar-collapsed .crm-nav-link {
    justify-content: flex-start;
  }

  .crm-sidebar {
    position: fixed;
    left: 0;
    transform: translateX(-100%);
    transition: transform 180ms ease;
  }

  body.crm-sidebar-open .crm-sidebar {
    transform: translate3d(0, 0, 0);
  }

  body.crm-sidebar-open {
    overflow: hidden;
  }

  .crm-topbar {
    padding-inline: 16px;
  }
}

@media (max-width: 767.98px) {
  .crm-topbar {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
  }

  .crm-topbar-start {
    grid-column: 1;
    flex: 0 1 auto;
    min-width: 0;
    gap: 8px;
  }

  .crm-topbar-actions {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    margin-left: 0;
  }

  .crm-mobile-brand {
    display: inline-flex;
  }

  .crm-header-logo {
    display: none;
  }

  .crm-header-mark {
    display: none;
  }

  .crm-topbar-title {
    display: none;
  }

  .crm-topbar-actions,
  .crm-auth-links {
    gap: 6px;
  }

  .crm-auth-links .btn {
    padding-inline: 0.5rem;
  }

  .crm-mobile-login-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--crm-border);
    border-radius: 8px;
    background: var(--crm-surface);
    color: #344054;
    text-decoration: none;
  }

  .crm-auth-links {
    display: none;
  }

  .crm-topbar-search {
    grid-column: 1 / -1;
    grid-row: 2;
    flex-basis: 100%;
    max-width: none;
  }

  .crm-topbar-kicker,
  .crm-user-copy {
    display: none;
  }

  .crm-breadcrumb-bar,
  .crm-content-container {
    padding-inline: 16px;
  }

  .crm-footer {
    min-height: 54px;
    padding-inline: 16px;
    font-size: var(--crm-font-xs);
  }

  .crm-footer-powered {
    gap: 7px;
    font-size: var(--crm-font-xs);
  }

  .crm-footer-solaris-logo {
    width: 104px;
  }
}


/* Account management */
.account-manage-page {
  display: grid;
  gap: 14px;
  padding-bottom: 20px;
}

.account-manage-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.account-manage-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 5px;
  color: var(--crm-brand-orange);
  font-size: var(--crm-font-xs);
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.account-manage-header h1 {
  margin: 0;
  color: var(--crm-brand-navy-deep);
  font-size: clamp(1.4rem, 2vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -.025em;
}

.account-manage-header p {
  margin: 6px 0 0;
  color: var(--crm-muted);
  font-size: var(--crm-font-body);
}

.account-manage-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  min-height: 24px;
  color: var(--crm-muted);
  font-size: var(--crm-font-xs);
}

.account-manage-breadcrumb a {
  color: var(--crm-brand-blue);
  font-weight: 600;
  text-decoration: none;
}

.account-manage-breadcrumb a:hover {
  color: var(--crm-brand-navy);
  text-decoration: underline;
}

.account-manage-breadcrumb .bi {
  font-size: .65rem;
}

.account-manage-shell {
  display: grid;
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
  align-items: start;
  gap: 18px;
}

.account-manage-sidebar {
  position: sticky;
  top: 86px;
}

.account-manage-nav-card,
.account-manage-panel {
  border: 1px solid var(--crm-border);
  border-radius: 12px;
  background: var(--crm-surface);
  box-shadow: 0 8px 24px rgba(8, 45, 93, .05);
}

.account-manage-nav-card {
  padding: 12px;
}

.account-manage-nav-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px 13px;
  border-bottom: 1px solid var(--crm-border);
}

.account-manage-nav-heading > span:last-child {
  display: grid;
  min-width: 0;
}

.account-manage-nav-heading strong {
  color: var(--crm-text);
  font-size: var(--crm-font-sm);
  font-weight: 700;
}

.account-manage-nav-heading small {
  margin-top: 2px;
  color: var(--crm-muted);
  font-size: var(--crm-font-xs);
}

.account-manage-nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 9px;
  background: var(--crm-brand-blue-soft);
  color: var(--crm-brand-blue);
  font-size: 1rem;
}

.account-manage-nav {
  display: grid;
  gap: 4px;
  padding-top: 10px;
}

.account-manage-nav .nav-item {
  width: 100%;
}

.account-manage-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  border-radius: 8px;
  color: #43526a;
  font-size: var(--crm-font-sm);
  font-weight: 600;
  line-height: 1.25;
}

.account-manage-nav .nav-link .bi {
  width: 18px;
  color: #718096;
  font-size: .95rem;
  text-align: center;
}

.account-manage-nav .nav-link:hover {
  background: var(--crm-brand-blue-soft);
  color: var(--crm-brand-navy);
}

.account-manage-nav .nav-link.active {
  background: var(--crm-brand-navy);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--crm-brand-orange);
}

.account-manage-nav .nav-link.active .bi {
  color: #fff;
}

.account-manage-nav-separator {
  margin-top: 5px;
  padding-top: 9px;
  border-top: 1px solid var(--crm-border);
}

.account-manage-panel {
  min-width: 0;
  min-height: 410px;
  padding: 22px 24px 24px;
}

.account-manage-panel > h3,
.account-manage-panel > h4,
.account-manage-section-heading h3 {
  margin: 0 0 5px;
  color: var(--crm-brand-navy-deep);
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -.01em;
}

.account-manage-panel > h4 {
  margin-top: 22px;
  font-size: var(--crm-font-md);
}

.account-manage-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--crm-border);
}

.account-manage-section-heading p {
  margin: 0;
  color: var(--crm-muted);
  font-size: var(--crm-font-sm);
}

.account-manage-panel > h3 + .row,
.account-manage-panel > .account-manage-status + .row,
.account-manage-panel > h3 + p,
.account-manage-panel > h3 + form {
  margin-top: 18px;
}

.account-manage-panel > .row {
  margin-right: 0;
  margin-left: 0;
}

.account-manage-panel > .row > [class*="col-"] {
  width: 100%;
  max-width: 650px;
  padding-right: 0;
  padding-left: 0;
}

.account-manage-form {
  max-width: 650px;
}

.account-manage-form-wide {
  max-width: 820px;
}

.account-profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.account-profile-grid-full {
  grid-column: 1 / -1;
}

.account-manage-panel .form-floating {
  margin-bottom: 14px;
}

.account-profile-grid .form-floating {
  margin-bottom: 0;
}

.account-manage-panel .form-control,
.account-manage-panel .input-group-text {
  min-height: 50px;
  border-color: var(--crm-border);
  border-radius: 8px;
  font-size: var(--crm-font-body);
}

.account-manage-panel .form-control:focus {
  border-color: rgba(13, 76, 143, .65);
  box-shadow: 0 0 0 .2rem rgba(13, 76, 143, .11);
}

.account-manage-panel .form-control:disabled {
  background: #f6f8fb;
  color: #526175;
}

.account-manage-panel .form-floating > label {
  color: var(--crm-muted);
  font-size: var(--crm-font-sm);
}

.account-manage-panel .text-danger,
.account-manage-panel .validation-summary-errors {
  font-size: var(--crm-font-xs);
}

.account-manage-panel p,
.account-manage-panel li,
.account-manage-panel td {
  font-size: var(--crm-font-sm);
  line-height: 1.6;
}

.account-manage-panel .btn {
  border-radius: 8px;
  font-size: var(--crm-font-sm);
  font-weight: 600;
}

.account-manage-panel .btn-lg {
  padding-top: .65rem;
  padding-bottom: .65rem;
  font-size: var(--crm-font-sm);
}

.account-manage-actions {
  display: flex;
  gap: 9px;
  margin-top: 18px;
}

.account-manage-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding-inline: 16px;
}

.account-manage-status {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 16px;
  padding: 11px 42px 11px 13px;
  border-radius: 8px;
  font-size: var(--crm-font-sm);
}

.account-manage-status .btn-close {
  padding: 14px;
}

.account-manage-panel .alert {
  border-radius: 8px;
  font-size: var(--crm-font-sm);
}

.account-manage-panel .table {
  margin-top: 14px;
  border-color: var(--crm-border);
}

.account-manage-panel code {
  color: var(--crm-brand-navy);
  font-size: var(--crm-font-sm);
}

.account-manage-panel kbd {
  background: var(--crm-brand-navy-deep);
}

@media (max-width: 991.98px) {
  .account-manage-shell {
    grid-template-columns: 1fr;
  }

  .account-manage-sidebar {
    position: static;
  }

  .account-manage-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .account-manage-nav-separator {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
  }
}

@media (max-width: 575.98px) {
  .account-manage-header p {
    max-width: 34rem;
  }

  .account-manage-panel {
    min-height: 0;
    padding: 18px 16px;
  }

  .account-manage-nav {
    grid-template-columns: 1fr;
  }

  .account-profile-grid {
    grid-template-columns: 1fr;
  }

  .account-profile-grid-full {
    grid-column: auto;
  }
}

/* Personal data management */
.account-data-intro {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid var(--crm-status-info-border);
  border-radius: 10px;
  background: var(--crm-status-info-bg);
}

.account-data-intro-icon,
.account-delete-warning-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 9px;
  background: #fff;
  color: var(--crm-brand-blue);
  font-size: 1rem;
}

.account-data-intro strong,
.account-delete-warning strong {
  display: block;
  margin: 1px 0 3px;
  color: var(--crm-brand-navy-deep);
  font-size: var(--crm-font-sm);
  font-weight: 700;
}

.account-data-intro p,
.account-delete-warning p {
  margin: 0;
  color: var(--crm-muted);
  font-size: var(--crm-font-xs);
  line-height: 1.55;
}

.account-data-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.account-data-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 218px;
  padding: 18px;
  border: 1px solid var(--crm-border);
  border-radius: 10px;
  background: #fff;
}

.account-data-card-danger {
  border-color: var(--crm-status-critical-border);
  background: linear-gradient(180deg, #fff 0%, #fffbfb 100%);
}

.account-data-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin-bottom: 14px;
  border-radius: 10px;
  background: var(--crm-brand-blue-soft);
  color: var(--crm-brand-blue);
  font-size: 1.15rem;
}

.account-data-card-danger .account-data-card-icon {
  background: var(--crm-status-critical-bg);
  color: var(--crm-status-critical);
}

.account-data-card-copy {
  flex: 1;
}

.account-data-card h4 {
  margin: 0 0 6px;
  color: var(--crm-brand-navy-deep);
  font-size: var(--crm-font-md);
  font-weight: 700;
}

.account-data-card p {
  margin: 0 0 16px;
  color: var(--crm-muted);
  font-size: var(--crm-font-sm);
  line-height: 1.55;
}

.account-data-card .btn,
.account-delete-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding-inline: 14px;
}

.account-data-card .btn-outline-danger {
  --bs-btn-color: var(--crm-status-critical);
  --bs-btn-border-color: var(--crm-status-critical-border);
  --bs-btn-hover-bg: var(--crm-status-critical);
  --bs-btn-hover-border-color: var(--crm-status-critical);
}

.account-delete-warning {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  max-width: 700px;
  margin-bottom: 18px;
  padding: 15px 16px;
  border: 1px solid var(--crm-status-critical-border);
  border-radius: 10px;
  background: var(--crm-status-critical-bg);
}

.account-delete-warning-icon {
  color: var(--crm-status-critical);
}

.account-delete-form {
  max-width: 560px;
}

.account-delete-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 18px;
}

.account-delete-actions .btn-light {
  border-color: var(--crm-border);
  background: #fff;
  color: var(--crm-text);
}

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

  .account-data-card {
    min-height: 0;
  }
}

/* Unified list pagination */
.crm-pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 16px;
  width: 100%;
}

.crm-pagination-summary,
.crm-pagination-bar > .text-muted {
  color: var(--crm-muted) !important;
  font-size: var(--crm-font-xs) !important;
  font-weight: 500;
  line-height: 1.4;
}

.crm-pagination-bar,
nav:not(.crm-pagination-bar) > .crm-pagination {
  margin-top: 14px;
}

.crm-pagination-actions,
.crm-pagination {
  display: flex;
  align-items: center;
  gap: 6px;
}

.crm-pagination {
  flex-wrap: wrap;
  margin: 0;
}

.crm-pagination .page-item {
  margin: 0;
}

.crm-pagination .page-link,
.crm-page-control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  margin: 0 !important;
  padding: 0 10px;
  border: 1px solid var(--crm-border) !important;
  border-radius: 8px !important;
  background: #fff !important;
  color: #43526a !important;
  box-shadow: none !important;
  font-family: "Montserrat", "Segoe UI", Arial, sans-serif;
  font-size: var(--crm-font-xs);
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  transition: border-color .15s ease, background-color .15s ease, color .15s ease, transform .15s ease;
}

.crm-pagination .page-link:hover,
.crm-page-control:hover {
  border-color: rgba(13, 76, 143, .4) !important;
  background: var(--crm-brand-blue-soft) !important;
  color: var(--crm-brand-navy) !important;
  transform: translateY(-1px);
}

.crm-page-control {
  min-width: 94px;
  gap: 7px;
  padding-inline: 12px;
}

.crm-page-control .bi {
  font-size: .68rem;
  line-height: 1;
}

.crm-pagination .page-item.active > .page-link {
  border-color: var(--crm-brand-navy) !important;
  background: var(--crm-brand-navy) !important;
  color: #fff !important;
  box-shadow: inset 0 -2px 0 var(--crm-brand-orange) !important;
}

.crm-pagination .page-item.disabled > .crm-page-control,
.crm-page-control.disabled,
.crm-page-control[aria-disabled="true"] {
  border-color: #e6ebf1 !important;
  background: #f6f8fb !important;
  color: #9aa6b5 !important;
  opacity: .72;
  pointer-events: none;
  transform: none;
}

.crm-pagination .page-item.disabled > .page-link:not(.crm-page-control) {
  min-width: auto;
  padding-inline: 6px;
  border-color: transparent !important;
  background: transparent !important;
  color: var(--crm-muted) !important;
  opacity: 1;
}

@media (max-width: 575.98px) {
  .crm-pagination-bar {
    align-items: center;
  }

  .crm-page-control {
    min-width: 38px;
    width: 38px;
    padding-inline: 0;
  }

  .crm-page-control span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
}

/* Compact three-part pager */
.crm-pagination-bar {
  justify-content: flex-end;
  gap: 12px;
}

.crm-pagination-bar .crm-pagination-summary {
  min-width: 76px;
  color: #526175 !important;
  font-size: var(--crm-font-xs) !important;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
}

@media (max-width: 575.98px) {
  .crm-pagination-bar {
    justify-content: center;
    gap: 9px;
  }

  .crm-pagination-bar .crm-page-control {
    width: auto;
    min-width: 84px;
    padding-inline: 10px;
  }

  .crm-pagination-bar .crm-page-control span {
    position: static;
    width: auto;
    height: auto;
    padding: 0;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: nowrap;
  }
}

/* Lead create and edit forms */
.lead-form-page {
  width: 100%;
}

.lead-form-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
  padding: 18px 20px;
  border: 1px solid var(--crm-border);
  border-radius: 12px;
  background: linear-gradient(120deg, #fff 0%, #f7faff 72%, #fff5ee 100%);
  box-shadow: 0 4px 14px rgba(4, 26, 56, .035);
}

.lead-form-hero-main {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
}

.lead-form-hero-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 11px;
  background: linear-gradient(145deg, var(--crm-brand-navy), var(--crm-brand-blue));
  color: #fff;
  box-shadow: inset 0 -2px 0 var(--crm-brand-orange), 0 7px 16px rgba(13, 76, 143, .14);
  font-size: 1.05rem;
}

.lead-form-eyebrow {
  margin-bottom: 3px;
  color: var(--crm-brand-orange);
  font-size: var(--crm-font-xs);
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.lead-form-hero h1 {
  margin: 0;
  color: var(--crm-brand-navy-deep);
  font-size: var(--crm-font-xl);
  font-weight: 700;
  letter-spacing: -.025em;
  line-height: 1.25;
}

.lead-form-hero p {
  margin: 4px 0 7px;
  color: var(--crm-muted);
  font-size: var(--crm-font-sm);
  line-height: 1.45;
}

.lead-form-breadcrumb {
  margin: 0;
  font-size: var(--crm-font-xs);
}

.lead-form-breadcrumb a {
  color: var(--crm-brand-blue);
  font-weight: 600;
  text-decoration: none;
}

.lead-form-breadcrumb a:hover {
  color: var(--crm-brand-orange);
}

.lead-form-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 39px;
  border-radius: 8px;
  font-size: var(--crm-font-sm);
  font-weight: 600;
  white-space: nowrap;
}

.lead-form {
  display: grid;
  gap: 14px;
}

.lead-form-validation:empty {
  display: none;
}

.lead-form-validation:not(:empty) {
  padding: 12px 14px;
  border: 1px solid var(--crm-status-critical-border);
  border-radius: 9px;
  background: var(--crm-status-critical-bg);
  color: var(--crm-status-critical);
  font-size: var(--crm-font-sm);
}

.lead-form-validation ul {
  margin: 0;
  padding-left: 18px;
}

.lead-form-sections {
  display: grid;
  gap: 14px;
}

.lead-form-section {
  overflow: hidden;
  border: 1px solid var(--crm-border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 3px 12px rgba(4, 26, 56, .03);
}

.lead-form-section--danger {
  border-color: var(--crm-status-critical-border);
}

.lead-form-section-header {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 17px;
  border-bottom: 1px solid #e9edf2;
  background: #fafbfd;
}

.lead-form-section-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 8px;
  background: var(--crm-status-info-bg);
  color: var(--crm-status-info);
  font-size: .9rem;
}

.lead-form-section-icon--orange { background: var(--crm-status-warning-bg); color: var(--crm-status-warning); }
.lead-form-section-icon--green { background: var(--crm-status-positive-bg); color: var(--crm-status-positive); }
.lead-form-section-icon--purple { background: #f2edff; color: #6941c6; }
.lead-form-section-icon--slate { background: var(--crm-status-neutral-bg); color: var(--crm-status-neutral); }
.lead-form-section-icon--danger { background: var(--crm-status-critical-bg); color: var(--crm-status-critical); }

.lead-form-section-header h2 {
  margin: 1px 0 0;
  color: var(--crm-brand-navy-deep);
  font-size: var(--crm-font-body);
  font-weight: 700;
  line-height: 1.35;
}

.lead-form-section-header p {
  margin: 2px 0 0;
  color: var(--crm-muted);
  font-size: var(--crm-font-xs);
  line-height: 1.45;
}

.lead-form-section-body {
  padding: 17px;
}

.lead-form-section .form-label {
  min-height: auto;
  margin-bottom: 6px;
  color: #43526a;
  font-size: var(--crm-font-xs);
  font-weight: 650;
}

.lead-form-required {
  color: var(--crm-brand-orange);
}

.lead-form-section .form-control,
.lead-form-section .form-select {
  min-height: 40px;
  border-color: #d7dfe8;
  border-radius: 8px;
  background-color: #fff;
  color: var(--crm-text);
  font-size: var(--crm-font-sm);
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.lead-form-section textarea.form-control {
  min-height: 108px;
  resize: vertical;
  line-height: 1.55;
}

.lead-form-section .form-control::placeholder {
  color: #9aa6b5;
}

.lead-form-section .form-control:hover,
.lead-form-section .form-select:hover {
  border-color: #bcc8d6;
}

.lead-form-section .form-control:focus,
.lead-form-section .form-select:focus {
  border-color: rgba(13, 76, 143, .62);
  box-shadow: 0 0 0 .2rem rgba(13, 76, 143, .1);
}

.lead-form-section .text-danger {
  display: block;
  margin-top: 4px;
  font-size: var(--crm-font-xs);
  line-height: 1.35;
}

.lead-form-help {
  margin-top: 5px;
  color: var(--crm-muted);
  font-size: .6875rem;
  line-height: 1.4;
}

.lead-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 16px;
  border: 1px solid var(--crm-border);
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 3px 12px rgba(4, 26, 56, .03);
}

.lead-form-action-note {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--crm-muted);
  font-size: var(--crm-font-xs);
}

.lead-form-action-note .bi {
  color: var(--crm-brand-blue);
}

.lead-form-action-note strong {
  color: var(--crm-brand-orange);
}

.lead-form-action-buttons {
  display: flex;
  align-items: center;
  gap: 9px;
}

.lead-form-action-buttons .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  min-width: 104px;
  border-radius: 8px;
  font-size: var(--crm-font-sm);
  font-weight: 650;
}

.lead-form-action-buttons .btn-primary {
  min-width: 132px;
  border-color: var(--crm-brand-blue);
  background: linear-gradient(90deg, var(--crm-brand-navy), var(--crm-brand-blue));
  box-shadow: inset 0 -2px 0 var(--crm-brand-orange);
}

@media (max-width: 767.98px) {
  .lead-form-hero {
    align-items: stretch;
    flex-direction: column;
    padding: 16px;
  }

  .lead-form-back {
    align-self: flex-start;
  }

  .lead-form-section-header,
  .lead-form-section-body {
    padding-inline: 14px;
  }

  .lead-form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .lead-form-action-buttons {
    justify-content: flex-end;
  }
}

@media (max-width: 420px) {
  .lead-form-hero-main {
    gap: 10px;
  }

  .lead-form-hero-icon {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }

  .lead-form-action-buttons .btn {
    flex: 1 1 0;
    min-width: 0;
  }
}
/* Dynamic Lead Management filters */
.lead-filter-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid #dfe5ed;
  border-radius: 11px;
  background: linear-gradient(110deg, #fafbfd, #f6f9fd);
}

.lead-filter-panel[aria-busy="true"] {
  opacity: .72;
  pointer-events: none;
}

.lead-filter-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 25px;
}

.lead-filter-heading > div {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--crm-brand-navy-deep);
  font-size: var(--crm-font-sm);
  font-weight: 700;
}

.lead-filter-heading-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 25px;
  height: 25px;
  border-radius: 7px;
  background: var(--crm-brand-blue-soft);
  color: var(--crm-brand-blue);
  font-size: .75rem;
}

.lead-filter-auto-note {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--crm-muted);
  font-size: var(--crm-font-xs);
  font-weight: 500;
}

.lead-filter-auto-note .bi {
  color: var(--crm-brand-orange);
}

.lead-filter-grid {
  display: grid;
  grid-template-columns: minmax(250px, 1.35fr) repeat(4, minmax(145px, .8fr));
  align-items: end;
  gap: 9px;
}

.lead-filter-field {
  min-width: 0;
}

.lead-filter-field .form-label {
  min-height: auto;
  margin-bottom: 5px;
  color: #526175;
  font-size: var(--crm-font-xs);
  font-weight: 650;
}

.lead-filter-field .form-control,
.lead-filter-field .form-select {
  min-height: 39px;
  border-color: #d4dde7;
  border-radius: 8px;
  background-color: #fff;
  color: var(--crm-text);
  font-size: var(--crm-font-sm);
}

.lead-filter-field .form-control:focus,
.lead-filter-field .form-select:focus {
  border-color: rgba(13, 76, 143, .58);
  box-shadow: 0 0 0 .18rem rgba(13, 76, 143, .09);
}

.lead-filter-search-control {
  position: relative;
}

.lead-filter-search-control > .bi-search {
  position: absolute;
  top: 50%;
  left: 12px;
  z-index: 2;
  color: #8290a3;
  font-size: .85rem;
  transform: translateY(-50%);
  pointer-events: none;
}

.lead-filter-search-control .form-control {
  padding-right: 38px;
  padding-left: 36px;
}

.lead-filter-clear {
  position: absolute;
  top: 50%;
  right: 7px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 27px;
  height: 27px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #7d8999;
  font-size: .7rem;
  transform: translateY(-50%);
}

.lead-filter-clear:hover,
.lead-filter-clear:focus-visible {
  background: #edf2f7;
  color: var(--crm-brand-navy);
}

.lead-filter-clear[hidden] {
  display: none;
}

@media (max-width: 1199.98px) {
  .lead-filter-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .lead-filter-field--search {
    grid-column: 1 / -1;
  }
}

@media (max-width: 767.98px) {
  .lead-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lead-filter-auto-note {
    display: none;
  }
}

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

  .lead-filter-field--search {
    grid-column: auto;
  }
}
/* Lead list and Kanban views */
.lead-workspace-header {
  gap: 12px;
}

.lead-workspace-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
}

.lead-workspace-actions > .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.lead-view-switch {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--crm-border);
  border-radius: 9px;
  background: #f5f7fa;
}

.lead-view-switch-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 31px;
  padding: 6px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--crm-muted);
  font-family: "Montserrat", "Segoe UI", Arial, sans-serif;
  font-size: var(--crm-font-xs);
  font-weight: 600;
  line-height: 1;
}

.lead-view-switch-button:hover {
  color: var(--crm-brand-navy);
}

.lead-view-switch-button.active {
  background: #fff;
  color: var(--crm-brand-navy);
  box-shadow: 0 1px 4px rgba(8, 45, 93, .14);
}

.lead-view-switch-button.active .bi {
  color: var(--crm-brand-orange);
}

.lead-view-panel[hidden] {
  display: none !important;
}

.lead-kanban-scroll {
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  padding: 2px 2px 9px;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}

.lead-kanban-scroll:hover,
.lead-kanban-scroll:focus {
  scrollbar-color: rgba(13, 76, 143, .48) transparent;
}

.lead-kanban-scroll::-webkit-scrollbar {
  height: 7px;
}

.lead-kanban-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.lead-kanban-scroll::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: transparent;
}

.lead-kanban-scroll:hover::-webkit-scrollbar-thumb,
.lead-kanban-scroll:focus::-webkit-scrollbar-thumb {
  background: rgba(13, 76, 143, .48);
}

.lead-kanban-board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 252px;
  align-items: start;
  gap: 11px;
  width: max-content;
  min-width: 100%;
}

.lead-kanban-column {
  position: relative;
  overflow: hidden;
  min-height: 350px;
  border: 1px solid var(--crm-border);
  border-radius: 10px;
  background: #f6f8fb;
}

.lead-kanban-column::before {
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--crm-status-neutral);
  content: "";
}

.lead-kanban-column--info::before { background: var(--crm-status-info); }
.lead-kanban-column--warning::before { background: var(--crm-status-warning); }
.lead-kanban-column--positive::before { background: var(--crm-status-positive); }
.lead-kanban-column--critical::before { background: var(--crm-status-critical); }

.lead-kanban-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 13px 12px 10px;
}

.lead-kanban-column-title {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: var(--crm-brand-navy-deep);
  font-size: var(--crm-font-sm);
  font-weight: 700;
}

.lead-kanban-column-title .bi {
  color: var(--crm-brand-blue);
  font-size: .9rem;
}

.lead-kanban-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding-inline: 6px;
  border: 1px solid var(--crm-border);
  border-radius: 999px;
  background: #fff;
  color: var(--crm-muted);
  font-size: .68rem;
  font-weight: 700;
}

.lead-kanban-column-body {
  display: grid;
  align-content: start;
  gap: 9px;
  padding: 0 9px 10px;
}

.lead-kanban-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #dfe6ef;
  border-radius: 9px;
  background: #fff;
  color: var(--crm-text);
  box-shadow: 0 3px 10px rgba(8, 45, 93, .04);
  text-decoration: none;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.lead-kanban-card:hover {
  border-color: rgba(13, 76, 143, .38);
  color: var(--crm-text);
  box-shadow: 0 7px 18px rgba(8, 45, 93, .09);
  transform: translateY(-1px);
}

.lead-kanban-card.selected {
  border-color: var(--crm-brand-blue);
  box-shadow: inset 3px 0 0 var(--crm-brand-orange), 0 5px 14px rgba(8, 45, 93, .08);
}

.lead-kanban-card-topline,
.lead-kanban-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.lead-kanban-number {
  color: var(--crm-brand-blue);
  font-size: .7rem;
  font-weight: 700;
}

.lead-kanban-customer {
  overflow: hidden;
  color: var(--crm-brand-navy-deep);
  font-size: var(--crm-font-sm);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-kanban-title {
  display: -webkit-box;
  overflow: hidden;
  color: var(--crm-muted);
  font-size: var(--crm-font-xs);
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.lead-kanban-destination {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  color: #43526a;
  font-size: var(--crm-font-xs);
}

.lead-kanban-destination span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-kanban-destination .bi {
  color: var(--crm-brand-orange);
}

.lead-kanban-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.lead-kanban-tags span {
  padding: 4px 7px;
  border-radius: 999px;
  background: #eef2f6;
  color: #526175;
  font-size: .62rem;
  font-weight: 600;
}

.lead-kanban-card-footer {
  align-items: flex-start;
  padding-top: 8px;
  border-top: 1px solid #edf1f5;
  color: var(--crm-muted);
}

.lead-kanban-card-footer span {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
  font-size: .62rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-kanban-card-footer span:last-child {
  justify-content: flex-end;
}

.lead-kanban-column-empty,
.lead-kanban-empty {
  display: grid;
  place-items: center;
  min-height: 92px;
  border: 1px dashed #d6dee8;
  border-radius: 8px;
  color: #93a0b1;
  font-size: var(--crm-font-xs);
}

.lead-kanban-empty {
  gap: 5px;
  min-height: 270px;
  background: #fafbfd;
  text-align: center;
}

.lead-kanban-empty .bi {
  color: var(--crm-brand-blue);
  font-size: 1.4rem;
}

.lead-kanban-empty strong {
  color: var(--crm-text);
  font-size: var(--crm-font-sm);
}

.lead-kanban-page-note {
  margin-top: 8px;
  color: var(--crm-muted);
  font-size: .68rem;
  text-align: right;
}

@media (max-width: 575.98px) {
  .lead-workspace-header {
    align-items: flex-start;
  }

  .lead-workspace-actions {
    width: 100%;
    justify-content: space-between;
  }

  .lead-kanban-board {
    grid-auto-columns: min(82vw, 270px);
  }
}

/* Refined lead Kanban */
.lead-kanban-scroll {
  padding: 3px 2px 10px;
  scroll-snap-type: x proximity;
}

.lead-kanban-board {
  grid-auto-columns: 292px;
  gap: 12px;
}

.lead-kanban-column {
  display: flex;
  overflow: hidden;
  height: clamp(460px, 61vh, 640px);
  min-height: 0;
  flex-direction: column;
  scroll-snap-align: start;
  border-color: #dfe5ed;
  border-radius: 11px;
  background: #f7f9fc;
  box-shadow: 0 3px 12px rgba(4, 26, 56, .035);
}

.lead-kanban-column::before {
  height: 3px;
}

.lead-kanban-column-header {
  display: block;
  flex: 0 0 auto;
  padding: 13px 13px 11px;
  border-bottom: 1px solid #e5eaf0;
  background: rgba(255, 255, 255, .88);
}

.lead-kanban-column-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.lead-kanban-column-title {
  gap: 8px;
  font-size: var(--crm-font-sm);
}

.lead-kanban-column-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
  border-radius: 7px;
  background: var(--crm-status-neutral-bg);
  color: var(--crm-status-neutral);
}

.lead-kanban-column-title .lead-kanban-column-icon .bi {
  color: inherit;
  font-size: .8rem;
}

.lead-kanban-column--info .lead-kanban-column-icon {
  background: var(--crm-status-info-bg);
  color: var(--crm-status-info);
}

.lead-kanban-column--warning .lead-kanban-column-icon {
  background: var(--crm-status-warning-bg);
  color: var(--crm-status-warning);
}

.lead-kanban-column--positive .lead-kanban-column-icon {
  background: var(--crm-status-positive-bg);
  color: var(--crm-status-positive);
}

.lead-kanban-column--critical .lead-kanban-column-icon {
  background: var(--crm-status-critical-bg);
  color: var(--crm-status-critical);
}

.lead-kanban-count {
  min-width: 25px;
  height: 25px;
  border: 0;
  background: #edf2f7;
  color: #43526a;
  font-size: var(--crm-font-xs);
}

.lead-kanban-column-metrics {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 9px;
  color: var(--crm-muted);
  font-size: var(--crm-font-xs);
}

.lead-kanban-column-metrics strong {
  color: var(--crm-brand-navy-deep);
  font-size: var(--crm-font-xs);
  font-weight: 700;
}

.lead-kanban-column-body {
  display: grid;
  flex: 1 1 auto;
  align-content: start;
  gap: 9px;
  min-height: 0;
  padding: 10px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}

.lead-kanban-column-body:hover,
.lead-kanban-column-body:focus-within {
  scrollbar-color: rgba(13, 76, 143, .38) transparent;
}

.lead-kanban-column-body::-webkit-scrollbar {
  width: 6px;
}

.lead-kanban-column-body::-webkit-scrollbar-track {
  background: transparent;
}

.lead-kanban-column-body::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: transparent;
}

.lead-kanban-column-body:hover::-webkit-scrollbar-thumb,
.lead-kanban-column-body:focus-within::-webkit-scrollbar-thumb {
  background: rgba(13, 76, 143, .38);
}

.lead-kanban-card {
  gap: 8px;
  padding: 11px;
  border-color: #e0e6ee;
  border-radius: 9px;
  box-shadow: 0 2px 7px rgba(4, 26, 56, .035);
}

.lead-kanban-card:hover {
  border-color: rgba(13, 76, 143, .35);
  box-shadow: 0 7px 16px rgba(4, 26, 56, .08);
}

.lead-kanban-card.selected {
  border-color: var(--crm-brand-blue);
  box-shadow: inset 3px 0 0 var(--crm-brand-orange), 0 6px 14px rgba(8, 45, 93, .09);
}

.lead-kanban-card-identity {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.lead-kanban-card-identity > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.lead-kanban-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 50%;
  background: var(--crm-status-neutral-bg);
  color: var(--crm-status-neutral);
  font-size: var(--crm-font-xs);
  font-weight: 700;
}

.lead-kanban-column--info .lead-kanban-avatar {
  background: var(--crm-status-info-bg);
  color: var(--crm-status-info);
}

.lead-kanban-column--warning .lead-kanban-avatar {
  background: var(--crm-status-warning-bg);
  color: var(--crm-status-warning);
}

.lead-kanban-column--positive .lead-kanban-avatar {
  background: var(--crm-status-positive-bg);
  color: var(--crm-status-positive);
}

.lead-kanban-column--critical .lead-kanban-avatar {
  background: var(--crm-status-critical-bg);
  color: var(--crm-status-critical);
}

.lead-kanban-customer {
  font-size: var(--crm-font-sm);
  line-height: 1.3;
}

.lead-kanban-number {
  color: var(--crm-brand-blue);
  font-size: var(--crm-font-xs);
  line-height: 1.25;
}

.lead-kanban-title {
  min-height: 34px;
  font-size: var(--crm-font-xs);
  line-height: 1.45;
}

.lead-kanban-destination {
  font-size: var(--crm-font-xs);
}

.lead-kanban-tags span {
  padding: 3px 7px;
  border: 1px solid #e2e7ed;
  background: #f7f9fb;
  font-size: .6875rem;
}

.lead-kanban-card-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

.lead-kanban-card-footer span {
  font-size: .6875rem;
}

.lead-kanban-value-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid #edf1f5;
  color: var(--crm-muted);
  font-size: var(--crm-font-xs);
}

.lead-kanban-value-row span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.lead-kanban-value-row .bi {
  color: var(--crm-brand-orange);
}

.lead-kanban-value-row strong {
  color: var(--crm-brand-navy-deep);
  font-size: var(--crm-font-xs);
  font-weight: 700;
}

.lead-kanban-column-empty {
  display: flex;
  min-height: 110px;
  flex-direction: column;
  gap: 6px;
  text-align: center;
}

.lead-kanban-column-empty .bi {
  color: #a1adbc;
  font-size: 1rem;
}

.lead-kanban-column-footer {
  flex: 0 0 auto;
  padding: 8px 10px 10px;
  border-top: 1px solid #e5eaf0;
  background: rgba(255, 255, 255, .72);
}

.lead-kanban-column-footer a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  border: 1px dashed #cbd6e3;
  border-radius: 7px;
  color: var(--crm-brand-blue);
  font-size: var(--crm-font-xs);
  font-weight: 650;
  text-decoration: none;
}

.lead-kanban-column-footer a:hover {
  border-color: var(--crm-brand-blue);
  background: var(--crm-brand-blue-soft);
}

.lead-kanban-page-note {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  font-size: var(--crm-font-xs);
}

@media (max-width: 575.98px) {
  .lead-kanban-board {
    grid-auto-columns: min(88vw, 300px);
  }

  .lead-kanban-column {
    height: min(620px, 68vh);
  }
}
/* Lead details slide-over drawer */
body.lead-drawer-open {
  overflow: hidden;
}

.lead-detail-drawer-backdrop {
  position: fixed;
  inset: 68px 0 0;
  z-index: 1024;
  background: rgba(4, 26, 56, .28);
  opacity: 0;
  backdrop-filter: blur(1px);
  transition: opacity .14s ease-out;
}

.lead-detail-drawer-backdrop.is-visible {
  opacity: 1;
}

.lead-detail-drawer {
  position: fixed;
  top: 68px;
  right: 0;
  bottom: 0;
  z-index: 1028;
  width: min(984px, calc(100vw - 32px));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #fff;
  box-shadow: -18px 0 45px rgba(4, 26, 56, .18);
  transform: translate3d(101%, 0, 0);
  visibility: hidden;
  will-change: transform;
  transition: transform .16s cubic-bezier(.22, 1, .36, 1), visibility 0s linear .16s;
}

.lead-detail-drawer.is-open {
  transform: translate3d(0, 0, 0);
  visibility: visible;
  transition: transform .16s cubic-bezier(.22, 1, .36, 1);
}

.lead-detail-drawer > .dashboard-section-card {
  min-height: 100%;
  border: 0;
  border-left: 1px solid var(--crm-border);
  border-radius: 0;
  box-shadow: none;
}

.lead-detail-drawer-header {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(255, 255, 255, .97);
  box-shadow: 0 5px 14px rgba(4, 26, 56, .05);
  backdrop-filter: blur(10px);
}

.lead-detail-drawer-header-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.lead-detail-drawer-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  padding: 0;
  border: 1px solid var(--crm-border);
  border-radius: 8px;
  background: #fff;
  color: #526175;
  font-size: .8rem;
  transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}

.lead-detail-drawer-close:hover {
  border-color: rgba(13, 76, 143, .35);
  background: var(--crm-brand-blue-soft);
  color: var(--crm-brand-navy);
}

.lead-detail-drawer > .dashboard-section-card {
  display: flex;
  flex-direction: column;
  background: #f5f7fa;
}

.lead-detail-drawer-header {
  align-items: flex-start;
  min-height: 0;
  padding: 18px 20px;
  border-top: 3px solid var(--crm-brand-orange);
  border-bottom-color: #e4e9f0;
}

.lead-detail-identity {
  min-width: 0;
}

.lead-detail-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 7px;
  color: var(--crm-brand-blue);
  font-size: var(--crm-font-xs);
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.lead-detail-eyebrow .bi {
  color: var(--crm-brand-orange);
  font-size: .82rem;
}

.lead-detail-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
}

.lead-detail-title-row .dashboard-section-title {
  color: var(--crm-brand-navy-deep);
  font-size: var(--crm-font-lg);
  line-height: 1.2;
}

.lead-detail-customer {
  margin-top: 5px;
  overflow: hidden;
  color: var(--crm-text);
  font-size: var(--crm-font-body);
  font-weight: 650;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-detail-subject {
  margin-top: 2px;
  overflow: hidden;
  color: var(--crm-muted);
  font-size: var(--crm-font-xs);
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-detail-drawer-body {
  display: grid;
  flex: 1 1 auto;
  align-content: start;
  gap: 14px;
  padding: 18px;
  background: #f5f7fa;
  font-size: var(--crm-font-sm);
}

.lead-detail-quick-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.lead-detail-quick-actions .btn,
.lead-detail-primary-form .btn,
.lead-detail-analysis-action .btn,
.lead-detail-form .btn,
.lead-detail-complete-form .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 8px;
  font-size: var(--crm-font-xs);
  font-weight: 650;
}

.lead-detail-quick-actions .btn {
  min-height: 40px;
  padding-inline: 8px;
  background: #fff;
}

.lead-detail-quick-actions .btn-primary {
  background: var(--crm-brand-blue);
}

.lead-detail-primary-form {
  margin: 0;
}

.lead-detail-primary-form .btn {
  min-height: 44px;
  border-color: var(--crm-brand-blue);
  background: linear-gradient(90deg, var(--crm-brand-navy), var(--crm-brand-blue));
  box-shadow: inset 0 -2px 0 var(--crm-brand-orange), 0 7px 18px rgba(13, 76, 143, .12);
  font-size: var(--crm-font-sm);
}

.lead-detail-card {
  padding: 16px;
  border: 1px solid #dfe5ed;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 3px 12px rgba(4, 26, 56, .035);
}

.lead-detail-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.lead-detail-section-heading--compact {
  align-items: center;
  margin-bottom: 12px;
}

.lead-detail-section-heading-copy {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.lead-detail-section-heading--compact .lead-detail-section-heading-copy {
  align-items: center;
}

.lead-detail-section-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 8px;
  background: var(--crm-brand-blue-soft);
  color: var(--crm-brand-blue);
  font-size: .9rem;
}

.lead-detail-section-icon--orange {
  background: var(--crm-brand-orange-soft);
  color: var(--crm-brand-orange);
}

.lead-detail-section-icon--danger {
  background: var(--crm-status-critical-bg);
  color: var(--crm-status-critical);
}

.lead-detail-section-heading h3 {
  margin: 1px 0 0;
  color: var(--crm-brand-navy-deep);
  font-size: var(--crm-font-body);
  font-weight: 700;
  line-height: 1.35;
}

.lead-detail-section-heading p {
  margin: 3px 0 0;
  color: var(--crm-muted);
  font-size: var(--crm-font-xs);
  line-height: 1.45;
}

.lead-detail-analysis-action {
  margin-bottom: 12px;
}

.lead-detail-analysis-action .btn {
  min-height: 38px;
}

.lead-detail-analysis-grid,
.lead-detail-summary-grid {
  margin: 0;
}

.lead-detail-analysis-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.lead-detail-analysis-grid > div {
  padding: 10px;
  border-radius: 8px;
  background: #f6f8fb;
}

.lead-detail-analysis-grid dt,
.lead-detail-summary-grid dt {
  margin: 0 0 5px;
  color: var(--crm-muted);
  font-size: var(--crm-font-xs);
  font-weight: 600;
  line-height: 1.25;
}

.lead-detail-analysis-grid dd,
.lead-detail-summary-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--crm-text);
  font-size: var(--crm-font-sm);
  font-weight: 650;
  line-height: 1.4;
}

.lead-detail-alert {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px 11px;
  border-radius: 8px;
  font-size: var(--crm-font-xs);
  line-height: 1.45;
}

.lead-detail-alert .bi {
  margin-top: 2px;
}

.lead-detail-tabs {
  overflow-x: auto;
  scrollbar-width: none;
}

.lead-detail-tabs::-webkit-scrollbar {
  display: none;
}

.lead-detail-tabs .nav-tabs {
  flex-wrap: nowrap;
  min-width: max-content;
  padding: 4px;
  border: 1px solid #dfe5ed;
  border-radius: 10px;
  background: #fff;
}

.lead-detail-tabs .nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border: 0;
  border-radius: 7px;
  color: var(--crm-muted);
  font-size: var(--crm-font-xs);
  font-weight: 600;
  white-space: nowrap;
}

.lead-detail-tabs .nav-link:hover {
  color: var(--crm-brand-blue);
}

.lead-detail-tabs .nav-link.active {
  background: var(--crm-brand-blue-soft);
  color: var(--crm-brand-navy);
}

.lead-detail-tabs .nav-link.active .bi {
  color: var(--crm-brand-orange);
}

.lead-detail-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.lead-detail-summary-grid > div {
  min-width: 0;
  padding: 11px;
  border: 1px solid #e7ebf1;
  border-radius: 8px;
  background: #fafbfd;
}

.lead-detail-summary-grid dt {
  display: flex;
  align-items: center;
  gap: 6px;
}

.lead-detail-summary-grid dt .bi {
  color: var(--crm-brand-orange);
}

.lead-detail-form .form-label {
  min-height: auto;
  margin-bottom: 5px;
  font-size: var(--crm-font-xs);
}

.lead-detail-form .form-control,
.lead-detail-form .form-select,
.lead-detail-complete-form .form-control {
  min-height: 36px;
  border-color: #d8e0e9;
  border-radius: 7px;
  font-size: var(--crm-font-sm);
}

.lead-detail-form .btn {
  min-height: 36px;
  padding-inline: 13px;
}

.lead-detail-timeline {
  display: grid;
}

.lead-detail-timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  padding-bottom: 14px;
}

.lead-detail-timeline-item:last-child {
  padding-bottom: 0;
}

.lead-detail-timeline-item:not(:last-child)::before {
  position: absolute;
  top: 28px;
  bottom: 0;
  left: 13px;
  width: 1px;
  background: #dde4ed;
  content: "";
}

.lead-detail-timeline-marker {
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--crm-status-positive-border);
  border-radius: 50%;
  background: var(--crm-status-positive-bg);
  color: var(--crm-status-positive);
  font-size: .75rem;
}

.lead-detail-timeline-content {
  min-width: 0;
  padding: 2px 0 0;
}

.lead-detail-timeline-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.lead-detail-timeline-heading > div {
  display: grid;
  gap: 2px;
}

.lead-detail-timeline-heading strong {
  color: var(--crm-text);
  font-size: var(--crm-font-sm);
  font-weight: 700;
}

.lead-detail-timeline-heading time {
  color: var(--crm-muted);
  font-size: var(--crm-font-xs);
}

.lead-detail-timeline-content p {
  margin: 6px 0 0;
  color: #526175;
  font-size: var(--crm-font-xs);
  line-height: 1.5;
}

.lead-detail-complete-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 9px;
}

.lead-detail-complete-form .btn {
  min-height: 36px;
}

.lead-detail-quotation-list {
  display: grid;
  gap: 7px;
}

.lead-detail-quotation-list > a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid #e3e8ef;
  border-radius: 8px;
  color: var(--crm-brand-blue);
  background: #fafbfd;
  font-size: var(--crm-font-sm);
  font-weight: 650;
  text-decoration: none;
}

.lead-detail-quotation-list > a:hover {
  border-color: rgba(13, 76, 143, .35);
  background: var(--crm-brand-blue-soft);
}

.lead-detail-quotation-list > a > span:first-child {
  display: flex;
  align-items: center;
  gap: 7px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-detail-quotation-list > a > .bi-chevron-right {
  color: #8793a4;
  font-size: .7rem;
}

.lead-detail-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  border: 1px dashed #d9e0e8;
  border-radius: 8px;
  color: var(--crm-muted);
  background: #fafbfd;
  font-size: var(--crm-font-xs);
}

.lead-detail-empty .bi {
  color: var(--crm-brand-blue);
}

.lead-detail-requirements {
  margin: 0;
  color: #526175;
  font-size: var(--crm-font-sm);
  line-height: 1.6;
  white-space: pre-line;
}

.lead-detail-danger-card {
  border-color: var(--crm-status-critical-border);
  background: #fffafa;
}

.lead-detail-tab-panel {
  display: grid;
  gap: 14px;
  min-width: 0;
  animation: lead-detail-tab-reveal .16s ease-out;
}

.lead-detail-tab-panel[hidden] {
  display: none !important;
}

.lead-detail-activity-list {
  display: grid;
}

.lead-detail-activity-list article {
  position: relative;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 10px;
  padding-bottom: 15px;
}

.lead-detail-activity-list article:last-child {
  padding-bottom: 0;
}

.lead-detail-activity-list article:not(:last-child)::before {
  position: absolute;
  top: 32px;
  bottom: 0;
  left: 15px;
  width: 1px;
  background: #dde4ed;
  content: "";
}

.lead-detail-activity-icon {
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--crm-status-info-border);
  border-radius: 50%;
  background: var(--crm-status-info-bg);
  color: var(--crm-status-info);
  font-size: var(--crm-font-xs);
}

.lead-detail-activity-list article > div {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding-top: 2px;
}

.lead-detail-activity-list strong {
  color: var(--crm-text);
  font-size: var(--crm-font-sm);
  font-weight: 700;
}

.lead-detail-activity-list time,
.lead-detail-activity-list p {
  margin: 0;
  color: var(--crm-muted);
  font-size: var(--crm-font-xs);
  line-height: 1.45;
}

@keyframes lead-detail-tab-reveal {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}
.lead-detail-loading-body {
  position: relative;
  overflow: hidden;
}

.lead-detail-loading-progress {
  position: relative;
  overflow: hidden;
  height: 3px;
  border-radius: 999px;
  background: #e1e8f0;
}

.lead-detail-loading-progress span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 36%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--crm-brand-orange), var(--crm-brand-blue));
  animation: lead-detail-loading-progress 1s cubic-bezier(.4, 0, .2, 1) infinite;
}

.lead-detail-loading-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid #dfe5ed;
  border-radius: 12px;
  background: #fff;
}

.lead-detail-loading-line,
.lead-detail-loading-grid span {
  display: block;
  overflow: hidden;
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(100deg, #edf1f5 20%, #f8fafc 42%, #edf1f5 64%);
  background-size: 240% 100%;
  animation: lead-detail-loading-shimmer 1.15s ease-in-out infinite;
}

.lead-detail-loading-line--short {
  width: 38%;
}

.lead-detail-loading-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.lead-detail-loading-grid span {
  height: 86px;
  border-radius: 10px;
}

@keyframes lead-detail-loading-progress {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(310%); }
}

@keyframes lead-detail-loading-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
@media (max-width: 767.98px) {
  .lead-detail-drawer-header {
    padding: 15px 16px;
  }

  .lead-detail-drawer-body {
    gap: 12px;
    padding: 14px;
  }

  .lead-detail-card {
    padding: 14px;
  }

  .lead-detail-quick-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lead-detail-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lead-detail-analysis-grid {
    grid-template-columns: repeat(3, minmax(92px, 1fr));
    overflow-x: auto;
  }
}

@media (max-width: 420px) {
  .lead-detail-summary-grid {
    grid-template-columns: 1fr;
  }

  .lead-detail-complete-form {
    grid-template-columns: 1fr;
  }

  .lead-detail-complete-form .btn {
    justify-self: end;
  }
}
@media (max-width: 767.98px) {
  .lead-detail-drawer-backdrop {
    inset: 0;
    z-index: 1042;
  }

  .lead-detail-drawer {
    top: 0;
    z-index: 1045;
    width: 100vw;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lead-detail-loading-progress span,
  .lead-detail-loading-line,
  .lead-detail-loading-grid span {
    animation: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .lead-detail-drawer,
  .lead-detail-drawer-backdrop {
    transition: none;
  }
}
