/**
 * Shared status / category / job-tag styling (aligned with dashboard v2).
 * Loaded globally so job detail, jobs list, embed, etc. match the dashboard palette.
 */

/* -------- Status pills (same as former dashboard_v2 “strict pastel” install flow) -------- */
.status-badge {
  border-radius: 9999px;
  font-weight: 700;
  padding: 2px 6px;
  font-size: 10px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border: 0;
}

.status-badge.status-ordered {
  background: #fef2f2;
  color: #b91c1c;
}
.status-badge.status-ready {
  background: #fecaca;
  color: #7f1d1d;
}
.status-badge.status-confirmed {
  background: #b91c1c;
  color: #ffffff;
}
.status-badge.status-quote {
  background: #ffffff;
  color: #94a3b8;
  border: 1px solid #f1f5f9;
  text-transform: uppercase;
}

.status-badge.status-quote.qs-draft {
  background: rgba(148, 163, 184, 0.18);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #475569;
}
.status-badge.status-quote.qs-sent {
  background: rgba(34, 197, 94, 0.14);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #166534;
}
.status-badge.status-quote.qs-measurements {
  background: rgba(168, 85, 247, 0.14);
  border: 1px solid rgba(168, 85, 247, 0.3);
  color: #6b21a8;
}
.status-badge.status-quote.qs-waiting {
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #92400e;
}

.status-badge.status-waiting-parts {
  background: #eef2ff;
  color: #4338ca;
}
.status-badge.status-partially-ready {
  background: #ffedd5;
  color: #c2410c;
}
.status-badge.status-partially-completed {
  background: #fffbeb;
  color: #b45309;
}
.status-badge.status-completed {
  background: #ecfdf5;
  color: #047857;
}
.status-badge.status-cancelled {
  background: #f1f5f9;
  color: #64748b;
}
.status-badge.status-archived {
  background: #f8fafc;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

/* -------- Category pills (dashboard cat-pill + Install) -------- */
.cat-pill {
  border-radius: 9999px;
  font-weight: 700;
  padding: 3px 8px;
  font-size: 11px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.cat-pill.install {
  background: #fff1f2;
  color: #be123c;
}
.cat-pill.noinstall {
  background: #fffbeb;
  color: #b45309;
}
.cat-pill.thermos {
  background: #f0f9ff;
  color: #0369a1;
}
.cat-pill.services {
  background: #faf5ff;
  color: #7e22ce;
}

/* -------- Job detail: slightly larger pills than dense table rows -------- */
#jobDetailPage .status-badge,
#jobDetailPage .cat-pill {
  font-size: 0.78rem;
  padding: 4px 10px;
  letter-spacing: 0.03em;
}

/* -------- Job tags (pastel = dashboard card tag row) -------- */
.crm-job-tags .badge.bg-danger {
  background: #fef2f2 !important;
  color: #b91c1c !important;
}
.crm-job-tags .badge.bg-info {
  background: #f0f9ff !important;
  color: #0369a1 !important;
}
.crm-job-tags .badge.bg-warning {
  background: #fffbeb !important;
  color: #b45309 !important;
}
.crm-job-tags .badge.bg-success {
  background: #ecfdf5 !important;
  color: #047857 !important;
}
.crm-job-tags .badge.bg-secondary {
  background: #f8fafc !important;
  color: #64748b !important;
  border: 1px solid #e2e8f0 !important;
}
.crm-job-tags .badge.bg-purple {
  background: #faf5ff !important;
  color: #7e22ce !important;
}

/* Tag toggles: active state uses stronger tint (not default Bootstrap solids) */
.crm-job-tags .tag-option.active {
  opacity: 1;
  transform: scale(1.06);
  font-weight: 800;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.12);
}
.crm-job-tags .tag-option.bg-danger.active {
  background: #fecaca !important;
  color: #7f1d1d !important;
  border: 2px solid #b91c1c !important;
}
.crm-job-tags .tag-option.bg-info.active {
  background: #bae6fd !important;
  color: #075985 !important;
  border: 2px solid #0369a1 !important;
}
.crm-job-tags .tag-option.bg-warning.active {
  background: #fde68a !important;
  color: #92400e !important;
  border: 2px solid #d97706 !important;
}
.crm-job-tags .tag-option.bg-success.active {
  background: #a7f3d0 !important;
  color: #065f46 !important;
  border: 2px solid #059669 !important;
}
.crm-job-tags .tag-option.bg-purple.active {
  background: #e9d5ff !important;
  color: #581c87 !important;
  border: 2px solid #7e22ce !important;
}

/* Dark theme: keep contrast */
body.dark-theme .status-badge.status-quote:not(.qs-draft):not(.qs-sent):not(.qs-measurements):not(.qs-waiting) {
  background: #1e293b;
  color: #cbd5e1;
  border-color: #334155;
}
body.dark-theme .cat-pill.install {
  background: rgba(190, 18, 60, 0.2);
  color: #fda4af;
}
body.dark-theme .cat-pill.noinstall {
  background: rgba(180, 83, 9, 0.2);
  color: #fcd34d;
}
body.dark-theme .cat-pill.thermos {
  background: rgba(3, 105, 161, 0.25);
  color: #7dd3fc;
}
body.dark-theme .cat-pill.services {
  background: rgba(126, 34, 206, 0.25);
  color: #e9d5ff;
}
