.issue-workspace { min-width: 0; }
.issue-workspace-toolbar { display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:42px; margin:0 0 10px; border-bottom:1px solid #dce5ef; }
.issue-workspace-toolbar > .issue-workspace-tabs { flex:0 0 auto; margin:0; border:0; gap:24px; }
.issue-workspace-toolbar > .issue-workspace-tabs button { margin:0; padding:9px 2px; font-size:14px; }
.issue-workspace-actions { display:flex; align-items:center; justify-content:flex-end; gap:12px; min-width:0; }
.issue-workspace-hint { color:#64748b; font-size:13px; line-height:1.5; }
.issue-workspace-actions button { width:auto; min-height:32px; margin:0; padding:5px 10px; white-space:nowrap; }
.issue-workspace-toolbar + .issue-context-note { padding:8px 12px; margin-bottom:10px; }
@media(max-width:900px) { .issue-workspace-toolbar { flex-wrap:wrap; gap:4px 12px; } .issue-workspace-actions { justify-content:flex-start; margin-bottom:6px; } }
.issue-workspace-heading { display:flex; align-items:center; justify-content:space-between; gap:20px; margin:0 0 20px; }
.issue-workspace-heading h2 { margin:0 0 6px; font-size:24px; }
.issue-workspace-heading p { margin:0; color:#64748b; font-size:13px; }
.issue-workspace-heading button { width:auto; flex-shrink:0; }
.issue-workspace-tabs { display:flex; gap:24px; border-bottom:1px solid #dce5ef; margin-bottom:20px; }
.issue-workspace-tabs button { width:auto; background:transparent; color:#64748b; border:0; border-bottom:3px solid transparent; border-radius:0; padding:12px 2px; font-size:14px; font-weight:600; }
.issue-workspace-tabs button[aria-pressed="true"] { color:#175bd1; border-bottom-color:#175bd1; }
.stock-workspace-heading { display:flex; align-items:center; gap:12px; border-bottom:1px solid #dce5ef; margin:0 0 10px; }
.stock-workspace-heading > .stock-workspace-tabs { flex:1; min-width:0; border:0; margin:0; gap:24px; }
.stock-workspace-tabs button { padding:9px 2px; font-size:14px; }
.stock-workspace-heading > button { flex-shrink:0; width:auto; }
.stock-context-note { padding:10px 14px; margin-bottom:10px; }
@media(max-width:700px) { .stock-workspace-heading { flex-wrap:wrap; gap:6px; } .stock-workspace-heading > .stock-workspace-tabs { gap:16px; } .stock-workspace-tabs button { font-size:13px; } }
.issue-context-note { border:1px solid #cdddf3; background:#f0f6ff; color:#294a76; border-radius:8px; padding:14px 16px; margin:0 0 18px; font-size:14px; }
.issue-context-note small { display:block; margin-top:6px; font-size:12px; color:#617793; }
.issue-material-body > [hidden], #content > [hidden] { display:none !important; }
.issue-material-body > .panel { margin-bottom:12px; }
.issue-material-body table { width:100%; }
.issue-material-body .material-usage-form-grid { grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; }
.issue-material-body .material-usage-form-grid > button[type="submit"] { align-self:end; justify-self:end; min-width:120px; width:auto; }
.issue-material-body .table-scroll { overflow:auto; }
.issue-material-body .panel { overflow-x:auto; }
.task-issue-summary { list-style:none; padding:0; margin:0 0 14px; }
.task-issue-summary li { padding:10px 0; border-bottom:1px solid #edf1f6; }
.task-issue-summary strong, .task-issue-summary span { display:block; font-size:13px; overflow-wrap:anywhere; }
.task-issue-summary strong { font-weight:600; margin-bottom:4px; }
.task-issue-summary span { color:#64748b; }
.task-issue-actions { display:flex; gap:8px; flex-wrap:wrap; }
.task-issue-actions button { width:auto; padding:8px 12px; }
@media(max-width:1100px) { .issue-material-body .material-usage-form-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:700px) { .issue-workspace-heading { align-items:flex-start; gap:12px; } .issue-material-body .material-usage-form-grid { grid-template-columns:1fr; } }

/* Reuse the original material forms in place, without leaving the current list. */
.material-issue-dialog { width:min(860px,calc(100vw - 32px)); max-width:none; max-height:calc(100dvh - 32px); box-sizing:border-box; padding:0; border:1px solid #d8e3f1; border-radius:10px; color:#17304e; background:#fff; box-shadow:0 16px 70px #12233855; }
.material-issue-dialog::backdrop { background:#1d304866; }
.material-issue-dialog[open] { display:flex; flex-direction:column; }
.material-issue-dialog > header { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:12px 18px; border-bottom:1px solid #dbe4ef; flex-shrink:0; }
.material-issue-dialog > header > strong { font-size:14px; font-weight:600; }
body .material-issue-dialog > header > button { flex:0 0 auto; width:auto; min-width:60px; min-height:32px; margin:0; padding:5px 12px; font-size:13px; }
.material-issue-dialog-body { min-width:0; min-height:0; overflow:auto; overscroll-behavior:contain; padding:16px 18px; }
body .material-issue-dialog .material-issue-dialog-body > .panel { min-width:0; margin:0; padding:0; border:0; border-radius:0; box-shadow:none; overflow:visible; background:#fff; }
.material-issue-dialog .material-issue-dialog-body > .panel > .section-head { display:none; }
body .material-issue-dialog :is(#usageForm,#returnForm) { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); align-items:start; gap:12px 16px; min-width:0; margin:0; padding:0; border:0; border-radius:0; background:#fff; }
body .material-issue-dialog :is(#usageForm,#returnForm) > * { grid-column:auto; min-width:0; max-width:100%; }
body .material-issue-dialog :is(#usageForm,#returnForm) > :is(.hidden,[hidden],input[type="hidden"]) { display:none!important; }
body .material-issue-dialog :is(#usageForm,#returnForm) .a-operation-field { display:flex; flex-direction:column; gap:4px; min-width:0; margin:0; color:#405572; font-size:13px; font-weight:500; }
body .material-issue-dialog :is(#usageForm,#returnForm) .a-operation-field:has(> .hidden) { display:none; }
body .material-issue-dialog :is(#usageForm,#returnForm) :is(input:not([type="checkbox"]):not([type="radio"]),select,textarea) { width:100%; min-width:0; max-width:100%; box-sizing:border-box; margin:0; font-size:13px; font-weight:400; }
body .material-issue-dialog :is(#usageForm,#returnForm) .a-operation-caption { margin-bottom:4px; font-size:13px; font-weight:500; }
body .material-issue-dialog :is(#usageForm,#returnForm) > :is(.form-span-2,.material-issue-summary,.material-return-summary,.form-static-field,.payable-validation,.material-submit-state) { grid-column:1 / -1; }
body .material-issue-dialog :is(#usageMaterialSummary,#returnUsageSummary) { padding:10px 12px; margin:0; border:1px solid #dce6f1; border-radius:6px; background:#f6f9fd; color:#405572; font-size:13px; line-height:1.65; overflow-wrap:anywhere; }
.material-issue-dialog .search-select { min-width:0; }
.material-issue-dialog .search-select-menu { position:static; max-height:210px; margin-top:5px; box-sizing:border-box; }
.material-issue-dialog .search-select-item { white-space:normal; overflow-wrap:anywhere; }
body .material-issue-dialog :is(#usageForm,#returnForm) > button[type="submit"] { grid-column:1 / -1; justify-self:end; width:auto; min-width:140px; margin:4px 0 0; padding:8px 14px; font-size:13px; }
.issue-material-body .material-issue-record-head { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:8px 12px; }
.issue-material-body .material-issue-record-head h3 { margin:0; }
.issue-material-body .material-issue-record-actions { display:flex; align-items:center; flex-wrap:wrap; gap:6px; }
.issue-material-body .material-issue-record-actions button { width:auto; margin:0; }
/* Keep each part of the issue request on a stable row as its scope changes. */
body .material-issue-dialog #usageForm { grid-template-columns:repeat(12,minmax(0,1fr)); gap:12px 16px; }
body .material-issue-dialog #usageForm > .usage-field-scope { grid-column:span 4; }
body .material-issue-dialog #usageForm > .usage-field-target { grid-column:span 8; }
body .material-issue-dialog #usageForm:not([data-scope="project"]):not([data-scope="client"]) > .usage-field-scope { grid-column:1 / -1; }
body .material-issue-dialog #usageForm > .usage-field-material { grid-column:span 8; display:flex; flex-direction:column; gap:4px; position:relative; }
body .material-issue-dialog #usageForm > .usage-field-quantity { grid-column:span 4; }
body .material-issue-dialog #usageForm > :is(.usage-field-category,.usage-field-subcategory,.usage-field-cost) { grid-column:span 4; }
body .material-issue-dialog #usageForm:not([data-scope="project"]) > :is(.usage-field-category,.usage-field-subcategory) { grid-column:span 6; }
body .material-issue-dialog #usageForm:not([data-scope="project"]) > .usage-field-cost { display:none; }
body .material-issue-dialog #usageForm > .usage-field-reason { grid-column:span 8; }
body .material-issue-dialog #usageForm > .usage-field-date { grid-column:span 4; }
body .material-issue-dialog #usageForm:not([data-borrow="true"]) > .usage-field-date { display:none; }
body .material-issue-dialog #usageForm:not([data-borrow="true"]) > .usage-field-reason { grid-column:1 / -1; }
body .material-issue-dialog #usageForm > .material-approver-field { grid-column:1 / -1; display:flex; flex-direction:column; gap:4px; margin:0; }
body .material-issue-dialog #usageForm :is(.a-operation-field > span,.a-operation-caption,.material-approver-field > span:first-child) { display:block; min-height:18px; margin:0; font-size:13px; font-weight:500; line-height:18px; color:#405572; }
body .material-issue-dialog #usageForm :is(input:not([type="hidden"]),select) { height:34px; min-height:34px; padding:6px 10px; line-height:20px; }
body .material-issue-dialog #usageForm #usageMaterialMenu { position:absolute; z-index:5; top:calc(100% + 4px); left:0; right:0; margin:0; max-height:180px; }
body .material-issue-dialog #usageForm #usageMaterialSummary { padding:7px 10px; margin-top:-4px; }
@media(max-width:700px) {
  .material-issue-dialog { width:calc(100vw - 16px); max-height:calc(100dvh - 16px); border-radius:8px; }
  .material-issue-dialog > header { gap:10px; padding:10px 12px; }
  .material-issue-dialog-body { padding:12px; }
  body .material-issue-dialog :is(#usageForm,#returnForm) { grid-template-columns:minmax(0,1fr); gap:10px; }
  body .material-issue-dialog :is(#usageForm,#returnForm) > * { grid-column:1 / -1; }
  body .material-issue-dialog :is(#usageForm,#returnForm) > button[type="submit"] { width:100%; justify-self:stretch; }
  body .material-issue-dialog #usageForm { grid-template-columns:minmax(0,1fr); gap:10px; }
  body .material-issue-dialog #usageForm > :is(.usage-field-scope,.usage-field-target,.usage-field-material,.usage-field-quantity,.usage-field-category,.usage-field-subcategory,.usage-field-cost,.usage-field-reason,.usage-field-date) { grid-column:1 / -1; }
  body .material-issue-dialog #usageForm:not([data-scope="project"]) > :is(.usage-field-category,.usage-field-subcategory) { grid-column:1 / -1; }
  body .material-issue-dialog #usageForm :is(input:not([type="hidden"]),select) { height:38px; min-height:38px; }
  body .material-issue-dialog #usageForm #usageMaterialMenu { position:static; margin-top:1px; max-height:180px; }
}

/* Record paging wraps tables; phone cards must work with or without that wrapper. */
@media(max-width:768px) {
  body .mobile-system-shell .issue-material-body :is(#material-usage-table-section,#material-return-table-section) { min-width:0; max-width:100%; overflow-x:hidden; }
  body .mobile-system-shell .issue-material-body :is(#material-usage-table-section,#material-return-table-section) .table-scroll { min-width:0; max-width:100%; overflow-x:hidden; }
  body .mobile-system-shell .issue-material-body :is(#material-usage-table-section,#material-return-table-section) table { display:block; width:100%; min-width:0!important; max-width:100%; border-collapse:separate; }
  body .mobile-system-shell .issue-material-body :is(#material-usage-table-section,#material-return-table-section) table thead { display:none; }
  body .mobile-system-shell .issue-material-body :is(#material-usage-table-section,#material-return-table-section) table tbody { display:grid; gap:9px; }
  body .mobile-system-shell .issue-material-body :is(#material-usage-table-section,#material-return-table-section) table tbody > tr:is(.material-usage-row,.material-return-row) { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px 10px; min-width:0; padding:11px; border:1px solid #dce6f0; border-radius:8px; background:#fff; box-shadow:none; }
  body .mobile-system-shell .issue-material-body :is(#material-usage-table-section,#material-return-table-section) table tbody > tr:is(.material-usage-row,.material-return-row) > td:nth-child(n) { display:block; min-width:0; max-width:100%; width:auto; margin:0; padding:0; border:0; color:#526c86; font-size:12px; line-height:1.5; text-align:left; white-space:normal; overflow-wrap:anywhere; }
  body .mobile-system-shell .issue-material-body :is(#material-usage-table-section,#material-return-table-section) table tbody > tr:is(.material-usage-row,.material-return-row) > td:nth-child(1) { grid-column:1; grid-row:1; }
  body .mobile-system-shell .issue-material-body #material-usage-table-section table tbody > tr.material-usage-row > td:nth-child(1)::before { content:'领用 #'; }
  body .mobile-system-shell .issue-material-body #material-return-table-section table tbody > tr.material-return-row > td:nth-child(1)::before { content:'归还 #'; }
  body .mobile-system-shell .issue-material-body :is(#material-usage-table-section,#material-return-table-section) table tbody > tr:is(.material-usage-row,.material-return-row) > td:nth-child(2) { grid-column:1; grid-row:3; }
  body .mobile-system-shell .issue-material-body #material-usage-table-section table tbody > tr.material-usage-row > td:nth-child(2)::before { content:'申请人：'; }
  body .mobile-system-shell .issue-material-body #material-return-table-section table tbody > tr.material-return-row > td:nth-child(2)::before { content:'原领用 #'; }
  body .mobile-system-shell .issue-material-body :is(#material-usage-table-section,#material-return-table-section) table tbody > tr:is(.material-usage-row,.material-return-row) > td:nth-child(3) { grid-column:2; grid-row:3; }
  body .mobile-system-shell .issue-material-body :is(#material-usage-table-section,#material-return-table-section) table tbody > tr:is(.material-usage-row,.material-return-row) > td:nth-child(4) { grid-column:1 / -1; grid-row:2; color:#173b5e; font-size:13px; font-weight:600; }
  body .mobile-system-shell .issue-material-body :is(#material-usage-table-section,#material-return-table-section) table tbody > tr:is(.material-usage-row,.material-return-row) > td:nth-child(5) { grid-column:1 / -1; grid-row:4; }
  body .mobile-system-shell .issue-material-body :is(#material-usage-table-section,#material-return-table-section) table tbody > tr:is(.material-usage-row,.material-return-row) > td:nth-child(5)::before { content:'费用归类：'; }
  body .mobile-system-shell .issue-material-body :is(#material-usage-table-section,#material-return-table-section) table tbody > tr:is(.material-usage-row,.material-return-row) > td:nth-child(6) { grid-column:1 / -1; grid-row:5; padding:8px 10px; border-radius:6px; background:#f6f9fc; color:#315984; }
  body .mobile-system-shell .issue-material-body :is(#material-usage-table-section,#material-return-table-section) table tbody > tr:is(.material-usage-row,.material-return-row) > td:nth-child(7) { grid-column:2; grid-row:1; text-align:right; color:#526c86; }
  body .mobile-system-shell .issue-material-body :is(#material-usage-table-section,#material-return-table-section) table tbody > tr:is(.material-usage-row,.material-return-row) > td:nth-child(8) { grid-column:1 / -1; grid-row:6; display:flex; flex-wrap:wrap; align-items:center; gap:6px; padding-top:8px; border-top:1px solid #edf1f5; }
  body .mobile-system-shell .issue-material-body :is(#material-usage-table-section,#material-return-table-section) .table-action-group { display:flex; flex-wrap:wrap; align-items:center; gap:6px; }
  body .mobile-system-shell .issue-material-body :is(#material-usage-table-section,#material-return-table-section) table tbody .tiny { flex:0 0 auto; min-height:34px; width:auto; max-width:100%; margin:0; padding:7px 10px; white-space:normal; }
  body .mobile-system-shell .issue-material-body :is(#material-usage-table-section,#material-return-table-section) table tbody :is(.cell-main,.cell-sub) { display:block; white-space:normal; overflow-wrap:anywhere; }
}
