/* CODSHIPX AI CRM R67-B2 CUSTOMER 360 + CRM PREMIUM UI */

:root {
  --cx-r67-ink: #102742;
  --cx-r67-muted: #76889d;
  --cx-r67-line: #dfe7ee;
  --cx-r67-soft: #f7f9fb;
  --cx-r67-lime: #8bdc0d;
  --cx-r67-lime-soft: #f1f9df;
}

/* ==========================================================
   MAIN CRM OVERVIEW
   ========================================================== */

.r7-crm .cx-r67-overview-strip {
  gap: 14px !important;
}

.r7-crm .cx-r67-overview-strip > div {
  position: relative;
  min-height: 126px !important;
  padding: 20px 20px 18px 72px !important;
  overflow: hidden;
  background:
    radial-gradient(circle at 100% 0, rgba(139,220,13,.11), transparent 38%),
    linear-gradient(145deg, #fff, #fcfefd) !important;
}

.r7-crm .cx-r67-metric-icon {
  position: absolute;
  top: 20px;
  left: 19px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid #dce9c7;
  border-radius: 13px;
  color: #659b12;
  background: linear-gradient(145deg, #f7fceb, #eef8dc);
  box-shadow: 0 8px 20px rgba(77,122,14,.10);
}

.r7-crm .cx-r67-overview-strip small {
  display: block;
  color: #78899d;
  font-size: 10.5px;
  font-weight: 800;
}

.r7-crm .cx-r67-overview-strip strong {
  display: block;
  margin-top: 7px;
  color: var(--cx-r67-ink);
  font-size: 23px;
  line-height: 1.1;
}

.r7-crm .cx-r67-overview-strip em {
  display: block;
  margin-top: 6px;
  color: #7d8e9f;
  font-size: 10.5px;
  font-style: normal;
}

/* ==========================================================
   MAIN CRM TABS
   ========================================================== */

.r7-crm .cx-r67-main-tabs {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 5px !important;
  width: 100% !important;
  max-width: none !important;
  overflow: visible !important;
  padding: 6px !important;
}

.r7-crm .cx-r67-main-tabs button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px !important;
  padding: 0 13px !important;
  color: #64768b;
  border: 1px solid transparent;
}

.r7-crm .cx-r67-main-tabs button .app-icon {
  flex: none;
  opacity: .84;
}

.r7-crm .cx-r67-main-tabs button.active {
  color: #365d09 !important;
  background: #fff !important;
  border-color: #d7e8bc !important;
}

.r7-crm .cx-r67-main-tabs button.active .app-icon {
  color: #70ab10;
  opacity: 1;
}

.r7-crm .cx-r67-main-tabs button b {
  display: inline-grid;
  min-width: 21px;
  height: 21px;
  place-items: center;
  padding: 0 6px;
  border-radius: 999px;
  color: #617286;
  background: #edf1f4;
  font-size: 9px;
}

.r7-crm .cx-r67-main-tabs button.active b {
  color: #527f0d;
  background: #edf8dc;
}

/* ==========================================================
   CUSTOMER SEARCH
   ========================================================== */

.r7-crm .table-toolbar.r53-toolbar {
  gap: 12px !important;
  padding: 17px 18px !important;
  background: linear-gradient(#fff, #fcfdfe);
  border-bottom: 1px solid #edf1f4;
}

.r7-crm .table-toolbar .cx-r67-customer-search {
  width: min(620px, 60%) !important;
  min-width: 310px;
  height: 50px !important;
  padding: 0 14px !important;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff !important;
  border: 1px solid #ced9e3 !important;
  border-radius: 14px !important;
  box-shadow:
    0 7px 20px rgba(15,38,63,.06),
    inset 0 1px rgba(255,255,255,.9);
  transition:
    border-color .15s,
    box-shadow .15s,
    background .15s;
}

.r7-crm .table-toolbar .cx-r67-customer-search:focus-within {
  border-color: #91cb27 !important;
  box-shadow:
    0 0 0 4px rgba(139,220,13,.12),
    0 10px 25px rgba(15,38,63,.07);
}

.r7-crm .cx-r67-search-icon {
  flex: none;
  color: #71869a;
  display: grid;
  place-items: center;
}

.r7-crm .cx-r67-customer-search input {
  width: 100%;
  height: 46px !important;
  min-height: 46px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #17314d;
  font-size: 12.5px !important;
}

.r7-crm .cx-r67-customer-search input::placeholder {
  color: #8796a8;
  opacity: 1;
}

/* ==========================================================
   CUSTOMER 360
   ========================================================== */

.r7-crm-customer-detail {
  width: min(1040px, calc(100vw - 64px)) !important;
  max-width: 1040px !important;
}

.r7-crm-customer-detail .cx-r67-360 {
  padding: 0 !important;
  border-top: 1px solid #e7edf2;
  border-bottom: 1px solid #e7edf2;
  background: #fff;
}

.r7-crm-customer-detail .cx-r67-360-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px 16px;
  background:
    radial-gradient(circle at 95% 0, rgba(139,220,13,.10), transparent 32%),
    linear-gradient(#fff, #fcfefd);
}

.r7-crm-customer-detail .cx-r67-360-head h3 {
  margin: 6px 0 4px;
  color: var(--cx-r67-ink);
  font-size: 18px;
  letter-spacing: -.02em;
}

.r7-crm-customer-detail .cx-r67-360-head p {
  margin: 0;
  font-size: 11.5px;
  color: #7b8ca0;
}

.cx-r67-live-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: none;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #d9e8c0;
  border-radius: 999px;
  color: #5a8a13;
  background: #f3f9e7;
  font-size: 9.5px;
  font-weight: 850;
}

.cx-r67-live-chip i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #8bdc0d;
  box-shadow: 0 0 0 4px rgba(139,220,13,.13);
}

