/* Workspace palette and dashboard structure adapted from the V1.3.1 home. */
/* Hide the two shell scrollbars without disabling wheel, touch or keyboard scrolling. */
html{scrollbar-width:none}
html::-webkit-scrollbar,body::-webkit-scrollbar,#navigation::-webkit-scrollbar{display:none;width:0;height:0}
body:not(.auth-screen) #navigation{scrollbar-width:none}
body:not(.auth-screen) #main>.page-title{margin:0 0 24px}
body:not(.auth-screen) #main>.page-title .subtitle{margin:6px 0 0}
.intake-method .intake-actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-top:20px}
.intake-method .intake-actions button{margin:0}
body:not(.auth-screen){--blue:#4988ff;--blue-pale:#e8f0ff;font-family:'Segoe UI','Microsoft YaHei',sans-serif}.workspace-logo{width:42px;height:40px;object-fit:contain}.brand{gap:10px}.brand>span{font:700 19px 'Segoe UI','Microsoft YaHei',sans-serif}.brand-sub{font-size:10px;margin-top:5px}.workspace-theme{padding:5px 11px;margin-left:auto}.auth-screen .workspace-theme{display:none}.ui-icon{width:20px;height:20px;flex-shrink:0;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}#navigation button{display:flex;align-items:center;gap:12px;padding:11px 14px}#navigation button.active{background:var(--blue);color:#fff;border-radius:8px}body:not(.auth-screen) main{max-width:1800px;padding:26px 28px}.home-head h1{font-size:23px;margin-bottom:5px}.home-head p{color:var(--muted);margin:0}.home-search{display:flex;gap:10px;margin:20px 0;max-width:660px}.home-search input{flex:1;min-width:0;padding:10px 14px;border:1px solid var(--line);border-radius:8px;background:var(--white);color:var(--ink)}.home-section{margin:24px 0}.home-section h2,.home-lower h2{font-size:16px;margin:0 0 16px}.home-stats,.home-quick{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}.home-card{background:var(--white);border:1px solid var(--line);color:var(--ink);border-radius:12px;box-shadow:0 3px 10px #00000008;text-align:left;font-weight:400}.home-card:hover{background:var(--blue-pale);border-color:var(--blue)}.home-stat{position:relative;padding:20px;min-height:148px}.home-stat>span:not(.stat-icon){color:var(--muted)}.home-stat>strong{display:block;font:700 32px Consolas,monospace;margin:10px 0 20px}.home-stat small{display:flex;justify-content:space-between;color:var(--muted);font-size:12px;gap:10px}.stat-icon{position:absolute;right:16px;top:16px;padding:8px;background:var(--blue-pale);color:var(--blue);border-radius:9px;display:flex}.home-section-head{display:flex;justify-content:space-between;align-items:baseline;gap:12px}.home-section-head>span{font-size:12px;color:var(--muted)}.quick-card{display:flex;align-items:center;gap:14px;padding:20px 15px;min-height:106px}.quick-card>span:nth-child(2){flex:1}.quick-card strong{display:block;font-size:15px}.quick-card small{display:block;color:var(--muted);font-size:12px;margin-top:5px}.quick-card>b{color:var(--muted)}.quick-icon{display:flex;padding:12px;background:var(--blue-pale);border-radius:10px;color:var(--blue)}.home-lower{display:grid;grid-template-columns:minmax(0,2.2fr) minmax(250px,1fr);gap:18px}.home-lower>.panel{min-width:0;padding:18px}.home-lower .panel-title h2{margin:0}.home-lower th,.home-lower td{padding:12px 10px;font-size:12px}.home-todo{width:100%;display:flex;gap:12px;align-items:center;text-align:left;background:transparent;color:var(--ink);padding:15px 0;border:0;border-bottom:1px solid var(--line);border-radius:0}.home-todo>span{flex:1}.home-todo:hover{color:var(--blue);background:transparent}.home-todos .empty{padding-top:70px}.delta-negative{color:#f16571}.delta-positive{color:#16a982}
body[data-auth-palette=dark]:not(.auth-screen){--ink:#e2e7ef;--muted:#929daa;--paper:#0e151b;--white:#171e24;--line:#28333e;--blue:#4988ff;--blue-pale:#1d2d46;--danger:#ef7882;background:var(--paper);color:var(--ink)}body[data-auth-palette=dark]:not(.auth-screen) aside,body[data-auth-palette=dark]:not(.auth-screen) header,body[data-auth-palette=dark]:not(.auth-screen) .panel{background:var(--white)}body[data-auth-palette=dark]:not(.auth-screen) .secondary,body[data-auth-palette=dark]:not(.auth-screen) dialog{background:var(--white);color:var(--ink)}body[data-auth-palette=dark]:not(.auth-screen) th{background:#202932}body[data-auth-palette=dark]:not(.auth-screen) input,body[data-auth-palette=dark]:not(.auth-screen) textarea,body[data-auth-palette=dark]:not(.auth-screen) select{background:#202932;color:var(--ink);border-color:var(--line)}body[data-auth-palette=dark]:not(.auth-screen) .notice{background:#1b2b3a;color:#b1c8dd}body[data-auth-palette=dark] .workspace-logo{filter:brightness(0) invert(1)}
@media(max-width:1200px){.home-stats,.home-quick{grid-template-columns:repeat(2,minmax(0,1fr))}.home-lower{grid-template-columns:1fr}}@media(max-width:720px){body:not(.auth-screen) main{padding:22px 16px}.home-head h1{font-size:21px}.home-stat{padding:16px;min-height:140px}.home-stat>span:not(.stat-icon){font-size:12px}.stat-icon{padding:5px;right:10px;top:12px}.stat-icon .ui-icon{width:16px;height:16px}.home-stats,.home-quick{gap:10px}.quick-card{padding:14px 10px;gap:8px}.quick-icon{padding:8px}.quick-card small{font-size:11px}.home-section-head>span{display:none}.home-lower>.panel{padding:15px}.workspace-theme{padding:3px 8px}.home-search{margin-top:18px}}@media(max-width:380px){.home-quick{grid-template-columns:1fr}}

/* The body must paint the viewport even when the inventory has only one row. */
html,body{min-height:100%}body{min-height:100dvh}.shell{min-height:100dvh}
body:not(.auth-screen) .toolbar input{appearance:none;border:1px solid var(--line);border-radius:8px;padding:10px 12px;min-height:42px;background:var(--white);color:var(--ink)}
body[data-auth-palette=dark]:not(.auth-screen) .tag.rejected{background:#3a232c;border-color:#643640;color:#ff9ca5}

body:not(.auth-screen) .page-title{margin-bottom:24px}body:not(.auth-screen) .page-title h1{font-size:24px;margin:0}body:not(.auth-screen) .page-title .eyebrow{display:none}body:not(.auth-screen) .page-title .subtitle:empty{display:none}
.category-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:18px;margin-top:18px}.category-row{display:flex;align-items:center;gap:8px;border-top:1px solid var(--line);padding:12px 0}.category-row>span{flex:1}.preserve-lines{white-space:pre-wrap;line-height:1.9}.detail-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:20px 0}.detail-stats>div{border:1px solid var(--line);padding:18px;border-radius:10px}.detail-stats strong{display:block;font-size:24px}.detail-stats span{color:var(--muted);font-size:13px}.detail-ledger{max-height:280px;overflow:auto}.part-link{font-weight:700;text-align:left}.intake-method{border:1px solid var(--line);border-radius:10px;padding:24px;min-height:180px}.bulk-parts{max-height:240px;overflow:auto;border:1px solid var(--line);padding:12px;border-radius:8px}.bulk-parts label{margin:8px 0}.record details{margin-top:14px}#dialog:has(.detail-stats){width:min(1000px,calc(100% - 32px));max-width:1000px}@media(max-width:600px){.detail-stats{grid-template-columns:1fr}.detail-stats>div{padding:12px}.category-grid{grid-template-columns:1fr}}

/* Match legacy shell: stationary top bar and brand, independently scrollable navigation. */
body:not(.auth-screen)>.shell>header{position:sticky;top:0;z-index:30;min-height:64px;height:64px;padding:10px 22px;gap:12px;background:var(--white)}
body:not(.auth-screen) #sidebar{height:100dvh;overflow:hidden;padding:0;z-index:40}.brand{height:64px;min-height:64px;padding:12px 20px;border-bottom:1px solid var(--line);font-family:'Segoe UI','Microsoft YaHei',sans-serif;font-size:18px}.workspace-logo{width:36px!important;height:36px!important}.brand-sub{font-size:11px;letter-spacing:1px}.workspace-label{flex:none;padding:12px 20px!important;margin:0!important;font-size:12px!important}#navigation{display:flex;flex-direction:column;gap:5px;min-height:0;flex:1;overflow-y:auto;overscroll-behavior:contain;padding:8px 10px;scrollbar-width:thin}#navigation button{flex:none;padding:10px 12px;min-height:42px;font-size:14px}.sidebar-foot{flex:none;margin:0;padding:12px 16px;border-top:1px solid var(--line);font-size:11px}.sidebar-foot p{margin:3px 0 6px}.sidebar-foot .text-button{font-size:11px;padding:0;margin-right:12px}.global-search{display:flex;flex:1;min-width:160px;max-width:640px;position:relative}.global-search input{width:100%;min-width:0;border:1px solid var(--line);border-radius:8px;background:var(--paper);color:var(--ink);padding:10px 40px 10px 12px;font:inherit;font-size:13px}.global-search button{position:absolute;right:4px;top:3px;background:transparent;color:var(--muted);border:0;padding:4px 9px;font-size:22px}.header-filing{font-size:12px;color:var(--muted);white-space:nowrap}header .secondary{padding:7px 10px;font-size:12px;white-space:nowrap}body.warehouse-ready #breadcrumb{display:none}#account{font-size:12px;gap:8px;white-space:nowrap}body:not(.auth-screen) main{padding:26px 24px}.header-feedback,.header-notices{font-size:12px!important}.nav-group-label{font-size:11px;color:var(--muted);padding:18px 12px 4px}
[hidden]{display:none!important}@media(max-width:1250px){.header-filing{display:none}.header-feedback{display:none!important}}@media(max-width:900px){.header-notices{display:none!important}header .identity-badge{display:none}}@media(max-width:720px){body:not(.auth-screen)>.shell>header{padding:8px 12px;gap:8px;min-height:60px;height:auto}.header-help{display:none!important}#account>span:not(.identity-badge){max-width:72px;overflow:hidden;text-overflow:ellipsis}#account .text-button{font-size:12px}.global-search{min-width:60px}.global-search input{padding-right:28px;font-size:12px}body:not(.auth-screen) #sidebar{z-index:50}.sidebar-foot .header-filing{display:block}body:not(.auth-screen) main{padding:20px 14px}.workspace-theme{padding:4px!important}}

/* Role groups and shared page tabs reduce the sidebar without removing workflows. */
#navigation .nav-group-label{padding:16px 12px 4px;font-size:11px;letter-spacing:1px;font-weight:600;flex:none}
#navigation .nav-group-label:first-child{padding-top:6px}
.workspace-tabs{display:flex;gap:8px;flex-wrap:wrap;border-bottom:1px solid var(--line);padding-bottom:14px;margin-bottom:24px}
.workspace-tabs button{padding:8px 16px;font-size:13px}
.invite-code-box{display:flex;flex-direction:column;align-items:flex-start;gap:8px;margin:20px 0;padding:20px 24px;background:var(--blue-pale);border:1px solid var(--line);border-radius:10px;width:fit-content;max-width:100%}
.invite-code-box>span{font-size:12px;color:var(--muted)}
.invite-code{font-size:32px;letter-spacing:4px;color:var(--blue);line-height:1.4;overflow-wrap:anywhere;user-select:all}
body:not(.auth-screen) #main[data-view="workspace-settings"]{max-width:1040px;margin-inline:auto}
#workspace-settings-form{max-width:none;width:100%}
#workspace-settings-form textarea{font-weight:400;line-height:1.7;resize:vertical}
#workspace-settings-form .form-actions{justify-content:flex-end}
.shortage-row{display:flex;align-items:center;justify-content:space-between;gap:24px;padding:18px 0;border-bottom:1px solid var(--line)}
.shortage-row:last-child{border-bottom:0;padding-bottom:0}
.shortage-row p{margin:6px 0 0}.shortage-row button{flex:none}
.workspace-empty{text-align:center;padding:36px 20px;color:var(--muted)}
.workspace-empty strong{display:block;font-size:16px;color:var(--ink);margin-bottom:8px}.workspace-empty p{margin:0}
@media(max-width:600px){.invite-code{font-size:26px}.shortage-row{align-items:flex-start;flex-direction:column;gap:12px}.workspace-tabs{gap:6px}.workspace-tabs button{padding:8px 10px}}

.material-spec-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:12px 0 4px;padding-top:12px;border-top:1px solid var(--line)}
#inventory-form .material-form-switch{width:auto;flex:none;min-height:34px;padding:6px 12px;font-size:13px;font-weight:500;white-space:nowrap}
.spec-issues{margin:20px 0;padding:18px;border:1px solid var(--line);border-left:3px solid var(--danger);border-radius:10px;background:var(--white)}
.spec-issues h3{margin:0}.spec-issues dl{margin:16px 0}.spec-issues dl>div{display:grid;grid-template-columns:130px minmax(0,1fr);gap:12px;padding:10px 0;border-top:1px solid var(--line)}
.spec-issues dt{font-weight:600}.spec-issues dd{margin:0;overflow-wrap:anywhere}.spec-issues dd span{display:block;margin-top:4px}.spec-issues p{font-size:13px;margin-bottom:0}
@media(max-width:480px){.spec-issues{padding:12px}.spec-issues dl>div{grid-template-columns:1fr;gap:4px}}
