/* CRM V2.5.6 premium navigation, customer-owner width and internal messaging. */
:root {
  --v256-sidebar-width: 252px;
  --v256-sidebar-compact: 86px;
  --v256-navy-950: #06101f;
  --v256-navy-900: #091528;
  --v256-navy-850: #0c1b31;
  --v256-blue: #4c8dff;
  --v256-cyan: #4bcfff;
}

.sidebar {
  width: var(--v256-sidebar-width);
  padding: 16px 12px 12px;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 0%, rgba(49,198,247,.13), transparent 30%),
    radial-gradient(circle at 100% 40%, rgba(76,141,255,.09), transparent 34%),
    linear-gradient(160deg, var(--v256-navy-850) 0%, var(--v256-navy-950) 76%);
  border-right: 1px solid rgba(126,168,228,.12);
  box-shadow: 18px 0 58px rgba(7,23,45,.17);
  transition: width .3s cubic-bezier(.22,.8,.22,1), padding .3s ease;
}

.sidebar::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .17;
  background-image:
    linear-gradient(rgba(129,173,234,.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(129,173,234,.06) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, #000, transparent 67%);
}

.sidebar > * { position: relative; z-index: 1; }
.main { margin-left: var(--v256-sidebar-width); transition: margin-left .3s cubic-bezier(.22,.8,.22,1); }

.brand {
  position: relative;
  min-height: 66px;
  gap: 11px;
  padding: 5px 8px 16px;
  margin-bottom: 5px;
  border-bottom: 1px solid rgba(142,177,225,.11);
}

.brand .small-logo,
.brand .brand-logo {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  object-fit: contain;
  border-radius: 13px;
  border: 1px solid rgba(255,255,255,.22);
  background: linear-gradient(145deg,#31cafa,#3479f5 66%,#5a5ce8);
  box-shadow: 0 11px 26px rgba(44,142,245,.25), inset 0 1px 0 rgba(255,255,255,.36);
}

.brand .small-logo { display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 800; letter-spacing: .06em; }
.brand .brand-copy { min-width: 0; padding-right: 25px; white-space: nowrap; overflow: hidden; }
.brand strong { font-size: 16px; font-weight: 760; letter-spacing: .02em; }
.brand small { margin-top: 5px; color: #8298b8; font-size: 9.5px; letter-spacing: .08em; }

.sidebar-collapse {
  position: absolute;
  right: 2px;
  top: 13px;
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(145,180,228,.12);
  border-radius: 8px;
  color: #7187a6;
  background: rgba(255,255,255,.035);
  cursor: pointer;
  transition: .2s ease;
}

.sidebar-collapse:hover { color: white; border-color: rgba(76,141,255,.4); background: rgba(76,141,255,.13); }
.sidebar-collapse svg { width: 15px; height: 15px; }

.sidebar .nav-title {
  height: 29px;
  padding: 8px 12px 6px;
  color: #5f7697;
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: .15em;
}

.sidebar nav {
  display: block;
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(126,156,198,.22) transparent;
}

.sidebar .nav-btn {
  position: relative;
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 3px 0;
  padding: 5px 11px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #a6b5cb;
  background: transparent;
  font-size: 13px;
  font-weight: 590;
  white-space: nowrap;
  transition: color .2s ease, background .2s ease, border-color .2s ease, transform .2s ease;
}

.sidebar .nav-btn:hover { color: #f6f9ff; background: rgba(106,150,216,.075); transform: translateX(1px); }
.sidebar .nav-btn.active {
  color: #fff;
  border-color: rgba(91,151,255,.17);
  background: linear-gradient(90deg,rgba(50,117,247,.24),rgba(49,198,247,.08));
  box-shadow: inset 3px 0 0 var(--v256-cyan),0 8px 20px rgba(3,16,35,.16);
}

.sidebar .nav-btn em { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; font-style: normal; }
.sidebar .nav-btn .nav-line-icon {
  width: 31px;
  height: 31px;
  flex: 0 0 31px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: #7d94b5;
  transition: .2s ease;
}

.sidebar .nav-btn .nav-line-icon i { display: grid; place-items: center; font-style: normal; }
.sidebar .nav-btn .nav-line-icon svg { width: 18px; height: 18px; }
.sidebar .nav-btn:hover .nav-line-icon { color: #9fdcff; }
.sidebar .nav-btn.active .nav-line-icon { color: #70d9ff; background: rgba(70,170,255,.11); box-shadow: 0 0 18px rgba(58,160,255,.12); }

.nav-count {
  min-width: 21px;
  height: 20px;
  display: grid;
  place-items: center;
  padding: 0 6px;
  border: 1px solid rgba(103,191,255,.19);
  border-radius: 999px;
  color: #a0e1ff;
  font-size: 9.5px;
  background: rgba(61,157,239,.1);
}

.sidebar .nav-group { display: block; }
.sidebar .nav-group-toggle b { margin-left: auto; color: #64809f; }
.sidebar .nav-submenu { position: relative; display: grid; gap: 2px; padding: 4px 0 7px 38px; }
.sidebar .nav-submenu.hidden { display: none; }
.sidebar .nav-submenu::before { content: ""; position: absolute; left: 25px; top: 6px; bottom: 9px; width: 1px; background: linear-gradient(to bottom,rgba(70,159,255,.54),rgba(105,140,190,.08)); }

.sidebar .nav-submenu button {
  position: relative;
  min-height: 37px;
  justify-content: flex-start;
  gap: 8px;
  padding: 4px 7px;
  color: #788ca9;
  font-size: 11.5px;
  border-radius: 9px;
}

.sidebar .nav-submenu button::before { content: ""; position: absolute; left: -15px; width: 5px; height: 5px; border: 1px solid #4a719c; border-radius: 50%; background: #091528; }
.sidebar .nav-submenu button:hover,
.sidebar .nav-submenu button.active { color: #c3eaff; background: rgba(49,151,244,.09); }
.sidebar .nav-submenu button.active::before { border-color: #5cd7ff; background: #5cd7ff; box-shadow: 0 0 11px rgba(92,215,255,.75); }
.sidebar .nav-submenu button em { flex: 1; overflow: hidden; text-overflow: ellipsis; font-style: normal; }
.sidebar .nav-submenu .nav-sub-icon { width: 22px; height: 22px; display: grid; place-items: center; flex: 0 0 22px; color: #6784a8; }
.sidebar .nav-submenu .nav-sub-icon svg { width: 14px; height: 14px; }
.sidebar .nav-submenu .drag-handle { display: none; color: #536a87; font-style: normal; cursor: grab; letter-spacing: -2px; }
.sidebar .nav-submenu .tool-reorder-enabled .drag-handle { display: block; }

.sidebar-footer {
  flex: 0 0 auto;
  max-height: 112px;
  overflow: auto;
  margin-top: 8px;
  padding: 12px 11px 6px;
  border-top: 1px solid rgba(142,177,225,.11);
  color: #667c9b;
  font-size: 10.5px;
  line-height: 1.72;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

body.crm-sidebar-compact .sidebar { width: var(--v256-sidebar-compact); padding-inline: 12px; }
body.crm-sidebar-compact .main { margin-left: var(--v256-sidebar-compact); }
body.crm-sidebar-compact .brand { justify-content: center; padding-inline: 7px; }
body.crm-sidebar-compact .brand-copy,
body.crm-sidebar-compact .nav-title,
body.crm-sidebar-compact .nav-btn em,
body.crm-sidebar-compact .nav-count,
body.crm-sidebar-compact .nav-group-toggle b,
body.crm-sidebar-compact .nav-submenu,
body.crm-sidebar-compact .sidebar-footer { display: none !important; }
body.crm-sidebar-compact .sidebar-collapse { right: -7px; top: 14px; background: #10213a; }
body.crm-sidebar-compact .sidebar-collapse svg { transform: rotate(180deg); }
body.crm-sidebar-compact .sidebar .nav-btn { justify-content: center; padding-inline: 7px; }
body.crm-sidebar-compact .sidebar .nav-btn.active { box-shadow: inset 0 0 0 1px rgba(91,151,255,.18),0 8px 20px rgba(3,16,35,.18); }

/* Preserve a readable owner column next to the sticky action column. */
.customer-table { min-width: 1400px; }
.customer-table th:nth-last-child(2),
.customer-table td:nth-last-child(2) { min-width: 104px; width: 104px; max-width: 104px; white-space: normal; overflow-wrap: anywhere; }
.customer-table th:last-child,
.customer-table td:last-child { min-width: 318px; }

/* Internal messaging. */
.message-center-v256 { min-height: calc(100vh - 142px); display: grid; grid-template-columns: 320px minmax(0,1fr); overflow: hidden; padding: 0; }
.message-people-v256 { min-width: 0; border-right: 1px solid #e3eaf3; background: linear-gradient(180deg,#fbfdff,#f7fafe); }
.message-people-head-v256 { min-height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 18px 13px; }
.message-people-head-v256 h3 { margin: 0; color: #132844; font-size: 17px; }
.message-people-head-v256 p { margin: 5px 0 0; color: #8a99ae; font-size: 10.5px; }
.message-people-head-v256 button { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid #dce6f2; border-radius: 10px; color: #66809f; background: white; cursor: pointer; }
.message-people-head-v256 button:hover { color: #2469dd; border-color: #aecdff; }
.message-people-head-v256 svg { width: 16px; height: 16px; }
.message-search-v256 { height: 38px; display: flex; align-items: center; gap: 8px; margin: 0 16px 12px; padding: 0 11px; border: 1px solid #dce5ef; border-radius: 10px; color: #8495ac; background: #fff; }
.message-search-v256 svg { width: 15px; height: 15px; }
.message-search-v256 input { height: 34px; padding: 0; border: 0; box-shadow: none; background: transparent; font-size: 12px; }
.message-search-v256 input:focus { box-shadow: none; }
.message-people-list-v256 { height: calc(100vh - 275px); overflow-y: auto; padding: 0 10px 14px; }
.message-person-v256 { width: 100%; display: grid; grid-template-columns: 42px minmax(0,1fr) auto; align-items: center; gap: 10px; margin: 3px 0; padding: 10px; border: 1px solid transparent; border-radius: 12px; color: #263a54; background: transparent; cursor: pointer; text-align: left; }
.message-person-v256:hover { background: #f0f6ff; }
.message-person-v256.active { border-color: #c9defb; background: linear-gradient(90deg,#eaf3ff,#f3f9ff); box-shadow: inset 3px 0 #3e80ea; }
.message-person-avatar-v256,.message-avatar-v256 { position: relative; display: grid; place-items: center; border-radius: 12px; color: #eaf7ff; font-weight: 750; background: linear-gradient(145deg,#214c7f,#1d8cb8); }
.message-person-avatar-v256 { width: 42px; height: 42px; font-size: 14px; }
.message-person-avatar-v256 img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.message-online-dot-v256 { position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border: 2px solid #fff; border-radius: 50%; background: #9aa9bc; }
.message-online-dot-v256.online { background: #34d399; box-shadow: 0 0 0 3px rgba(52,211,153,.12); }
.message-person-main-v256 { min-width: 0; }
.message-person-main-v256 strong { display: block; overflow: hidden; color: #1a304e; font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }
.message-person-main-v256 span { display: block; margin-top: 4px; overflow: hidden; color: #8494aa; font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.message-person-side-v256 { display: grid; justify-items: end; gap: 5px; color: #9aa8ba; font-size: 9.5px; }
.message-unread-v256 { min-width: 19px; height: 19px; display: grid; place-items: center; padding: 0 5px; border-radius: 99px; color: #fff; font-size: 9px; background: #3478e5; }
.message-empty-v256 { padding: 42px 15px; color: #8c9cb1; font-size: 12px; text-align: center; }
.message-conversation-v256 { min-width: 0; display: grid; grid-template-rows: 76px minmax(280px,1fr) auto; background: #fff; }
.message-conversation-head-v256 { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid #e3eaf3; }
.message-avatar-v256 { width: 42px; height: 42px; font-size: 13px; }
.message-avatar-v256 img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.message-conversation-head-v256 strong { display: block; color: #1a304e; font-size: 13.5px; }
.message-conversation-head-v256 span { display: block; margin-top: 5px; color: #8494aa; font-size: 10.5px; }
.message-thread-v256 { overflow-y: auto; padding: 24px; background: linear-gradient(180deg,#f9fbfe,#f5f8fc); }
.message-thread-placeholder-v256 { min-height: 100%; display: grid; place-content: center; justify-items: center; color: #94a5ba; text-align: center; }
.message-thread-placeholder-v256 svg { width: 40px; height: 40px; margin-bottom: 14px; color: #86aee8; }
.message-thread-placeholder-v256 strong { color: #59708e; font-size: 14px; }
.message-thread-placeholder-v256 span { margin-top: 7px; font-size: 11px; }
.message-row-v256 { display: flex; margin: 8px 0; }
.message-row-v256.mine { justify-content: flex-end; }
.message-bubble-v256 { max-width: min(68%,620px); padding: 10px 13px 8px; border: 1px solid #dce7f4; border-radius: 5px 15px 15px 15px; color: #2a405e; background: #fff; box-shadow: 0 4px 12px rgba(39,69,109,.05); }
.message-row-v256.mine .message-bubble-v256 { border-color: #2f72dc; border-radius: 15px 5px 15px 15px; color: #fff; background: linear-gradient(145deg,#347cec,#2764cb); }
.message-bubble-v256 p { margin: 0; font-size: 12.5px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.message-bubble-v256 time { display: block; margin-top: 5px; color: #93a2b5; font-size: 9px; text-align: right; }
.message-row-v256.mine time { color: rgba(255,255,255,.67); }
.message-composer-v256 { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; padding: 14px 17px; border-top: 1px solid #e3eaf3; background: #fff; }
.message-composer-v256 textarea { min-height: 54px; max-height: 120px; resize: vertical; border-color: #dce5f0; font-size: 12.5px; line-height: 1.55; }
.message-composer-v256 button { align-self: stretch; min-width: 92px; display: flex; align-items: center; justify-content: center; gap: 7px; }
.message-composer-v256 button svg { width: 15px; height: 15px; }

@media (max-width: 1050px) {
  .message-center-v256 { grid-template-columns: 270px minmax(0,1fr); }
  .message-bubble-v256 { max-width: 80%; }
}

@media print {
  .message-center-v256 { display: none !important; }
}
