Each text box has a class nr-dashboard-widget-{the_widget_label_with_underscores}
according to the docs, so target that.
e.g.
[{"id":"b0326e8d8ea65cb7","type":"inject","z":"65617ffeb779f51c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"5","payloadType":"num","x":150,"y":1240,"wires":[["a6335b40731d9e15"]]},{"id":"a6335b40731d9e15","type":"ui_text","z":"65617ffeb779f51c","group":"2d4fe667.28f8ba","order":20,"width":0,"height":0,"name":"","label":"Oven1","format":"{{msg.payload}}","layout":"row-spread","className":"","x":430,"y":1240,"wires":[]},{"id":"8720e803a030d636","type":"ui_template","z":"65617ffeb779f51c","group":"2d4fe667.28f8ba","name":"","order":21,"width":0,"height":0,"format":"<style>\n .nr-dashboard-widget-Oven1{\nborder: 2px solid #666;\nbackground-color : #b0cff5 !important;\n}\n </style>>","storeOutMessages":false,"fwdInMessages":false,"resendOnRefresh":false,"templateScope":"local","className":"","x":280,"y":1180,"wires":[[]]},{"id":"2d4fe667.28f8ba","type":"ui_group","name":"demo","tab":"1caa8458.b17814","order":2,"disp":true,"width":"12","collapse":false},{"id":"1caa8458.b17814","type":"ui_tab","name":"Demo","icon":"dashboard","order":1,"disabled":false,"hidden":false}]
You may need to add !important to override the dashboard theme colour.