/* ============================================================================
   Data Cleanser — Home view (alerts panel, filter pills, scenario rows,
   data-health bars, validation modal).
   Verbatim copy of lwc/dcHome/dcHome.css (minus the @import handled by the
   snippet pages). Plus the dcStatusBadge processing-pulse rules at the end.
   ============================================================================ */

.dc-home-alerts {
  margin-bottom: 12px;
  border: 1px solid var(--dc-border-1);
  border-radius: var(--dc-radius-md);
  background: var(--dc-neutral-0);
  box-shadow: var(--dc-shadow-xs);
  overflow: hidden;
}

/* Collapsed bar: gentle border/glow pulse so new updates are noticeable without
   pushing the stats grid down. Stops when expanded; dcBrand suppresses motion. */
.dc-home-alerts_collapsed {
  animation: dc-home-alerts-glow 2s ease-in-out infinite;
}

.dc-home-alerts_collapsed .dc-home-alerts-toggle-icon {
  animation: dc-home-alerts-icon-pulse 2s ease-in-out infinite;
}

@keyframes dc-home-alerts-glow {
  0%,
  100% {
    box-shadow: var(--dc-shadow-xs);
    border-color: var(--dc-border-1);
  }
  50% {
    box-shadow: 0 0 0 3px var(--dc-brand-100);
    border-color: var(--dc-brand-300);
  }
}

@keyframes dc-home-alerts-icon-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.85;
    transform: scale(1.06);
  }
}

.dc-home-alerts-bar {
  display: flex;
  align-items: stretch;
  gap: 4px;
  min-height: 44px;
}

.dc-home-alerts-toggle {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 8px 12px;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
}

.dc-home-alerts-toggle:hover {
  background: var(--dc-neutral-25);
}

.dc-home-alerts-toggle:focus-visible {
  outline: 2px solid var(--dc-brand-500);
  outline-offset: -2px;
}

.dc-home-alerts-toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--dc-radius-sm);
  background: var(--dc-brand-50);
  color: var(--dc-brand-600);
  flex: none;
}

.dc-home-alerts-toggle-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.dc-home-alerts-toggle-title {
  font: 600 13px/1.2 var(--dc-font-sans);
  color: var(--dc-fg-1);
}

.dc-home-alerts-toggle-hint {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dc-home-alerts-chips {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: none;
}

.dc-home-alerts-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--dc-radius-pill);
  font: 700 11px/1 var(--dc-font-sans);
}

.dc-home-alerts-chip-success {
  background: var(--dc-success-50);
  color: var(--dc-success-700);
}

.dc-home-alerts-chip-brand {
  background: var(--dc-brand-50);
  color: var(--dc-brand-700);
}

.dc-home-alerts-chip-warning {
  background: var(--dc-warning-50);
  color: var(--dc-warning-700);
}

.dc-home-alerts-chip-error {
  background: #fef1f1;
  color: #b42318;
}

.dc-home-alerts-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  color: var(--dc-fg-3);
}

.dc-home-alerts-dismiss-all {
  align-self: center;
  flex: none;
  margin-right: 8px;
  padding: 0 8px;
  font-size: 12px;
}

.dc-home-alerts-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 10px 10px;
  border-top: 1px solid var(--dc-border-1);
  background: var(--dc-neutral-25);
}

.dc-home-alerts_expanded .dc-home-alerts-bar {
  border-bottom: 1px solid var(--dc-border-1);
}

.dc-home-alert {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 14px 16px;
  border-radius: var(--dc-radius-md);
  border: 1px solid var(--dc-border-1);
  background: var(--dc-neutral-0);
  box-shadow: var(--dc-shadow-xs);
}

.dc-home-alert-brand {
  border-color: var(--dc-brand-200);
  background: var(--dc-brand-50);
}

.dc-home-alert-success {
  border-color: var(--dc-success-100);
  background: var(--dc-success-50);
}

.dc-home-alert-warning {
  border-color: var(--dc-warning-100);
  background: var(--dc-warning-50);
}

.dc-home-alert-error {
  border-color: #f4c7c7;
  background: #fef1f1;
}

.dc-home-alert-icon {
  display: inline-flex;
  margin-top: 2px;
}

.dc-home-alert-body {
  min-width: 0;
}

.dc-home-alert-message {
  margin: 4px 0 0;
  color: var(--dc-fg-2);
}

.dc-home-alert-ids {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: var(--dc-radius-sm);
  border: 1px solid var(--dc-border-1);
  background: rgb(255 255 255 / 0.72);
}

.dc-home-alert-ids-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--dc-fg-3);
}

.dc-home-alert-ids-value {
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--dc-fg-1);
  word-break: break-all;
}

.dc-home-alert-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: 8px;
}

.dc-home-alert-link {
  margin-top: 0;
  padding-left: 0;
}

.dc-home-alert-dismiss {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: var(--dc-radius-sm);
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.dc-home-alert-dismiss:hover {
  background: rgb(0 0 0 / 6%);
}

.dc-home-alert-dismiss:focus-visible {
  outline: 2px solid var(--dc-brand-500);
  outline-offset: 2px;
}

.dc-home-scenarios-head {
  flex-wrap: wrap;
  gap: 10px 12px;
}
.dc-home-scenarios-head-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  min-width: 0;
  flex: 1;
}