.cx-r67-tabs {
  display: flex;
  gap: 6px;
  padding: 10px 18px;
  overflow-x: auto;
  scrollbar-width: thin;
  background: #f7f9fb;
  border-top: 1px solid #edf1f4;
  border-bottom: 1px solid #e9eef2;
}

.cx-r67-tabs button {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px !important;
  padding: 0 12px !important;
  border: 1px solid #e0e7ed !important;
  border-radius: 11px !important;
  color: #65778c;
  background: #fff;
  font-size: 10.5px;
  font-weight: 760;
}

.cx-r67-tabs button.active {
  color: #416a0b;
  border-color: #cfe2ad !important;
  background: linear-gradient(145deg, #f7fceb, #eef8dc);
  box-shadow: 0 5px 14px rgba(65,105,10,.08);
}

.cx-r67-tabs button b {
  display: grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  padding: 0 5px;
  border-radius: 999px;
  background: #edf1f4;
  color: #718095;
  font-size: 8.5px;
}

.cx-r67-tabs button.active b {
  background: #dff1be;
  color: #54800f;
}

.cx-r67-tab-body {
  min-height: 260px;
  padding: 20px 22px 23px;
  background: #fff;
}

.cx-r67-loading,
.cx-r67-empty {
  min-height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 25px;
  text-align: center;
  color: #7e8fa2;
}

.cx-r67-loading strong,
.cx-r67-empty strong {
  color: #223b56;
  font-size: 13px;
}

.cx-r67-loading small,
.cx-r67-empty small {
  max-width: 500px;
  line-height: 1.55;
}

.cx-r67-spinner {
  width: 34px;
  height: 34px;
  margin-bottom: 5px;
  border: 3px solid #e6eed9;
  border-top-color: #85d20b;
  border-radius: 50%;
  animation: cxR67Spin .7s linear infinite;
}

@keyframes cxR67Spin {
  to {
    transform: rotate(360deg);
  }
}

.cx-r67-error {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 20px 0;
  padding: 11px 12px;
  border: 1px solid #f0d0d0;
  border-radius: 12px;
  color: #a84b4b;
  background: #fff7f7;
  font-size: 10.5px;
}

/* Overview */

.cx-r67-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 10px;
}

.cx-r67-metric {
  min-height: 96px;
  display: grid;
  grid-template-columns: 40px minmax(0,1fr);
  align-items: center;
  gap: 11px;
  padding: 14px;
  border: 1px solid #e0e8ee;
  border-radius: 15px;
  background:
    radial-gradient(circle at 100% 0, rgba(139,220,13,.08), transparent 37%),
    #fff;
  box-shadow: 0 7px 20px rgba(15,38,63,.05);
}

.cx-r67-metric > span {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid #dde9ca;
  border-radius: 12px;
  color: #659c11;
  background: #f3f9e8;
}

.cx-r67-metric div {
  min-width: 0;
}

.cx-r67-metric small,
.cx-r67-metric strong,
.cx-r67-metric em {
  display: block;
}

.cx-r67-metric small {
  color: #8291a2;
  font-size: 9.5px;
  font-weight: 760;
}

