/* Riviera Suite PATCH290 · Command · 290.1
   Opt-in scope shared by the existing web shells. No business or layout behavior. */
body[data-rv-command290] {
  --rv290-bg: #040e1c;
  --rv290-panel: #081c33;
  --rv290-thead: #0a2440;
  --rv290-zebra: #0b2745;
  --rv290-border: #1f5b86;
  --rv290-line: #3d9fd6;
  --rv290-field: #1b5a8c;
  --rv290-focus: #2273ad;
  --rv290-selected: #12355a;
  --rv290-text: #d6f1ff;
  --rv290-muted: #a5bfd2;
  --rv290-accent: #8fd8ff;
  --rv290-good: #76e3b3;
  --rv290-warn: #ffd47a;
  --rv290-danger: #ffab9d;
  --rv290-good-bg: #103b35;
  --rv290-warn-bg: #40321a;
  --rv290-danger-bg: #442530;
  --rv290-heading: 'Bahnschrift Condensed', 'Arial Narrow', 'Roboto Condensed', system-ui, sans-serif;
  --suite-primary: #8fd8ff;
  --suite-primary-600: #b6e7ff;
  --suite-accent: #76e3b3;
  --suite-bg: var(--rv290-bg);
  --suite-card-border: var(--rv290-border);
  --suite-text: var(--rv290-text);
  --suite-muted: var(--rv290-muted);
  --suite-radius: 3px;
  --suite-shadow: 0 5px 22px #0005;
  --bs-body-bg: var(--rv290-bg);
  --bs-body-bg-rgb: 4, 14, 28;
  --bs-body-color: var(--rv290-text);
  --bs-body-color-rgb: 214, 241, 255;
  --bs-secondary-color: var(--rv290-muted);
  --bs-secondary-color-rgb: 165, 191, 210;
  --bs-secondary-bg: var(--rv290-thead);
  --bs-tertiary-bg: var(--rv290-panel);
  --bs-border-color: var(--rv290-border);
  --bs-border-color-translucent: #3d9fd64d;
  --bs-emphasis-color: var(--rv290-text);
  --bs-emphasis-color-rgb: 214, 241, 255;
  --bs-heading-color: var(--rv290-text);
  --bs-link-color: var(--rv290-accent);
  --bs-link-color-rgb: 143, 216, 255;
  --bs-link-hover-color: #c4edff;
  --bs-link-hover-color-rgb: 196, 237, 255;
  --bs-primary-text-emphasis: var(--rv290-accent);
  --bs-success-text-emphasis: var(--rv290-good);
  --bs-warning-text-emphasis: var(--rv290-warn);
  --bs-danger-text-emphasis: var(--rv290-danger);
  --bs-primary-bg-subtle: var(--rv290-selected);
  --bs-success-bg-subtle: var(--rv290-good-bg);
  --bs-warning-bg-subtle: var(--rv290-warn-bg);
  --bs-danger-bg-subtle: var(--rv290-danger-bg);
  color-scheme: dark;
  color: var(--rv290-text);
  background: linear-gradient(#3d9fd606 1px, transparent 1px), linear-gradient(90deg, #3d9fd606 1px, transparent 1px), var(--rv290-bg);
  background-size: 32px 32px;
  accent-color: var(--rv290-accent);
}
body[data-rv-command290] :is(h1,h2,h3,h4,h5,h6,.card-title,.panel-title) {
  color: var(--rv290-text);
  font-family: var(--rv290-heading);
  letter-spacing: .045em;
}
body[data-rv-command290] :is(h1,h2,.card-header,.panel-heading) { text-transform: uppercase; }
body[data-rv-command290] a:where(:not(.btn):not(.badge):not(.nav-link):not(.nav-item):not(.dropdown-item)) { color: var(--rv290-accent); }
body[data-rv-command290] a:not(.btn):hover { text-decoration-thickness: 1px; text-underline-offset: 3px; }
body[data-rv-command290] :is(.muted,.text-muted,.small-muted,.form-text,.text-secondary) { color: var(--rv290-muted) !important; }
body[data-rv-command290] :is(.text-dark,.text-body,.text-body-emphasis) { color: var(--rv290-text) !important; }
body[data-rv-command290] .text-white-50 { color: var(--rv290-muted) !important; }
body[data-rv-command290] :is(.text-primary,.text-info) { color: var(--rv290-accent) !important; }
body[data-rv-command290] .text-success { color: var(--rv290-good) !important; }
body[data-rv-command290] .text-warning { color: var(--rv290-warn) !important; }
body[data-rv-command290] :is(.text-danger,.invalid-feedback,.invalid-tooltip) { color: var(--rv290-danger) !important; }
body[data-rv-command290] hr { border-color: var(--rv290-border); opacity: 1; }
body[data-rv-command290] ::selection { background: var(--rv290-focus); color: #fff; }

/* Frames retain their normal overflow: menus and help popovers remain usable. */
body[data-rv-command290] :is(.card,.panel,.kpi,.kpi-card,.modal-content) {
  color: var(--rv290-text);
  background-color: var(--rv290-panel) !important;
  border: 1px solid var(--rv290-border) !important;
  border-radius: 3px !important;
  box-shadow: inset 0 1px 0 #8fd8ff12, 0 6px 22px #0002;
}
body[data-rv-command290] :is(.card,.panel,.kpi,.kpi-card):hover {
  transform: none;
  transition: border-color .14s ease;
  box-shadow: inset 0 1px 0 #8fd8ff12, 0 6px 22px #0002;
}
body[data-rv-command290] :is(.card-header,.panel-heading,.modal-header) {
  color: var(--rv290-text);
  background: var(--rv290-thead);
  border-color: var(--rv290-line);
  border-radius: 2px 2px 0 0 !important;
  font-family: var(--rv290-heading);
  font-weight: 700;
  letter-spacing: .055em;
}
body[data-rv-command290] :is(.card-footer,.panel-footer,.modal-footer) { background: #06172b; border-color: var(--rv290-border); }
body[data-rv-command290] :is(.card-body,.panel-body) { color: var(--rv290-text); }
body[data-rv-command290] :is(.bg-white,.bg-light) { background-color: var(--rv290-panel) !important; color: var(--rv290-text); }
body[data-rv-command290] :is(.list-group-item,.accordion-item) { color: var(--rv290-text); background: var(--rv290-panel); border-color: var(--rv290-border); }
body[data-rv-command290] :is(.list-group-item-action:hover,.list-group-item.active,.accordion-button:not(.collapsed)) { color: var(--rv290-text); background: var(--rv290-selected); border-color: var(--rv290-line); }
body[data-rv-command290] .accordion-button { color: var(--rv290-text); background: var(--rv290-thead); }
body[data-rv-command290] :is(.dropdown-menu,.popover,.offcanvas) { color: var(--rv290-text); background-color: var(--rv290-panel); border-color: var(--rv290-line); border-radius: 3px; }
body[data-rv-command290] :is(.dropdown-item,.popover-body) { color: var(--rv290-text); }
body[data-rv-command290] :is(.dropdown-header,.popover-header) { color: var(--rv290-muted); background: var(--rv290-thead); border-color: var(--rv290-border); }
body[data-rv-command290] :is(.dropdown-item:hover,.dropdown-item:focus,.dropdown-item.active,.dropdown-item:active) { color: var(--rv290-text); background: var(--rv290-selected); }
body[data-rv-command290] .dropdown-divider { border-color: var(--rv290-border); }

/* Fields preserve every original name, value, validation and readonly state. */
body[data-rv-command290] :is(label,legend,.col-form-label,.form-label) { color: var(--rv290-text); }
body[data-rv-command290] :is(input:where(:not([type='hidden']):not([type='checkbox']):not([type='radio']):not([type='range']):not([type='color']):not([type='button']):not([type='submit']):not([type='reset']):not([type='image'])),textarea,select,.form-control,.form-select,.custom-select) {
  color: var(--rv290-text);
  background-color: var(--rv290-field);
  border-color: #3985b5;
  border-radius: 2px !important;
  caret-color: #fff;
}
body[data-rv-command290] :is(input,textarea)::placeholder { color: #bfd8e8; opacity: 1; }
body[data-rv-command290] :is(input,textarea,select,.form-control,.form-select):focus { color: var(--rv290-text); background-color: var(--rv290-field); border-color: var(--rv290-accent) !important; box-shadow: 0 0 0 3px #8fd8ff24 !important; }
body[data-rv-command290] :is(input,textarea)[readonly] { background-color: var(--rv290-thead) !important; color: var(--rv290-muted) !important; }
body[data-rv-command290] :is(input,textarea,select,button):disabled { opacity: .68; cursor: not-allowed; }
body[data-rv-command290] :is(input,textarea,select):disabled { background-color: var(--rv290-thead) !important; color: var(--rv290-muted) !important; }
body[data-rv-command290] select option { background-color: var(--rv290-panel); color: var(--rv290-text); }
body[data-rv-command290] input::file-selector-button { color: var(--rv290-text); background: var(--rv290-selected); border: 1px solid var(--rv290-line); border-radius: 2px; }
body[data-rv-command290] .input-group-text { background: var(--rv290-thead); color: var(--rv290-muted); border-color: var(--rv290-border); }
body[data-rv-command290] :is(.form-check-input,.custom-control-input):checked { background-color: var(--rv290-focus); border-color: var(--rv290-accent); }
body[data-rv-command290] :is(input,textarea,select)[aria-invalid='true'],
body[data-rv-command290] :is(input,textarea,select).is-invalid { border-color: var(--rv290-danger) !important; }
body[data-rv-command290] :is(a,button,input,select,textarea,summary,[tabindex]):focus-visible { outline: 2px solid var(--rv290-accent) !important; outline-offset: 3px; }

/* Stable controls: no hover movement; semantic destructive controls stay distinct. */
body[data-rv-command290] :is(.btn,.btn-ghost) {
  color: var(--rv290-accent);
  background-color: var(--rv290-thead);
  border-color: var(--rv290-line);
  border-radius: 3px !important;
  font-weight: 650;
  box-shadow: none;
  text-decoration: none;
}
body[data-rv-command290] :is(.btn,.btn-ghost):hover { color: #e6f7ff; background-color: var(--rv290-selected); border-color: var(--rv290-accent); }
body[data-rv-command290] :is(.btn-primary,.btn.primary) { color: #052039 !important; background-color: var(--rv290-accent) !important; border-color: var(--rv290-accent) !important; }
body[data-rv-command290] :is(.btn-primary,.btn.primary):hover { color: #052039 !important; background-color: #b6e7ff !important; border-color: #b6e7ff !important; }
body[data-rv-command290] :is(.btn-danger,.btn-outline-danger,.btn.danger) { color: var(--rv290-danger) !important; background-color: var(--rv290-danger-bg); border-color: #cb776b; }
body[data-rv-command290] :is(.btn-success,.btn-outline-success) { color: var(--rv290-good); background-color: var(--rv290-good-bg); border-color: #4b9c80; }
body[data-rv-command290] :is(.btn-warning,.btn-outline-warning) { color: var(--rv290-warn); background-color: var(--rv290-warn-bg); border-color: #b39456; }
body[data-rv-command290] :is(.btn-outline-primary,.btn-outline-info,.btn-outline-secondary,.btn-outline-dark,.btn-default,.btn-secondary,.btn-info) { color: var(--rv290-accent) !important; background: var(--rv290-thead) !important; border-color: var(--rv290-line) !important; }
body[data-rv-command290] :is(.btn-outline-primary,.btn-outline-info,.btn-outline-secondary,.btn-outline-dark,.btn-default,.btn-secondary,.btn-info):is(:hover,:focus-visible,:active,.active) { color: var(--rv290-text) !important; background: var(--rv290-selected) !important; border-color: var(--rv290-accent) !important; }
body[data-rv-command290] :is(.btn-danger,.btn-outline-danger,.btn.danger) { color: var(--rv290-danger) !important; background: var(--rv290-danger-bg) !important; border-color: #cb776b !important; }
body[data-rv-command290] :is(.btn-success,.btn-outline-success) { color: var(--rv290-good) !important; background: var(--rv290-good-bg) !important; border-color: #4b9c80 !important; }
body[data-rv-command290] :is(.btn-warning,.btn-outline-warning) { color: var(--rv290-warn) !important; background: var(--rv290-warn-bg) !important; border-color: #b39456 !important; }
body[data-rv-command290] .btn-link { color: var(--rv290-accent); background: transparent; border-color: transparent; }
body[data-rv-command290] :is(.btn.disabled,.btn:disabled,[aria-disabled='true']) { opacity: .6; }
body[data-rv-command290] .btn-close { filter: none !important; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath stroke='%23D6F1FF' stroke-width='2' d='m2 2 12 12m0-12L2 14'/%3E%3C/svg%3E"); }
body[data-rv-command290] .close { color: var(--rv290-text); text-shadow: none; opacity: .9; }
body[data-rv-command290] .page-link { color: var(--rv290-accent); background: var(--rv290-thead); border-color: var(--rv290-border); }
body[data-rv-command290] :is(.page-item.active .page-link,.page-link:hover,.page-link:focus) { color: #052039; background: var(--rv290-accent); border-color: var(--rv290-accent); }
body[data-rv-command290] .page-item.disabled .page-link { color: var(--rv290-muted); background: var(--rv290-panel); border-color: var(--rv290-border); }
body[data-rv-command290] .nav-tabs { border-color: var(--rv290-border); }
body[data-rv-command290] .nav-tabs .nav-link { color: var(--rv290-muted); border-radius: 2px 2px 0 0; }
body[data-rv-command290] .nav-tabs .nav-link.active { color: var(--rv290-accent); background: var(--rv290-panel); border-color: var(--rv290-line) var(--rv290-line) var(--rv290-panel); }

/* Table state colors are explicit, including Bootstrap 4 and 5 cell backgrounds. */
body[data-rv-command290] :is(.table,.calendar) {
  --bs-table-color: var(--rv290-text);
  --bs-table-bg: var(--rv290-panel);
  --bs-table-border-color: var(--rv290-border);
  --bs-table-striped-color: var(--rv290-text);
  --bs-table-striped-bg: var(--rv290-zebra);
  --bs-table-hover-color: var(--rv290-text);
  --bs-table-hover-bg: var(--rv290-selected);
  --bs-table-active-color: var(--rv290-text);
  --bs-table-active-bg: var(--rv290-selected);
  color: var(--rv290-text);
  background-color: var(--rv290-panel);
  border-color: var(--rv290-border);
  border-radius: 2px;
  font-variant-numeric: tabular-nums;
}
body[data-rv-command290] :is(.table,.calendar) :is(th,td) { color: inherit; border-color: var(--rv290-border) !important; }
body[data-rv-command290] :is(.table,.calendar) thead th {
  color: var(--rv290-accent);
  background: var(--rv290-thead) !important;
  font-family: var(--rv290-heading);
  font-weight: 700;
  letter-spacing: .045em;
  border-bottom-color: var(--rv290-line) !important;
}
body[data-rv-command290] .table :where(tbody tr:nth-child(even)) > :is(th,td) { background-color: var(--rv290-zebra); }
body[data-rv-command290] .table :where(tbody tr:hover) > :is(th,td) { background-color: var(--rv290-selected); }
body[data-rv-command290] .table :is(tr.table-active,tr.selected,tr[aria-selected='true']) > :is(th,td) { background-color: var(--rv290-selected); box-shadow: inset 0 1px #3d9fd655, inset 0 -1px #3d9fd655; }
body[data-rv-command290] .table :is(tr.overdue,tr.table-danger) > :is(th,td),
body[data-rv-command290] .table :is(td.table-danger,th.table-danger,td.overdue) { --bs-table-bg: var(--rv290-danger-bg); --bs-table-accent-bg: transparent; --bs-table-bg-type: transparent; --bs-table-bg-state: transparent; background-color: var(--rv290-danger-bg); color: #ffd9d2; }
body[data-rv-command290] .table :is(tr.due-soon,tr.due-warning,tr.table-warning) > :is(th,td),
body[data-rv-command290] .table :is(td.table-warning,th.table-warning,td.due-soon,td.due-warning) { --bs-table-bg: var(--rv290-warn-bg); --bs-table-accent-bg: transparent; --bs-table-bg-type: transparent; --bs-table-bg-state: transparent; background-color: var(--rv290-warn-bg); color: #ffe6b7; }
body[data-rv-command290] .table :is(tr.done,tr.table-success) > :is(th,td),
body[data-rv-command290] .table :is(td.table-success,th.table-success,td.done) { --bs-table-bg: var(--rv290-good-bg); --bs-table-accent-bg: transparent; --bs-table-bg-type: transparent; --bs-table-bg-state: transparent; background-color: var(--rv290-good-bg); color: #cbf6e6; }
body[data-rv-command290] .table :is(tr.table-info,tr.table-primary) > :is(th,td) { --bs-table-bg: var(--rv290-selected); background-color: var(--rv290-selected); color: var(--rv290-text); }
body[data-rv-command290] .table tfoot :is(th,td) { background: var(--rv290-thead); color: var(--rv290-accent); border-top: 1px solid var(--rv290-line); }

body[data-rv-command290] .badge { color: var(--rv290-accent) !important; background-color: var(--rv290-selected); border: 1px solid var(--rv290-border); font-weight: 650; }
body[data-rv-command290] :is(.badge.red,.badge-danger,.badge.bg-danger,.badge.text-bg-danger) { color: var(--rv290-danger) !important; background: var(--rv290-danger-bg) !important; border-color: #ae645d; }
body[data-rv-command290] :is(.badge.orange,.badge.yellow,.badge-warning,.badge.bg-warning,.badge.text-bg-warning) { color: var(--rv290-warn) !important; background: var(--rv290-warn-bg) !important; border-color: #a68a50; }
body[data-rv-command290] :is(.badge.green,.badge-success,.badge.bg-success,.badge.text-bg-success) { color: var(--rv290-good) !important; background: var(--rv290-good-bg) !important; border-color: #40866e; }
body[data-rv-command290] :is(.badge.gray,.badge-secondary,.badge.bg-secondary,.badge.text-bg-secondary) { color: var(--rv290-muted) !important; background: #1b3046 !important; border-color: #57728c; }
body[data-rv-command290] :is(.badge.blue,.badge-info,.badge-primary,.badge.bg-info,.badge.bg-primary,.badge.text-bg-info,.badge.text-bg-primary,.badge-light) { color: var(--rv290-accent) !important; background: var(--rv290-selected) !important; border-color: var(--rv290-line); }
body[data-rv-command290] :is(.alert,.flash) { color: var(--rv290-text); background: var(--rv290-thead); border: 1px solid var(--rv290-line); border-radius: 3px; }
body[data-rv-command290] :is(.alert-success,.flash.success) { color: #cbf6e6; background: var(--rv290-good-bg); border-color: #40866e; }
body[data-rv-command290] :is(.alert-warning,.flash.warning) { color: #ffe6b7; background: var(--rv290-warn-bg); border-color: #a68a50; }
body[data-rv-command290] :is(.alert-danger,.alert-error,.flash.error,.flash.danger) { color: #ffd9d2; background: var(--rv290-danger-bg); border-color: #ae645d; }
body[data-rv-command290] :is(.alert,.flash) a { color: inherit !important; text-decoration: underline; }
body[data-rv-command290] :is(code,kbd) { color: #b8e7ff; background: #061426; border-radius: 2px; }
body[data-rv-command290] pre { color: var(--rv290-text); background: #061426; border: 1px solid var(--rv290-border); border-radius: 3px; }
body[data-rv-command290] .progress { background-color: #16334c; }
body[data-rv-command290] .progress-bar { color: #041422; background-color: var(--rv290-accent); }

/* Existing chart renderers use dark legend text. Retain a light plot surface;
   images, maps, videos, signatures and QR codes are never filtered or recolored. */
body[data-rv-command290] canvas:not(.rs-canvas):not([data-rv290-transparent]) { background-color: #f4f8fc; border-radius: 2px; }

body[data-rv-command290] .leaflet-container canvas { background: transparent !important; border-radius: 0 !important; }

/* Inline field guidance and save confirmations share the same contrast contract. */
body[data-rv-command290] button.rs-field-help { color: var(--rv290-accent) !important; background: var(--rv290-thead) !important; border-color: var(--rv290-line) !important; }
body[data-rv-command290] button.rs-field-help:is(:hover,[aria-expanded='true']) { color: #052039 !important; background: var(--rv290-accent) !important; }
body[data-rv-command290] .rs-help-tooltip { color: var(--rv290-text) !important; background: var(--rv290-panel) !important; border-color: var(--rv290-line) !important; border-radius: 3px !important; }
body[data-rv-command290] .rs-help-tooltip :is(p,.rs-help-title) { color: var(--rv290-text) !important; }
body[data-rv-command290] .rs-help-tooltip .rs-help-example { border-color: var(--rv290-line); }
body[data-rv-command290] .suite-save-status272 { color: var(--rv290-text); background: var(--rv290-thead); border-color: var(--rv290-border); border-radius: 3px; }
body[data-rv-command290] .suite-save-status272:is([data-save-state272='dirty'],[data-save-state272='unconfirmed']) { color: var(--rv290-warn); background: var(--rv290-warn-bg); border-color: #a68a50; }
body[data-rv-command290] .suite-save-status272[data-save-state272='saved'] { color: var(--rv290-good); background: var(--rv290-good-bg); border-color: #40866e; }

@media (prefers-reduced-motion: reduce) {
  body[data-rv-command290] :is(.card,.panel,.kpi,.btn,.nav-link,.nav-item,.progress-bar,.collapse,.collapsing,.offcanvas,.modal,.fade) { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media print {
  body[data-rv-command290] {
    color-scheme: light;
    --rv290-bg: #fff; --rv290-panel: #fff; --rv290-thead: #edf2f6;
    --rv290-zebra: #f4f6f8; --rv290-border: #8b9caa; --rv290-line: #526d82;
    --rv290-text: #111; --rv290-muted: #444; --rv290-accent: #153b5b;
    --rv290-field: #fff; --rv290-selected: #edf2f6;
    --rv290-good: #175a40; --rv290-warn: #715216; --rv290-danger: #8b2d24;
    --rv290-good-bg: #edf7f0; --rv290-warn-bg: #fff7e6; --rv290-danger-bg: #fff1ee;
    color: #111 !important; background: #fff !important;
  }
  body[data-rv-command290] :is(.card,.panel,.kpi,.kpi-card,.modal-content) { color: #111 !important; background: #fff !important; box-shadow: none !important; transform: none !important; }
  body[data-rv-command290] :is(.table,.calendar) :is(th,td) { color: #111 !important; box-shadow: none !important; }
  body[data-rv-command290] :is(input,textarea,select,.form-control,.form-select) { color: #111 !important; background-color: #fff !important; box-shadow: none !important; }
  body[data-rv-command290] :is(.badge,.alert,.flash) { color: #111 !important; box-shadow: none !important; }
  body[data-rv-command290] :is(.text-muted,.muted,.small-muted,.text-secondary,.text-white-50,.text-dark,.text-body,.text-primary,.text-info,.text-success,.text-warning,.text-danger) { color: #333 !important; }
  body[data-rv-command290] :is(a,code,kbd,pre) { color: #111 !important; }
  body[data-rv-command290] :is(code,kbd,pre) { background: #f4f6f8 !important; }
}

@media (forced-colors: active) {
  body[data-rv-command290] :is(a,button,input,select,textarea,summary,[tabindex]):focus-visible { outline: 3px solid Highlight !important; box-shadow: none !important; }
}
