.company-record-header {
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}
.company-record-breadcrumb {
    gap: 8px;
    font-size: 13px;
    line-height: 1.4;
 display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    color: var(--text-muted);
}
.company-record-breadcrumb a {
    font-weight: 700;
    color: var(--brand);
    text-decoration: none;
}


/* =========================================================
   CRM THREE COLUMN CONTACT LAYOUT
   ========================================================= */

.crm-contact-layout {
  width: 100%;
  height: calc(100vh - var(--header-h));
  min-height: 0;
  padding: 14px;
  background: var(--bg);
  overflow: hidden;
}

.crm-contact-layout__row {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  width: 100%;
  height: 100%;
  min-height: 0;
  --crm-gutter-x: 14px;
  --crm-gutter-y: 0;
}

/* Desktop: exactly 3 / 6 / 3 columns */
.crm-contact-layout__left {
  flex: 0 0 25%;
  max-width: 25%;
}

.crm-contact-layout__center {
  flex: 0 0 50%;
  max-width: 50%;
}

.crm-contact-layout__right {
  flex: 0 0 25%;
  max-width: 25%;
}

/* Utility classes are the source of the column widths.
   The rules above only keep the three panels in one row. */

.crm-contact-layout__left,
.crm-contact-layout__center,
.crm-contact-layout__right {
  position: relative;
  min-width: 0;
  min-height: 0;
}

/* =========================================================
   LEFT PANEL
   ========================================================= */

.crm-contact-layout__left {
  height: 100%;

  overflow-x: hidden;
  overflow-y: auto;

  scrollbar-width: thin;
  border-radius: var(--radius-lg);
  scrollbar-color: var(--border-strong) transparent;
}

/* =========================================================
   LEFT STICKY CONTACT HEADER
   ========================================================= */

.crm-left-sticky-contact {
  position: sticky;
  top: 0;

  z-index: 8;

  width: 100%;

  margin-bottom: -108px;

  padding: 15px 14px;

  background: var(--surface);

  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);

  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);

  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  transform: translateY(-100%);

  height: 108px;
  max-height: 108px;

  overflow: hidden;

  transition:
    opacity 0.18s ease,
    transform 0.18s ease,
    visibility 0.18s ease;
}

.crm-left-sticky-contact.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;

  transform: translateY(0);
}

.crm-left-sticky-contact__top {
  display: flex;
  align-items: center;

  min-height: 30px;

  gap: 8px;
}

.crm-left-sticky-contact__back,
.crm-left-sticky-contact__actions {
  display: inline-flex;
  align-items: center;

  border: 0;

  background: transparent;

  color: var(--text);

  padding: 0;

  cursor: pointer;
}

.crm-left-sticky-contact__back {
  width: 20px;
  height: 20px;

  justify-content: center;

  flex: 0 0 20px;
}

.crm-left-sticky-contact__back svg {
  width: 18px;
  height: 18px;

  fill: none;
  stroke: var(--text-muted);

  stroke-width: 1.8;

  stroke-linecap: round;
  stroke-linejoin: round;
}

.crm-left-sticky-contact__title {
  margin-right: auto;

  color: var(--text);

  font-size: 16px;
  font-weight: 700;

  line-height: 1;
}

.crm-left-sticky-contact__actions {
  gap: 4px;

  font-size: 14px;
  font-weight: 700;

  line-height: 1;
}

.crm-left-sticky-contact__actions svg {
  width: 14px;
  height: 14px;

  fill: none;
  stroke: currentColor;

  stroke-width: 2;

  stroke-linecap: round;
  stroke-linejoin: round;
}

.crm-left-sticky-contact__person {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-top: 8px;
}

.crm-left-sticky-contact__avatar {
  position: relative;

  width: 28px;
  height: 28px;

  flex: 0 0 28px;
}

.crm-left-sticky-contact__avatar span {
  position: absolute;

  width: 7px;
  height: 7px;

  background: #29a9ed;

  transform: rotate(45deg);
}

.crm-left-sticky-contact__avatar span:nth-child(1) {
  left: 16px;
  top: 6px;
}

.crm-left-sticky-contact__avatar span:nth-child(2) {
  left: 10px;
  top: 12px;
}

.crm-left-sticky-contact__avatar span:nth-child(3) {
  right: 5px;
  top: 18px;
}

.crm-left-sticky-contact__avatar span:nth-child(4) {
  left: 22px;
  bottom: 9px;
}

.crm-left-sticky-contact__name {
  color: var(--text);

  font-size: 16px;
  font-weight: 700;

  line-height: 1.2;
}

/* =========================================================
   CENTER PANEL
   ========================================================= */

.crm-contact-layout__center {
  height: 100%;

  min-width: 0;
  min-height: 0;

  overflow: hidden;
}

/* =========================================================
   RIGHT PANEL
   ========================================================= */

.crm-contact-layout__right {
  height: 100%;

  min-width: 0;

  overflow-x: hidden;
  overflow-y: auto;

  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;

  transition:
    opacity 0.2s ease,
    transform 0.28s ease;
}

/* =========================================================
   COMMON PANEL
   ========================================================= */

.crm-panel {
  display: flex;
  flex-direction: column;

  gap: 12px;

  min-width: 0;
}

/* =========================================================
   CENTER
   ========================================================= */

.crm-center-panel {
  display: flex;
  flex-direction: column;

  width: 100%;
  height: 100%;

  min-height: 0;

  background: var(--surface);

  border: 1px solid var(--border);

  border-radius: var(--radius-lg);

  box-shadow: var(--shadow-sm);

  overflow: hidden;
}

/* =========================================================
   CENTER TABS
   ========================================================= */

.crm-center-tabs {
  display: flex;
  align-items: stretch;

  flex: 0 0 60px;

  border-bottom: 1px solid var(--border);

  overflow-x: auto;

  scrollbar-width: none;
}

.crm-center-tabs::-webkit-scrollbar {
  display: none;
}

.crm-center-tab {
  position: relative;

  flex: 1 0 auto;

  min-width: 145px;

  padding: 0 24px;

  border: 0;
  border-right: 1px solid var(--border);

  background: var(--surface);

  color: var(--text-muted);

  font-size: 15px;
  font-weight: 500;

  white-space: nowrap;

  cursor: pointer;

  transition:
    color 0.18s ease,
    background-color 0.18s ease;
}

.crm-center-tab:hover {
  background: var(--surface-2);

  color: var(--text);
}

.crm-center-tab.is-active {
  color: var(--text);

  font-weight: 650;
}

.crm-center-tab.is-active::after {
  content: "";

  position: absolute;

  left: 0;
  right: 0;
  bottom: 0;

  height: 3px;

  background: var(--brand);
}

/* =========================================================
   CENTER CONTENT
   ========================================================= */

.crm-center-content {
  flex: 1;

  min-height: 0;

  padding: 20px;

  overflow-y: auto;

  background: var(--bg);

  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

/* =========================================================
   EMPTY CARDS
   ========================================================= */

.crm-empty-card {
  flex: none;

  width: 100%;

  padding: 14px;

  background: var(--surface);

  border: 1px solid var(--border);

  border-radius: var(--radius-lg);

  box-shadow: var(--shadow-sm);
}

.crm-empty-card--profile {
  min-height: 230px;
}

.crm-empty-card--large {
  min-height: 250px;
}

.crm-empty-card--playbook {
  min-height: 230px;
}

/* =========================================================
   CARD HEADER
   ========================================================= */

.crm-empty-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 15px;

  margin-bottom: 18px;
}

/* =========================================================
   PROFILE
   ========================================================= */

.crm-empty-profile {
  display: flex;
  align-items: center;

  gap: 14px;

  margin-bottom: 22px;
}

.crm-empty-profile__lines {
  flex: 1;

  min-width: 0;
}

/* =========================================================
   COMPANY
   ========================================================= */

.crm-empty-company {
  display: flex;
  align-items: center;

  gap: 13px;
}

/* =========================================================
   ACTIONS
   ========================================================= */

.crm-empty-actions {
  display: grid;

  grid-template-columns: repeat(5, minmax(0, 1fr));

  gap: 7px;
}

/* =========================================================
   EMPTY CONTENT
   ========================================================= */

.crm-empty-content {
  display: flex;
  flex-direction: column;

  gap: 13px;
}

/* =========================================================
   SKELETON
   ========================================================= */

.crm-skeleton {
  display: block;

  height: 10px;

  border-radius: 5px;

  background: linear-gradient(
    90deg,
    var(--surface-3),
    var(--surface-hover),
    var(--surface-3)
  );

  background-size: 200% 100%;

  animation: crmSkeleton 2s ease-in-out infinite;
}

