
:root{font-family:Arial,Helvetica,sans-serif;color:#1b2b3d;background:#eef2f7}*{box-sizing:border-box}body{margin:0}.shell{max-width:1200px;margin:0 auto;padding:27px 20px 65px}.top{display:flex;justify-content:space-between;align-items:center;gap:20px;margin-bottom:22px}.top h1{font-size:26px;margin:0 0 6px}.top p{margin:0;color:#607084}.tag{font-size:12px;font-weight:700;border:1px solid #c8d5e3;border-radius:40px;padding:8px 12px;background:white;white-space:nowrap}.layout{display:grid;grid-template-columns:minmax(300px,360px) minmax(0,1fr);gap:24px;align-items:start}.panel,.preview-panel{min-width:0;background:white;border-radius:13px;box-shadow:0 3px 16px #21354c12;padding:22px}.panel h2{font-size:16px;margin:0 0 12px}.panel p{font-size:13px;color:#617185;line-height:1.5}.drop{position:relative;border:2px dashed #9cacc1;border-radius:10px;background:#f7f9fc;padding:24px 15px;text-align:center;cursor:pointer;display:block}.drop.drag{border-color:#1762a2;background:#e5f2ff}.drop strong{display:block;font-size:15px;margin-bottom:6px}.drop small{font-size:12px;color:#6b7c90}.drop input{position:absolute;inset:0;opacity:0;width:100%;cursor:pointer}.status{margin:12px 0;font-size:13px;line-height:1.5}.status.error{color:#aa2323}.status.ok{color:#0e714d}.field-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:11px;min-width:0}.field{min-width:0;width:100%}.field{display:flex;flex-direction:column;gap:5px;margin-bottom:9px}.field label{font-weight:700;font-size:12px;color:#53667a}.field input{display:block;width:100%;max-width:100%;min-width:0;padding:10px 9px;border:1px solid #ced6e0;border-radius:7px;background:#fff;color:#17283c;font-size:13px}.field input:focus,.num:focus,.item:focus{outline:2px solid #97c1ea}.section-break{border:0;border-top:1px solid #e1e7ed;margin:18px 0}.actions{display:flex;gap:9px;flex-wrap:wrap}.btn{border:1px solid #aebfd2;border-radius:8px;background:white;color:#1d3955;font-size:13px;padding:11px 13px;cursor:pointer;font-weight:bold}.btn.primary{background:#172f49;color:white;border-color:#172f49}.btn:disabled{opacity:.5;cursor:not-allowed}.preview-panel{padding:18px}.preview-top{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}.preview-top h2{font-size:16px;margin:0}.preview-top small{color:#637589}.paper{background:#fff;border:1px solid #d8dfe7;min-height:690px;padding:34px 36px 32px;box-shadow:0 2px 8px #00000009}.paper h2{font-size:21px;color:#17283c;letter-spacing:.3px;margin:0 0 12px;border-bottom:2px solid #a8b5c4;padding-bottom:12px}.meta{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px 10px;margin-bottom:22px}.meta .entry{min-width:0;display:flex;flex-direction:column;gap:6px}.entry b{font-size:10px;letter-spacing:.4px;color:#62758a}.entry span{font-size:12px;min-height:22px;border-bottom:1px solid #b4c0ce;overflow-wrap:anywhere}.entry.wide{grid-column:span 2}.contents{width:100%;border-collapse:collapse;font-size:12px}.contents thead th{text-align:left;background:#172f49;color:#fff;padding:9px}.contents th:last-child,.contents td:last-child{text-align:center;width:95px;border-left:1px solid #d5dde7}.contents td{padding:6px 9px;border-bottom:1px solid #d5dde7;height:28px}.contents tbody tr:nth-child(even){background:#f3f6fa}.contents input{font:inherit;border:1px solid transparent;background:transparent;width:100%;min-width:0;padding:4px;color:#1b2b3d}.contents input:hover,.contents input:focus{border-color:#92b5d8;background:#fff}.contents .num{text-align:center}.foot{font-size:10px;color:#5f7287;margin-top:14px;display:flex;justify-content:space-between}.muted{color:#6b7c90}.help{font-size:12px;color:#607084;line-height:1.5;margin-top:12px}.edit-only{width:76px;text-align:center!important}.remove-line{font-size:12px;font-weight:700;border:1px solid #edc4c4;background:#fff3f3;color:#a21e1e;padding:7px 9px;border-radius:6px;cursor:pointer}.remove-line:hover,.remove-line:focus{background:#fce1e1;outline-color:#a21e1e}.item-remove{background:transparent;color:#b03b3b;border:0;cursor:pointer;margin-left:6px;font-size:15px}.empty{font-size:13px;color:#718094;text-align:center;padding:50px 15px}.import-summary{background:#eff7ff;border-radius:6px;padding:9px;margin-top:9px;font-size:12px;color:#20517a}@media(max-width:840px){.layout{grid-template-columns:1fr}.paper{padding:22px}.shell{padding:16px}.top{align-items:flex-start}.tag{display:none}}@page{size:letter;margin:0.5in}@media print{html,body{background:#fff!important}.shell{max-width:none;padding:0}.top,.panel,.preview-top,.help,.edit-only{display:none!important}.layout{display:block}.preview-panel{padding:0;box-shadow:none}.paper{box-shadow:none;border:0;min-height:0;padding:0}.contents input{padding:0;border:0!important}.contents th:last-child,.contents td:last-child{width:95px}.contents tr{break-inside:avoid;page-break-inside:avoid}.contents thead{display:table-header-group}.contents thead th{background:#172f49!important;color:#fff!important;print-color-adjust:exact;-webkit-print-color-adjust:exact}.contents tbody tr:nth-child(even){background:#f3f6fa!important;print-color-adjust:exact;-webkit-print-color-adjust:exact}.foot{margin-top:10px}}

/* WMS export help: constrained to sidebar; full-size viewer is optional. */
.import-help{min-width:0;max-width:100%;overflow:hidden;margin:16px 0 4px;padding:12px;border:1px solid #d8e1eb;border-radius:10px;background:#f8fafd}
.import-help h3{font-size:15px;line-height:1.3;margin:0 0 8px;color:#172f49}
.import-help p{font-size:12px;line-height:1.5;margin:0 0 10px}
.import-help img{display:block;width:100%;max-width:100%;height:auto;object-fit:contain;border:1px solid #d4dfe9;border-radius:5px;background:white}
.import-help .tip{font-size:11px;line-height:1.45;color:#516c82;margin:8px 0 0}
.import-help .help-enlarge{margin-top:9px;width:100%;border:1px solid #9ab5cf;background:#fff;border-radius:7px;padding:9px 10px;font-size:12px;font-weight:bold;color:#1d3955;cursor:pointer}
#helpDialog{border:0;border-radius:12px;max-width:min(96vw,1100px);width:fit-content;max-height:92vh;padding:15px;background:#fff;box-shadow:0 18px 65px #0005}
#helpDialog::backdrop{background:#102238ab}
#helpDialog .dialog-bar{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:10px;font-weight:bold}
#helpDialog .dialog-bar button{border:1px solid #9ab5cf;border-radius:6px;background:#fff;padding:7px 12px;cursor:pointer}
#helpDialog img{display:block;width:100%;max-width:100%;max-height:78vh;height:auto;object-fit:contain}
@media print{.import-help,#helpDialog{display:none!important}}

/* Search imported items without changing the printed document. */
.quick-search{margin:16px 0;padding:13px;border:1px solid #bcd0e3;background:#f5f9fd;border-radius:10px;min-width:0}
.quick-search h3{font-size:15px;margin:0 0 6px;color:#172f49}
.quick-search p{font-size:12px;line-height:1.45;margin:0 0 9px}
.quick-search input{display:block;width:100%;min-width:0;border:1px solid #aebfd2;border-radius:7px;font-size:14px;padding:10px 11px;background:#fff;color:#17283c}
.quick-search input:focus{outline:2px solid #97c1ea}
.quick-search .search-count{font-size:12px;color:#506a84;margin:9px 0 5px}
.quick-search .search-results{max-height:250px;overflow-y:auto;overscroll-behavior:contain}
.quick-search .search-result{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 0;border-bottom:1px solid #dfe8f0;min-width:0}
.quick-search .search-result:last-child{border-bottom:0}
.quick-search .search-part{min-width:0;overflow-wrap:anywhere;font-size:12px;font-weight:700;color:#182e46}
.quick-search .search-qty{font-size:11px;font-weight:400;color:#536b80;display:block;margin-top:3px}
.quick-search .remove-line{flex:none}
@media print{.quick-search{display:none!important}}

/* v9: full-width case details and export controls. Keep import/preview in the middle. */
.shell{max-width:1400px}
.details-panel{margin-bottom:22px;padding:22px 26px}
.details-panel .field-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:14px;align-items:end}
.details-panel .field{margin-bottom:0}
.details-panel p{margin:0 0 15px}
.export-panel{margin-top:22px;padding:22px 26px}
.export-panel .actions{display:flex;gap:12px;align-items:center;flex-wrap:wrap}
.export-panel .actions .btn{min-width:145px}
.export-panel .help{max-width:1050px}
@media(max-width:1100px){.details-panel .field-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:650px){.details-panel .field-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.details-panel,.export-panel{padding:18px}.export-panel .actions .btn{min-width:0;flex:1 1 165px}}
@media print{.details-panel,.export-panel{display:none!important}}

/* v10: pick parts before adding them to the case */
.import-mode{border:1px solid #d4e1ef;border-radius:10px;padding:12px;margin:12px 0;background:#f9fbff}
.import-mode strong{display:block;font-size:13px;margin-bottom:9px}
.mode-choices{display:flex;gap:12px;flex-wrap:wrap}
.mode-choices label{display:flex;align-items:center;gap:7px;font-size:13px;cursor:pointer}
.mode-choices input{accent-color:#173b61}
.selection-panel{margin:14px 0;border:1px solid #9dbbd8;border-radius:11px;background:#f8fbff;padding:12px;min-width:0}
.selection-panel[hidden]{display:none!important}
.selection-panel h3{font-size:15px;margin:0 0 7px}
.selection-panel p{font-size:12px;color:#506b83;margin:0 0 10px;line-height:1.5}
.selection-panel .select-filter{width:100%;padding:10px;border:1px solid #aebfd2;border-radius:7px;min-width:0;background:white;font-size:14px}
.selection-panel .select-actions{display:flex;gap:7px;flex-wrap:wrap;margin:10px 0}
.selection-panel .select-actions button{font-size:12px;padding:7px 9px;border:1px solid #aebfd2;border-radius:6px;background:#fff;cursor:pointer}
.selection-count{font-size:12px;color:#284967;margin:7px 0;font-weight:700}
.selection-results{max-height:300px;overflow:auto;border:1px solid #dde5ed;border-radius:7px;background:white}
.selection-row{display:flex;gap:10px;align-items:center;padding:9px 10px;border-bottom:1px solid #e7edf4;font-size:12px;cursor:pointer;min-width:0}
.selection-row:last-child{border-bottom:0}
.selection-row:hover{background:#edf5fc}
.selection-row input{width:17px;height:17px;accent-color:#173b61;flex:none}
.selection-row .select-part{font-weight:700;overflow-wrap:anywhere;min-width:0}
.selection-row .select-info{font-size:11px;color:#607589;margin-top:3px;overflow-wrap:anywhere}
.selection-footer{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}
.selection-footer .btn{flex:1 1 140px}
@media print{.import-mode,.selection-panel{display:none!important}}

/* v11: import workflow lives in a centered modal instead of the main page. */
.sidebar-heading{display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap}
.sidebar-heading h2{margin:0}.sidebar-heading .btn{padding:10px 12px}
.export-instructions{margin-top:17px;border:1px solid #d5e0ec;border-radius:9px;padding:10px;background:#f8fbff;max-width:100%;min-width:0;overflow:hidden}
.export-instructions summary{cursor:pointer;font-weight:700;font-size:13px;color:#1d3955}
.export-instructions .import-help{border:0;padding:8px 0 0;margin:0}
#importDialog{width:min(900px,96vw);max-width:96vw;max-height:94vh;padding:0;border:0;border-radius:15px;background:white;color:#1b2b3d;box-shadow:0 25px 80px #15223870;overflow:hidden}
#importDialog[open]{display:flex;flex-direction:column}
#importDialog::backdrop{background:rgba(17,35,55,.66)}
.import-dialog-header{display:flex;justify-content:space-between;align-items:flex-start;gap:14px;padding:22px 26px 16px;border-bottom:1px solid #e2e8f0}
.import-dialog-header h2{font-size:23px;margin:0 0 6px}
.import-dialog-header p{font-size:13px;margin:0;color:#5d7186;line-height:1.5}
.dialog-close{border:1px solid #d1dae5;background:#fff;border-radius:7px;font-size:26px;line-height:1;cursor:pointer;width:36px;height:36px;flex:none}
.import-dialog-body{padding:18px 26px;overflow-y:auto;min-height:0;overscroll-behavior:contain}
#importDialog .drop{padding:16px}
#importDialog .status{margin:10px 0}
#importDialog .import-mode{padding:11px 13px;margin:15px 0 11px}
#importDialog .mode-choices{display:flex;gap:20px;flex-wrap:wrap}
#importDialog .select-filter{min-width:0;width:100%;padding:12px;border:1px solid #aebfd2;border-radius:8px;font-size:14px}
.picker-toolbar{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.picker-toolbar input{flex:1 1 250px}
.picker-toolbar .selection-count{white-space:nowrap}
#importDialog .select-actions{margin:10px 0}
#importDialog .selection-results{max-height:min(39vh,380px);overflow:auto}
#importDialog .selection-row{min-height:45px}
.selection-note{font-size:12px;color:#5c7085;margin:9px 0 0}
.import-dialog-footer{display:flex;justify-content:flex-end;gap:12px;align-items:center;padding:15px 26px;border-top:1px solid #e1e8f0;background:#f9fbfe}
.upload-errors{font-size:12px;color:#a02525;margin:8px 0;padding:8px;border-radius:7px;background:#fff1f1}
@media(max-width:620px){.import-dialog-header,.import-dialog-body,.import-dialog-footer{padding-left:14px;padding-right:14px}#importDialog .selection-results{max-height:37vh}.import-dialog-header h2{font-size:19px}}
@media print{#importDialog,.export-instructions{display:none!important}}

/* v12: fixed units and refined selection controls */
.details-panel .field-grid{grid-template-columns:repeat(7,minmax(0,1fr))}
.details-panel .field select{display:block;width:100%;min-width:0;min-height:39px;padding:9px 10px;border:1px solid #ced6e0;border-radius:7px;background:#fff;color:#17283c;font-size:13px}
.details-panel .field select:focus-visible{outline:2px solid #97c1ea;outline-offset:2px}
.weight-field{display:flex;position:relative;width:100%;min-width:0}
.weight-field input{padding-right:42px}
.weight-field .unit-suffix{position:absolute;right:10px;top:50%;transform:translateY(-50%);color:#52697f;font-size:12px;font-weight:700;pointer-events:none}
#importDialog .select-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:13px 0}
#importDialog .select-actions[hidden]{display:none!important}
#importDialog .select-actions button.selection-action{appearance:none;display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:38px;padding:9px 12px;border:1px solid #c2d0de;border-radius:9px;background:#fff;color:#243e59;font-family:inherit;font-size:12px;line-height:1.1;font-weight:700;box-shadow:0 1px 3px #12253a0c;cursor:pointer;transition:background-color .14s,border-color .14s,box-shadow .14s}
#importDialog .select-actions button.selection-action:hover{background:#eaf3fc;border-color:#87aacb;box-shadow:0 2px 6px #12253a15}
#importDialog .select-actions button.selection-action:active{background:#dceafa;transform:translateY(1px)}
#importDialog .select-actions button.selection-action:focus-visible{outline:3px solid #96bfeb;outline-offset:2px}
#importDialog .select-actions .selection-action-icon{display:inline-flex;align-items:center;justify-content:center;border-radius:5px;width:19px;height:19px;background:#eaf1f8;color:#234b72;font-size:15px;line-height:1}
#importDialog .select-actions #selectVisible{background:#edf5fd;border-color:#abc8e4;color:#143b60}
#importDialog .select-actions #selectVisible:hover{background:#dbeafa}
#importDialog .select-actions #deselectAllPending{color:#8d3944;border-color:#e3ccd0}
#importDialog .select-actions #deselectAllPending:hover{background:#fff0f1;border-color:#d6a1a9}
#importDialog .select-actions .selection-action-divider{width:1px;height:26px;background:#d8e1eb;margin:0 3px}
@media(max-width:1100px){.details-panel .field-grid{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:650px){.details-panel .field-grid{grid-template-columns:repeat(2,minmax(0,1fr))}#importDialog .select-actions .selection-action-divider{display:none}#importDialog .select-actions button.selection-action{flex:1 1 135px}}

/* StagePoint public Tools navigation: hidden from case output */
.tool-mini-nav{max-width:1400px;margin:0 auto;padding:17px 20px 0;display:flex;justify-content:space-between;align-items:center;gap:14px;font-size:13px;color:#587087}
.tool-mini-nav a{display:inline-flex;align-items:center;gap:6px;color:#1e527f;text-decoration:none;font-weight:800;background:#fff;border:1px solid #d0deeb;border-radius:9px;padding:10px 14px}
.tool-mini-nav a:hover{background:#edf5fc;border-color:#8fb4d5}
.tool-mini-nav a:focus-visible{outline:3px solid #76addc;outline-offset:2px}
.tool-mini-nav span{font-size:12px;font-weight:700;letter-spacing:.035em}
@media(max-width:560px){.tool-mini-nav{align-items:flex-start;flex-direction:column;gap:8px;padding-top:12px}}
@media print{.tool-mini-nav{display:none!important}}
