/* MetaDS additions on top of the WooSpeed design system (styles.css).
   Same tokens, same radius, same mono numbers. */

.card-body { padding: 14px 16px 16px; }
.card-body p { margin: 0 0 12px; line-height: 1.6; }

/* ---------------- upload ---------------- */
.drop {
  border: 1.5px dashed hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--card));
  padding: 34px 22px;
  text-align: center;
  margin-bottom: 16px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.drop:hover, .drop.over {
  border-color: hsl(var(--primary));
  background: hsl(var(--muted));
}
.drop-ico { font-size: 26px; color: hsl(var(--muted-foreground)); line-height: 1; }
.drop-title { font-weight: 650; margin-top: 10px; font-size: 14px; }
.drop-sub { font-size: 12px; color: hsl(var(--muted-foreground)); margin-top: 4px; }
.drop-hint { font-size: 11px; color: hsl(var(--muted-foreground)); margin-top: 12px; opacity: .8; }

/* ---------------- alerts ---------------- */
.alert {
  display: flex;
  gap: 10px;
  border: 1px solid hsl(var(--border));
  border-left: 4px solid hsl(var(--warning));
  border-radius: var(--radius);
  background: hsl(var(--card));
  padding: 11px 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
  font-size: 12.5px;
  line-height: 1.55;
}
.alert.bad { border-left-color: hsl(var(--danger)); }
.alert.info { border-left-color: hsl(var(--primary)); }
.alert-ico { flex-shrink: 0; font-weight: 700; }
.alert b { font-weight: 650; }

/* ---------------- actions ---------------- */
.actions { display: flex; flex-direction: column; }
.action {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid hsl(var(--border));
}
.action:last-child { border-bottom: 0; }
.action-tag {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: 3px 0;
  text-align: center;
  border-radius: 999px;
  align-self: start;
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
}
.action.stop .action-tag { background: hsl(var(--danger)); color: #fff; }
.action.fix .action-tag { background: hsl(var(--warning)); color: #fff; }
.action.scale .action-tag { background: hsl(var(--success)); color: #fff; }
.action.watch .action-tag { background: hsl(var(--primary)); color: #fff; }
.action-title { font-weight: 650; font-size: 13px; }
.action-scope {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10.5px;
  color: hsl(var(--muted-foreground));
  margin-top: 3px;
  word-break: break-word;
}
.action-why { font-size: 12.5px; margin-top: 6px; line-height: 1.55; }
.action-do { font-size: 12.5px; margin-top: 6px; line-height: 1.55; }
.action-do b { font-weight: 650; }
.action-rule {
  display: inline-block;
  margin-top: 7px;
  font-size: 10px;
  letter-spacing: .04em;
  color: hsl(var(--muted-foreground));
  border: 1px solid hsl(var(--border));
  border-radius: 999px;
  padding: 1px 7px;
}

/* ---------------- units table ---------------- */
.unit-wrap { overflow-x: auto; }
.unit {
  display: grid;
  grid-template-columns: 1.6fr repeat(7, minmax(64px, .6fr)) 84px;
  gap: 10px;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid hsl(var(--border));
  font-size: 12px;
  min-width: 900px;
}
.unit:last-child { border-bottom: 0; }
.unit.head {
  font-size: 10px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
  border-bottom: 1px solid hsl(var(--border));
  background: hsl(var(--muted));
}
.unit-name { font-weight: 600; word-break: break-word; line-height: 1.35; }
.unit-name small { display: block; font-weight: 400; color: hsl(var(--muted-foreground)); font-size: 10.5px; margin-top: 2px; }
.unit-num { font-variant-numeric: tabular-nums; text-align: right; }
.unit-num.bad { color: hsl(var(--danger)); }
.unit-num.good { color: hsl(var(--success)); }
.chip {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 999px;
  text-align: center;
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  white-space: nowrap;
}
.chip.scale { background: hsl(var(--success)); color: #fff; }
.chip.fix { background: hsl(var(--warning)); color: #fff; }
.chip.kill { background: hsl(var(--danger)); color: #fff; }
.chip.hold { background: hsl(var(--primary)); color: #fff; }
.chip.unread { background: hsl(var(--border)); color: hsl(var(--muted-foreground)); }

/* ---------------- columns ---------------- */
.cols { display: flex; flex-wrap: wrap; gap: 6px; padding: 13px 16px 16px; }
.col-chip {
  font-size: 11px;
  border: 1px solid hsl(var(--border));
  border-radius: 999px;
  padding: 2px 9px;
  color: hsl(var(--muted-foreground));
}
.col-chip.mapped { border-color: hsl(var(--success)); color: hsl(var(--success)); }
.col-chip.missing { border-style: dashed; }

/* ---------------- sku editor ---------------- */
.sku {
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 10px;
}
.sku-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.sku-title { font-weight: 650; font-size: 13px; }
.sku-key { font-family: ui-monospace, monospace; font-size: 10.5px; color: hsl(var(--muted-foreground)); }
.sku-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.sku-grid label, .field-row label {
  display: block;
  font-size: 10.5px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
  margin-bottom: 4px;
}
.sku-grid input, .field-row input, .match-input {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid hsl(var(--border));
  border-radius: 7px;
  background: hsl(var(--background));
  color: inherit;
  font: inherit;
  font-variant-numeric: tabular-nums;
}
.sku-tier { border-top: 1px dashed hsl(var(--border)); margin-top: 10px; padding-top: 10px; }
.sku-tier-head { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-bottom: 8px; }
.tier-label { font-size: 12px; font-weight: 600; }
.field-row { display: grid; grid-template-columns: 1fr 120px; gap: 12px; align-items: center; margin-bottom: 9px; }
.field-row label { margin-bottom: 0; }
.editor-foot { display: flex; gap: 10px; margin-top: 14px; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.ghost-btn2 {
  padding: 6px 12px; border-radius: 8px; cursor: pointer; font: inherit; font-size: 12px;
  border: 1px solid hsl(var(--border)); background: transparent; color: inherit;
}
.mini-del {
  border: 1px solid hsl(var(--border)); background: transparent; color: hsl(var(--danger));
  border-radius: 7px; padding: 3px 8px; font: inherit; font-size: 11px; cursor: pointer;
}

/* ---------------- rules ---------------- */
.rule-group { margin-bottom: 18px; }
.rule-item {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid hsl(var(--border));
  font-size: 12.5px;
  line-height: 1.55;
}
.rule-item:last-child { border-bottom: 0; }
.rule-n { font-weight: 700; color: hsl(var(--muted-foreground)); font-variant-numeric: tabular-nums; }
.rule-tag {
  display: inline-block;
  margin-left: 7px;
  font-size: 9px;
  letter-spacing: .05em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 1px 6px;
  border: 1px solid hsl(var(--border));
  color: hsl(var(--muted-foreground));
  vertical-align: 1px;
}
.rule-tag.new { border-color: hsl(var(--success)); color: hsl(var(--success)); }
.rule-tag.kills { border-color: hsl(var(--danger)); color: hsl(var(--danger)); }
.rule-code {
  font-family: ui-monospace, monospace;
  font-size: 11px;
  background: hsl(var(--muted));
  padding: 1px 5px;
  border-radius: 4px;
}

@media (max-width: 980px) {
  .sku-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .action { grid-template-columns: 1fr; gap: 8px; }
  .action-tag { justify-self: start; padding: 3px 10px; }
}
