/* Enterprise Master Data Management */
.mdm-table-wrap {
  overflow-x: auto;
}

.mdm-table th,
.mdm-table td {
  white-space: nowrap;
  font-size: 0.875rem;
}

.mdm-row--required td:first-child {
  font-weight: 600;
}

.mdm-row--missing {
  background: color-mix(in srgb, var(--eu-danger, #b91c1c) 8%, transparent);
}

.mdm-scope,
.mdm-class {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.mdm-scope--global {
  background: color-mix(in srgb, var(--eu-accent, #0f766e) 15%, transparent);
  color: var(--eu-accent, #0f766e);
}

.mdm-scope--organization {
  background: color-mix(in srgb, #2563eb 15%, transparent);
  color: #1d4ed8;
}

.mdm-scope--hospital {
  background: color-mix(in srgb, #9333ea 12%, transparent);
  color: #7e22ce;
}

.mdm-scope--department {
  background: color-mix(in srgb, #ea580c 12%, transparent);
  color: #c2410c;
}

.mdm-scope--station {
  background: color-mix(in srgb, #0891b2 12%, transparent);
  color: #0e7490;
}

.mdm-class--global { background: #ecfdf5; color: #047857; }
.mdm-class--organization { background: #eff6ff; color: #1d4ed8; }
.mdm-class--hospital { background: #f5f3ff; color: #6d28d9; }
.mdm-class--department { background: #fff7ed; color: #c2410c; }
.mdm-class--station { background: #ecfeff; color: #0e7490; }
.mdm-class--user { background: #fdf2f8; color: #be185d; }
.mdm-class--clinical { background: #f0fdf4; color: #15803d; }
.mdm-class--financial { background: #fffbeb; color: #b45309; }
.mdm-class--government { background: #f8fafc; color: #334155; }
.mdm-class--integration { background: #eef2ff; color: #4338ca; }

.mdm-status {
  font-weight: 600;
  font-size: 0.8125rem;
}

.mdm-status--complete { color: var(--eu-success, #15803d); }
.mdm-status--in_progress { color: var(--eu-warning, #b45309); }
.mdm-status--not_started { color: var(--eu-muted, #64748b); }

.mdm-row-actions {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  flex-wrap: wrap;
}

.mdm-meta-strip,
.eu-meta-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 1rem 0;
  font-size: 0.8125rem;
  color: var(--eu-muted, #64748b);
  align-items: center;
}

.mdm-view-toggle {
  display: inline-flex;
  gap: 0.35rem;
  margin-right: 0.75rem;
}

.mdm-health {
  margin: 1.25rem 0 1.75rem;
}

.mdm-health__title {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 700;
}

.mdm-health__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  gap: 0.75rem;
}

.mdm-health__card {
  border: 1px solid var(--eu-border, #e2e8f0);
  border-radius: 0.5rem;
  padding: 0.75rem;
  background: var(--eu-surface, #fff);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.mdm-health__card--warn {
  border-color: color-mix(in srgb, var(--eu-warning, #b45309) 35%, transparent);
}

.mdm-health__label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--eu-muted, #64748b);
  font-weight: 600;
}

.mdm-health__value {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.1;
}

.mdm-health__meta {
  font-size: 0.75rem;
  color: var(--eu-muted, #64748b);
}

.mdm-capabilities {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.75rem;
  font-size: 0.8125rem;
  color: var(--eu-muted, #64748b);
}

.mdm-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.mdm-dep-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mdm-dep-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.mdm-cap-list {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mdm-cap-list > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.875rem;
}

.mdm-cap-list dt {
  color: var(--eu-muted, #64748b);
}

.mdm-cap-list dd {
  margin: 0;
  font-weight: 600;
}

.mdm-master-link {
  color: inherit;
  text-decoration: none;
  font-weight: 600;
}

.mdm-master-link:hover {
  text-decoration: underline;
}

.mdm-dep-hint {
  color: var(--eu-muted, #64748b);
  margin-left: 0.25rem;
}

.mdm-help {
  font-size: 0.875rem;
  color: var(--eu-muted, #64748b);
  margin-bottom: 0.75rem;
}

.mdm-import-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.mdm-error-report {
  background: color-mix(in srgb, var(--eu-danger, #b91c1c) 8%, transparent);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.mdm-error-report h4 {
  margin: 0 0 0.5rem;
}

.mdm-empty {
  color: var(--eu-muted, #64748b);
  margin: 0;
}

.mdm-skeleton {
  padding: 1rem;
  color: var(--eu-muted, #64748b);
  font-size: 0.875rem;
  min-height: 3rem;
}

.mdm-skeleton--summary {
  min-height: 6rem;
  border: 1px dashed var(--eu-border, #e2e8f0);
  border-radius: 0.5rem;
  margin: 1rem 0;
}

.mdm-skeleton--section {
  min-height: 4rem;
}

.mdm-async-frame {
  display: block;
}

.mdm-section-pager {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.mdm-section-pager__meta {
  font-size: 0.8125rem;
  color: var(--eu-muted, #64748b);
}

.mdm-search-form {
  margin-bottom: 0.75rem;
}

.mdm-search-form__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.mdm-search-form__row .eu-input {
  max-width: 16rem;
}

.mdm-search-meta {
  font-size: 0.8125rem;
  color: var(--eu-muted, #64748b);
  margin: 0 0 0.5rem;
}

.mdm-pagination {
  margin-top: 0.75rem;
}