.cx-r67-metric strong {
  margin-top: 4px;
  color: #17304b;
  font-size: 17px;
  overflow-wrap: anywhere;
}

.cx-r67-metric em {
  margin-top: 3px;
  color: #8997a6;
  font-size: 9px;
  font-style: normal;
}

.cx-r67-overview-grid {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 10px;
  margin-top: 12px;
}

.cx-r67-overview-grid article {
  position: relative;
  min-height: 132px;
  padding: 17px;
  border: 1px solid #e2e9ef;
  border-radius: 15px;
  background: #fbfcfd;
}

.cx-r67-card-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  margin-bottom: 12px;
  border-radius: 10px;
  color: #6a9e14;
  background: #eff8df;
}

.cx-r67-overview-grid article > small {
  display: block;
  color: #8896a6;
  font-size: 9.5px;
  font-weight: 760;
}

.cx-r67-overview-grid article > strong {
  display: block;
  margin-top: 5px;
  color: #19334e;
  font-size: 13px;
}

.cx-r67-overview-grid article > p {
  margin: 5px 0 0;
  color: #7c8c9e;
  font-size: 10px;
  overflow-wrap: anywhere;
}

.cx-r67-status-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.cx-r67-status-grid > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 31px;
  padding: 0 10px;
  border: 1px solid #e0e7ed;
  border-radius: 999px;
  background: #f8fafb;
}

.cx-r67-status-grid b {
  color: #203a55;
  font-size: 11px;
}

.cx-r67-status-grid small {
  color: #8291a3;
  font-size: 9px;
}

/* Lists */

.cx-r67-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cx-r67-row {
  display: grid;
  grid-template-columns: 39px minmax(0,1fr) auto auto;
  align-items: center;
  gap: 11px;
  min-height: 68px;
  padding: 11px 13px;
  border: 1px solid #e1e8ee;
  border-radius: 14px;
  background: #fff;
  transition:
    transform .15s,
    border-color .15s,
    box-shadow .15s;
}

.cx-r67-row:hover {
  transform: translateY(-1px);
  border-color: #d2e2bc;
  box-shadow: 0 8px 21px rgba(15,38,63,.07);
}

.cx-r67-row-icon {
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  color: #659c11;
  border-radius: 12px;
  background: #f0f8e2;
}

.cx-r67-row-main {
  min-width: 0;
}

.cx-r67-row-main strong,
.cx-r67-row-main small {
  display: block;
}

.cx-r67-row-main strong {
  color: #1b354f;
  font-size: 11.5px;
}

.cx-r67-row-main small {
  margin-top: 4px;
  color: #8594a4;
  font-size: 9.5px;
}

.cx-r67-value {
  color: #17314c;
  font-size: 11px;
  white-space: nowrap;
}

.cx-r67-status {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border: 1px solid #dde5eb;
  border-radius: 999px;
  color: #687a8f;
  background: #f6f8fa;
  font-size: 8.5px;
  font-weight: 820;
  white-space: nowrap;
}

.cx-r67-status.status-completed,
.cx-r67-status.status-delivered {
  color: #438014;
  border-color: #d5e8bb;
  background: #f1f9e5;
}

.cx-r67-status.status-cancelled,
.cx-r67-status.status-returned {
  color: #ad5151;
  border-color: #efd3d3;
  background: #fff5f5;
}

.cx-r67-unread {
  min-height: 25px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  color: #537e10;
  background: #eaf6d6;
  font-size: 8.5px;
  white-space: nowrap;
}

/* Messages */

.cx-r67-subsection {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #e9eef2;
}

.cx-r67-subsection h4 {
  margin: 0 0 10px;
  color: #203951;
  font-size: 11px;
}

.cx-r67-message-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cx-r67-message {
  max-width: 78%;
  padding: 10px 11px;
  border: 1px solid #e1e8ed;
  border-radius: 13px 13px 13px 5px;
  background: #f8fafb;
}

.cx-r67-message.out {
  align-self: flex-end;
  border-color: #d9e8c0;
  border-radius: 13px 13px 5px 13px;
  background: #f1f9e5;
}

.cx-r67-message strong {
  display: block;
  color: #73859a;
  font-size: 8.5px;
  text-transform: uppercase;
}

.cx-r67-message p {
  margin: 4px 0 !important;
  color: #304960 !important;
  font-size: 10.5px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.cx-r67-message small {
  font-size: 8.5px;
}

/* Activity */

.cx-r67-timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.cx-r67-timeline article {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0,1fr);
  gap: 11px;
  padding: 4px 0 17px;
}

