/* SCUZO ONE RC6790 unified contrast and color system — staging/UAT only.
   Scope: existing UI panels, not business rules. DARK SURFACE = LIGHT TEXT;
   LIGHT INPUTS = DARK TEXT. No pure-white feature cards.
*/
:root {
  --scz-ink:#102338; --scz-light:#f2f8ff;
  --scz-navy:#17364d; --scz-teal:#12545b;
  --scz-indigo:#303a79; --scz-purple:#533767;
  --scz-amber:#76502b; --scz-border:#7397ad;
  --scz-focus:#ffd474;
}
/* Colorful, distinct dark card families instead of white cards. */
#appView .view .card,
#appView .module-panel .card,
#appView .admin-panel .card {
  background:var(--scz-navy) !important;
  color:var(--scz-light) !important;
  border:1px solid #50829a !important;
  box-shadow:0 10px 28px rgba(5,20,34,.20);
}
#appView .view .card:nth-of-type(4n + 2),
#appView .module-panel .card:nth-of-type(4n + 2) {
  background:var(--scz-teal) !important;
  border-color:#54a99d !important;
}
#appView .view .card:nth-of-type(4n + 3),
#appView .module-panel .card:nth-of-type(4n + 3) {
  background:var(--scz-indigo) !important;
  border-color:#8694d7 !important;
}
#appView .view .card:nth-of-type(4n),
#appView .module-panel .card:nth-of-type(4n) {
  background:var(--scz-purple) !important;
  border-color:#bc95cb !important;
}
/* This covers product and KPI cards, including dynamically rendered descendants. */
#appView :is(.mini-kpis,.store-cards,.recipe-grid,.inventory-procurement-grid) > :is(div,article,section),
#appView :is(.mini-kpis,.store-cards) > .card {
  background:#17475a !important; color:#f5fbff !important;
  border:1px solid #58a6b2 !important;
}
#appView :is(.mini-kpis,.store-cards,.recipe-grid) > :is(div,article,section):nth-child(3n + 2){
  background:#383e79 !important; border-color:#909de3 !important;
}
#appView :is(.mini-kpis,.store-cards,.recipe-grid) > :is(div,article,section):nth-child(3n){
  background:#665029 !important; border-color:#d4b467 !important;
}
/* Text on dark panels: never inherit faint/low-contrast muted colors. */
#appView .view .card :is(h1,h2,h3,h4,h5,h6,p,small,label,strong,b,dt,dd),
#appView .module-panel .card :is(h1,h2,h3,h4,h5,h6,p,small,label,strong,b,dt,dd),
#appView :is(.mini-kpis,.store-cards,.recipe-grid) > :is(div,article,section) :is(h3,h4,p,label,small,strong,b) {
  color:#f4faff !important; opacity:1 !important; text-shadow:none !important;
}
#appView .view .card :is(.muted,.eyebrow,.byline,.subtext),
#appView .module-panel .card :is(.muted,.eyebrow,.byline,.subtext) {
  color:#c9e1ee !important; opacity:1 !important;
}
/* Light surfaces (text-entry boxes, dropdowns, editable cells) ALWAYS dark text. */
#appView :is(.view,.module-panel,.admin-panel) :is(input,textarea,select),
#appView :is(.view,.module-panel,.admin-panel) :is(input,textarea,select):enabled {
  background:#edf5fb !important; color:#13263a !important;
  -webkit-text-fill-color:#13263a !important;
  border:1.5px solid #708ba1 !important;
  opacity:1 !important;
}
#appView :is(input,textarea)::placeholder {color:#4f6578 !important;opacity:1 !important}
#appView :is(input,textarea,select,button):focus-visible {
  outline:3px solid var(--scz-focus) !important;outline-offset:2px !important;
}
/* Light table headings with dark ink; dark table body with light text. */
#appView .view .card :is(table,.report-table) {background:#173448 !important;color:#f0f7fd !important}
#appView .view .card :is(table,.report-table) thead :is(th,td) {
  background:#d3e7f1 !important;color:#11293d !important;
  -webkit-text-fill-color:#11293d !important;
}
#appView .view .card :is(table,.report-table) tbody :is(th,td) {
  background:#16374b !important;color:#e8f5ff !important;
}
#appView :is(button.primary,.primary) {
  background:#145b79 !important;color:#ffffff !important;
  -webkit-text-fill-color:#ffffff !important;
  border-color:#67aec8 !important;
}
#appView :is(button.secondary,.secondary) {
  background:#d6eaf3 !important;color:#173149 !important;
  -webkit-text-fill-color:#173149 !important;
  border:1px solid #789db3 !important;
}
/* Preserve warning / error semantics, but ensure readable text. */
#appView .status.bad,#appView [role="alert"] {color:#ffdfd9 !important}
#appView .status.warn {color:#fff0bb !important}
/* Modals and popup cards: dark panels get light text. RC6787 separately sets
   explicit light-background / dark-ink discount and manager approval dialogs. */
#appView :is(.pos-order-dialog,.pos-floating-panel):not(#billingDiscountControl) {
  background:#1a4055 !important;color:#f2faff !important;
  border:1px solid #6ba7bb !important;
}
#appView :is(.pos-order-dialog,.pos-floating-panel):not(#billingDiscountControl) :is(h2,h3,p,label,small,strong) {
  color:#eff9ff !important;opacity:1 !important;
}
@media(max-width:760px) {
  #appView .view .card,#appView .module-panel .card{box-sizing:border-box;max-width:100%;min-width:0}
  #billingApprovalModal .bill-approval-modal {max-width:min(96vw,540px)!important;max-height:92dvh;overflow-y:auto}
}
@media(prefers-reduced-motion:reduce) {
  #appView .view .card{transition:none!important}
}