@keyframes crmSkeleton {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* =========================================================
   SKELETON SIZES
   ========================================================= */

.crm-skeleton--sm {
  width: 100px;
}

.crm-skeleton--title {
  width: 120px;
  height: 15px;
}

.crm-skeleton--name {
  width: 175px;
  height: 18px;

  margin-bottom: 9px;
}

.crm-skeleton--line {
  width: 100%;
  max-width: 210px;
}

.crm-skeleton--short {
  max-width: 135px;
}

.crm-skeleton--medium {
  max-width: 60%;
}

.crm-skeleton--avatar {
  width: 58px;
  height: 58px;

  flex: 0 0 58px;

  border-radius: 50%;
}

.crm-skeleton--company-logo {
  width: 50px;
  height: 50px;

  flex: 0 0 50px;

  border-radius: 9px;
}

.crm-skeleton--action {
  width: 42px;
  height: 11px;
}

.crm-skeleton--action-box {
  width: 100%;
  height: 42px;

  border-radius: 8px;
}

.crm-skeleton--label {
  width: 75px;
  height: 8px;

  margin-top: 4px;
}

.crm-skeleton--button {
  width: 115px;
  height: 34px;

  margin: 22px auto 0;

  border-radius: 18px;
}

.crm-skeleton--main-title {
  width: 160px;
  height: 17px;

  margin-bottom: 25px;
}

.crm-skeleton--main-line {
  width: 100%;
  height: 12px;

  margin-bottom: 15px;
}

/* =========================================================
   CENTER ACTIVITY VIEW
   ========================================================= */

.crm-activity-tabs {
  display: flex;
  align-items: stretch;
  flex: 0 0 60px;
  padding: 0 6px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  overflow-x: auto;
  scrollbar-width: none;
}

.crm-activity-tabs::-webkit-scrollbar {
  display: none;
}

.crm-activity-tab {
  position: relative;
  flex: 0 0 auto;
  min-width: 112px;
  height: 60px;
  padding: 0 14px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.crm-activity-tab:hover {
  color: var(--text);
}

.crm-activity-tab.is-active {
  color: var(--text);
}

.crm-activity-tab.is-active::after {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 0;
  height: 4px;
  border-radius: 0px;
  background: var(--text);
}

.crm-activity-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 16px 24px;
  background: var(--bg);
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.crm-activity-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0 10px;
}

.crm-activity-search {
  position: relative;
  width: 242px;
  flex: 0 0 242px;
}

.crm-activity-search input {
  width: 100%;
  height: 40px;
  padding: 0 42px 0 18px;
  border: 1px solid var(--border-strong);
  border-radius: 22px;
  outline: 0;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 14px;
}

.crm-activity-search input::placeholder {
  color: var(--text-muted);
}

.crm-activity-search input:focus {
  border-color: var(--brand);
  box-shadow: var(--focus-ring);
}

.crm-activity-search svg {
  position: absolute;
  top: 11px;
  right: 16px;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--text-muted);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.crm-activity-expand {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.crm-activity-expand svg {
  width: 14px;display: none;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.crm-activity-filters {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 0 14px;
  overflow-x: auto;
  scrollbar-width: none;
}

.crm-activity-filters::-webkit-scrollbar {
  display: none;
}

.crm-activity-filter,
.crm-activity-clear {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 42px;
  padding: 0 15px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.crm-activity-filter:hover,
.crm-activity-clear:hover {
  background: var(--surface-hover);
}

.crm-activity-filter.is-active {
  background: var(--surface-3);
}

.crm-activity-filter svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.crm-activity-clear {
  margin-left: auto;
}

.crm-activity-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.crm-activity-month {
  padding: 6px 0 8px;
  color: var(--text);
  font-size: 16px;
  font-weight: 500;
}

.crm-activity-card {
    padding: 15px 0px;
    border-bottom: 1px solid var(--border);
    border-radius: 0px;
    background: var(--surface);
    box-shadow: none;
}

.crm-activity-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.crm-activity-card__title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.crm-activity-card__title strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.crm-activity-card__top time {
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
}

.crm-activity-info-icon {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  fill: none;
  stroke: var(--text-muted);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.crm-activity-card__description {
  margin-top: 9px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

.crm-activity-actor {
  color: var(--brand);
  font-weight: 700;
}

.crm-activity-link {
  color: var(--brand);
  font-weight: 700;
  text-decoration: none;
}

.crm-activity-link:hover {
  text-decoration: underline;
}

.crm-activity-empty {
  padding: 50px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

@media (max-width: 991.98px) {
  .crm-activity-card {
    padding-left: 24px;
    padding-right: 24px;
  }

  .crm-activity-card__top {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }
}

@media (max-width: 767.98px) {
  .crm-activity-content {
    padding-left: 10px;
    padding-right: 10px;
  }

  .crm-activity-tabs {
    padding-left: 0;
  }

  .crm-activity-tab {
    min-width: auto;
    padding-left: 12px;
    padding-right: 12px;
    font-size: 13px;
  }

  .crm-activity-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .crm-activity-search {
    width: 100%;
    flex-basis: auto;
  }

  .crm-activity-expand {
    align-self: flex-end;
  }

  .crm-activity-card {
    padding: 16px;
    border-radius: 14px;
  }

  .crm-activity-card__description {
    font-size: 14px;
  }
}

/* =========================================================
   CENTER EMPTY CARDS
   ========================================================= */

.crm-empty-main-card {
  width: 100%;

  min-height: 145px;

  margin-bottom: 14px;

  padding: 24px;

  background: var(--surface);

  border: 1px solid var(--border);

  border-radius: var(--radius-lg);

  box-shadow: var(--shadow-sm);
}

.crm-empty-main-card--large {
  min-height: 280px;
}

/* =========================================================
   ALWAYS VISIBLE COLLAPSE BUTTON
   IMPORTANT:
   It is outside the right panel.
   ========================================================= */

.crm-panel-collapse {
  display: none !important;
  position: absolute;

  top: 52px;

  /*
       The columns are 3 / 6 / 3, so the
       center/right boundary is exactly 75%
       of the layout width. Keep the button
       centered on that boundary.
    */

  left: calc(var(--crm-collapse-left, 75%) - 19px);
  right: auto;

  z-index: 100;

  width: 38px;
  height: 38px;

  display: grid;
  place-items: center;

  padding: 0;

  background: var(--surface);

  color: var(--text-muted);

  border: 1px solid var(--border-strong);

  border-radius: 50%;

  box-shadow: var(--shadow-sm);

  cursor: pointer;

  transition:
    right 0.28s ease,
    background-color 0.18s ease,
    color 0.18s ease,
    transform 0.28s ease;
}

.crm-panel-collapse:hover {
  background: var(--surface-hover);

  color: var(--brand);
}

.crm-panel-collapse svg {
  width: 17px;
  height: 17px;

  fill: none;

  stroke: currentColor;

  stroke-width: 1.7;

  stroke-linecap: round;
  stroke-linejoin: round;
}

/* =========================================================
   COLLAPSED RIGHT PANEL
   ========================================================= */

.crm-contact-layout.is-right-collapsed .crm-contact-layout__left {
  flex: 0 0 25%;
  max-width: 25%;
}

.crm-contact-layout.is-right-collapsed .crm-contact-layout__center {
  flex: 0 0 75%;
  max-width: 75%;
}

/*
   Hide only the right panel.
   The button remains completely independent.
*/

/* Right panel disappears */

.crm-contact-layout.is-right-collapsed .crm-contact-layout__right {
  width: 0;
  min-width: 0;

  opacity: 0;

  overflow: hidden;

  pointer-events: none;
}

/* =========================================================
   COLLAPSE BUTTON
   ========================================================= */

.crm-contact-layout.is-right-collapsed .crm-panel-collapse {
  left: auto;
  right: 3px;

  transform: rotate(180deg);
}

/* =========================================================
   CUSTOM SCROLLBARS
   ========================================================= */

.crm-contact-layout__left::-webkit-scrollbar,
.crm-contact-layout__right::-webkit-scrollbar,
.crm-center-content::-webkit-scrollbar {
  width: 6px;
}

.crm-contact-layout__left::-webkit-scrollbar-track,
.crm-contact-layout__right::-webkit-scrollbar-track,
.crm-center-content::-webkit-scrollbar-track {
  background: transparent;
}

.crm-contact-layout__left::-webkit-scrollbar-thumb,
.crm-contact-layout__right::-webkit-scrollbar-thumb,
.crm-center-content::-webkit-scrollbar-thumb {
  background: var(--border-strong);

  border-radius: 10px;
}

/* =========================================================
   MOBILE
   ========================================================= */

/* =========================================================
   RESPONSIVE COLUMNS
   ========================================================= */

@media (max-width: 1024px) {
  /* Tablet: stack ALL three columns vertically */
  .crm-contact-layout {
    height: auto;
    min-height: calc(100vh - var(--header-h));
    padding: 10px;
    overflow: visible;
  }

  .crm-contact-layout__row {
    flex-wrap: wrap;
    height: auto;
    --crm-gutter-x: 10px;
    --crm-gutter-y: 10px;
  }

  .crm-contact-layout__left,
  .crm-contact-layout__center,
  .crm-contact-layout__right {
    flex: 0 0 100%;
    width: 100%;
    max-width: 100%;
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .crm-center-panel {
    min-height: 500px;
  }

  /* There is no side-by-side right panel on tablet/mobile. */
  .crm-panel-collapse {
    display: none;
  }
}

/* MOBILE CONTACT PROFILE */

@media (max-width: 767.98px) {
  .crm-contact-profile__name {
    font-size: 18px;
  }

  .crm-contact-profile__designation,
  .crm-contact-profile__email a {
    font-size: 14px;
  }

  .crm-contact-profile__permission {
    padding: 18px 20px;
    font-size: 14px;
  }

  .crm-contact-profile__quick-actions {
    padding-left: 10px;
    padding-right: 10px;
  }

  .crm-contact-profile__action-icon {
    width: 36px;
    height: 36px;
  }
}

@media (max-width: 767.98px) {
  .crm-contact-layout {
    padding: 8px;
  }

  .crm-contact-layout__row {
    --crm-gutter-x: 8px;
    --crm-gutter-y: 8px;
  }

  .crm-center-panel {
    min-height: 500px;
  }

  .crm-contact-layout.is-right-collapsed .crm-contact-layout__right {
    display: none;
  }

  .crm-panel-collapse {
    display: none;
  }
}

.crm-sidebar-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* =====================================================
   LEFT CONTACT PROFILE CARD
   ===================================================== */

.crm-contact-profile-card {
  width: 100%;
  flex: none;
}

.crm-contact-profile {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

/* TOP HEADER */

.crm-contact-profile__top {
  min-height: 60px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
}

.crm-contact-profile__section-title {
  margin-left:0px;
  margin-right: auto;
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
}

.crm-contact-profile__back,
.crm-contact-profile__actions {
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.crm-contact-profile__back {
  display: flex;
  align-items: center;
  padding: 0;
}

.crm-contact-profile__back svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--text-muted);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.crm-contact-profile__actions {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  font-size: 14px;
  font-weight: 700;
}

.crm-contact-profile__actions svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* PERMISSION */

.crm-contact-profile__permission {
  margin: 20px 20px 13px;
  padding: 19px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.7;
}

/* CONTACT INFORMATION */

.crm-contact-profile__info {
  padding: 0 20px;
}

.crm-contact-profile__identity {
  display: flex;
  align-items: center;
  gap: 7px;
}

.crm-contact-profile__avatar {
  position: relative;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
}

.crm-contact-profile__avatar span {
  position: absolute;
  width: 8px;
  height: 8px;
  background: #29a9ed;
  transform: rotate(45deg);
}

.crm-contact-profile__avatar span:nth-child(1) {
  left: 16px;
  top: 6px;
}

.crm-contact-profile__avatar span:nth-child(2) {
  left: 9px;
  top: 13px;
}

.crm-contact-profile__avatar span:nth-child(3) {
  right: 7px;
  top: 13px;
}

.crm-contact-profile__avatar span:nth-child(4) {
  left: 16px;
  bottom: 10px;
}

.crm-contact-profile__name {
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
}
.crm-contact-profile__designation {
  margin-top: 7px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.55;
}

.crm-contact-profile__email {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
}

.crm-contact-profile__email a {
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.crm-contact-profile__email button {
  display: flex;
  align-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--brand);
  cursor: pointer;
}

.crm-contact-profile__email svg {
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* QUICK ACTIONS */

.crm-contact-profile__quick-actions {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
  padding: 22px 20px 18px;
}

.crm-contact-profile__quick-actions button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
}

.crm-contact-profile__action-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface-2);
}

.crm-contact-profile__quick-actions
  button:first-child
  .crm-contact-profile__action-icon,
.crm-contact-profile__quick-actions
  button:last-child
  .crm-contact-profile__action-icon {
  background: var(--surface);
  border-color: var(--border);
}

.crm-contact-profile__action-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: var(--text-muted);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.crm-contact-profile__dots {
  display: flex;
  gap: 3px;
}

.crm-contact-profile__dots i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #666;
}

/* =====================================================
   ABOUT THIS CONTACT
   ===================================================== */

.crm-about-contact {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

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

.crm-about-label {
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.4;
}

.crm-about-business-icon {
  display: inline-block;
  margin-right: 4px;
  font-size: 14px;
}

.crm-about-value {
  color: var(--text);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

/* SIMPLE GENERATED CARDS */

.crm-collapsible-card--simple .crm-collapsible-card__body {
  padding-top: 14px;
}

/* NARROW LEFT COLUMN */

@media (max-width: 1200px) {
  .company-quick-actions {width: fit-content;}
  .crm-contact-profile__name {
    font-size: 18px;
  }

  .crm-contact-profile__quick-actions {
    padding-left: 12px;
    padding-right: 12px;
  }

  .crm-contact-profile__action-icon {
    width: 38px;
    height: 38px;
  }
}

/* =====================================================
   CARD
   ===================================================== */

.crm-collapsible-card {
  width: 100%;

  background: var(--surface);

  border: 1px solid var(--border);

  border-radius: var(--radius-lg);

  box-shadow: var(--shadow-sm);

  overflow: hidden;
}

/* =====================================================
   HEADER
   ===================================================== */

.crm-collapsible-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;

  min-height: 58px;

  padding: 0 20px;

  gap: 12px;
}

/* =====================================================
   TITLE TOGGLE
   ===================================================== */

.crm-collapsible-card__toggle {
  display: inline-flex;
  align-items: center;
text-align: left;
  gap: 12px;

  padding: 0;

  border: 0;

  background: transparent;

  color: var(--text);

  font-family: inherit;

  font-size: 14px;
  font-weight: 700;

  line-height: 1;

  cursor: pointer;
}

/* =====================================================
   CHEVRON
   ===================================================== */

.crm-collapsible-card__chevron {
  width: 16px;
  height: 16px;

  flex: 0 0 16px;

  fill: none;

  stroke: var(--text-muted);

  stroke-width: 2;

  stroke-linecap: round;
  stroke-linejoin: round;

  transition: transform 0.2s ease;
}

/* =====================================================
   ACTION
   ===================================================== */

.crm-collapsible-card__action {
  padding: 0;

  border: 0;

  background: transparent;

  color: var(--brand);

  font-family: inherit;

  font-size: 13px;
  font-weight: 500;

  cursor: pointer;
}

.crm-collapsible-card__action:hover {
  color: var(--brand-hover);
}

.crm-collapsible-card__body {
  display: grid;
  grid-template-rows: 1fr;

  overflow: hidden;

  padding: 4px 20px 24px;

  opacity: 1;

  transition:
    grid-template-rows 0.25s ease,
    padding 0.25s ease,
    opacity 0.2s ease;
}

/*
   Inner wrapper is required for smooth collapse
*/

.crm-collapsible-card__body-inner {
  min-height: 0;

  overflow: hidden;
}

/* =====================================================
   COLLAPSED
   ===================================================== */

.crm-collapsible-card.is-collapsed .crm-collapsible-card__body {
  grid-template-rows: 0fr;

  padding-top: 0;
  padding-bottom: 0;

  opacity: 0;
}

/* =====================================================
   CHEVRON
   ===================================================== */

.crm-collapsible-card__chevron {
  transition: transform 0.25s ease;
}

.crm-collapsible-card.is-collapsed .crm-collapsible-card__chevron {
  transform: rotate(-90deg);
}

/* =====================================================
   PLAYBOOK CONTENT
   ===================================================== */

.crm-card-description {
  margin: 0 0 20px;

  color: var(--text);

  font-size: 13px;

  line-height: 1.6;
}

.crm-card-button {
  display: block;

  min-width: 142px;
  height: 40px;

  margin: 0 auto;

  border: 1px solid var(--border);

  border-radius: var(--radius-pill);

  background: var(--surface-2);

  color: var(--text-subtle);

  font-size: 14px;

  cursor: not-allowed;
}

/* =====================================================
   COMPANY CONTENT
   ===================================================== */

.company-card-item {
  display: flex;
  align-items: center;

  gap: 10px;

  padding: 10px;

  border: 1px solid var(--border);

  border-radius: var(--radius);

  background: var(--surface);
}

.company-card-logo {
  width: 40px;
  height: 40px;

  display: grid;
  place-items: center;

  flex: 0 0 40px;

  border-radius: 8px;

  background: var(--brand-soft);

  color: var(--brand);

  font-size: 12px;
  font-weight: 700;
}

.company-card-info {
  flex: 1;

  min-width: 0;
}

.company-card-info a {
  display: block;

  color: var(--brand);

  font-size: 12px;
  font-weight: 700;
}

.company-card-info span {
  display: block;

  margin-top: 3px;

  color: var(--text-muted);

  font-size: 10px;
}

.company-card-arrow {
  color: var(--text-subtle);

  font-size: 22px;
}

/* =====================================================
   DEAL CONTENT
   ===================================================== */

.deal-card-item {
  padding: 11px 0;

  border-bottom: 1px solid var(--border);
}

.deal-card-item:first-child {
  padding-top: 4px;
}

.deal-card-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.deal-card-title {
  display: block;

  margin-bottom: 5px;

  color: var(--brand);

  font-size: 12px;
  font-weight: 700;
}

.deal-card-item strong {
  color: var(--text);

  font-size: 12px;
}

.deal-card-item > span {
  color: var(--text-muted);

  font-size: 10px;
}

.deal-card-item small {
  display: block;

  margin-top: 3px;

  color: var(--text-muted);

  font-size: 10px;
}

/* =====================================================
   ATTACHMENT
   ===================================================== */

.attachment-card-item {
  display: flex;
  align-items: center;

  gap: 10px;

  padding: 9px;

  border: 1px solid var(--border);

  border-radius: var(--radius);
}

.attachment-pdf {
  width: 30px;
  height: 34px;

  display: grid;
  place-items: center;

  flex: 0 0 30px;

  border-radius: 4px;

  background: #f04438;

  color: white;

  font-size: 7px;
  font-weight: 700;
}

.attachment-card-info {
  flex: 1;

  min-width: 0;
}

.attachment-card-info strong {
  display: block;

  color: var(--text);

  font-size: 11px;
}

.attachment-card-info span {
  display: block;

  margin-top: 3px;

  color: var(--text-muted);

  font-size: 9px;
}

.attachment-more {
  border: 0;

  background: transparent;

  color: var(--text-subtle);

  font-size: 18px;

  cursor: pointer;
}

/*.crm-collapsible-card[data-card-id="about"] .crm-collapsible-card__body {
  padding: 6px 20px 24px;
}*/

.crm-collapsible-card[data-card-id="about"] .crm-collapsible-card__header {
  min-height: 58px;
}

/* =========================================================
   IMAGE-MATCHED LEFT / RIGHT CRM CONTENT
   Additive styles only — existing typography is preserved.
   ========================================================= */

.crm-sidebar-info-card {
  padding: 0 0 2px;
}

.crm-sidebar-info-card p {
  margin: 0 0 12px;
  color: var(--text);
  line-height: 1.55;
}

.crm-sidebar-info-card a,
.crm-associated-link,
.crm-attribution-content a {
  color: var(--brand);
  font-weight: 700;
  text-decoration: none;
}

.crm-sidebar-info-card a:hover,
.crm-associated-link:hover,
.crm-attribution-content a:hover {
  text-decoration: underline;
}

/* Company card */

.company-card-item--hubspot {
  align-items: flex-start;
  padding: 10px;
}

.company-card-item--hubspot .company-card-logo {
  width: 32px;
  height: 32px;
  flex-basis: 32px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
}

.company-card-title-row {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.company-card-title-row a {
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.company-primary-tag {
 display: inline-flex;
    align-items: center;
    gap: 5px;
  min-height: 20px;
  padding: 3px 10px;
  border-radius: 6px;
  background: var(--success-bg);
    color: var(--success)!important;
  font-weight: 700;
  white-space: nowrap;
}

.company-card-detail {
  margin-top: 6px;
  color: var(--text-muted);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.company-card-detail a {
  color: var(--brand);
  font-weight: 700;
  text-decoration: none;
}

.crm-inline-copy {
  margin-left: 3px;
  color: var(--text-subtle);
}

.company-card-association {
  margin-top: 8px;
  color: var(--text-muted);
}

/* Shared associated links */

.crm-associated-link {
  display: inline-block;
  margin-top: 13px;font-size: 13px;
}

/* Deals toolbar */

.crm-deals-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin: 0px 0 8px;
}

.crm-deals-toolbar button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--surface);
  color: var(--text-muted);
  font-family: inherit;
  cursor: pointer;
}

.crm-deals-toolbar button:first-child {
  width: 30px;
  padding: 0;
  justify-content: center;
  border-radius: 50%;
}

.crm-deals-toolbar svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Deal cards */

.deal-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 5px;
  color: var(--text-muted);
}

.deal-meta {
  margin-top: 5px;
  color: var(--text);
}

.deal-meta > span {
  color: var(--text-muted);
}

.deal-meta strong {
  color: var(--text);
}

.deal-association {
  margin-top: 8px;
  color: var(--text-muted);
}

/* Empty association cards */

.crm-empty-association {
/*  min-height: 94px;*/
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-muted);
}

.crm-empty-association p {
  margin: 8px 0 0;
  line-height: 1.55;
}

.crm-empty-association__icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  opacity: 0.55;
}

.crm-empty-association__icon svg {
  width: 52px;
  height: 52px;
  fill: none;
  stroke: #b7c8dc;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.crm-empty-association--quote {
  min-height: 92px;
  align-items: flex-start;
  text-align: left;
}

.crm-empty-association--quote .crm-card-button {
  margin: 10px auto 0;
}

/* Attribution */

.crm-attribution-content p {
  margin: 0 0 12px;
  color: var(--text);
  line-height: 1.55;
}

.crm-attribution-content a {
  display: inline-block;
}

@media (max-width: 767.98px) {
  .company-card-detail {
    white-space: normal;
  }

  .crm-deals-toolbar {
    justify-content: flex-start;
  }
}

/* =========================================================
   RIGHT SIDEBAR SVG ICON VISIBILITY / PRECISION
   Explicit sizing prevents inherited/global SVG rules from
   hiding or collapsing the icons in the right column.
   ========================================================= */

.crm-contact-layout__right svg {
  display: inline-block;
  visibility: visible;
  opacity: 1;
  overflow: visible;
  flex: 0 0 auto;
}

.crm-contact-layout__right .crm-inline-copy {
  display: inline-flex;
  margin-left: 4px;
  vertical-align: -2px;
  color: var(--text-subtle);
}

.crm-contact-layout__right .crm-inline-copy svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.crm-contact-layout__right .crm-external-icon {
  margin-left: 3px;
  vertical-align:bottom;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.crm-contact-layout__right .crm-deals-toolbar button svg {
  display: block;
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.crm-contact-layout__right .deal-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  vertical-align: -3px;
  margin-right: 4px;
}

.crm-contact-layout__right .deal-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.crm-contact-layout__right .crm-empty-association__icon svg {
  display: block;
  width: 52px;
  height: 52px;
  min-width: 52px;
  min-height: 52px;
  fill: none;
  stroke: #b7c8dc;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.crm-contact-layout__right .crm-lock-icon {
  display: inline-block;
  margin-left: 4px;
  vertical-align: -2px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.crm-contact-layout__right .crm-attribution-content a {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

/* =========================================================
   CONTACT ACTIONS DROPDOWN
   ========================================================= */
.crm-contact-actions-menu {
  position: fixed;
  z-index: 9999;
  display: none;
  min-width: 255px;
  max-width: 255px;
  padding: 8px 0;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  box-shadow:
    0 18px 45px rgba(0, 0, 0, 0.14),
    0 3px 10px rgba(0, 0, 0, 0.08);
  color: var(--text);
}
.crm-contact-actions-menu.is-open {
  display: block;
}
.crm-contact-actions-menu__search {
  position: relative;
  margin: 0 10px 8px;
}
.crm-contact-actions-menu__search input {
  width: 100%;
  height: 40px;
  padding: 0 16px 0 44px;
  border: 1px solid var(--border);
  border-radius: 28px;
  outline: 0;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
}
.crm-contact-actions-menu__search input::placeholder {
  color: #6f6f6f;
}
.crm-contact-actions-menu__search input:focus {
  border-color: var(--brand);
}
.crm-contact-actions-menu__search svg {
  position: absolute;
  left: 16px;
  top: 13px;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--text-muted);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}
.crm-contact-actions-menu__items {
  max-height: min(540px, calc(100vh - 90px));
  overflow-y: auto;
  padding: 0 0 5px;
}
.crm-contact-action-item {
  position: relative;
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0px 13px 0px 13px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}
.crm-contact-action-item:hover,
.crm-contact-action-item:focus-visible {
  background: var(--surface-hover);
  outline: 0;
}
.crm-contact-action-item__icon {
  width: 20px;
  height: 20px;
  flex: 0 0 22px;
  display: grid;
  place-items: center;
  color: var(--text-muted);
}
input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  display: none;
}
.crm-contact-action-item__icon svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.crm-contact-action-item__icon--linkedin {
  color: #333;
}
.crm-contact-action-item__icon--linkedin svg rect {
  fill: currentColor;
  stroke: currentColor;
}
.crm-contact-action-item__icon--linkedin svg path {
  stroke: #fff;
  stroke-width: 1.8;
}
.crm-contact-action-item__label {
  min-width: 0;
  flex: 1;
  line-height: 1.35;
}
.crm-contact-action-item__arrow {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  color: #777;
}
.crm-contact-action-item__arrow svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.crm-contact-action-item__lock {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: #888;
}
.crm-contact-action-item__lock svg {
  width: 18px;
  height: 17px;
  fill: none;
  stroke: var(--text-muted);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.crm-contact-actions-menu__divider {
  height: 1px;
  margin: 6px 18px;
  background: var(--border);
}
.crm-contact-actions-submenu {
  max-width: 255px;
  position: fixed;
  z-index: 10000;
  display: none;
  padding: 8px 0;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  box-shadow:
    0 18px 45px rgba(0, 0, 0, 0.14),
    0 3px 10px rgba(0, 0, 0, 0.08);
}
.crm-contact-actions-submenu.is-open {
  display: block;
}
.crm-contact-actions-submenu .crm-contact-action-item {
  min-height: 36px;
  padding-left: 12px;
}
.crm-contact-action-item--linkedin {
  margin-top: 2px;
}
@media (max-width: 767.98px) {
  .crm-contact-actions-menu {
    min-width: 0;
    width: 100% !important;
    left: auto !important;
    right: 27px;
    border-radius: 16px;
    top: 156px !important;
  }
  .crm-contact-actions-submenu {
    width: min(255px, calc(100vw - 16px)) !important;
    left: auto !important;
    right: auto !important;
  }
  .crm-contact-action-item {
    min-height: 27px;
    padding-left: 15px;
    font-size: 13px;
  }
  .crm-contact-actions-submenu .crm-contact-action-item {
    min-height: 30px;
    padding-left: 12px;
  }
  .crm-contact-actions-menu__search input {
    height: 38px;
    font-size: 14px;
  }
  .crm-contact-actions-menu__search svg {
    left: 13px;
    top: 10px;
  }
}

/* =========================================================
   RESPONSIVE UTILITY-BASED THREE COLUMN LAYOUT
   Uses utilities(3).css: container / row / col
   Desktop  : 3 / 6 / 3
   <=1024px : 12 / 12 / 12
   ========================================================= */

.crm-contact-layout.crm-container-fluid {
  width: 100%;
  max-width: none;
  padding: 14px 0;
  height: calc(100vh - var(--header-h));
  min-height: 0;
  background: var(--bg);
  overflow: hidden;
}

.crm-contact-layout__row {
  min-height: 0;
  height: 100%;
  align-items: stretch;
  --crm-gutter-x: 0px;
  --crm-gutter-y: 0;
}

.crm-contact-layout__left,
.crm-contact-layout__center,
.crm-contact-layout__right {
  position: relative;
  min-width: 0;
  min-height: 0;
}

.crm-contact-layout__left,
.crm-contact-layout__center,
.crm-contact-layout__right {
  height: 100%;
}

.crm-contact-layout__left {
  overflow-x: hidden;
  overflow-y: auto;
}

.crm-contact-layout__center {
  overflow: hidden;
}

.crm-contact-layout__right {
  overflow-x: hidden;
  overflow-y: auto;
}

/* Desktop: HTML uses crm-col-12 crm-col-lg-3/6/3.
   At >= 992px the utility classes resolve to 3 / 6 / 3. */
@media (min-width: 1025px) {
  .crm-contact-layout__row {
    height: 100%;
  }

  .crm-panel-collapse {
    right: calc(25% - 7px);
  }
}

/* Tablet + mobile: keep the actual column utility structure,
   but make every column a full-width utility column through 1024px. */
@media (max-width: 1024px) {
  .crm-contact-layout.crm-container-fluid {
    height: auto;
    min-height: calc(100vh - var(--header-h));
    padding: 10px 0;
    overflow: visible;
  }

  .crm-contact-layout__row {
    height: auto;
    --crm-gutter-x: 0px;
    --crm-gutter-y: 0px;
  }

  /* Override only the responsive utility width; markup remains col-12. */
  .crm-contact-layout__left,
  .crm-contact-layout__center,
  .crm-contact-layout__right {
    flex: 0 0 100%;
    width: 100%;
    max-width: 100%;
    height: auto;
    overflow: visible;
  }

  .crm-contact-layout__left {
    max-height: none;
  }

  .crm-contact-layout__center {
    min-height: 680px;
  }

  .crm-contact-layout__right {
    display: block;
  }

  .crm-panel-collapse {
    display: none;
  }

  .crm-center-tabs,
  .crm-activity-tabs {
    overflow-x: auto;
  }
}

@media (max-width: 992px) {
  .crm-contact-actions-menu {
    min-width: 0;
    width: 100% !important;
    left: auto !important;
    right: 63px;
    border-radius: 16px;
    top: 156px !important;
  }
}

@media (max-width: 767.98px) {
  .crm-contact-layout.crm-container-fluid {
    padding: 8px 0;
  }

  .crm-contact-layout__row {
    --crm-gutter-x: 8px;
    --crm-gutter-y: 8px;
  }

  .crm-contact-layout__center {
    min-height: 560px;
  }

  .crm-contact-layout.is-right-collapsed .crm-contact-layout__right {
    display: none;
  }

  .crm-activity-toolbar {
    flex-wrap: wrap;
    align-items: stretch;
  }

  .crm-activity-search {
    width: 100%;
    flex: 1 1 100%;
  }

  .crm-activity-expand {
    margin-left: auto;
  }
}

@media (max-width: 575.98px) {
  .crm-contact-layout.crm-container-fluid {
    padding-top: 6px;
    padding-bottom: 6px;
  }

  .crm-contact-layout__row {
    --crm-gutter-x: 0px;
    --crm-gutter-y: 0px;
  }

  .crm-center-panel {
    border-radius: var(--radius-md, 12px);
  }

  .crm-center-tabs,
  .crm-activity-tabs {
    padding-left: 2px;
    padding-right: 2px;
  }

  .crm-center-tab {
    min-width: 108px;
    padding-left: 12px;
    padding-right: 12px;
  }
}

/* =========================================================
   FINAL RESPONSIVE COLUMN OVERRIDE
   < 1200px  : 12 / 12 / 12
   1200-1399 : 3 / 9 / 12
   >= 1400px : 3 / 6 / 3
   ========================================================= */
.crm-contact-layout__row {
  width: 100%;
  min-width: 0;
}

.crm-contact-layout__left,
.crm-contact-layout__center,
.crm-contact-layout__right {
  min-width: 0;
  box-sizing: border-box;
}

@media (max-width: 1199.98px) {
  .crm-contact-layout__row {
    flex-wrap: wrap !important;
  }

  .crm-contact-layout__left,
  .crm-contact-layout__center,
  .crm-contact-layout__right {
    flex: 0 0 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto;
  }

  .crm-panel-collapse {
    display: none !important;
  }
}

@media (min-width: 1200px) and (max-width: 1399.98px) {
  .crm-contact-layout__row {
    flex-wrap: wrap !important;
    height: auto;
  }

  .crm-contact-layout__left {
    flex: 0 0 25% !important;
    width: 25% !important;
    max-width: 25% !important;
  }

  .crm-contact-layout__center {
    flex: 0 0 calc(75% - 6px) !important;
    width: calc(75% - 6px) !important;
    max-width: calc(75% - 6px) !important;
  }

  .crm-contact-layout__right {
    flex: 0 0 100% !important;
    width: 100% !important;
    max-width: 100% !important;
  }
}

@media (min-width: 1400px) {
  .crm-contact-layout__row {
    flex-wrap: nowrap !important;
    height: 100%;
  }

  .crm-contact-layout__left {
    flex: 0 0 25% !important;
    width: 25% !important;
    max-width: 25% !important;
  }

  .crm-contact-layout__center {
    flex: 0 0 calc(50% - 6px) !important;
    width: calc(50% - 6px) !important;
    max-width: calc(50% - 6px) !important;
  }

  .crm-contact-layout__right {
    flex: 0 0 calc(25% - 6px) !important;
    width: calc(25% - 6px) !important;
    max-width: calc(25% - 6px) !important;
  }
}

/* Quick actions: utility-based flex instead of CSS Grid. */
.crm-contact-profile__quick-actions.crm-d-flex {
  display: flex !important;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-2, 8px);
}

.crm-contact-profile__quick-actions.crm-d-flex > button {
  flex: 1 1 0;
  min-width: 0;
}

/* =========================================================
   FINAL RESPONSIVE LAYOUT FIX
   <1200   : 12 / 12 / 12
   1200-1399: 3 / 9 / 12
   >=1400  : 3 / 6 / 3
   The wrapper must scroll when the third column moves below.
   ========================================================= */
.crm-contact-layout.crm-container-fluid {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
}

.crm-contact-layout__row {
  box-sizing: border-box;
  width: 100%;
  flex-wrap: wrap;
  height: auto;
  min-height: 0;
}

.crm-contact-layout__left,
.crm-contact-layout__center,
.crm-contact-layout__right {
  box-sizing: border-box;
  min-width: 0;
}

/* < 1200px: all three stacked */
@media (max-width: 1199.98px) {
  .crm-contact-layout.crm-container-fluid {
    height: auto !important;
    min-height: calc(100vh - var(--header-h));
    overflow-x: hidden !important;
    overflow-y: visible !important;
  }

  .crm-contact-layout__row {
    height: auto !important;
    flex-wrap: wrap !important;
  }

  .crm-contact-layout__left,
  .crm-contact-layout__center,
  .crm-contact-layout__right {
    flex: 0 0 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    overflow: visible !important;
  }
}

/* 1200px - 1399.98px: 3 / 9 / 12 */
@media (min-width: 1200px) and (max-width: 1399.98px) {
  .crm-contact-layout.crm-container-fluid {
    height: auto !important;
    min-height: calc(100vh - var(--header-h));
    overflow-x: hidden !important;
    overflow-y: auto !important;
    padding-bottom: 24px;
  }

  .crm-contact-layout__row {
    height: auto !important;
    min-height: 0;
    flex-wrap: wrap !important;
    align-items: stretch;
  }

  .crm-contact-layout__left {
    flex: 0 0 25% !important;
    width: 25% !important;
    max-width: 25% !important;
    height: auto !important;
  }

  .crm-contact-layout__center {
    flex: 0 0 75% !important;
    width: 75% !important;
    max-width: 75% !important;
    height: auto !important;
    overflow: visible !important;
  }

  .crm-contact-layout__right {
    flex: 0 0 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    overflow: visible !important;
    margin-top: var(--crm-gutter-y, 14px);
  }

  .crm-panel-collapse {
    display: none !important;
  }
}

/* >= 1400px: normal 3 / 6 / 3 */
@media (min-width: 1400px) {
  .crm-contact-layout.crm-container-fluid {
    height: calc(100vh - var(--header-h));
    overflow: hidden;
  }

  .crm-contact-layout__row {
    height: 100%;
    flex-wrap: nowrap !important;
  }

  .crm-contact-layout__left {
    flex: 0 0 25% !important;
    width: 25% !important;
    max-width: 25% !important;
  }

  .crm-contact-layout__center {
    flex: 0 0 50% !important;
    width: 50% !important;
    max-width: 50% !important;
  }

  .crm-contact-layout__right {
    flex: 0 0 25% !important;
    width: 25% !important;
    max-width: 25% !important;
    margin-top: 0;
  }
}

/* =========================================================
   FINAL CLEAN RESPONSIVE LAYOUT
   < 1200px  : 12 / 12 / 12
   1200-1399 : 3 / 9 / 12
   >= 1400px : 3 / 6 / 3
   No horizontal overflow / balanced viewport spacing.
   ========================================================= */

.crm-contact-layout.crm-container-fluid {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.crm-contact-layout__row {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.crm-contact-layout__left,
.crm-contact-layout__center,
.crm-contact-layout__right {
  box-sizing: border-box;
  min-width: 0;
}

/* Mobile / tablet: 12 / 12 / 12 */
@media (max-width: 1199.98px) {
  .crm-contact-layout.crm-container-fluid {
    height: auto !important;
    min-height: calc(100vh - var(--header-h));
    padding: 0px !important;
    overflow-x: hidden !important;
    overflow-y: visible !important;
  }

  .crm-contact-layout__row {
    height: auto !important;
    flex-wrap: wrap !important;
    gap: 8px;
  }

  .crm-contact-layout__left,
  .crm-contact-layout__center,
  .crm-contact-layout__right {
    flex: 0 0 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    overflow: visible !important;
  }

  .crm-panel-collapse {
    display: none !important;
  }
}

/* 1200px - 1399.98px: 3 / 9 / 12 */
@media (min-width: 1200px) and (max-width: 1399.98px) {
  .crm-contact-layout.crm-container-fluid {
    height: calc(100vh - 145px) !important;
    min-height: 0 !important;
    max-height: none !important;
    /*    padding: 14px 8px 24px !important;*/
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  .crm-contact-layout__row {
    height: auto !important;
    min-height: 0 !important;
    flex-wrap: wrap !important;
    align-items: stretch !important;
    column-gap: 12px !important;
    row-gap: 14px !important;
  }

  .crm-contact-layout__left {
    flex: 0 0 calc(25% - 6px) !important;
    width: calc(25% - 6px) !important;
    max-width: calc(25% - 6px) !important;
    height: auto !important;
    overflow-x: hidden !important;
    overflow-y: visible !important;
  }

  .crm-contact-layout__center {
    flex: 0 0 75% !important;
    width: 75% !important;
    max-width: 75% !important;
    height: auto !important;
    overflow: visible !important;
  }

  .crm-contact-layout__right {
    flex: 0 0 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    margin-top: 14px;
    overflow: visible !important;
  }

  .crm-panel-collapse {
    display: none !important;
  }
}

/* >= 1400px: normal 3 / 6 / 3 */
@media (min-width: 1400px) {
  .crm-contact-layout.crm-container-fluid {
    height: calc(100vh - 145px) !important;

    overflow: hidden;
  }

  .crm-contact-layout__row {
    height: 100% !important;
    flex-wrap: nowrap !important;
    column-gap: 12px !important;
    row-gap: 0 !important;
  }

  .crm-contact-layout__left {
    flex: 0 0 calc(25% - 6px) !important;
    width: calc(25% - 6px) !important;
    max-width: calc(25% - 6px) !important;
  }

  .crm-contact-layout__center {
    flex: 0 0 50% !important;
    width: 50% !important;
    max-width: 50% !important;
  }

  .crm-contact-layout__right {
    flex: 0 0 25% !important;
    width: 25% !important;
    max-width: 25% !important;
  }
}

/* Quick actions: utility-based flex layout. */
.crm-contact-profile__quick-actions.crm-d-flex {
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
  gap: var(--sp-2, 8px);
}

.crm-contact-profile__quick-actions.crm-d-flex > button {
  flex: 1 1 0;
  min-width: 0;
}

/* =========================================================
   FINAL COLUMN GAP FIX
   The previous 25% + 75% widths plus a gap exceeded 100%,
   which forced the second column onto the next line.
   ========================================================= */
.crm-contact-layout__row {
  gap: 0;
}

@media (max-width: 1199.98px) {
  .crm-contact-layout__row {
    gap: 14px;
  }

  .crm-contact-layout__left,
  .crm-contact-layout__center,
  .crm-contact-layout__right {
    flex: 0 0 100% !important;
    width: 100% !important;
    max-width: 100% !important;
  }
}

@media (min-width: 1200px) and (max-width: 1399.98px) {
  .crm-contact-layout__row {
    gap: 14px;
  }

  .crm-contact-layout__left {
    flex: 0 0 calc(25% - 7px) !important;
    width: calc(25% - 7px) !important;
    max-width: calc(25% - 7px) !important;
  }

  .crm-contact-layout__center {
    flex: 0 0 calc(75% - 7px) !important;
    width: calc(75% - 7px) !important;
    max-width: calc(75% - 7px) !important;
  }

  .crm-contact-layout__right {
    flex: 0 0 100% !important;
    width: 100% !important;
    max-width: 100% !important;
  }
}

@media (min-width: 1400px) {
  .crm-contact-layout__row {
    gap: 14px;
    flex-wrap: nowrap !important;
  }

  .crm-contact-layout__left {
    flex: 0 0 calc(25% - 9.333px) !important;
    width: calc(25% - 9.333px) !important;
    max-width: calc(25% - 9.333px) !important;
  }

  .crm-contact-layout__center {
    flex: 0 0 calc(50% - 9.333px) !important;
    width: calc(50% - 9.333px) !important;
    max-width: calc(50% - 9.333px) !important;
  }

  .crm-contact-layout__right {
    flex: 0 0 calc(25% - 9.333px) !important;
    width: calc(25% - 9.333px) !important;
    max-width: calc(25% - 9.333px) !important;
  }
}

/* =========================================================
   QUICK ACTIONS - MOBILE / TABLET SPACING
   Give each action its own natural width so labels do not
   touch each other when the screen gets narrow.
   ========================================================= */
@media (max-width: 1199.98px) {
  .crm-contact-profile__quick-actions.crm-d-flex {
    justify-content: space-between !important;
    gap: 10px !important;
    padding-left: 12px;
    padding-right: 12px;
  }

  .crm-contact-profile__quick-actions.crm-d-flex > button {
    flex: 0 1 auto !important;
    min-width: 34px;
    white-space: nowrap;
  }
}

@media (max-width: 575.98px) {
  .crm-contact-profile__quick-actions.crm-d-flex {
    gap: 7px !important;
    padding-left: 10px;
    padding-right: 10px;
  }
}

/* =========================================================
   QUICK ACTIONS - TABLET COMPACT SPACING
   Keep the six actions grouped instead of distributing the
   available tablet width with space-between.
   ========================================================= */
@media (min-width: 576px) and (max-width: 1199.98px) {
  .crm-contact-profile__quick-actions.crm-d-flex {
    justify-content: flex-start !important;
    gap: 18px !important;
    padding-left: 12px;
    padding-right: 12px;
  }

  .crm-contact-profile__quick-actions.crm-d-flex > button {
    flex: 0 0 54px !important;
    width: 54px;
    min-width: 54px;
    max-width: 54px;
  }
}

/* Small mobile: keep actions compact while retaining readable labels. */
@media (max-width: 575.98px) {
  .crm-contact-profile__quick-actions.crm-d-flex {
    justify-content: space-between !important;
    gap: 7px !important;
  }

  .crm-contact-profile__quick-actions.crm-d-flex > button {
    flex: 1 1 0 !important;
    width: auto;
    min-width: 0;
    max-width: none;
  }
}

/* =========================================================
   ACTIONS DROPDOWN - RIGHT ANCHORED
   Always opens directly below the Actions trigger.
   JavaScript controls the exact viewport position.
   ========================================================= */
.crm-contact-actions-menu {
  position: fixed !important;
  right: auto !important;
  max-width: 255px;
}

@media (max-width: 767.98px) {
  .crm-contact-actions-menu {
    max-width: calc(100vw - 16px) !important;
    min-width: 0 !important;
    border-radius: 16px;
  }
}

/* =========================================================
   ACTIONS SUBDROPDOWN
   Desktop/tablet: left of the main dropdown
   Mobile: below the item that owns the submenu
   ========================================================= */
.crm-contact-actions-submenu {
  position: fixed !important;
  z-index: 10000 !important;
  max-width: 255px;
}

@media (max-width: 767.98px) {
  .crm-contact-actions-submenu {
    max-width: calc(100vw - 16px);
  }
}

/* =========================================================
   FINAL DEVICE-SAFE RESPONSIVE OVERRIDES
   <1200       : 12 / 12 / 12
   1200-1399   : 3 / 9 / 12
   >=1400      : 3 / 6 / 3
   No horizontal overflow.
   ========================================================= */
.crm-contact-layout,
.crm-contact-layout__row,
.crm-contact-layout__left,
.crm-contact-layout__center,
.crm-contact-layout__right {
  box-sizing: border-box;
  min-width: 0;
}

.crm-contact-layout {
  width: 100%;
  max-width: 100%;
  padding-inline: 10px;
  overflow-x: hidden !important;
}

.crm-contact-layout__row {
  width: 100%;
  margin-inline: 0 !important;
  gap: 14px;
  height: auto;
  flex-wrap: wrap !important;
}

/* < 1200px: all columns stacked */
@media (max-width: 1199.98px) {
  .crm-contact-layout {
    height: auto !important;
    min-height: calc(100vh - var(--header-h));
    overflow-x: hidden !important;
    overflow-y: visible !important;
    padding-inline: 8px;
  }

  .crm-contact-layout__row {
    gap: 14px;
  }

  .crm-contact-layout__left,
  .crm-contact-layout__center,
  .crm-contact-layout__right {
    flex: 0 0 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    overflow: visible !important;
  }
}

/* 1200-1399px: 3 / 9 / 12 */
@media (min-width: 1200px) and (max-width: 1399.98px) {
  .crm-contact-layout {
    height: calc(100vh - var(--header-h)) !important;
    min-height: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    padding-inline: 10px;
    padding-bottom: 24px;
  }

  .crm-contact-layout__row {
    gap: 14px;
    height: auto !important;
  }

  .crm-contact-layout__left {
    flex: 0 0 calc(30% - 7px) !important;
    width: calc(30% - 7px) !important;
    max-width: calc(30% - 7px) !important;
    height: auto !important;
  }

  .crm-contact-layout__center {
    flex: 0 0 calc(70% - 7px) !important;
    width: calc(70% - 7px) !important;
    max-width: calc(70% - 7px) !important;
    height: auto !important;
    overflow: visible !important;
  }

  .crm-contact-layout__right {
    flex: 0 0 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    overflow: visible !important;
  }
}

@media (min-width: 1920px) {
  .crm-contact-layout {
    height: calc(100vh - var(--header-h)) !important;
    overflow: hidden !important;
  }

  .crm-contact-profile__quick-actions.crm-d-flex {
    justify-content: space-between !important;
  }

  .crm-contact-layout__row {
    flex-wrap: nowrap !important;
    gap: 14px;
    height: 100% !important;
  }

  .crm-contact-layout__left {
    flex: 0 0 calc(25% - 10.5px) !important;
    width: calc(25% - 10.5px) !important;
    max-width: calc(25% - 10.5px) !important;
  }

  .crm-contact-layout__center {
    flex: 0 0 calc(50% - 7px) !important;
    width: calc(50% - 7px) !important;
    max-width: calc(50% - 7px) !important;
  }

  .crm-contact-layout__right {
    flex: 0 0 calc(25% - 10.5px) !important;
    width: calc(25% - 10.5px) !important;
    max-width: calc(25% - 10.5px) !important;
  }
}

/* >= 1400px: 3 / 6 / 3 */
@media (min-width: 1400px) {
  .crm-contact-layout {
    height: calc(100vh - var(--header-h)) !important;
    overflow: hidden !important;
  }

  .crm-contact-profile__quick-actions.crm-d-flex {
    justify-content: space-between !important;
  }

  .crm-contact-layout__row {
    flex-wrap: nowrap !important;
    gap: 14px;
    height: 100% !important;
  }

  .crm-contact-layout__left {
    flex: 0 0 calc(25% - 10.5px) !important;
    width: calc(25% - 10.5px) !important;
    max-width: calc(25% - 10.5px) !important;
  }

  .crm-contact-layout__center {
    flex: 0 0 calc(50% - 7px) !important;
    width: calc(50% - 7px) !important;
    max-width: calc(50% - 7px) !important;
  }

  .crm-contact-layout__right {
    flex: 0 0 calc(25% - 10.5px) !important;
    width: calc(25% - 10.5px) !important;
    max-width: calc(25% - 10.5px) !important;
  }
}

/* Quick actions: compact, predictable spacing on every device. */
.crm-contact-profile__quick-actions.crm-d-flex {
  display: flex !important;
  align-items: flex-start !important;
  gap: 4px !important;
  flex-wrap: nowrap !important;
  min-width: 0;
  overflow: auto;
}

.crm-contact-profile__quick-actions.crm-d-flex > button {
  flex: 0 1 auto !important;
  min-width: 44px;
}

@media (max-width: 767.98px) {
  .crm-contact-profile__quick-actions.crm-d-flex {
    gap: 7px !important;
  }

  .crm-contact-profile__quick-actions.crm-d-flex > button {
    flex: 1 1 0 !important;
    min-width: 0;
  }
}

/* Actions main menu: always below trigger, right aligned. */
.crm-contact-actions-menu {
  max-width: min(350px, calc(100vw - 16px));
  box-sizing: border-box;
}

/* Submenu base: JS supplies exact coordinates. */
/*.crm-contact-actions-submenu {
  box-sizing: border-box;
  max-width: calc(100vw - 16px);
}
*/
@media (max-width: 767.98px) {
  /* Preserve mobile submenu as a dropdown below its parent item. */
  .crm-contact-actions-submenu {
    /* width: calc(100vw - 16px) !important;
    max-width: calc(100vw - 16px) !important;*/
    right: auto !important;
  }
}

/* =========================================================
   CONTACT DETAILS BREADCRUMB ACTIONS
   Same placement/visual treatment as Company Details.
   The existing contact Actions menu is reused by this trigger,
   so the popup content remains contact-specific.
   ========================================================= */
.crm-details-page .company-record-header {
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

.crm-details-page .company-record-breadcrumb {
  flex: 1 1 auto;
  min-width: 0;
}

.crm-details-header-actions {
  flex: 0 0 auto;
  margin-left: auto;
  position: relative;
  z-index: 20;
}

.crm-details-actions-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 36px;
  white-space: nowrap;
}

.crm-details-actions-btn svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 575.98px) {
  .crm-details-page .company-record-header {
    gap: 8px;
  }

  .crm-details-actions-btn {
    min-height: 34px;
    padding-inline: 10px;
    font-size: 12px;
  }
}

/* Contact details: company-style breadcrumb and activity controls */
.crm-details-page {height:calc(100vh - var(--header-h));min-height:0;display:flex;flex-direction:column;padding:0px;background:var(--bg)}
.crm-details-page .company-record-header{flex:0 0 35px;margin-bottom:10px;display:flex;align-items:center}
.crm-details-page .crm-contact-layout{height:auto;flex:1;min-height:0;padding:0}
.crm-details-page .crm-activity-tabs{flex:0 0 60px;padding:0 10px}
.crm-details-page .crm-activity-tab{min-width:0;height:60px;padding:0 15px;font-size:14px}
.crm-details-page .crm-activity-tab.is-active::after{height:3px;background:var(--brand);left:2px;right:2px}
.crm-details-page .crm-activity-content{background:var(--surface);padding:18px}
.crm-details-page .crm-activity-toolbar{gap:16px;padding:0px 0 10px}
.crm-details-page .crm-activity-search{width:auto;flex:1;min-width:0}
.crm-details-page .crm-activity-search input{height:40px;padding:0 14px 0 38px;border-radius:24px}
.crm-details-page .crm-activity-search svg{left:13px;right:auto;top:11px;width:16px;height:16px}
.crm-details-page .crm-activity-expand{border:1px solid var(--border-strong);border-radius:9px;min-height:36px;padding:0 12px;font-size:13px;white-space:nowrap}
/*.crm-details-page .crm-activity-expand svg{display:none}*/
.crm-details-page .crm-activity-filters{gap:8px;padding-bottom:12px;flex-wrap:wrap;overflow:visible}
.crm-details-page .crm-activity-select {
  min-width: 150px;
  flex: 0 0 auto;
}

.crm-details-page .crm-activity-select .custom-select-trigger {
  min-height: 38px;
  height: 38px;
  font-size: 13px;
}
.crm-details-page .crm-activity-clear{margin-left:auto;color:var(--brand);font-size:13px;min-height:38px;padding:0 8px}
.crm-activity-collapsed .crm-activity-card__description{display:none}
@media(max-width:650px)
{.crm-details-page{height:auto;min-height:calc(100vh - var(--header-h));overflow:visible}.crm-details-page .crm-contact-layout{height:auto}
  .crm-details-page .crm-activity-toolbar{gap:8px}.crm-details-page .crm-activity-expand{font-size:13.5px;font-weight:600;padding:0 8px;width: 100%;justify-content: center;}
  .crm-details-page .crm-activity-tab{padding:0 10px}.crm-detail-filter{min-width:100%}
  .crm-details-page .crm-activity-clear{width: 100%;text-align: center;display: block;}
}


/* =========================================================
   COMPANY-STYLE CONTACT QUICK ACTIONS
   Same visual treatment as Company Details; actions still use
   the Contact Details action popup/content.
   ========================================================= */
.crm-contact-profile__quick-actions.crm-company-style-quick-actions {
  display: grid !important;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: start !important;
  justify-content: initial !important;
  gap: 8px !important;
  margin: 16px 0 !important;
  overflow: visible !important;
}

.crm-contact-profile__quick-actions.crm-company-style-quick-actions > button {
  min-width: 0 !important;
  width: 100% !important;
  max-width: none !important;
  flex: none !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 7px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: var(--text-muted) !important;
  font: 600 12px/1.25 inherit !important;
  cursor: pointer;
  white-space: nowrap;
}

.crm-contact-profile__quick-actions.crm-company-style-quick-actions > button:hover,
.crm-contact-profile__quick-actions.crm-company-style-quick-actions > button:focus-visible {
  color: var(--text) !important;
  outline: 0;
}

.crm-company-style-quick-actions .crm-contact-profile__action-icon {
  width: 42px !important;
  height: 42px !important;
  flex: 0 0 42px !important;
  display: grid !important;
  place-items: center !important;
  border: 1px solid var(--border) !important;
  border-radius: 50% !important;
  background: var(--surface) !important;
  color: var(--text-muted) !important;
  transition: background-color var(--fast) var(--ease), border-color var(--fast) var(--ease), color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}

.crm-company-style-quick-actions .crm-contact-profile__action-icon svg {
  width: 18px !important;
  height: 18px !important;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.crm-company-style-quick-actions > button:hover .crm-contact-profile__action-icon,
.crm-company-style-quick-actions > button:focus-visible .crm-contact-profile__action-icon {
  background: var(--surface-hover) !important;
  border-color: var(--border-strong) !important;
  color: var(--text) !important;
}

.crm-company-style-quick-actions .crm-contact-profile__dots {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.crm-company-style-quick-actions .crm-contact-profile__dots i {
  display: block;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
}

.crm-contact-action-item.is-current {
  background: var(--brand-soft);
  color: var(--brand-ink, var(--brand));
}

@media (max-width: 767.98px) {
  .crm-contact-profile__quick-actions.crm-company-style-quick-actions {
    grid-template-columns: repeat(6, minmax(46px, 1fr));
    gap: 6px !important;
    overflow-x: auto !important;
    padding-bottom: 2px !important;
  }

  .crm-contact-profile__quick-actions.crm-company-style-quick-actions > button {
    min-width: 46px !important;
  }

  .crm-company-style-quick-actions .crm-contact-profile__action-icon {
    width: 40px !important;
    height: 40px !important;
    flex-basis: 40px !important;
  }
}

/* =========================================================
   CONTACT QUICK ACTIONS
   Same UI as Company Details; actions remain Contact Details actions.
   ========================================================= */
.crm-contact-profile__quick-actions.company-quick-actions {
  display: grid !important;
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  align-items: start !important;
  gap: 7px !important;
  margin: 20px 0 !important;
  padding: 0 !important;
  overflow: visible !important;
}

.crm-contact-profile__quick-actions.company-quick-actions > .company-quick-action {
  min-width: 0 !important;
  width: 100% !important;
  max-width: none !important;
  min-height: 60px !important;
  height: auto !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 7px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--text-muted) !important;
  font: 600 13px/1.25 inherit !important;
  cursor: pointer;
  white-space: nowrap;
}

.crm-contact-profile__quick-actions.company-quick-actions > .company-quick-action .icon {
  width: 42px !important;
  height: 42px !important;
  flex: 0 0 42px !important;
  display: grid !important;
  place-items: center !important;
  padding: 11px !important;
  box-sizing: border-box !important;
  border: 1px solid var(--border) !important;
  border-radius: 50% !important;
  background: var(--surface) !important;
  color: var(--text-muted) !important;
  transition: background-color var(--fast) var(--ease), border-color var(--fast) var(--ease), color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}

.crm-contact-profile__quick-actions.company-quick-actions > .company-quick-action:hover,
.crm-contact-profile__quick-actions.company-quick-actions > .company-quick-action:focus-visible {
  color: var(--text) !important;
  outline: 0;
}

.crm-contact-profile__quick-actions.company-quick-actions > .company-quick-action:hover .icon,
.crm-contact-profile__quick-actions.company-quick-actions > .company-quick-action:focus-visible .icon {
  background: var(--surface-hover) !important;
  border-color: var(--border-strong) !important;
  color: var(--text) !important;
}

.crm-contact-profile__quick-actions.company-quick-actions > .company-quick-action span {
  display: block !important;
  font-size: 13px !important;
  line-height: 1.25 !important;
  font-weight: 600 !important;
}

@media (max-width: 767.98px) {
  .crm-contact-profile__quick-actions.company-quick-actions {
    grid-template-columns: repeat(6, minmax(46px, 1fr)) !important;
    gap: 6px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    padding-bottom: 2px !important;
    scrollbar-width: none;
  }

  .crm-contact-profile__quick-actions.company-quick-actions::-webkit-scrollbar {
    display: none;
  }

  .crm-contact-profile__quick-actions.company-quick-actions > .company-quick-action {
    min-width: 46px !important;
  }

  .crm-contact-profile__quick-actions.company-quick-actions > .company-quick-action .icon {
    width: 40px !important;
    height: 40px !important;
    flex-basis: 40px !important;
  }
}

/* =========================================================
   CONTACT QUICK ACTIONS - EXACT COMPANY DETAILS TREATMENT
   Five compact icon buttons; contact-specific popup behavior.
   ========================================================= */
.crm-contact-profile__quick-actions.company-quick-actions {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 6px !important;
  margin: 16px 0 !important;
  padding: 0 20px!important;
  overflow: visible !important;
}

.crm-contact-profile__quick-actions.company-quick-actions > .company-quick-action {
  min-width: 40px !important;
  min-height: 40px !important;
  height: 40px !important;
  width: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0 !important;
  padding: 0 !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  background: var(--surface) !important;
  color: var(--text-muted) !important;
  font-size: 10.5px !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  cursor: pointer;
}

.crm-contact-profile__quick-actions.company-quick-actions > .company-quick-action span {
  display: none !important;
}

.crm-contact-profile__quick-actions.company-quick-actions > .company-quick-action .icon {
  width: 18px !important;
  height: 18px !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  color: currentColor !important;
}

.crm-contact-profile__quick-actions.company-quick-actions > .company-quick-action:hover,
.crm-contact-profile__quick-actions.company-quick-actions > .company-quick-action:focus-visible {
  background: var(--surface-hover) !important;
  border-color: var(--border-strong) !important;
  color: var(--text) !important;
  outline: 0;
}

/* =========================================================
   CONTACT CREATE POPUP - SAME VISUAL TREATMENT AS COMPANY DETAILS
   ========================================================= */
.contact-create-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(16, 24, 40, .42);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity var(--fast) var(--ease);
}

.contact-create-modal-overlay.is-open {
  opacity: 1;
}

.contact-create-modal {
  position: fixed;
  z-index: 1001;
  top: 50%;
  left: 50%;
  width: min(500px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  transform: translate(-50%, -48%);
  background: var(--surface);
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 14px;
  box-shadow: 0 18px 45px rgba(16,24,40,.20);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--fast) var(--ease), transform var(--fast) var(--ease);
}

.contact-create-modal.is-open {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%);
}

.contact-create-modal__header {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
}

.contact-create-modal__header h2 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  line-height: 1.3;
  font-weight: 700;
}

.contact-create-modal__close {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 25px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
}

.contact-create-modal__close:hover {
  color: var(--text);
}

.contact-create-modal__body {
  padding: 24px;
}

.contact-create-field {
  margin-bottom: 17px;
}

.contact-create-field--row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.contact-create-field label {
  display: block;
  margin: 0 0 7px;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
}

.contact-create-input,
.contact-create-textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #98a2b3;
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: 400 14px/1.45 inherit;
  outline: 0;
}

.contact-create-input {
  height: 46px;
  padding: 0 14px;
}

.contact-create-textarea {
  min-height: 46px;
  padding: 11px 14px;
  resize: vertical;
}

.contact-create-input::placeholder,
.contact-create-textarea::placeholder {
  color: #98a2b3;
}

.contact-create-input:focus,
.contact-create-textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(36,86,230,.10);
}

.contact-create-modal__footer {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 38px;
}

.contact-create-primary,
.contact-create-cancel {
  min-height: 42px;
  padding: 0 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.contact-create-primary {
  border: 1px solid var(--brand);
  background: var(--brand);
  color: var(--brand-contrast);
}

.contact-create-cancel {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
}

.contact-create-primary:hover {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
}

.contact-create-cancel:hover {
  background: var(--surface-hover);
}

.contact-create-modal-open {
  overflow: hidden;
}

@media (max-width: 575.98px) {
  .crm-contact-profile__quick-actions.company-quick-actions {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 5px !important;
  }

  .crm-contact-profile__quick-actions.company-quick-actions > .company-quick-action {
    min-height: 40px !important;
    height: 40px !important;
  }

  .contact-create-modal {
    width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
  }

  .contact-create-modal__header,
  .contact-create-modal__body {
    padding-left: 18px;
    padding-right: 18px;
  }
}


/* =========================================================
   CONTACT ACTIONS DROPDOWN
   Company Details visual treatment — single level only.
   ========================================================= */

.crm-contact-actions-menu {
  min-width: 255px;
  max-width: 255px;
  padding: 8px 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(16, 24, 40, 0.14);
  overflow: hidden;
}

.crm-contact-actions-menu__search {
  margin: 0 10px 8px;
}

.crm-contact-actions-menu__items {
  max-height: min(540px, calc(100vh - 90px));
  overflow-y: auto;
  padding-bottom: 4px;
}

.crm-contact-action-item {
  min-height: 40px;
  padding: 0 14px;
  gap: 12px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 0;
}

.crm-contact-action-item__icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  color: var(--text-muted);
}

.crm-contact-action-item__icon svg {
  width: 20px;
  height: 20px;
}

.crm-contact-action-item:hover,
.crm-contact-action-item:focus-visible {
  background: var(--surface-hover);
}

/* No nested/sub dropdown. */
.crm-contact-actions-submenu,
.crm-contact-action-item__arrow {
  display: none !important;
}

@media (max-width: 767px) {
  .crm-contact-actions-menu {
    min-width: min(255px, calc(100vw - 16px));
    max-width: calc(100vw - 16px);
    border-radius: 12px;
  }
}


/* =========================================================
   SIDEBAR BLUE-LINK POPUPS
   ========================================================= */

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

.crm-sidebar-action-overlay {
  position: fixed;
  inset: 0;
  z-index: 1300;
  background: rgba(16, 24, 40, 0.34);
  backdrop-filter: blur(2px);
}

.crm-sidebar-action-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 1301;
  width: min(520px, calc(100vw - 32px));
  max-height: min(720px, calc(100vh - 32px));
  transform: translate(-50%, -50%);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(16, 24, 40, 0.20);
}

.crm-sidebar-action-modal[hidden],
.crm-sidebar-action-overlay[hidden] {
  display: none !important;
}

.crm-sidebar-action-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
}

.crm-sidebar-action-modal__header h2 {
  margin: 0;
  color: var(--text);
  font-size: 17px;
  font-weight: 700;
}

.crm-sidebar-action-modal__close {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 25px;
  line-height: 1;
  cursor: pointer;
  border-radius: 8px;
}

.crm-sidebar-action-modal__close:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.crm-sidebar-action-modal__body {
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  padding: 20px;
}

.crm-action-popup-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.crm-action-popup-form label {
  margin-top: 6px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.crm-action-popup-form input,
.crm-action-popup-form select,
.crm-action-popup-form textarea {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  outline: 0;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
}

.crm-action-popup-form input:focus,
.crm-action-popup-form select:focus,
.crm-action-popup-form textarea:focus {
  border-color: var(--brand);
  box-shadow: var(--focus-ring);
}

.crm-action-popup-help {
  margin: 4px 0 8px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
}

.crm-action-popup-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.crm-action-popup-list {
  display: flex;
  flex-direction: column;
}

.crm-action-popup-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 13px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.crm-action-popup-item:hover {
  background: var(--surface-hover);
}

.crm-action-popup-icon {
  width: 22px;
  flex: 0 0 22px;
  color: var(--brand);
  font-size: 17px;
  text-align: center;
}

.crm-action-popup-item span:last-child {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.crm-action-popup-item strong {
  font-size: 13px;
  font-weight: 700;
}

.crm-action-popup-item small {
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.4;
}

.crm-attribution-action {
  color: var(--brand);
  font-weight: 700;
  text-decoration: none;
}

.crm-attribution-action:hover {
  text-decoration: underline;
}

@media (max-width: 767.98px) {
  .crm-sidebar-action-modal {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
    border-radius: 14px;
  }

  .crm-sidebar-action-modal__body {
    padding: 16px;
  }
}

/* =========================================================
   ATTACHMENT FILE INPUT - IMPROVED UI
   ========================================================= */
.crm-action-popup-form input[type="file"] {
  width: 100%;
  min-height: 48px;
  box-sizing: border-box;
  padding: 6px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text-muted);
  font: 500 13px/1.4 inherit;
  cursor: pointer;
  outline: 0;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.crm-action-popup-form input[type="file"]::file-selector-button {
  margin-right: 10px;
  padding: 8px 13px;
  border: 1px solid var(--brand);
  border-radius: 7px;
  background: var(--brand);
  color: var(--brand-contrast);
  font: 600 13px/1 inherit;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease;
}

.crm-action-popup-form input[type="file"]::-webkit-file-upload-button {
  margin-right: 10px;
  padding: 8px 13px;
  border: 1px solid var(--brand);
  border-radius: 7px;
  background: var(--brand);
  color: var(--brand-contrast);
  font: 600 13px/1 inherit;
  cursor: pointer;
}

.crm-action-popup-form input[type="file"]:hover {
  border-color: var(--brand);
  background: var(--surface);
}

.crm-action-popup-form input[type="file"]:hover::file-selector-button {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
}

.crm-action-popup-form input[type="file"]:focus-visible {
  border-color: var(--brand);
  box-shadow: var(--focus-ring);
}

.crm-action-popup-form input[type="file"] + .crm-action-popup-help {
  margin-top: 8px;
  margin-bottom: 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
}

@media (max-width: 575.98px) {
  .crm-action-popup-form input[type="file"] {
    min-height: 46px;
  }

  .crm-action-popup-form input[type="file"]::file-selector-button,
  .crm-action-popup-form input[type="file"]::-webkit-file-upload-button {
    padding: 7px 11px;
    font-size: 12px;
  }
}

/* =========================================================
   CONTACT RELEVANT SIDE POPUP
   Same fixed side-drawer behavior as Company Details.
   ========================================================= */
.contact-relevant-overlay {
  position: fixed;
  inset: 0;
  z-index: 9996;
  background: rgba(16, 24, 40, .30);
  opacity: 0;
  transition: opacity var(--fast) var(--ease);
}

.contact-relevant-overlay.is-open {
  opacity: 1;
}

.contact-relevant-drawer {
  position: fixed;
  z-index: 9997;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(760px, 92vw);
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform var(--slow) var(--ease);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.contact-relevant-drawer.is-open {
  transform: translateX(0);
}

.contact-relevant-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  border-bottom: 1px solid var(--border);
  flex: 0 0 auto;
}

.contact-relevant-head h2 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
}

.contact-relevant-head p {
  margin: 5px 0 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
}

.contact-relevant-head .icon-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.contact-relevant-toolbar {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  flex: 0 0 auto;
}

.contact-relevant-search {
  min-height: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
}

.contact-relevant-search svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--text-subtle);
  stroke-width: 1.8;
  stroke-linecap: round;
}

