/* Shared accessible dark palette for cabinets, forms and standalone settings. */
html[data-theme="dark"]{color-scheme:dark;--bg:#121820;--panel:#1b242f;--card:#1b242f;--text:#eef2f7;--muted:#b7c4d3;--border:#465467;--gold:#e2ba60}
html[data-theme="dark"] body{background:#121820!important;color:#eef2f7!important}
html[data-theme="dark"] body :is(.shell,.main,.workspace,.content){background:#151d27!important;color:#eef2f7!important}
html[data-theme="dark"] body :is(.sidebar,.header,.caption,.tools){background:#151e29!important;color:#eef2f7!important;border-color:#465467!important}
html[data-theme="dark"] body :is(section,article,.card,.owner-panel,.lead-panel,.modal-card,.sales-modal-panel,.g-modal-panel,.kp-shell,.kp-client,.kp-results,.kp-footer,.g-db-modal,.g-db-settings-panel,.g-form,.g-toolbar,.g-filter,.g-client-placement-card,.g-client-stage,.g-client-helper,.owner-section,.g-public-general-card,.g-smart-empty,.g-adv-section,.g-client-warehouse-card){background:#1b242f!important;background-image:none!important;color:#eef2f7!important;border-color:#465467!important;box-shadow:0 4px 16px #0002!important}
html[data-theme="dark"] body :is(h1,h2,h3,h4,h5,label,legend,td,th,p,small,b,strong,span,.g-muted,.g-help,.g-empty,.detail-grid div){color:inherit}
html[data-theme="dark"] body :is(h1,h2,h3,h4,h5,label,legend,.g-section-title){color:#f4f6fa!important}
html[data-theme="dark"] body :is(p,small,.g-muted,.g-help,.g-empty,.g-eyebrow){color:#bfccdb!important}
html[data-theme="dark"] body :is(input:not([type="checkbox"]):not([type="radio"]),select,textarea){background:#101720!important;color:#f2f5fa!important;border:1px solid #63758b!important;box-shadow:none!important}
html[data-theme="dark"] body :is(input,textarea)::placeholder{color:#a7b5c7!important;opacity:1}
html[data-theme="dark"] body :is(input,select,textarea,button,a):focus-visible{outline:3px solid #f4ca6d!important;outline-offset:3px}
html[data-theme="dark"] body :is(select option,optgroup){background:#101720!important;color:#f2f5fa!important}
html[data-theme="dark"] body :is(.filters label,.g-top-filter,.g-filter-item,.g-filter-control,.g-client-route-bar,.kp-controls label,.g-warehouse-filter){background:#1b242f!important;color:#e8eef6!important;border-color:#63758b!important}
html[data-theme="dark"] body :is(table,.g-table,.kp-draft-table,.kp-catalog-table){background:#1b242f!important;color:#edf2f7!important}
html[data-theme="dark"] body :is(table,.g-table) :is(th,td){background:#1b242f!important;color:#edf2f7!important;border-color:#465467!important}
html[data-theme="dark"] body :is(table,.g-table) th{background:#283748!important;color:#fff0c8!important}
html[data-theme="dark"] body :is(table,.g-table) tr:nth-child(even) td{background:#202d3b!important}
html[data-theme="dark"] body :is(table,.g-table) tr:hover td{background:#2a3d51!important}
html[data-theme="dark"] body :is(table,.g-table) tr[style*="fff0d9"] td{background:#48301c!important;color:#ffe5b7!important}
html[data-theme="dark"] body :is(table,.g-table) tr[style*="ffe1ae"] td{background:#5b401b!important;color:#ffecc4!important}
html[data-theme="dark"] body :is(.notice,.g-notice,.kp-rate-strip,.kp-import-result,.g-smart-result){background:#263448!important;color:#e2eaf4!important;border-color:#71849a!important}
html[data-theme="dark"] body :is(.g-error,.error,[role="alert"]){color:#ffb7ad!important}
html[data-theme="dark"] body :is(.g-success,.success){color:#a4ebc5!important}
html[data-theme="dark"] body :is(a,.owner-link){color:#f4ce79!important}
html[data-theme="dark"] body button{background:#253345!important;color:#e9f0f9!important;border-color:#738197!important}
html[data-theme="dark"] body :is(.gold-action,.primary,.primary-action,.gambit-ai-launch,.gold,.nav button.active){background:linear-gradient(180deg,#edc86d,#c89937)!important;color:#21190b!important;border-color:#d3aa4e!important}
html[data-theme="dark"] body :is(.gold-action,.primary,.primary-action,.gambit-ai-launch,.gold,.nav button.active) :is(span,b,strong,small){color:#21190b!important}
html[data-theme="dark"] body :is(.outline-action,.g-mini-action,.kp-page-btn,.g-filter-btn){background:#253345!important;color:#f3d28c!important;border-color:#738197!important}
html[data-theme="dark"] body :is(.danger,.g-mini-action.danger){background:#49292a!important;color:#ffc7bf!important}
html[data-theme="dark"] body :is(input[type="checkbox"],input[type="radio"]){accent-color:#e4bd66}
html[data-theme="dark"] body :is(.modal,.sales-modal){background-color:#0009!important}
html[data-theme="dark"] body :is(.g-inline-switch,.g-preferences,.detail-grid>div,.g-client-account-facts article,.g-client-address-row){background:#202d3b!important;color:#e9eff7!important;border-color:#52657b!important}
@media print{html[data-theme="dark"] body{background:#fff!important;color:#111!important}html[data-theme="dark"] body :is(table,td,th,section,article){background:#fff!important;color:#111!important}}
html[data-theme="dark"] body :is(.g-top-select,.g-top-fixed,.g-wh-readonly-row,.g-warehouse-address-card,.g-client-account-facts article.g-warehouse-address-card,.g-client-account-facts article.g-warehouse-address-card .g-wh-copy){background:#202d3b!important;background-image:none!important;color:#ecf2f9!important;border-color:#607187!important}
html[data-theme="dark"] body :is(.g-top-select,.g-top-fixed,.g-wh-readonly-row,.g-client-account-facts article.g-warehouse-address-card) :is(span,b,strong,small){color:#dfe9f5!important}
html[data-theme="dark"] body .g-multi-price-cell>span{background:#273344!important;color:#fff1c9!important;border-color:#718095!important}
html[data-theme="dark"] body :is(.g-status,.kp-stock,.g-id-chip,.g-published-badge){background:#253d33!important;color:#b7f1cf!important;border-color:#6da18b!important}
.g-cq-counters{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin:18px 0}.g-cq-counters button{padding:18px;border:1px solid #c6ac6c;border-radius:14px;background:#fff7df;font-size:16px}.g-cq-counters b{display:block;font-size:26px;margin-top:8px}.g-cq-counters .g-cq-missing{background:#ffe8e5;color:#942d24;border:2px solid #c05246}.g-cq-missing-row td{background:#fff0ed!important;color:#8b3027!important}html[data-theme="dark"] body .g-cq-counters .g-cq-missing,html[data-theme="dark"] body .g-cq-missing-row td{background:#49292a!important;color:#ffc7bf!important;border-color:#c47a71!important}@media(max-width:650px){.g-cq-counters{grid-template-columns:1fr}.g-toolbar{flex-wrap:wrap}}
@media(max-width:700px){body .tools{flex-wrap:wrap!important}body .g-top-select{min-width:180px!important;max-width:100%!important;width:auto!important;flex:1 1 180px!important}body .g-top-select select{width:100%!important;max-width:100%!important}}

/* V313: loader contrast and selected navigation have explicit independent colors. */
html body .gambit-loading-screen{background:#f7f3e9!important;color:#302719!important}
html body .gambit-loading-card{background:#fffdf8!important;color:#302719!important;border-color:#ceb16b!important}
html body .gambit-loading-card b{color:#302719!important}
html body .gambit-loading-card span{color:#625642!important}
html[data-theme="dark"] body .gambit-loading-screen{background:#151d27!important;color:#eef2f7!important}
html[data-theme="dark"] body .gambit-loading-card{background:#202d3b!important;border-color:#b49a58!important;color:#eef2f7!important}
html[data-theme="dark"] body .gambit-loading-card b{color:#fff3d0!important}
html[data-theme="dark"] body .gambit-loading-card span{color:#d0dbe8!important}
html[data-theme="dark"] body .sidebar .nav button.active,html[data-theme="dark"] body .sidebar .nav button[aria-current="page"]{background:#efc665!important;background-image:none!important;color:#241b09!important;border:2px solid #ffe4a3!important;box-shadow:inset 5px 0 0 #fff3cf!important;font-weight:900!important}
html[data-theme="dark"] body .sidebar .nav button.active :is(span,b,strong,small,em),html[data-theme="dark"] body .sidebar .nav button[aria-current="page"] :is(span,b,strong,small,em){color:#241b09!important}
html[data-theme="dark"] body .sidebar .nav button:not(.active){color:#e4edf8!important}
html[data-theme="dark"] body .sidebar .nav button:not(.active) span{color:#e4edf8!important}
.gai-replacement-errors{border:2px solid #bd5248;padding:14px;border-radius:12px;margin:12px 0;background:#fff0ec;color:#842c26}.gai-replacement-errors button{font-weight:800}
html[data-theme="dark"] body .gai-replacement-errors{background:#48262b!important;color:#ffd4ce!important}

/* V314 shared ROP/sales order table geometry: same columns in head and body. */
html body .g-orders-table{table-layout:fixed!important;min-width:1200px!important;width:100%!important}
html body .g-orders-table :is(th,td){box-sizing:border-box!important;vertical-align:middle!important;word-break:normal!important;overflow-wrap:normal!important}
html body .g-orders-table :is(th.pick,td.pick){width:44px!important;min-width:44px!important;max-width:44px!important;text-align:center!important;padding:8px!important}
html body .g-orders-table :is(.order-id-cell,.g-order-status-cell){width:auto!important;min-width:0!important}
html body .g-orders-table :is(.g-order-status,.wh-route-chip){max-width:100%!important;box-sizing:border-box!important;white-space:normal!important;word-break:normal!important;overflow-wrap:normal!important;line-height:1.3!important}
html body .g-orders-table .g-order-attention-text{display:block!important;white-space:normal!important;line-height:1.3!important}
html body :is(main,.main,.workspace,.g-table-wrap){min-width:0!important}
html body .g-table-wrap{max-width:100%!important;overflow-x:auto!important}
html body .tools{display:flex!important;flex-wrap:wrap!important;gap:8px!important;min-width:0!important}
html body .tools :is(button,a){height:auto!important;min-height:38px!important;white-space:normal!important;line-height:1.25!important}

/* V354: neutral dashed loading indicator, global loading overlays */
.gambit-loading-card::before{content:"";display:block;width:30px;height:30px;border:3px dashed #b8913b;border-radius:50%;margin:0 auto 12px;animation:gambit-v354-spin .9s linear infinite}
@keyframes gambit-v354-spin{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.gambit-loading-card::before{animation:none}}
