/* Colour themes and row density (Settings → General → Display). Chosen per person, saved on their account.
   html[data-theme] picks the menu colour and the accent used for main buttons, highlights and table headings;
   "unified" (the default) keeps the original look. html[data-density=compact] tightens table rows. */
html[data-theme=ocean]{--th-side:#0f2747;--th-side-hi:#7fb8ff;--th-accent:#1f63c4;--th-accent-dark:#174f9e;--th-soft:#e8f0fb;--th-head:#e6eef9;--th-head-ink:#4a6587;--brand-blue:#2f7be0}
html[data-theme=forest]{--th-side:#14352a;--th-side-hi:#9fe0a8;--th-accent:#2b7a4b;--th-accent-dark:#21613b;--th-soft:#e9f5ed;--th-head:#e5f2e9;--th-head-ink:#4c6d58;--brand-blue:#36a565}
html[data-theme=charcoal]{--th-side:#24282c;--th-side-hi:#f7b03a;--th-accent:#3d4f63;--th-accent-dark:#2e3c4b;--th-soft:#eef1f4;--th-head:#eceff2;--th-head-ink:#5a6570;--brand-blue:#5b7fa6}
html[data-theme=plum]{--th-side:#2e1d3f;--th-side-hi:#e0b5ff;--th-accent:#6f42a8;--th-accent-dark:#58338a;--th-soft:#f3edf9;--th-head:#efe8f7;--th-head-ink:#6a5a80;--brand-blue:#8a5cc7}
html[data-theme=sunset]{--th-side:#3b2218;--th-side-hi:#ffc27a;--th-accent:#c0582b;--th-accent-dark:#9e4520;--th-soft:#fbefe8;--th-head:#f8ebe3;--th-head-ink:#7d5e4f;--brand-blue:#e07a3f}
html[data-theme=light]{--th-side:#ffffff;--th-side-hi:#087e9c;--th-accent:#087e9c;--th-accent-dark:#086c85;--th-soft:#eaf6f9;--th-head:#eaf4f7;--th-head-ink:#63808b}

html[data-theme]:not([data-theme=unified]) .workspace .sidebar{background:var(--th-side)}
html[data-theme]:not([data-theme=unified]) .nav-item.selected{color:var(--th-side-hi);box-shadow:inset 2px 0 var(--th-side-hi)}
html[data-theme]:not([data-theme=unified]) .nav-toggle[aria-pressed=true]{color:var(--th-side-hi)}
html[data-theme]:not([data-theme=unified]) .crm-primary,html[data-theme]:not([data-theme=unified]) .ops-dialog .crm-primary{background:var(--th-accent);border-color:var(--th-accent)}
html[data-theme]:not([data-theme=unified]) .crm-primary:hover:enabled{background:var(--th-accent-dark)}
html[data-theme]:not([data-theme=unified]) .crm-table th{background:var(--th-head);color:var(--th-head-ink)}
html[data-theme]:not([data-theme=unified]) .rp-bar-fill{fill:var(--th-accent)}
html[data-theme]:not([data-theme=unified]) .rp-pick.on,html[data-theme]:not([data-theme=unified]) .order-quick[aria-pressed=true]{background:var(--th-soft)}

/* Light menu: white sidebar with dark icons and text. */
html[data-theme=light] .workspace .sidebar{border-right:1px solid var(--line);color:#3d6470}
html[data-theme=light] .nav-item{color:#3d6470}
html[data-theme=light] .nav-item:hover{background:#eef8fa;color:#10343e}
html[data-theme=light] .nav-item.selected{background:#e3f4f8}
html[data-theme=light] .nav-caption{color:#8aa3aa}
html[data-theme=light] .nav-toggle{color:#3d6470}
html[data-theme=light] .nav-toggle:hover{background:#eef8fa;color:#10343e}
html[data-theme=light] .sidebar-bottom{border-top-color:var(--line)}
html[data-theme=light] .sidebar-bottom strong{color:#10343e}
html[data-theme=light] .sidebar-bottom span{color:#6a8c94}
html[data-theme=light] .avatar{background:#e3f4f8;color:#087e9c}
html[data-theme=light] .sidebar:not(.nav-wide) .nav-caption{background:linear-gradient(var(--line),var(--line)) center/100% 1px no-repeat}

/* Compact rows: more lines on the screen. */
html[data-density=compact] .crm-table td{padding:4px 8px;font-size:12px}
html[data-density=compact] .crm-table th{padding:5px 8px}
html[data-density=compact] .crm-table td small{font-size:10.5px}
html[data-density=compact] .workspace-content{padding-top:8px}

/* Settings → Display */
.display-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:12px 18px;margin-top:8px}
.theme-swatches{display:flex;flex-wrap:wrap;gap:8px;margin-top:6px}
.theme-swatch{display:flex;flex-direction:column;align-items:center;gap:4px;border:2px solid transparent;border-radius:8px;padding:6px;background:#fff;cursor:pointer;font-size:11.5px;color:#3d6470;min-width:74px}
.theme-swatch[aria-pressed=true]{border-color:var(--th-accent,#087e9c);font-weight:600}
.theme-swatch i{display:flex;width:60px;height:34px;border-radius:5px;overflow:hidden;border:1px solid #d3e8ed}
.theme-swatch i b{width:30%;display:block}.theme-swatch i u{flex:1;display:flex;align-items:flex-end;justify-content:flex-end;padding:4px;background:#f5fbfb}
.theme-swatch i u s{display:block;width:22px;height:9px;border-radius:3px}
.display-saved{font-size:12px;color:#527982;margin-left:10px}
.sw-unified b{background:#10343e}.sw-unified s{background:#087e9c}
.sw-ocean b{background:#0f2747}.sw-ocean s{background:#1f63c4}
.sw-forest b{background:#14352a}.sw-forest s{background:#2b7a4b}
.sw-charcoal b{background:#24282c}.sw-charcoal s{background:#3d4f63}
.sw-plum b{background:#2e1d3f}.sw-plum s{background:#6f42a8}
.sw-sunset b{background:#3b2218}.sw-sunset s{background:#c0582b}
.sw-light b{background:#fff;border-right:1px solid #d3e8ed}.sw-light s{background:#087e9c}

/* Shop and driver screens: the theme colours their top bars and main buttons. */
html[data-theme]:not([data-theme=unified]){--teal:var(--th-accent)}
html[data-theme]:not([data-theme=unified]):not([data-theme=light]){--navy:var(--th-side)}
html[data-theme]:not([data-theme=unified]) .shop-top{box-shadow:inset 0 -3px var(--th-accent)}
/* The Display panel (shop and driver screens). */
.display-panel{border:0;border-radius:16px;padding:0;width:min(440px,calc(100vw - 24px));box-shadow:0 20px 50px #0004;color:#173f4a;font:16px system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif}
.display-panel::backdrop{background:#10343e66}
.display-panel form{padding:16px 18px;display:grid;gap:8px}
.display-panel header{display:flex;align-items:center;justify-content:space-between}
.display-panel h2{margin:0;font-size:20px}.display-panel h3{margin:8px 0 0;font-size:13px;text-transform:uppercase;letter-spacing:.05em;color:#5c757c}
.display-hint{margin:0;font-size:13px;color:#5c757c}
.display-close{background:none;border:0;font-size:28px;line-height:1;color:#5c757c;cursor:pointer;padding:4px 8px}
.display-panel .theme-swatch{min-width:84px;min-height:64px;font-size:13px}
.display-sizes{display:flex;flex-wrap:wrap;gap:6px}
.display-sizes button,.display-foot button{min-height:44px;padding:0 14px;border-radius:10px;border:2px solid #d6e2e4;background:#fff;font:inherit;font-size:15px;color:#173f4a;cursor:pointer}
.display-sizes button[aria-pressed=true]{border-color:var(--th-accent,#1286a0);background:#eef8fa;font-weight:700}
.display-foot{display:flex;align-items:center;gap:10px;margin-top:8px}.display-foot span{flex:1;font-size:12px;color:#5c757c}
.display-done{background:var(--th-accent,#1286a0)!important;border-color:var(--th-accent,#1286a0)!important;color:#fff!important;font-weight:700}
