.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.dashboard-grid.small {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
}

.metrics-section {
  margin-top: 16px;
  margin-bottom: 20px;
}

.metrics-section-title {
  margin: 0 0 12px 0;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #9ca3af;
}

.metrics-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}

.stat-card {
  padding: 16px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid rgba(17, 24, 39, 0.06);
  box-shadow: var(--shadow);
}

.stat-card .label {
  font-size: 12px;
  color: #0f172a;
  font-weight: 700;
  margin-bottom: 10px;
}

.stat-card .value {
  font-size: 20px;
  font-weight: 500;
  color: #94a3b8;
}

.stat-card.emphasis {
  background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%);
  border-color: #a7f3d0;
}

.stat-card.emphasis .label,
.stat-card.emphasis .stat-label {
  color: #047857;
}

.stat-card.emphasis .value,
.stat-card.emphasis .stat-value {
  color: #0f766e;
  font-weight: 600;
}

.stat-label {
  margin: 0;
  font-size: 12px;
  color: #0f172a;
  font-weight: 700;
  margin-bottom: 10px;
}

.stat-value {
  margin: 0;
  font-size: 20px;
  font-weight: 500;
  color: #94a3b8;
}

.campaign-filter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  align-items: end;
}

.campaign-filter-grid>div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: 50px;
  justify-content: flex-end;
}

.campaign-filter-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  line-height: 1;
}

.campaign-filter-grid label span {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  height: 12px;
  line-height: 1.2;
  overflow: hidden;
}

.campaign-filter-grid input,
.campaign-filter-grid select {
  padding: 7px 10px;
  border: 1px solid #d5deea;
  border-radius: 6px;
  font-size: 13px;
  background: #fff;
  height: 34px;
  line-height: 1;
  width: 100%;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid transparent;
}

.status-running {
  /* Campaign running: green */
  background: #ecfdf5;
  color: #065f46;
  border-color: #86efac;
}

/* Pending / Đã duyệt (KOC-level) - keep purple styling in a dedicated class */
.status-pending {
  background: #f5f3ff;
  color: #5b21b6;
  border-color: #c7b2ff;
}

.status-paused {
  /* Negotiating / Đang deal: orange */
  background: #fff7ed;
  color: #b45309;
  border-color: #fdba74;
}

.status-done {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #93c5fd;
}

/* Status colors for campaign KOC: differentiate confirmed vs completed */
.status-confirmed {
  /* Confirmed / Đã chốt: blue */
  background: #eff6ff;
  color: #1e40af;
  border-color: #93c5fd;
}

.status-completed {
  /* Completed / Đã gửi hàng: green */
  background: #ecfdf5;
  color: #065f46;
  border-color: #86efac;
}

.report-filter-grid {
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  align-items: end;
}

.dashboard-delta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  padding: 4px 9px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 12px;
}