.dc-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.dc-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 13px;
  border-radius: var(--dc-radius-sm);
  cursor: pointer;
  border: 1px solid var(--dc-border-1);
  background: var(--dc-neutral-0);
  box-shadow: var(--dc-shadow-xs);
  font: 600 var(--dc-text-sm)/1 var(--dc-font-sans);
  color: var(--dc-fg-2);
  transition:
    background var(--dc-dur-fast) var(--dc-ease),
    border-color var(--dc-dur-fast) var(--dc-ease),
    box-shadow var(--dc-dur-fast) var(--dc-ease);
}
.dc-pill:hover {
  background: var(--dc-neutral-25);
  border-color: var(--dc-border-2);
}
.dc-pill.is-active {
  border-color: var(--dc-brand-500);
  background: var(--dc-brand-50);
  color: var(--dc-brand-700);
  box-shadow: 0 0 0 1px var(--dc-brand-200);
}
.dc-pill:focus-visible {
  outline: none;
  box-shadow: var(--dc-shadow-focus);
}

.dc-home-cols {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 16px;
  margin-top: 16px;
}
.dc-home-scenarios {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dc-home-scenario {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  cursor: pointer;
  transition:
    border-color var(--dc-dur-fast) var(--dc-ease),
    box-shadow var(--dc-dur-fast) var(--dc-ease);
}
.dc-home-scenario:hover {
  border-color: var(--dc-brand-200);
  box-shadow: var(--dc-shadow-md);
}
.dc-home-scenario:focus-visible {
  outline: 2px solid var(--dc-brand-500);
  outline-offset: 2px;
}
.dc-home-scenario-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
}
.dc-home-scenario-id {
  flex: 1;
  min-width: 0;
}
.dc-home-scenario-name {
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dc-home-scenario-description {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dc-home-scenario-badges {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.dc-home-object-pill {
  display: inline-flex;
  align-items: center;
  max-width: 11rem;
  min-height: 24px;
  padding: 0 9px;
  border-radius: var(--dc-radius-pill);
  background: var(--dc-neutral-100);
  color: var(--dc-fg-2);
  font: 600 var(--dc-text-xs)/1 var(--dc-font-sans);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: none;
}

.dc-home-groups-pill {
  gap: var(--slds-g-spacing-1, 4px);
  height: 22px;
  max-width: 12rem;
  white-space: nowrap;
  border: 0;
  cursor: pointer;
  font: inherit;
  transition:
    background var(--dc-dur-fast) var(--dc-ease),
    box-shadow var(--dc-dur-fast) var(--dc-ease);
}

.dc-home-groups-pill:hover {
  background: var(--dc-brand-100);
  box-shadow: 0 0 0 1px var(--dc-brand-200);
}

.dc-home-groups-pill:focus-visible {
  outline: 2px solid var(--dc-brand-500);
  outline-offset: 2px;
}

.dc-home-groups-pill lightning-icon {
  --slds-c-icon-color-foreground-default: var(--dc-brand-600);
}

.dc-btn-fav {
  width: 30px;
  height: 30px;
  border-radius: var(--dc-radius-sm);
  border: 0;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  transition: background var(--dc-dur-fast) var(--dc-ease);
}
.dc-btn-fav:hover {
  background: var(--dc-neutral-100);
}
/* utility icons read --slds-c-icon-color-foreground-default, not -foreground */
.dc-fav-icon {
  --slds-c-icon-color-foreground-default: var(--dc-neutral-400);
}
.dc-btn-fav:hover .dc-fav-icon {
  --slds-c-icon-color-foreground-default: var(--dc-neutral-500);
}
.dc-fav-icon-on {
  color: var(--slds-g-color-palette-teal-90, #7dd3c0);
  --slds-c-icon-color-foreground-default: var(
    --slds-g-color-palette-teal-90,
    #7dd3c0
  );
}
.dc-health {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.dc-health-top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}
.dc-health-name {
  font: 600 13px var(--dc-font-sans);
  color: var(--dc-fg-1);
}
.dc-health-track {
  height: 8px;
  border-radius: 999px;
  background: var(--dc-neutral-100);
  overflow: hidden;
}
.dc-health-fill {
  height: 100%;
  border-radius: 999px;
}
.dc-divider {
  height: 1px;
  background: var(--dc-border-1);
}

@media (max-width: 1080px) {
  .dc-home-cols {
    grid-template-columns: 1fr;
  }
}
.dc-validation-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: oklch(20% 0 0 / 0.45);
  padding: 1rem;
}

.dc-validation-modal {
  width: min(32rem, 100%);
  background: var(--dc-surface, #fff);
  border-radius: 0.75rem;
  box-shadow: 0 1.25rem 2.5rem oklch(20% 0 0 / 0.25);
  overflow: hidden;
}

.dc-validation-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid oklch(90% 0 0);
}

.dc-validation-body {
  padding: 1rem 1.25rem;
}

.dc-validation-lead {
  margin: 0 0 0.5rem;
  font-weight: 600;
}

.dc-validation-list {
  margin: 0;
  padding-left: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.dc-validation-foot {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem 1.25rem;
}

/* ---- c-dc-status-badge (lwc/dcStatusBadge/dcStatusBadge.css) ------------- */
.dc-status-badge {
  display: inline-flex;
}

/* In-progress lozenge: brand-toned, with a gently pulsing dot so a long-running
   activation reads as "working" rather than stalled. Pulse is opacity-only
   (compositor-friendly) and is suppressed under reduced-motion. */
.dc-badge-progress {
  background: var(--dc-pastel-selected-bg);
  color: var(--dc-pastel-selected-text);
}
.dc-badge-progress .dc-dot {
  background: var(--dc-brand-300);
  animation: dc-badge-pulse 1.4s ease-in-out infinite;
}

@keyframes dc-badge-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dc-badge-progress .dc-dot {
    animation: none;
  }
}