.cx-r67-timeline article > i {
  width: 10px;
  height: 10px;
  margin-top: 4px;
  border-radius: 50%;
  background: #8bdc0d;
  box-shadow: 0 0 0 5px rgba(139,220,13,.10);
}

.cx-r67-timeline article:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 18px;
  bottom: 0;
  left: 4px;
  width: 1px;
  background: #dfe7ed;
}

.cx-r67-timeline strong {
  display: block;
  color: #203a54;
  font-size: 11px;
}

.cx-r67-timeline small {
  display: block;
  margin-top: 3px;
  font-size: 9px;
}

.cx-r67-timeline p {
  margin: 5px 0 0 !important;
  color: #73859a !important;
  font-size: 10px;
}

.cx-r67-note-grid {
  display: grid;
  gap: 8px;
}

.cx-r67-note-grid article {
  display: grid;
  grid-template-columns: 30px minmax(0,1fr);
  gap: 9px;
  padding: 10px;
  border: 1px solid #e2e9ef;
  border-radius: 12px;
  background: #fafcfd;
}

.cx-r67-note-grid .app-icon {
  color: #789f25;
}

.cx-r67-note-grid p {
  margin: 0 !important;
  color: #364f67 !important;
  font-size: 10.5px;
}

.cx-r67-note-grid small {
  display: block;
  margin-top: 4px;
  font-size: 8.5px;
}

.cx-r67-muted {
  color: #8796a6;
}

/* Codi Insight */

.cx-r67-codi-wrap {
  padding: 3px;
}

.cx-r67-codi {
  display: grid;
  grid-template-columns: 58px minmax(0,1fr);
  gap: 17px;
  padding: 22px;
  border: 1px solid #dce9c6;
  border-radius: 19px;
  background:
    radial-gradient(circle at 100% 0, rgba(139,220,13,.15), transparent 34%),
    linear-gradient(145deg, #fbfef6, #f4fae9);
  box-shadow: 0 12px 30px rgba(69,105,12,.08);
}

.cx-r67-codi-orb {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  color: #6a9e12;
  background: #fff;
  border: 1px solid #dae8c2;
  box-shadow: 0 10px 26px rgba(67,103,10,.10);
}

.cx-r67-codi-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cx-r67-codi-title b {
  min-height: 27px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  color: #547f10;
  background: #e8f5d2;
  font-size: 8.5px;
  text-transform: uppercase;
}

.cx-r67-codi h3 {
  margin: 8px 0 6px;
  color: #17314b !important;
  font-size: 17px !important;
}

.cx-r67-codi p {
  margin: 0 !important;
  color: #63788e !important;
  font-size: 11.5px;
}

.cx-r67-next-action {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 15px;
  padding: 11px 12px;
  border: 1px solid #dce8c7;
  border-radius: 12px;
  color: #5d8c13;
  background: #fff;
}

.cx-r67-next-action > span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cx-r67-next-action small {
  color: #81916f;
  font-size: 8.5px;
}

.cx-r67-next-action strong {
  color: #294623;
  font-size: 10.5px;
}

.cx-r67-grounded {
  display: block;
  margin-top: 10px;
  color: #8a9980 !important;
  font-size: 8.5px !important;
}

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

@media (max-width: 980px) {
  .cx-r67-metrics {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }

  .cx-r67-overview-grid {
    grid-template-columns: 1fr;
  }

  .r7-crm .table-toolbar .cx-r67-customer-search {
    width: 100% !important;
  }

  .r7-crm .table-toolbar.r53-toolbar {
    flex-wrap: wrap;
  }
}

@media (max-width: 700px) {
  .r7-crm .cx-r67-overview-strip > div {
    min-height: 112px !important;
  }

  .cx-r67-metrics {
    grid-template-columns: 1fr;
  }

  .cx-r67-tab-body {
    padding: 15px;
  }

  .cx-r67-row {
    grid-template-columns: 38px minmax(0,1fr) auto;
  }

  .cx-r67-value {
    grid-column: 2 / -1;
  }

  .cx-r67-codi {
    grid-template-columns: 1fr;
  }

  .cx-r67-codi-orb {
    width: 48px;
    height: 48px;
  }

  .cx-r67-message {
    max-width: 90%;
  }

  .r7-crm .table-toolbar .cx-r67-customer-search {
    min-width: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cx-r67-spinner {
    animation: none;
  }

  .cx-r67-row {
    transition: none;
  }
}