.dashboard-delta.up {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.dashboard-delta.down {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.dashboard-delta.flat {
  background: #f8fafc;
  color: #475569;
  border: 1px solid #e2e8f0;
}



.report-filter-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.report-filter-grid label span {
  font-size: 12px;
  font-weight: 700;
  color: #4b5563;
}

.report-filter-grid input,
.report-filter-grid select {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #111827;
  font-size: 13px;
  font-weight: 400;
  height: auto;
  min-height: 40px;
}

.danger-outline {
  background: #fff;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

.danger-outline:hover:not(:disabled) {
  background: #fef2f2;
}

.table-toolbar.segmented {
  flex-wrap: wrap;
}

.segment-control {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border: 2px solid #64748b;
  border-radius: 8px;
  background: #f8fafc;
  width: fit-content;
}

.segment-btn {
  border: none;
  border-radius: 0;
  background: transparent;
  color: #64748b;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  border-right: 2px solid #64748b;
}

.segment-btn:last-child {
  border-right: none;
}

.segment-btn:hover {
  background: #eef4ff;
  color: #0f172a;
}

.segment-btn.active {
  background: #06b6d4;
  color: #fff;
}

.report-table table {
  min-width: 960px;
}

.report-table td {
  color: #0f172a;
  line-height: 1.45;
}

/* Report details cell styling */
.report-details-cell {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-wrap: break-word;
  word-break: break-word;
  font-size: 12px;
  font-family: var(--font-main), sans-serif;
  color: #374151;
  max-height: 150px;
  overflow-y: auto;
}

/* Hidden state */
.hidden {
  display: none !important;
}

.status-stopped {
  background: #f3f4f6;
  color: #374151;
  border-color: #d1d5db;
}

.status-rejected {
  /* Không duyệt: red */
  background: #fef2f2;
  color: #dc2626;
  border-color: #fca5a5;
}

/* Inline status dropdown */
.status-dropdown {
  padding: 2px 4px;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  background: white;
  font-size: 11.4px;
  min-width: 90px;
  max-width: 100px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.status-dropdown:hover {
  border-color: #d1d5db;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.status-dropdown:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.status-dropdown:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background-color: #f9fafb;
}

/* Contact cell styling */
.contact-cell {
  font-size: 12px;
  line-height: 1.3;
}

.contact-hint {
  color: #6b7280;
  font-style: italic;
  font-size: 11px;
}

/* Contact line styling for icons */
.contact-line {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
  font-size: 11px;
}

.contact-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.contact-icon img {
  width: 14px;
  height: 14px;
  object-fit: contain;
}

.contact-value {
  color: #374151;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Contact popover styling */
.contact-popover {
  position: absolute;
  pointer-events: auto;
  background: #111827;
  border: 1px solid #374151;
  border-radius: 6px;
  box-shadow: 0 6px 16px rgba(2, 6, 23, 0.2);
  padding: 12px;
  min-width: 200px;
  max-width: 280px;
  font-size: 12px;
  line-height: 1.4;
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.contact-popover.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.contact-popover.hide {
  opacity: 0;
  transform: translateY(6px) scale(0.98);
}

.contact-popover .contact-line {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 6px 0;
}

.contact-popover .contact-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}

.contact-popover .contact-icon img {
  width: 20px;
  height: 20px;
}

.contact-popover .contact-value {
  color: #fff;
  text-decoration: none;
  word-break: break-word;
  user-select: text;
  cursor: text;
}

.contact-popover .contact-empty {
  color: #9ca3af;
}

/* Arrow triangle pointing to contact button */
.contact-popover::after {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  background: #111827;
  border: 1px solid #374151;
  border-right: none;
  border-bottom: none;
  transform: rotate(45deg);
  top: var(--arrow-top, 50%);
  left: -6px;
  margin-top: -6px;
  box-shadow: 0 6px 16px rgba(2, 6, 23, 0.2);
}

.contact-popover.arrow-left::after {
  left: -6px;
}

.contact-popover.arrow-right::after {
  right: -6px;
}

.contact-toggle-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 3px;
  font-size: 14px;
  transition: background-color 0.2s ease;
}

.contact-toggle-btn:hover {
  background-color: #f3f4f6;
}

/* Status dropdown color based on dynamic class */
.status-dropdown.status-not_contacted {
  background: #f3f4f6;
  color: #374151;
  border-color: #d1d5db;
}

.status-dropdown.status-pending {
  background: #f5f3ff;
  color: #5b21b6;
  border-color: #c7b2ff;
}

.status-dropdown.status-not_approved {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fca5a5;
}

.status-dropdown.status-negotiating {
  background: #fff7ed;
  color: #b45309;
  border-color: #fdba74;
}

.status-dropdown.status-confirmed {
  background: #eff6ff;
  color: #1e40af;
  border-color: #93c5fd;
}

.status-dropdown.status-completed {
  background: #ecfdf5;
  color: #065f46;
  border-color: #a7f3d0;
}

/* Individual option colors */
.status-dropdown option[value="not_contacted"] {
  background: #f3f4f6;
  color: #374151;
}

.status-dropdown option[value="pending"] {
  background: #f5f3ff;
  color: #5b21b6;
}

.status-dropdown option[value="not_approved"] {
  background: #fef2f2;
  color: #dc2626;
}

.status-dropdown option[value="negotiating"] {
  background: #fff7ed;
  color: #b45309;
}

.status-dropdown option[value="confirmed"] {
  background: #eff6ff;
  color: #1e40af;
}

.status-dropdown option[value="completed"] {
  background: #ecfdf5;
  color: #065f46;
}

.pill-dealine-done {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.video-edit-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.video-edit-row .btn-link {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-page {
  min-height: 100vh;
  padding: 26px 28px 40px;
}

.detail-page-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.back-row {
  margin-bottom: 16px;
}

.campaign-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e5e7eb;
}

.campaign-title {
  margin: 0 0 6px 0;
  font-size: 20px;
  font-weight: 800;
  color: #111827;
  line-height: 1.4;
}

.campaign-product {
  margin: 0;
  font-size: 13px;
  color: #6b7280;
  font-weight: 500;
}

.campaign-status-badge {
  display: flex;
  align-items: center;
}

.pill.pill-lg {
  padding: 6px 14px;
  font-size: 13px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px 24px;
  margin-bottom: 0;
}

.meta-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #9ca3af;
  margin-bottom: 6px;
}

.meta-value {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: #111827;
  line-height: 1.5;
  word-break: break-word;
}

.meta-value.emphasis-value {
  font-size: 16px;
  font-weight: 500;
  color: #64748b;
}

.campaign-notes {
  padding: 12px 0;
  border-top: 1px solid #f3f4f6;
}

.notes-label {
  margin: 0 0 8px 0;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #9ca3af;
}

.notes-content {
  margin: 0;
  font-size: 13px;
  color: #374151;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}