/* Creatio-inspired light appearance for the shared Legacy modules.
   Visual-only: no layout, workflow, or print styles are changed. */
@media screen {
html:root[data-theme="light"] {
  color-scheme: light;
  --bg: #eae5f4; --surface: #fcfaff; --surface2: #f1ebf8; --surface-alt: #f1ebf8;
  --border: #d9cfea; --border2: #c6b6df; --border-strong: #ad99d0;
  --text: #173356; --text-2: #4e6080; --text-3: #74829d;
  --muted: #64718c; --soft: #71809b;
  --accent: #1a58d8; --accent-dark: #1747b6; --accent2: #e5ecff;
  --accent-bg: #e5ecff; --accent-text: #1747b6;
  --purple: #6537b8; --purple2: #eee8fb; --purple-bg: #eee8fb;
  --purple-text: #552d9c; --green: #168a16; --green2: #e6f6e4;
  --green-bg: #e6f6e4; --green-text: #176d2f;
  --red: #de3d50; --red2: #fff0f1; --red-bg: #fff0f1;
  --amber: #e97a00; --amber2: #fff3e4; --amber-bg: #fff3e4;
  --gold: #e97a00; --gold2: #fff3e4;
  --panel: #fcfaff; --line: #d9cfea; --brand: #fff;
  --shadow: 0 5px 18px rgba(64, 34, 115, .09);
  --shadow-md: 0 16px 36px rgba(43, 36, 108, .12);
  background: var(--bg); color: var(--text);
}
html:root[data-theme="light"] body {
  background: linear-gradient(140deg,#e8e0f4 0%,#f0e9f8 48%,#e3e9fa 100%) fixed !important; color: var(--text);
}
html:root[data-theme="light"] body :is(.app,.main,.layout,.content) {
  background: transparent;
}
html:root[data-theme="light"] body :is(.side,.sidebar,.mac-recep-side,.tech-side) {
  background: linear-gradient(165deg,#472a88 0%,#58358f 46%,#40275e 76%,#291d39 100%) !important;
  border-color: rgba(255,255,255,.16) !important;
  box-shadow: 5px 0 20px rgba(52,33,111,.1);
}
html:root[data-theme="light"] body :is(.sidebar-logo,.brandbox,.sidebar-footer,.nav-sep,.user) {
  border-color: rgba(255,255,255,.16) !important;
}
html:root[data-theme="light"] body :is(.side,.sidebar,.mac-recep-side,.tech-side) :is(.brand,.brand span,.title,.user-name,.sidebar-logo .sub,.sidebar-logo .mini-meta,.sub,.user-role) {
  color: #f6f2ff !important;
}
html:root[data-theme="light"] body :is(.side,.sidebar,.mac-recep-side,.tech-side) :is(.nav button,.nav-item,.nav a,.mac-recep-side a) {
  color: #f2edff !important;
  border-radius: 10px;
  font-weight: 650;
}
html:root[data-theme="light"] body :is(.side,.sidebar,.mac-recep-side,.tech-side) :is(.nav button:hover,.nav button.active,.nav-item:hover,.nav-item.active,.nav a:hover,.nav a.active,.mac-recep-side a:hover,.mac-recep-side a.active) {
  color: #fff !important;
  background: rgba(255,255,255,.19) !important;
  box-shadow: inset 3px 0 #d7a8ff;
}
html:root[data-theme="light"] body :is(.side,.sidebar,.mac-recep-side,.tech-side) .avatar {
  background: #f4e8ff !important; color: #513084 !important;
}
html:root[data-theme="light"] body :is(.top,.topbar,header.top,header.topbar) {
  background: linear-gradient(100deg,#402685,#4f2c91 55%,#3d308f) !important;
  border-color: #533aa1 !important;
  color: #fff !important;
  box-shadow: 0 5px 18px rgba(54,36,128,.14);
}
html:root[data-theme="light"] body :is(.top,.topbar,header.top,header.topbar) :is(.title,.topbar-title,.crumb,.topbar-date,.brand,.role-badge,.user-chip,.user-chip span) {
  color: #fff !important;
}
html:root[data-theme="light"] body :is(.top,.topbar,header.top,header.topbar) :is(.btn,button.btn) {
  background: rgba(255,255,255,.13) !important;
  border-color: rgba(255,255,255,.3) !important;
  color: #fff !important;
}
html:root[data-theme="light"] body :is(.top,.topbar,header.top,header.topbar) :is(.btn,button.btn):hover {
  background: rgba(255,255,255,.25) !important;
}
html:root[data-theme="light"] body :is(.top,.topbar,header.top,header.topbar) :is(.btn.primary,.btn.btn-primary) {
  background: #0754dd !important; border-color: #0754dd !important;
}
html:root[data-theme="light"] body :is(.panel,.card,.stat-card,.kpi,.info-card,.product-card,.modal,.modal-box,.modal-card,.drawer) {
  background: var(--surface); color: var(--text); border-color: var(--border);
  box-shadow: var(--shadow); border-radius: 12px;
}
html:root[data-theme="light"] body :is(.board .col,.kanban-column,.orders-column,.section-card,.table-wrap,.tablewrap,.filters,.controls) {
  background: rgba(250,247,255,.72); border-color: var(--border);
}
html:root[data-theme="light"] body :is(.board .col,.kanban-column,.orders-column) {
  box-shadow: 0 7px 22px rgba(67,39,122,.08);
}
html:root[data-theme="light"] body :is(.col-head,.kanban-header,.panel-head,.section-title) {
  background: #e9def8; border-color: #d4c2eb; color: #3d2767;
}
html:root[data-theme="light"] body :is(.board .card,.orders-column .card) {
  background: #fff; border-left: 3px solid #8062c8;
}
html:root[data-theme="light"] body :is(.stats-row,.dashboard-stats) {
  background: rgba(238,230,249,.55);
  border-bottom: 1px solid rgba(154,121,203,.2);
}
html:root[data-theme="light"] body :is(.controls,.filters,.toolbar) {
  background: rgba(241,234,250,.68);
}
html:root[data-theme="light"] body :is(.btn.primary,.btn.btn-primary,button.primary) {
  background: #0754dd; border-color: #0754dd; color: #fff;
}
html:root[data-theme="light"] body :is(.btn.primary,.btn.btn-primary,button.primary):hover {
  background: #0647bc; border-color: #0647bc;
}
html:root[data-theme="light"] body :is(input,select,textarea,.field input,.field select,.field textarea) {
  background: #fff; color: var(--text); border-color: var(--border2);
  accent-color: #0754dd;
}
html:root[data-theme="light"] body :is(input,select,textarea):focus {
  border-color: #0754dd; box-shadow: 0 0 0 3px rgba(7,84,221,.13);
}
html:root[data-theme="light"] body :is(button,a,input,select,textarea):focus-visible {
  outline: 2px solid #0754dd; outline-offset: 2px;
}
html:root[data-theme="light"] body :is(.tab.active,.pill.active,.chip.selected,.view-btn.active) {
  color: #0754dd; border-color: #0754dd;
}
html:root[data-theme="light"] body :is(th,thead,thead tr,.orders th) {
  background: #eae1f7; color: #473369; border-color: var(--border);
}
html:root[data-theme="light"] body :is(tbody tr:hover,.orders tbody tr:hover,.item-row:hover,.product-card:hover) {
  background: #eef3ff;
}
/* Brighter summary cards, like the reference. Keep all data/text intact. */
html:root[data-theme="light"] body :is(.stat-card,.kpi):nth-child(4n+1) { background: #0754dd !important; border-color: #0754dd !important; }
html:root[data-theme="light"] body :is(.stat-card,.kpi):nth-child(4n+2) { background: #1241b3 !important; border-color: #1241b3 !important; }
html:root[data-theme="light"] body :is(.stat-card,.kpi):nth-child(4n+3) { background: #bf5000 !important; border-color: #bf5000 !important; }
html:root[data-theme="light"] body :is(.stat-card,.kpi):nth-child(4n+4) { background: #147a23 !important; border-color: #147a23 !important; }
html:root[data-theme="light"] body :is(.stat-card,.kpi) :is(.stat-label,.stat-num,.stat-sub,label,b,span) {
  color: #fff !important;
}
html:root[data-theme="light"] body :is(.stat-card,.kpi) :is(.stat-label,label) { opacity: .88; }
html:root[data-theme="light"] body .card.delivered-card {
  background: #f1ebff; border-color: #a278e2; box-shadow: 0 4px 16px rgba(112,67,182,.12);
}
html:root[data-theme="light"] body .data-table tr.delivered-row { background: #f5f0ff; }
}

/* One dark appearance for both current and legacy saved theme names.
   Scoped to screen: the original light theme and printed documents are preserved. */
@media screen {
html:root:is([data-theme="dark"], [data-theme="blue"]),
html:root:is([data-theme="dark"], [data-theme="blue"]) body {
  color-scheme: dark;
  --bg: #090a0b; --surface: #111214; --surface2: #191a1d; --surface-alt: #191a1d;
  --border: #292a2e; --border2: #3b3d42; --border-strong: #505258;
  --text: #f5f5f6; --text-2: #c9c9ce; --text-3: #999ba3; --muted: #b4b5bc; --soft: #999ba3;
  --accent: #ededf0; --accent-dark: #d3d3d9; --accent2: #25262b;
  --accent-bg: #25262b; --accent-text: #f5f5f6;
  --green: #67d9a1; --green2: #142a21; --green-bg: #142a21; --green-text: #8be2b5;
  --red: #ff858d; --red2: #321b20; --red-bg: #321b20; --red-text: #ffabb0;
  --amber: #eac17a; --amber2: #30271b; --amber-bg: #30271b; --amber-text: #f2d29d;
  --gold: #eac17a; --gold2: #30271b; --purple: #bba4eb; --purple2: #282137;
  --purple-bg: #282137; --purple-text: #d2c0f3;
  --panel: #111214; --line: #292a2e; --brand: #ededf0;
  --shadow: 0 1px 2px #0005; --shadow-md: 0 12px 30px #0004;
  background: var(--bg) !important; color: var(--text) !important;
}
html:root:is([data-theme="dark"], [data-theme="blue"]) body :is(.app,.main,.layout,.content) {
  background: var(--bg) !important;
}
html:root:is([data-theme="dark"], [data-theme="blue"]) body :is(.side,.sidebar,.mac-recep-side,.top,.topbar,header.top,header.topbar) {
  background: #101113 !important; border-color: var(--border) !important; box-shadow: none !important;
}
html:root:is([data-theme="dark"], [data-theme="blue"]) body :is(.panel,.card,.kpi,.stat-card,.info-card,.product-card,.modal-box,.modal-card,.drawer) {
  background: var(--surface) !important; color: var(--text) !important;
  border-color: var(--border) !important; box-shadow: 0 1px 2px #0004 !important;
  border-radius: 10px;
}
html:root:is([data-theme="dark"], [data-theme="blue"]) body :is(.panel-head,.filters,.toolbar,.tablewrap,.modal-head,.modal-foot,.mh,.mf,.form-footer,.section-label,.item-row,.cart-row,tr,td,th,.brandbox,.sidebar-logo,.sidebar-footer,.nav-sep,.user) {
  border-color: var(--border) !important;
}
html:root:is([data-theme="dark"], [data-theme="blue"]) body :is(h1,h2,h3,h4,.brand,.brand span,.title,.panel-title,.topbar-title) {
  color: var(--text) !important;
}
html:root:is([data-theme="dark"], [data-theme="blue"]) body :is(.crumb,.sub,.panel-sub,.muted,.soft,.topbar-date,.user-role,label) {
  color: var(--muted) !important;
}
html:root:is([data-theme="dark"], [data-theme="blue"]) body :is(.nav button,.nav-item,.mac-recep-side a) {
  color: var(--text-2) !important; box-shadow: none !important;
}
html:root:is([data-theme="dark"], [data-theme="blue"]) body :is(.nav button:hover,.nav button.active,.nav-item:hover,.nav-item.active,.mac-recep-side a:hover,.mac-recep-side a.active,.tab.active,.pill.active,.chip.selected) {
  background: #27282c !important; color: #fff !important; border-color: #45464d !important;
}
html:root:is([data-theme="dark"], [data-theme="blue"]) body :is(th,thead,thead tr,.orders th) {
  background: #18191c !important; color: #bfc0c7 !important;
}
html:root:is([data-theme="dark"], [data-theme="blue"]) body :is(tbody tr:hover,.orders tbody tr:hover,.item-row:hover,.product-card:hover) {
  background: #1c1d21 !important;
}
html:root:is([data-theme="dark"], [data-theme="blue"]) body :is(input,select,textarea,.field input,.field select,.field textarea,.search input) {
  background: #151619 !important; color: var(--text) !important; border-color: #3b3d42 !important;
  accent-color: #dedee4;
}
html:root:is([data-theme="dark"], [data-theme="blue"]) body :is(input,textarea)::placeholder { color: #92949e !important; }
html:root:is([data-theme="dark"], [data-theme="blue"]) body :is(input,select,textarea):focus {
  border-color: #c9cad2 !important; box-shadow: 0 0 0 3px #ffffff14 !important;
}
html:root:is([data-theme="dark"], [data-theme="blue"]) body :is(button,a,input,select,textarea):focus-visible {
  outline: 2px solid #dedee4; outline-offset: 3px;
}
html:root:is([data-theme="dark"], [data-theme="blue"]) body :is(.btn,button.btn,.demo button) {
  background: #202125 !important; border-color: #3b3d42 !important; color: #e8e8ed !important;
  box-shadow: none !important; transform: none;
}
html:root:is([data-theme="dark"], [data-theme="blue"]) body :is(.btn:hover,button.btn:hover,.demo button:hover) {
  background: #2d2e34 !important; border-color: #60616b !important;
}
html:root:is([data-theme="dark"], [data-theme="blue"]) body :is(.btn.primary,.btn.btn-primary,button.primary) {
  background: #f0f0f3 !important; border-color: #f0f0f3 !important; color: #111214 !important;
}
html:root:is([data-theme="dark"], [data-theme="blue"]) body :is(.btn.primary,.btn-primary,button.primary):hover {
  background: #d4d4dc !important;
}
html:root:is([data-theme="dark"], [data-theme="blue"]) body :is(.btn.green,.btn-whatsapp) {
  background: #173b2b !important; color: #a4ecc5 !important; border-color: #306b4c !important;
}
html:root:is([data-theme="dark"], [data-theme="blue"]) body .btn.danger {
  background: #391e24 !important; color: #ffb0b7 !important; border-color: #74404a !important;
}
html:root:is([data-theme="dark"], [data-theme="blue"]) body .btn.warn {
  background: #372b1b !important; color: #f2d29d !important; border-color: #786039 !important;
}
html:root:is([data-theme="dark"], [data-theme="blue"]) body :is(a,.mono) { color: #e1e1e8 !important; }
html:root:is([data-theme="dark"], [data-theme="blue"]) body :is(.avatar,.view-btn.active) { background: #292a30 !important; color: #fff !important; }
html:root:is([data-theme="dark"], [data-theme="blue"]) body :is(.sidebar,.side,.mac-recep-side) > button {
  background: #202125 !important; color: #f5f5f6 !important; border-color: #3b3d42 !important;
}
html:root:is([data-theme="dark"], [data-theme="blue"]) body :is(.overlay,.modal.open) { background: #000b !important; }
/* The existing monochrome brand remains legible on charcoal. */
html:root:is([data-theme="dark"], [data-theme="blue"]) body .step.active .step-num { color: #111214 !important; }
html:root:is([data-theme="dark"], [data-theme="blue"]) body > button[style] {
  background: #202125 !important; color: #f5f5f6 !important; border-color: #3b3d42 !important;
}
html:root:is([data-theme="dark"], [data-theme="blue"]) body :is(.order,.file,.type-btn,.secondary) {
  background: #191a1d !important; color: #e8e8ed !important; border-color: #3b3d42 !important;
}
html:root:is([data-theme="dark"], [data-theme="blue"]) body .type-btn.active {
  background: #303138 !important; color: #fff !important; border-color: #bfc0c7 !important;
}
html:root:is([data-theme="dark"], [data-theme="blue"]) body :is(.brand-logo,.brand-mini img,.brandbox img) { filter: grayscale(1) invert(1); mix-blend-mode: screen; }
}
