.grid-toolbar{display:flex;align-items:center;gap:9px;flex-wrap:wrap;margin-bottom:12px;border:1px solid #dce6d4;background:#fff;border-radius:7px;padding:11px}.grid-toolbar select{padding:8px 10px;border:1px solid #dce5d3;color:#637b59;background:#fff;border-radius:5px;font-size:11px;max-width:180px}.grid-toolbar>span{font-size:11px;color:#7e8e70;margin-left:auto}.grid-toolbar small{width:100%;color:#98a28e;font-size:10px}.material-sheet td.grid-cell{position:relative;padding:0;background:#fff}.grid-control{display:block;width:100%;height:100%;min-height:42px;margin:0;padding:11px 9px;border:0;outline:0;background:transparent;resize:none;font-size:11px;color:#46613d;line-height:1.8;border-radius:0;font-family:inherit}.grid-control:focus{background:#f4f9ec;box-shadow:inset 0 0 0 2px #8cae70}.grid-textarea{height:130px}.grid-cell.dirty{background:#fff9df!important}.grid-cell.cell-active{box-shadow:inset 0 0 0 2px #73a351}.grid-cell.range-selected{background:#e6f2db!important;box-shadow:inset 0 0 0 1px #a0bf87}.fill-handle{position:absolute;right:0;bottom:0;width:15px;height:15px;border:0;background:#79a35b;color:white;font-size:11px;padding:0;line-height:13px;cursor:crosshair;opacity:0;z-index:1}.grid-cell:hover .fill-handle,.grid-cell.cell-active .fill-handle{opacity:1}.grid-field-diff{display:grid;grid-template-columns:95px 1fr 1fr;border-top:1px solid #e5ecdf}.grid-field-diff>*{padding:10px;white-space:pre-wrap;overflow-wrap:anywhere;font-size:11px;max-height:180px;overflow:auto}.grid-field-diff strong{background:#f5f8ef;font-weight:500;color:#81936b}.grid-field-diff div:last-child{background:#f2f9ea;color:#54723e}.grid-toolbar .btn{padding:8px 12px}#grid-dialog{width:min(900px,95vw)}#grid-stage-import{margin-top:14px}#grid-paste-text{white-space:pre;overflow:auto;font-family:Consolas,"Microsoft YaHei",monospace}.grid-control[type=date]{font-size:10px;padding:10px 3px}.material-sheet .grid-cell select{font-size:11px;padding-right:2px}.material-sheet .grid-cell input{min-width:0}@media(max-width:800px){.grid-toolbar>span{margin-left:0}.grid-field-diff{grid-template-columns:70px 1fr 1fr}}
/* All data/status columns scroll together; only the selection checkbox stays left. */
.material-sheet{width:3150px}
.material-sheet :is(th,td):nth-child(n+16){position:static;right:auto;box-shadow:none;z-index:auto}
.material-sheet th:nth-child(n+16){position:sticky;top:0;z-index:1}
.material-sheet th:nth-child(n+2){width:125px}
.material-sheet th:nth-child(2){width:45px}
.material-sheet th:nth-child(3){width:160px}
.material-sheet th:nth-child(8){width:80px}
.material-sheet th:nth-child(10){width:195px}
.material-sheet th:nth-child(11){width:300px}
.material-sheet th:nth-child(12){width:180px}
.material-sheet th:nth-child(13){width:210px}
.material-sheet th:nth-child(14){width:180px}
.material-sheet th:last-child{width:85px}
.cell-drop{min-height:130px;border:1px dashed #d9e3cf;border-radius:5px;padding:7px;display:flex;flex-direction:column;gap:6px}
.cell-drop.drag-over{border:2px solid #568443;background:#eef7e7}
.cell-drop small{font-size:10px;overflow-wrap:anywhere;color:#8b9c7d}
.cell-upload{display:block;position:relative;cursor:pointer;background:#f0f5ea;padding:5px 8px;border-radius:4px;color:#4b7139;font-size:11px;text-align:center}
.cell-upload input{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer}
.cell-drop video{width:145px;max-height:100px}
.sheet-images{grid-template-columns:repeat(3,40px)}
.sheet-images span{position:relative}
.sheet-images img{width:40px;height:40px}
.sheet-images span button{position:absolute;right:-3px;top:-5px;border-radius:50%;background:#fff;color:#a2604f;width:16px;height:16px;line-height:16px}
.quick-auto{font-size:10px;margin-top:7px}
.material-sheet td.grid-cell{position:relative}
.grid-cell:has(.quick-auto) .grid-control{height:auto}
/* Compact rows, a narrower copy column and an image-first preview strip. */
.material-sheet{width:3200px}
.material-sheet th:nth-child(2){width:65px}
.material-sheet th:nth-child(11){width:205px}
.material-sheet th:nth-child(12){width:340px}
.material-sheet td{height:155px;padding:7px 8px}
.grid-control{height:auto;min-height:32px;padding:7px 8px}
.grid-textarea{height:150px;overflow:auto}
.cell-drop{min-height:0;padding:5px;gap:4px}
.image-drop .sheet-images{display:grid;grid-template-columns:repeat(5,52px);gap:6px;max-height:116px;overflow:auto;padding:3px}
.image-drop .sheet-images span{width:52px;height:52px;cursor:grab}
.image-drop .sheet-images img{width:52px;height:52px;object-fit:contain;background:#fff;border:1px solid #e2e9da;border-radius:4px}
.image-drop .sheet-images .image-dragging{opacity:.4}
.image-number{position:absolute;left:0;bottom:0;background:#315c41dd;color:white;font-size:9px;line-height:14px;padding:0 3px;border-radius:2px}
.image-reserve .image-number{background:#9b8054}
.image-reserve img{opacity:.75}
.image-drop .cell-upload{font-size:10px;padding:3px}
.cell-drop small{font-size:9px;line-height:1.4}
.cell-drop video{max-height:60px}
.row-delete{display:block;color:#aa6b58!important;font-size:10px;margin-top:8px;padding:2px 0!important}
.material-sheet th:last-child{width:100px}
.file-import-bar{display:flex;flex-wrap:wrap;align-items:center;gap:12px;margin:14px 0;color:#718563;font-size:11px}
.file-import-bar>small{width:100%}.file-import-bar select{padding:6px;border:1px solid #dce5d3;border-radius:4px;max-width:260px}
.file-import-label{position:relative;cursor:pointer;display:inline-block}
.file-import-label input{position:absolute;inset:0;opacity:0;width:100%;cursor:pointer}
#grid-file-preview{width:100%;max-height:180px;overflow:auto}
#grid-file-preview table{border-collapse:collapse;font-size:10px;min-width:100%}
#grid-file-preview :is(th,td){border:1px solid #dfe8d6;padding:5px 8px;white-space:pre-wrap;min-width:95px;max-width:220px;overflow-wrap:anywhere}
#grid-file-preview th{background:#eff5e9}
.category-all,.category-select,.category-child{border:0;background:transparent;color:#71866c;text-align:left;cursor:pointer;font:inherit;font-size:12px;display:flex;align-items:center;justify-content:space-between;gap:5px;min-width:0}
.category-all{width:100%;padding:10px 9px;margin-bottom:6px;border-radius:5px}
.category-node{margin:4px 0 8px}.category-parent{display:flex;align-items:center;border-radius:5px}
.category-toggle{border:0;background:transparent;color:#80966f;width:22px;flex-shrink:0;padding:8px 0;cursor:pointer;font-size:12px}
.category-select{flex:1;min-width:0;padding:9px 6px 9px 0;font-weight:600;line-height:1.5}
.category-name{overflow-wrap:anywhere}.category-count,.category-all>span{font-size:10px;font-weight:400;color:#94a58b;font-variant-numeric:tabular-nums;flex-shrink:0}
.category-children{border-left:1px solid #e2eadc;margin-left:10px;padding-left:8px}
.category-child{width:100%;border-radius:4px;padding:8px 6px 8px 10px;line-height:1.5}
.category-all:hover,.category-child:hover,.category-parent:hover{background:#f0f5eb}
.category-all.active,.category-child.active,.category-parent:has(.category-select.active){background:#e5efe0;color:#346344}
.category-parent.active-path .category-name{color:#346344}
.category-toggle:focus-visible,.category-select:focus-visible,.category-child:focus-visible,.category-all:focus-visible{outline:2px solid #86a876;outline-offset:-2px}
.login-page{margin:0;min-height:100vh;display:grid;place-items:center;background:#f4f7f0;color:#294b3b;font-family:Arial,"Microsoft YaHei",sans-serif}
.login-panel{width:min(360px,85vw);padding:38px;background:#fff;border:1px solid #dfe8d8;border-radius:12px;box-shadow:0 12px 45px #23442a0b}
.login-panel h1{font-size:24px}.login-brand{font-size:11px;letter-spacing:2px;color:#819479}.login-panel>p:not(.login-brand),.login-panel small{font-size:12px;color:#85937c}
.login-panel label{display:grid;gap:8px;margin:20px 0;font-size:13px}.login-panel input{font:inherit;padding:11px;border:1px solid #d9e3d2;border-radius:5px}.login-panel button{width:100%;padding:12px;background:#27634c;border:0;border-radius:5px;color:#fff;cursor:pointer;margin:5px 0 20px}
#login-error{color:#ae5949;font-size:12px;min-height:16px}#account-controls{display:flex;align-items:center;gap:12px;font-size:11px;color:#708367}
.clear-row-date{font-size:10px;margin:3px 8px}.grid-control[readonly]{color:#8b9c80;background:#f7f9f3;cursor:default}
.filters{flex-wrap:wrap;align-items:center}.filters .search{min-width:220px;flex:1 1 250px}.field-filters{display:contents}.filters .field-filters select{flex:0 0 auto;width:auto;max-width:145px;min-width:100px;height:38px}.filters #date-filter{height:38px}
.duplicate-note{font-size:11px;color:#847249;line-height:1.6;margin:10px 2px 16px}
.grid-cell.duplicate-cell{background:#fff2cf!important;box-shadow:inset 3px 0 #d39b26}.duplicate-cell .grid-control{background:transparent;color:#825614}.duplicate-badge{display:block;width:fit-content;margin:4px 8px;padding:2px 5px;border:1px solid #dfbd70;border-radius:4px;background:#fff0c2;color:#825614;font-size:10px;line-height:1.4}.card-code .duplicate-badge{display:inline-block;margin:3px 4px 0 0}
@media(max-width:700px){.filters .search{flex-basis:100%}.filters .field-filters select{flex:1 1 110px}}
.material-sheet td.grid-cell{cursor:text}
.image-drop .sheet-images img{cursor:zoom-in}
.image-drop .sheet-images img:focus-visible{outline:2px solid #568443;outline-offset:2px}
.image-viewer{width:min(1100px,94vw);max-width:94vw;max-height:94vh;padding:16px;background:#f8faf6;border:1px solid #dce6d4;border-radius:10px}
.image-viewer::backdrop{background:#10251ddb}
.image-viewer-head,.image-viewer-controls{display:flex;align-items:center;justify-content:space-between;gap:12px}
.image-viewer-head strong{font-size:14px;overflow-wrap:anywhere}.image-viewer-head button,.image-viewer-controls button{border:1px solid #dce6d4;border-radius:5px;padding:8px 12px;background:#fff;color:#315c41;cursor:pointer}
.image-viewer>img{display:block;width:100%;height:min(72vh,800px);object-fit:contain;margin:12px 0;background:#eaf0e6}
.image-viewer-controls{justify-content:center;font-size:12px}
[hidden]{display:none!important}
.library-heading{gap:14px;flex-wrap:wrap}.library-heading .heading-actions{margin-left:auto;flex-direction:row}.library-heading .view-switch{margin-left:auto}
.category-statistics{background:#fff;border:1px solid #e3e8e2;border-radius:9px;padding:22px;margin:22px 0}
.category-statistics>p{color:#849088;font-size:11px;line-height:1.8;margin:10px 0 20px}
.statistics-table-wrap{overflow:auto}.category-statistics table{width:100%;border-collapse:collapse;min-width:600px;font-size:12px}
.category-statistics :is(th,td){border-bottom:1px solid #e5ebe1;padding:13px 16px;text-align:right;font-variant-numeric:tabular-nums}
.category-statistics th:first-child{text-align:left}.category-statistics thead{background:#f2f6ee;color:#6f8166}
.category-statistics tbody th{font-weight:400}.statistics-parent{background:#f0f5ec}.statistics-parent th{font-weight:650!important}.statistics-parent small{display:inline-block;margin-left:12px;color:#8c9b83;font-weight:400;font-size:10px}
.statistics-child th{padding-left:35px}.category-statistics .maintained-count{color:#24644d;font-weight:650}
.statistics-fold-tools{display:flex;gap:8px;justify-content:flex-end;margin-top:-26px;margin-bottom:12px}
.statistics-line-toggle{background:none;border:0;padding:3px 0;color:inherit;font:inherit;font-weight:650;text-align:left;cursor:pointer}.statistics-line-toggle span{display:inline-block;width:16px;color:#638256}.statistics-line-toggle:focus-visible{outline:2px solid #73a351;outline-offset:4px}
.filters :is(#product-line-filter,#material-group-filter){width:135px;max-width:160px;height:38px}
@media(max-width:700px){.statistics-fold-tools{margin-top:12px;justify-content:flex-start}}
