/* Customer and item workbench only; existing console theme and routes retained. */
/* Reading width stays bounded on ultrawide displays. */
body.records-workbench { --rw-surface:#111820; --rw-text:#eeeae1; --rw-muted:#a5adb6; --rw-line:#2a323b; --rw-accent:#e0bd70; }
body.records-workbench[data-theme="light"], body.records-workbench.theme-light, html[data-theme="light"] body.records-workbench { --rw-surface:#fff; --rw-text:#242b34; --rw-muted:#626c78; --rw-line:#dde1e6; --rw-accent:#846017; }
body.records-workbench #app-shell:not(.hidden) :is(#customers-view,#products-view) {padding:28px 28px 44px!important;gap:0!important;min-width:0;color:var(--rw-text);}
body.records-workbench #app-shell:not(.hidden) :is(#customers-view,#products-view) [hidden] {display:none!important;}
body.records-workbench #app-shell:not(.hidden) :is(#customers-view,#products-view) button {cursor:pointer;}
body.records-workbench #app-shell:not(.hidden) :is(#customers-view,#products-view) button:disabled {cursor:default;opacity:.45;}
body.records-workbench #app-shell:not(.hidden) :is(#customers-view,#products-view) :is(button,input,select,textarea,a,summary):focus-visible {outline:2px solid var(--rw-accent)!important;outline-offset:3px;}
body.records-workbench #app-shell:not(.hidden) :is(#customers-view,#products-view) .rw-page-head {display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:28px;}
.rw-eyebrow {font-size:11px;letter-spacing:.13em;color:var(--rw-accent);margin:0 0 8px;}
body.records-workbench #app-shell:not(.hidden) :is(#customers-view,#products-view) .rw-page-head h1 {display:block!important;font-size:27px!important;font-weight:650;line-height:1.35;margin:0;color:var(--rw-text);}
.rw-description {font-size:14px;line-height:1.6;color:var(--rw-muted);margin:8px 0 0;}
.rw-head-actions {flex:none;}
body.records-workbench #app-shell:not(.hidden) :is(#customers-view,#products-view) .rw-tools {display:flex;align-items:stretch;gap:10px;position:relative;z-index:8;padding-bottom:14px;border-bottom:1px solid var(--rw-line);}
.rw-search {display:flex;align-items:center;flex:1;min-width:0;gap:8px;border:1px solid var(--rw-line);border-radius:8px;padding:0 14px;background:var(--rw-surface);}
.rw-search>span {font-size:23px;color:var(--rw-muted);}
body.records-workbench #app-shell:not(.hidden) :is(#customers-view,#products-view) .rw-search input {border:0!important;box-shadow:none!important;background:transparent!important;padding:12px 0!important;width:100%;min-width:0!important;color:var(--rw-text);font-size:14px!important;}
body.records-workbench #app-shell:not(.hidden) :is(#customers-view,#products-view) .rw-tools>select {width:132px;flex:none;min-width:0;padding:0 10px;border:1px solid var(--rw-line);background:var(--rw-surface);color:var(--rw-text);border-radius:8px;font-size:14px;}
.rw-tools details {position:relative;flex:none;}
.rw-tools summary {list-style:none;display:flex;align-items:center;justify-content:center;gap:6px;min-height:46px;padding:0 16px;border:1px solid var(--rw-line);border-radius:8px;cursor:pointer;font-size:14px;background:var(--rw-surface);}
.rw-tools summary::-webkit-details-marker {display:none;}
.rw-tools details[open]>summary {border-color:var(--rw-accent);color:var(--rw-accent);}
.rw-filter-count:empty {display:none;}
.rw-filter-count {padding:0 5px;border-radius:4px;background:var(--rw-accent);color:#17191e;}
.rw-filter-panel {position:absolute;top:calc(100% + 8px);right:0;display:grid;gap:14px;width:300px;max-width:calc(100vw - 36px);padding:20px;background:var(--rw-surface);border:1px solid var(--rw-line);border-radius:10px;box-shadow:0 16px 50px #0005;}
body.records-workbench #app-shell:not(.hidden) :is(#customers-view,#products-view) .rw-filter-panel label {display:grid!important;gap:6px;min-width:0!important;}
.rw-filter-panel label>span {font-size:12px;color:var(--rw-muted);}
body.records-workbench #app-shell:not(.hidden) :is(#customers-view,#products-view) .rw-filter-panel :is(input,select) {width:100%!important;min-width:0!important;min-height:42px;padding:8px;font-size:14px!important;background:var(--rw-surface);color:var(--rw-text);border:1px solid var(--rw-line);border-radius:6px;}
.rw-context {font-size:12px;line-height:1.6;color:var(--rw-muted);padding:10px 0 0;}
body.records-workbench #app-shell:not(.hidden) #customers-view .rw-filter-panel > label[hidden] {display:none!important;}
body.records-workbench #customers-view .rw-status-categories {display:flex;flex-wrap:wrap;gap:6px;margin:0 0 18px;}
body.records-workbench #app-shell:not(.hidden) #customers-view .rw-status-categories button {display:inline-flex;align-items:center;gap:9px;min-height:44px;padding:9px 14px;border:1px solid transparent!important;border-radius:6px;background:transparent!important;color:var(--rw-muted)!important;font-size:13px;cursor:pointer;}
body.records-workbench #customers-view .rw-status-categories button strong {font-size:12px;font-weight:500;font-variant-numeric:tabular-nums;}
body.records-workbench #customers-view .rw-status-categories button:hover {background:var(--rw-surface);color:var(--rw-text);}
body.records-workbench #app-shell:not(.hidden) #customers-view .rw-status-categories button[aria-pressed="true"] {color:var(--rw-accent)!important;border-color:var(--rw-accent)!important;background:var(--rw-surface)!important;font-weight:600;}
.rw-scope {display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:8px;padding:10px 12px;background:#b18b3214;border-left:2px solid var(--rw-accent);}
.rw-scope strong {flex:1;font-size:14px;overflow-wrap:anywhere;}
.rw-notice {font-size:13px;color:#e9a599;margin:8px 0;}
.rw-notice:empty {display:none;}
body.records-workbench #app-shell:not(.hidden) #customers-view .rw-summary {display:flex!important;gap:28px!important;border:0!important;border-bottom:1px solid var(--rw-line)!important;border-radius:0!important;padding:12px 0!important;margin:6px 0 18px!important;background:none!important;box-shadow:none!important;}
body.records-workbench #app-shell:not(.hidden) #customers-view .rw-summary .customer-summary-cell {display:flex!important;align-items:baseline;gap:8px;padding:0!important;background:none!important;border:0!important;min-height:0!important;}
.rw-summary .customer-summary-cell::before,.rw-summary .customer-summary-cell::after {display:none!important;}
body.records-workbench #app-shell:not(.hidden) #customers-view .rw-summary strong {font-size:19px!important;color:var(--rw-text)!important;}
body.records-workbench #app-shell:not(.hidden) #customers-view .rw-summary span {font-size:12px!important;color:var(--rw-muted)!important;}
body.records-workbench #app-shell:not(.hidden) :is(#customers-view,#products-view) :is(.customer-layout,.product-layout) {display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:24px!important;align-items:start!important;margin-top:18px!important;}
body.records-workbench #app-shell:not(.hidden) :is(#customers-view,#products-view).rw-detail-open :is(.customer-layout,.product-layout) {grid-template-columns:minmax(0,1fr) minmax(360px,40%)!important;}
body.records-workbench #app-shell:not(.hidden) :is(#customers-view,#products-view) :is(.customer-list-card,.product-category-card) {padding:0!important;border:0!important;min-width:0!important;background:none!important;box-shadow:none!important;}
body.records-workbench #app-shell:not(.hidden) :is(#customers-view,#products-view) .customer-list-head {margin:0 0 10px!important;padding:0!important;}
body.records-workbench #app-shell:not(.hidden) :is(#customers-view,#products-view) .customer-list-head h3 {font-size:15px!important;margin:0!important;}
body.records-workbench #app-shell:not(.hidden) :is(#customers-view,#products-view) :is(.customer-record-list,.product-category-list) {display:block!important;overflow:visible!important;max-height:none!important;min-height:0!important;padding:0!important;}
body.records-workbench #app-shell:not(.hidden) :is(#customers-view,#products-view) :is(.rw-customer-row,.rw-product-row) {display:grid;align-items:center;gap:16px;text-align:left;width:100%;min-height:78px;padding:16px 10px;border:0;border-bottom:1px solid var(--rw-line);border-radius:0;background:transparent;color:var(--rw-text);font:inherit;transition:background-color .12s;}
.rw-customer-row {grid-template-columns:36px minmax(90px,1fr) 60px 112px 12px;}
.rw-product-row {grid-template-columns:minmax(120px,1fr) 62px 62px 12px;}
body.records-workbench #app-shell:not(.hidden) :is(#customers-view,#products-view) :is(.rw-customer-row,.rw-product-row):hover {background:#adbbc909;}
body.records-workbench #app-shell:not(.hidden) :is(#customers-view,#products-view) .is-selected {background:#c6a35a14;border-left:2px solid var(--rw-accent);}
.rw-avatar {display:grid;place-items:center;width:36px;height:36px;background:#a5adb610;border:1px solid var(--rw-line);border-radius:50%;color:var(--rw-muted);font-size:14px;}
.rw-person,.rw-product-name {display:grid;gap:5px;min-width:0;}
.rw-person>strong,.rw-product-name>strong {font-size:15px;font-weight:600;line-height:1.5;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow-wrap:anywhere;}
.rw-person>span,.rw-product-name time {font-size:12px;color:var(--rw-muted);}
.rw-mobile-count {display:none;}
.rw-row-count {display:grid;gap:4px;text-align:right;font-variant-numeric:tabular-nums;}
.rw-row-count strong {font-size:16px;font-weight:600;}
.rw-row-count>span {font-size:12px;color:var(--rw-muted);}
.rw-row-state {display:grid;justify-items:end;gap:6px;}
.rw-row-state time {font-size:12px;color:var(--rw-muted);font-variant-numeric:tabular-nums;}
.rw-status {font-size:12px;line-height:1.4;padding:3px 7px;border-radius:4px;background:#a5adb610;color:var(--rw-muted);}
.rw-status.follow_up {color:#e2bd70;background:#ce9f2820;}.rw-status.done {color:#8dbfa9;background:#8dbfa910;}
.rw-chevron {font-size:20px;color:var(--rw-muted);}
.rw-pagination {display:flex;align-items:center;justify-content:space-between;gap:12px;padding:18px 0;font-size:13px;color:var(--rw-muted);font-variant-numeric:tabular-nums;}
.rw-pagination>div {display:flex;align-items:center;gap:10px;}
body.records-workbench #app-shell:not(.hidden) :is(#customers-view,#products-view) [data-rw]:not(.rw-customer-row):not(.rw-product-row):not(.rw-buyer):not([role="tab"]) {padding:9px 12px;border:1px solid var(--rw-line);border-radius:6px;background:transparent;color:var(--rw-text);font-size:13px;line-height:1.4;}
body.records-workbench #app-shell:not(.hidden) :is(#customers-view,#products-view) .rw-primary {background:var(--rw-accent)!important;color:#17191e!important;border-color:var(--rw-accent)!important;font-weight:600;}
body.records-workbench #app-shell:not(.hidden) :is(#customers-view,#products-view) :is(.customer-detail-card,.product-detail-card) {display:none!important;}
body.records-workbench #app-shell:not(.hidden) :is(#customers-view,#products-view).rw-detail-open :is(.customer-detail-card,.product-detail-card) {display:block!important;position:sticky!important;top:20px!important;max-height:calc(100dvh - 40px)!important;height:auto!important;overflow:auto!important;border:1px solid var(--rw-line)!important;border-radius:10px!important;padding:0!important;margin:0!important;background:var(--rw-surface)!important;box-shadow:none!important;min-width:0!important;}
.rw-detail-head {display:flex;align-items:flex-start;gap:12px;padding:22px;border-bottom:1px solid var(--rw-line);}
.rw-detail-head>div {flex:1;min-width:0;}
.rw-detail-head h2 {font-size:20px!important;line-height:1.45;margin:0!important;color:var(--rw-text);overflow-wrap:anywhere;}
.rw-detail-head p {font-size:12px;margin:6px 0 0;color:var(--rw-muted);overflow-wrap:anywhere;}
body.records-workbench #app-shell:not(.hidden) :is(#customers-view,#products-view) .rw-back {display:none;}
.rw-tabs {display:flex;gap:0;padding:0 20px;border-bottom:1px solid var(--rw-line);}
.rw-tabs button {min-height:48px;padding:12px 9px;border:0;border-bottom:2px solid transparent;background:none;color:var(--rw-muted);font-size:13px;white-space:nowrap;}
.rw-tabs button[aria-selected="true"] {color:var(--rw-accent);border-bottom-color:var(--rw-accent);}
.rw-detail-body {padding:22px;min-width:0;}
.rw-detail-body h3 {font-size:14px!important;margin:22px 0 12px!important;}
.rw-help {font-size:12px;line-height:1.7;color:var(--rw-muted);}
.rw-contact {display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:13px;color:var(--rw-muted);}
.rw-contact select {padding:8px;border:1px solid var(--rw-line);border-radius:6px;background:var(--rw-surface);color:var(--rw-text);max-width:150px;}
.rw-mini-stats {display:flex;gap:26px;border-bottom:1px solid var(--rw-line);padding:24px 0;}
.rw-mini-stats>span {display:grid;gap:7px;font-size:12px;color:var(--rw-muted);}
.rw-mini-stats b {font-size:22px;font-weight:550;color:var(--rw-text);font-variant-numeric:tabular-nums;}
.rw-recent article {padding:12px 0;border-bottom:1px solid var(--rw-line);}
.rw-recent time,.rw-timeline time {font-size:12px;color:var(--rw-muted);}
.rw-recent p {font-size:14px;line-height:1.7;overflow-wrap:anywhere;margin:5px 0;}
.rw-links {display:flex;flex-wrap:wrap;gap:16px;margin-top:24px;}
.rw-links a {font-size:13px;color:var(--rw-accent);}
.rw-buyer {display:flex;width:100%;align-items:center;justify-content:space-between;gap:15px;background:none;border:0;border-bottom:1px solid var(--rw-line);color:var(--rw-text);padding:16px 0;text-align:left;}
.rw-buyer>span:first-child {display:grid;gap:6px;min-width:0;}.rw-buyer strong {font-size:14px;overflow-wrap:anywhere;}.rw-buyer small,.rw-buyer>span:last-child {font-size:12px;color:var(--rw-muted);}
.rw-note-label {display:block;font-size:14px;margin-bottom:12px;}
body.records-workbench #app-shell:not(.hidden) :is(#rw-note,#rw-manual) {display:block;box-sizing:border-box;width:100%;min-height:180px;resize:vertical;padding:14px;border:1px solid var(--rw-line);border-radius:6px;background:transparent;color:var(--rw-text);font:inherit;font-size:15px;line-height:1.8;margin-bottom:16px;}
.rw-save-actions {display:flex;gap:10px;flex-wrap:wrap;}.rw-save-status {min-height:20px;font-size:13px;line-height:1.6;color:var(--rw-accent);}
.rw-timeline article {padding:16px 0;border-bottom:1px solid var(--rw-line);}.rw-timeline label {display:flex;align-items:flex-start;gap:10px;}.rw-timeline label span {display:grid;gap:7px;}.rw-timeline strong {font-size:14px;font-weight:500;overflow-wrap:anywhere;line-height:1.6;}.rw-timeline article>div {display:flex;justify-content:space-between;align-items:center;margin-top:12px;}.rw-job-state {font-size:12px;color:var(--rw-muted);}
.rw-record-actions {display:flex;align-items:center;gap:8px;}.rw-record-actions>span{margin-left:auto;}
.rw-empty {display:grid;gap:20px;place-items:center;text-align:center;min-height:210px;color:var(--rw-muted);font-size:14px;padding:20px;}
.rw-preview-banner {position:fixed;bottom:0;right:16px;z-index:999999;padding:5px 12px;background:#665126;color:#fff1cf;border-radius:6px 6px 0 0;font-size:11px;pointer-events:none;}
.rw-delivery-badge {font-size:11px;color:var(--rw-muted);white-space:nowrap;}
@media(max-width:1280px){.rw-customer-row {grid-template-columns:minmax(90px,1fr) 44px 105px 10px;gap:10px!important;}.rw-customer-row>.rw-avatar{display:none;}.rw-detail-head,.rw-detail-body{padding:18px;}.rw-tabs{padding:0 12px;}}
@media(max-width:980px){
 body.records-workbench #app-shell:not(.hidden) :is(#customers-view,#products-view) {padding:18px 18px 32px!important;}
 body.records-workbench #app-shell:not(.hidden) :is(#customers-view,#products-view) .rw-page-head {margin-bottom:20px;gap:10px;}
 .rw-eyebrow{display:none;}.rw-description{font-size:12px;margin-top:5px;}
 body.records-workbench #app-shell:not(.hidden) :is(#customers-view,#products-view) .rw-page-head h1{font-size:23px!important;}
 body.records-workbench #app-shell:not(.hidden) :is(#customers-view,#products-view) .rw-tools{gap:7px;flex-wrap:wrap;}
 .rw-search{flex:1 1 calc(100% - 95px);padding:0 10px;}
 body.records-workbench #app-shell:not(.hidden) :is(#customers-view,#products-view) .rw-tools>select{width:116px;min-height:36px;order:3;font-size:12px;}
 .rw-tools .rw-exports{order:4;margin-left:auto;}.rw-tools .rw-exports summary{min-height:36px;font-size:12px;padding:0 12px;}
 .rw-tools .rw-filters summary{min-height:46px;padding:0 13px;}
 .rw-filter-panel{position:absolute;right:0;max-width:calc(100vw - 36px);}
 body.records-workbench #app-shell:not(.hidden) #customers-view .rw-summary{gap:14px!important;flex-wrap:wrap;padding:9px 0!important;margin:0 0 10px!important;}
 body.records-workbench #app-shell:not(.hidden) #customers-view .rw-summary .customer-summary-cell{gap:5px;}
 body.records-workbench #app-shell:not(.hidden) #customers-view .rw-summary strong{font-size:15px!important;}
 body.records-workbench #app-shell:not(.hidden) :is(#customers-view,#products-view).rw-detail-open :is(.customer-layout,.product-layout){grid-template-columns:minmax(0,1fr)!important;}
 body.records-workbench.rw-mobile-detail{overflow:hidden!important;}
 body.records-workbench #app-shell:not(.hidden) :is(#customers-view,#products-view).rw-detail-open :is(.customer-detail-card,.product-detail-card){position:fixed!important;inset:0!important;width:100%!important;height:100dvh!important;max-height:none!important;border:0!important;border-radius:0!important;z-index:100000!important;overflow:hidden!important;}
 body.records-workbench #app-shell:not(.hidden) :is(#customers-view,#products-view) .rw-detail{display:flex!important;flex-direction:column!important;height:100%!important;padding:0!important;overflow:hidden!important;}
 .rw-detail-head{flex-wrap:wrap;flex:none;padding:16px 18px;gap:10px;}.rw-detail-head>div{flex-basis:100%;}.rw-detail-head h2{font-size:20px!important;}
 body.records-workbench #app-shell:not(.hidden) :is(#customers-view,#products-view) .rw-back{display:block;border:0!important;padding:4px 0!important;color:var(--rw-accent)!important;font-size:14px!important;min-height:36px;}
 body.records-workbench #app-shell:not(.hidden) :is(#customers-view,#products-view) .rw-close{display:none;}
 .rw-tabs{flex:none;justify-content:space-between;padding:0 12px;}.rw-tabs button{min-height:48px;font-size:13px;}
 .rw-detail-body{flex:1;overflow:auto;overscroll-behavior:contain;padding:18px 18px calc(24px + env(safe-area-inset-bottom));}
 .rw-customer-row{grid-template-columns:minmax(95px,1fr) 109px 10px;}.rw-customer-row>.rw-row-count{display:none;}.rw-mobile-count{display:inline;}
 .rw-product-row{grid-template-columns:minmax(95px,1fr) 43px 43px 10px;gap:10px!important;}.rw-product-name>strong{font-size:14px;}
 .rw-pagination{font-size:12px;}.rw-pagination>div{gap:6px;}
}
@media(prefers-reduced-motion:reduce){.rw-customer-row,.rw-product-row{transition:none!important;}}
body.records-workbench #app-shell:not(.hidden) #customers-view .rw-summary {min-height:0!important;}
body.records-workbench #app-shell:not(.hidden) :is(#customers-view,#products-view) .customer-list-head {min-height:32px!important;}
.rw-record-actions {flex-wrap:wrap;} .rw-item-summary {margin-bottom:20px;font-size:13px;} .rw-item-summary summary {padding:10px 0;cursor:pointer;color:var(--rw-accent);} .rw-item-summary>div {display:grid;gap:8px;padding:12px 0;border-bottom:1px solid var(--rw-line);} .rw-item-summary label {display:flex;gap:8px;line-height:1.6;} .rw-item-summary button {justify-self:end;} .rw-timeline [data-rw="delete"] {margin-left:5px;color:#dca19b!important;}
body.records-workbench #app-shell:not(.hidden) :is(#customers-view,#products-view) :is(.customer-list-card,.product-category-card) {max-width:none!important;width:100%!important;}
html[data-theme="light"] .rw-status.follow_up {color:#795710;background:#d3aa4020;} html[data-theme="light"] .rw-status.done {color:#346747;background:#4b875c14;} html[data-theme="light"] .rw-notice,html[data-theme="light"] .rw-timeline [data-rw="delete"] {color:#a33930!important;}

/* 2026-09-22: keep related customer information within a readable span. */
body.records-workbench #app-shell:not(.hidden) :is(#customers-view,#products-view) {
  box-sizing:border-box;width:100%;max-width:1440px;margin-inline:auto!important;
}
body.records-workbench #app-shell:not(.hidden) :is(#customers-view,#products-view) :is(.customer-list-card,.product-category-card) {
  container-type:inline-size;
}
.rw-latest-comment {display:grid;gap:5px;min-width:0;text-align:left;}
.rw-latest-comment small {color:var(--rw-muted);font-size:11px;}
.rw-latest-comment>span {color:var(--rw-text);font-size:13px;line-height:1.6;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere;}
@media(min-width:981px) {
  body.records-workbench #app-shell:not(.hidden) :is(#customers-view,#products-view).rw-detail-open :is(.customer-layout,.product-layout) {
    grid-template-columns:minmax(0,1fr) 420px!important;gap:20px!important;
  }
  body.records-workbench #app-shell:not(.hidden) #customers-view .rw-customer-row {
    grid-template-columns:36px minmax(120px,200px) minmax(120px,1fr) 52px 112px 12px;gap:14px!important;
  }
  .rw-customer-row>.rw-avatar {display:grid;}
  @container(max-width:680px) {
    body.records-workbench #app-shell:not(.hidden) #customers-view .rw-customer-row {
      grid-template-columns:minmax(90px,1fr) 44px 105px 10px;gap:10px!important;
    }
    .rw-customer-row>.rw-avatar,.rw-customer-row>.rw-latest-comment {display:none;}
  }
}
@media(max-width:980px) {.rw-latest-comment {display:none;}}