.contact-relevant-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
}

.contact-relevant-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 0 20px 24px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.contact-relevant-section {
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}

.contact-relevant-section:last-child {
  border-bottom: 0;
}

.contact-relevant-section-title {
  margin-bottom: 10px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.contact-relevant-list {
  display: flex;
  flex-direction: column;
}

.contact-relevant-row {
  display: grid;
  grid-template-columns: minmax(150px, 35%) minmax(0, 1fr);
  gap: 16px;
  padding: 11px 0;
  border-top: 1px solid var(--border);
}

.contact-relevant-row:first-child {
  border-top: 0;
}

.contact-relevant-row span {
  color: var(--text-subtle);
  font-size: 12px;
}

.contact-relevant-row strong {
  min-width: 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.contact-relevant-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.contact-relevant-actions button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.contact-relevant-actions button:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
}

.contact-relevant-actions button span {
  color: var(--brand);
  font-size: 16px;
  line-height: 1;
}

body.contact-relevant-open {
  overflow: hidden;
}

.crm-contact-profile__quick-actions .company-quick-action[data-tooltip] {
    position: relative !important;
}

.crm-contact-profile__quick-actions .company-quick-action[data-tooltip]::after {
    content: attr(data-tooltip);

    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    top: auto;

    transform: translateX(-50%) translateY(4px);

    padding: 6px 9px;
    border-radius: 6px;

    background: #101828;
    color: #fff;

    font-size: 12px;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    z-index: 7;

    transition:
        opacity .15s ease,
        visibility .15s ease,
        transform .15s ease;
}

.crm-contact-profile__quick-actions .company-quick-action[data-tooltip]:hover::after,
.crm-contact-profile__quick-actions .company-quick-action[data-tooltip]:focus-visible::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Keep contact details page itself viewport-locked like Company Details. */
@media (min-width: 1199.98px) {
  body:has(.crm-details-page) {
    overflow: hidden;
  }

  .crm-details-page {
    height: calc(100vh - var(--header-h));
    min-height: 0;
    overflow: hidden;
  }
}

@media (max-width: 767.98px) {
  .contact-relevant-drawer {
    width: min(100vw, 760px);
  }

  .contact-relevant-head,
  .contact-relevant-toolbar,
  .contact-relevant-body {
    padding-left: 16px;
    padding-right: 16px;
  }

  .contact-relevant-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .contact-relevant-actions {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   DEAL-DETAILS VIEWPORT MATCH
   Same contained viewport behavior as the Deal Details screen.
   No browser/page scroll; columns scroll internally.
   ========================================================= */

@media (min-width: 1400px) {
  html:has(.crm-details-page),
  body:has(.crm-details-page) {
    overflow: hidden !important;
  }

  .crm-details-page {
    height: calc(100dvh - var(--header-h, 60px) - 5vh) !important;
    max-height: calc(100dvh - var(--header-h, 60px) - 5vh) !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  .crm-details-page .crm-contact-layout.crm-container-fluid,
  .crm-details-page .crm-contact-layout__row,
  .crm-details-page .crm-contact-layout__left,
  .crm-details-page .crm-contact-layout__center,
  .crm-details-page .crm-contact-layout__right,
  .crm-details-page .crm-center-panel {
    min-height: 0 !important;
  }

  .crm-details-page .crm-contact-layout__left,
  .crm-details-page .crm-contact-layout__right {
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }

  .crm-details-page .crm-contact-layout__center,
  .crm-details-page .crm-center-panel {
    overflow: hidden !important;
  }
}

/* =========================================================
   FINAL VIEWPORT-LOCKED THREE-COLUMN LAYOUT
   Match the Company/Deal details behavior:
   - no browser/page scroll on desktop
   - one fixed viewport area below the app header
   - each of the 3 columns owns its own vertical scroll
   - center activity content scrolls inside the center panel
   ========================================================= */

@media (min-width: 1400px) {
  html:has(.crm-details-page),
  body:has(.crm-details-page) {
    height: 100%;
    overflow: hidden !important;
  }

  .crm-details-page {
    box-sizing: border-box;
    height: calc(100dvh - var(--header-h, 60px)) !important;
    min-height: 0 !important;
    max-height: calc(100dvh - var(--header-h, 60px)) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }

  .crm-details-page .company-record-header {
    flex: 0 0 45px !important;
    height: 45px !important;
    min-height: 45px !important;
    margin-bottom: 10px !important;
    box-sizing: border-box;
  }

  .crm-details-page .crm-contact-layout.crm-container-fluid {
    flex: 1 1 auto !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    box-sizing: border-box;
  }

  .crm-details-page .crm-contact-layout__row {
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    gap: 14px !important;
    overflow: hidden !important;
    box-sizing: border-box;
  }

  .crm-details-page .crm-contact-layout__left,
  .crm-details-page .crm-contact-layout__center,
  .crm-details-page .crm-contact-layout__right {
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
    box-sizing: border-box;
  }

  /* Left and right panels scroll independently. */
  .crm-details-page .crm-contact-layout__left,
  .crm-details-page .crm-contact-layout__right {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) transparent;
  }

  /* Center column itself never becomes the page scroller. */
  .crm-details-page .crm-contact-layout__center {
    overflow: hidden !important;
  }

  .crm-details-page .crm-center-panel {
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    box-sizing: border-box;
  }

  /* Only the activity body scrolls in the middle column. */
  .crm-details-page .crm-activity-content {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) transparent;
  }

  .crm-details-page .crm-activity-list {
    min-height: 0;
  }

  /* Keep the existing 3 / 6 / 3 desktop proportions. */
  .crm-details-page .crm-contact-layout__left {
    flex: 0 0 calc(25% - 7px) !important;
    width: calc(25% - 7px) !important;
    max-width: calc(25% - 7px) !important;
  }

  .crm-details-page .crm-contact-layout__center {
    flex: 0 0 calc(50% - 14px) !important;
    width: calc(50% - 14px) !important;
    max-width: calc(50% - 14px) !important;
  }

  .crm-details-page .crm-contact-layout__right {
    flex: 0 0 calc(25% - 7px) !important;
    width: calc(25% - 7px) !important;
    max-width: calc(25% - 7px) !important;
  }

  .crm-details-page .crm-panel {
    min-height: 0;
  }
}

/* =========================================================
   DESK PAGE - EXACT DEAL DETAILS VIEWPORT HEIGHT
   Reduce the page itself by 5vh so the bottom gap is real
   and the three columns stop above the viewport bottom.
   Desktop only; mobile/tablet remain unchanged.
   ========================================================= */
@media (min-width: 1400px) {
  .crm-details-page {
    height: calc(100dvh - var(--header-h, 60px) - 5vh) !important;
    max-height: calc(100dvh - var(--header-h, 60px) - 5vh) !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  .crm-details-page .crm-contact-layout.crm-container-fluid {
    margin-bottom: 0 !important;
  }
}
