.tab_journey .font-weight-bold {
  font-weight: 600;
}
#journey .text-muted {
  font-size: 12px;
  margin-bottom: 4px;
}

.tab_journey .stage-card {
  border-left: 4px solid transparent;
  transition: border-color .15s ease, transform .08s ease;
}

.tab_journey .stage-card:hover {
  background: #ecfdf5;
  border-color: #a7f3d0;
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

.tab_journey .stage-card.active {
  border-left-color: #28a745;
}

/* active stage highlight */
.tab_journey .stage-icon .fa {
  width: 28px;
  height: 28px;
  display: inline-block;
  text-align: center;
  line-height: 28px;
}

.tab_journey .modal-xl {
  max-width: 1100px;
}

.tab_journey .modal-body ul {
  margin-bottom: 0;
}

.tab_journey .stage-card .card-body {
  padding: 10px;
}

/* ======== Custom badge style ======== */
.tab_journey .badge-logic {
  display: inline-block;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 20px;
  color: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  letter-spacing: 0.3px;
  user-select: none;
  transition: all 0.15s ease;
}

.tab_journey .badge-logic.or {
  background: linear-gradient(135deg, #8a8c47, #cbc92e)
}

.tab_journey .badge-logic.and {
  background: linear-gradient(135deg, #7bafe7, #0056b3);
  /* xanh dương */
}

/* Hover subtle glow */
.tab_journey .badge-logic:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.tab_journey .cs-icon-or {
  color: #8a8c47;
}

.tab_journey .cs-icon-and {
  color: #0056b3;
}

#journey .dms-type-badge {
  border-radius: 999px;
  padding: 3px 8px; /* compact badge in mini tables */
  font-weight: 600;
  font-size: 12px;
}

/* ==========_referees_modal================ */
#refereesModal .crm-modal-wide {
  width: 95%;
  max-width: 1400px;
}

#refereesModal .modal-body {
  max-height: 70vh;
  overflow-y: auto;
}

#refereesModal .dataTables_filter input {
  width: 220px;
}

#refereesModal .dataTables_filter label {
  font-weight: 600;
}

@media (max-width: 767px) {
  #refereesModal .crm-modal-wide {
    width: auto;
    margin: 10px;
  }
}

/* ==========_dms_modal================ */
#dmsOrdersModal .crm-modal-wide {
  width: 95%;
  max-width: 1400px;
}

#dmsOrdersModal .modal-body {
  max-height: 70vh;
  overflow-y: auto;
}

#dmsOrdersModal .dataTables_filter input {
  width: 220px;
}

#dmsOrdersModal .dataTables_filter label {
  font-weight: 600;
}

@media (max-width: 767px) {
  #dmsOrdersModal .crm-modal-wide {
    width: auto;
    margin: 10px;
  }
}

.customer-mini-table .event-badge {
  border-radius: 999px;
  padding: 4px 10px;
  font-weight: 600;
}

.customer-mini-table tr.event-row.event-type-hoi-thao {
  background-color: #eaf3ff;
}

.customer-mini-table tr.event-row.event-type-tham-quan {
  background-color: #eaf9f0;
}

.customer-mini-table tr.event-row.event-type-trao-thuong {
  background-color: #fff5e6;
}

.customer-mini-table tr.event-row.event-type-dao-tao {
  background-color: #eaf9f0;
}

.customer-mini-table tr.event-row.event-type-trien-lam {
  background-color: #f3f4f6;
}

.customer-mini-table tr.event-row.event-type-thuc-hien {
  background-color: #f0f7ff;
}

/* Bảng chính của DMS */
.dms-table thead th {
  background: #eaf3ff;
  color: #0b5ed7;
  font-weight: 600;
}

.dms-table tbody td {
  background: #ffffff;
}

.dms-table tbody tr:hover td {
  background: #f6fbff;
}

/* Khối chi tiết sản phẩm nằm dưới từng dòng */
.dms-child-container {
  border-left: 3px solid #a5d6a7;
  background: #f9fff9;
  margin-left: 1rem;
  padding: 0.75rem 0.75rem 0.75rem 1rem;
}

.dms-child-table thead th,
.dms-child-header th {
  background: #e8f5e9;
  color: #2e7d32;
  font-weight: 600;
}

.dms-child-table tbody td {
  background: #ffffff;
}

/* Liên kết toggle sản phẩm */
a.dms-products-toggle {
  color: #0d6efd;
  text-decoration: none;
}

a.dms-products-toggle:hover {
  text-decoration: underline;
}

a.dms-products-toggle[aria-expanded="true"] {
  color: #363e45f2;
}

/* ===== A2CM child sections (match DMS look & feel) ===== */
.a2cm-child-container {
  border-left: 3px solid #a5d6a7;
  background: #f9fff9;
  margin-left: 1rem;
  padding: 0.75rem 0.75rem 0.75rem 1rem;
}

.a2cm-child-title {
  display: inline-block;
  margin: 0 0 8px 0;
  padding: 4px 10px;
  background: #eaf3ff;
  color: #1e88e5;
  border-radius: 4px;
  font-weight: 600;
}

