/* EPW CRM Hygiene Dashboard — crm-hygiene.css (EPW-PRO-313) */

#crm-hygiene-view {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0 24px 40px;
  overflow-y: auto;
  height: 100%;
  box-sizing: border-box;
}

/* ── Metric Cards ─────────────────────────────────────────── */
.hyg-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.hyg-card {
  background: #1E293B;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.hyg-card:hover { border-color: #06B6D4; }
.hyg-card.hyg-card--alert { border-left: 3px solid #EF4444; }
.hyg-card.hyg-card--warn  { border-left: 3px solid #F59E0B; }
.hyg-card.hyg-card--ok    { border-left: 3px solid #10B981; }

.hyg-card-label {
  font-size: 0.72rem;
  color: #94A3B8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.hyg-card-count {
  font-size: 1.7rem;
  font-weight: 700;
  color: #F1F5F9;
  line-height: 1;
}

.hyg-card-sub {
  font-size: 0.72rem;
  color: #64748B;
  margin-top: 4px;
}

/* ── Section headers ──────────────────────────────────────── */
.hyg-section-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: #94A3B8;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin: 20px 0 10px;
}

/* ── Phase Pipeline ───────────────────────────────────────── */
.hyg-phases {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}

.hyg-phase-row {
  display: grid;
  grid-template-columns: 32px 160px 1fr auto auto;
  align-items: center;
  gap: 12px;
  background: #1E293B;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 10px 14px;
}

.hyg-phase-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #334155;
  color: #94A3B8;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hyg-phase-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: #E2E8F0;
}

.hyg-phase-meta {
  font-size: 0.75rem;
  color: #64748B;
}

.hyg-phase-badge {
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 600;
  white-space: nowrap;
}
.hyg-phase-badge--never   { background: #1F2937; color: #6B7280; }
.hyg-phase-badge--dryrun  { background: #1E3A5F; color: #60A5FA; }
.hyg-phase-badge--done    { background: #064E3B; color: #34D399; }
.hyg-phase-badge--running { background: #451A03; color: #FCD34D; }

.hyg-phase-actions {
  display: flex;
  gap: 6px;
}

.hyg-btn {
  padding: 5px 12px;
  border-radius: 5px;
  font-size: 0.75rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s;
}
.hyg-btn:hover { opacity: 0.85; }
.hyg-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.hyg-btn--primary  { background: #0891B2; color: #fff; }
.hyg-btn--commit   { background: #059669; color: #fff; }
.hyg-btn--danger   { background: #DC2626; color: #fff; }
.hyg-btn--ghost    { background: #334155; color: #CBD5E1; }

/* ── Merge Queue ──────────────────────────────────────────── */
.hyg-merge-queue {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 24px;
}

.hyg-merge-row {
  display: grid;
  grid-template-columns: 60px 1fr 1fr 100px 120px;
  align-items: center;
  gap: 10px;
  background: #1E293B;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.78rem;
}

.hyg-merge-badge {
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 700;
  text-align: center;
}
.hyg-merge-badge--email { background: #1E3A5F; color: #60A5FA; }
.hyg-merge-badge--phone { background: #1A3A2A; color: #34D399; }
.hyg-merge-badge--fuzzy { background: #3B1F0A; color: #FB923C; }

.hyg-merge-contact { line-height: 1.3; }
.hyg-merge-name  { font-weight: 600; color: #E2E8F0; }
.hyg-merge-detail{ color: #64748B; font-size: 0.72rem; }

.hyg-merge-actions { display: flex; gap: 6px; }

/* ── Samples panel ────────────────────────────────────────── */
.hyg-samples {
  background: #0F172A;
  border: 1px solid #1E293B;
  border-radius: 6px;
  padding: 10px 14px;
  margin-top: 8px;
  font-size: 0.75rem;
  color: #94A3B8;
  display: none;
}
.hyg-samples.open { display: block; }
.hyg-samples table { width: 100%; border-collapse: collapse; }
.hyg-samples th { color: #64748B; text-align: left; padding: 3px 8px; font-size: 0.68rem; text-transform: uppercase; }
.hyg-samples td { padding: 3px 8px; border-bottom: 1px solid #1E293B; color: #CBD5E1; }

/* ── Toolbar ──────────────────────────────────────────────── */
.hyg-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}

.hyg-toolbar-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #F1F5F9;
  flex: 1;
}

.hyg-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1E293B;
  border: 1px solid #334155;
  color: #E2E8F0;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 0.82rem;
  z-index: 9999;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}

/* ── DQ Histogram ─────────────────────────────────────────── */
.hyg-histogram {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 24px;
}

.hyg-hist-row {
  display: grid;
  grid-template-columns: 160px 1fr 60px;
  align-items: center;
  gap: 10px;
  font-size: 0.78rem;
}

.hyg-hist-label { color: #94A3B8; }

.hyg-hist-bar-wrap {
  height: 10px;
  background: #1E293B;
  border-radius: 5px;
  overflow: hidden;
}

.hyg-hist-bar {
  height: 100%;
  border-radius: 5px;
  background: #0891B2;
  transition: width 0.4s ease;
}

.hyg-hist-count { color: #64748B; text-align: right; }