.a2cm-child-table thead th {
  background: #e8f5e9;
  color: #2e7d32;
  font-weight: 600;
}

.a2cm-child-table tbody td {
  background: #ffffff;
}

a.a2cm-details-toggle {
  color: #72afd2;
  text-decoration: none;
  display: inline-block;
  margin: 6px 0 10px 0;
}

a.a2cm-details-toggle:hover { text-decoration: underline; }

a.a2cm-details-toggle[aria-expanded="true"] { color: #363e45f2; }

/* Các cột con trong bảng user info (giống cách DMS có cột Sản phẩm) */
#a2cmInteractionsModal td.a2cm-col-address,
#a2cmInteractionsModal td.a2cm-col-crops,
#a2cmInteractionsModal td.a2cm-col-fertilizers {
  min-width: 200px;
  width: 220px;
  white-space: nowrap;
}

/* ===== Journey tab table sizing (scoped) ===== */
#journey table.customer-mini-table {
  border-collapse: collapse;
}

#journey table.customer-mini-table th.col-type,
#journey table.customer-mini-table td.col-type {
  width: 120px; /* status/platform column */
  white-space: nowrap;
}

#journey table.customer-mini-table th.col-time,
#journey table.customer-mini-table td.col-time {
  width: 160px; /* time column */
  white-space: normal; /* allow wrapping when space is tight */
  word-break: break-word;
}

/* Narrower badge/type column to save space */
#journey table.customer-mini-table th.col-type,
#journey table.customer-mini-table td.col-type {
  width: 100px;
  min-width: 90px;
  text-align: center;
}

/* Wide content columns for CRM event name and A2CM question */
#journey table.customer-mini-table th.col-content,
#journey table.customer-mini-table td.col-content {
  min-width: 140px;
}

#journey .customer-mini-table .label,
#journey .customer-mini-table .event-badge {
  padding: 3px 8px; /* smaller pill */
  font-size: 12px;
  border-radius: 999px;
}

/* ==========_crm_events_modal================ */

#crmEventsModal .crm-modal-wide {
  width: 95%;
  max-width: 1400px;
}

#crmEventsModal .modal-body {
  max-height: 70vh;
  overflow-y: auto;
}

/* ==========_a2cm_interactions_modal================ */
#a2cmInteractionsModal .crm-modal-wide {
  width: 95%;
  max-width: 1400px;
}

#a2cmInteractionsModal .modal-body {
  max-height: 70vh;
  overflow-y: auto;
}

#a2cmInteractionsModal .dataTables_filter input {
  width: 220px;
}

#a2cmInteractionsModal .dataTables_filter label {
  font-weight: 600;
}

@media (max-width: 767px) {
  #a2cmInteractionsModal .crm-modal-wide {
    width: auto;
    margin: 10px;
  }
}

/* A2CM modal section titles */
#a2cmInteractionsModal .section-title {
  display: inline-block;
  font-weight: 700;
  color: #0b5ed7;
  background: #eaf3ff;
  padding: 8px 12px;
  border-radius: 6px;
  border-left: 4px solid #0b5ed7;
  margin: 10px 0 8px;
}

#a2cmInteractionsModal .section-title.subtle {
  color: #2e7d32;
  background: #e8f5e9;
  border-left-color: #2e7d32;
}

/* Platform badges for A2CM interactions/campaigns */
#a2cmInteractionsModal .platform-badge,
#journey .platform-badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  line-height: 1;
  border: 2px solid currentColor;
  background: #fff;
}
#a2cmInteractionsModal .platform-mobile,
#journey .platform-mobile { color: #1e6bd6; }
#a2cmInteractionsModal .platform-desktop,
#a2cmInteractionsModal .platform-website,
#journey .platform-desktop,
#journey .platform-website { color: #2e7d32; }
#a2cmInteractionsModal .platform-other,
#journey .platform-other { color: #7f8c8d; }

#crmEventsModal .dataTables_filter input {
  width: 220px;
}

#crmEventsModal .dataTables_filter label {
  font-weight: 600;
}

/* Badge style */
#crmEventsModal .event-badge {
  border-radius: 999px;
  padding: 4px 10px;
  font-weight: 600;
}

/* Row highlight per type */
#crmEventsModal tr.event-row.event-type-hoi-thao {
  background-color: #eaf3ff;
}

#crmEventsModal tr.event-row.event-type-tham-quan {
  background-color: #eaf9f0;
}

#crmEventsModal tr.event-row.event-type-trao-thuong {
  background-color: #fff5e6;
}

#crmEventsModal tr.event-row.event-type-dao-tao {
  background-color: #eaf9f0;
}

#crmEventsModal tr.event-row.event-type-trien-lam {
  background-color: #f3f4f6;
}

#crmEventsModal tr.event-row.event-type-thuc-hien {
  background-color: #f0f7ff;
}

@media (max-width: 767px) {
  #crmEventsModal .crm-modal-wide {
    width: auto;
    margin: 10px;
  }
}
