:root {
  font-family: "Noto Sans SC", "Microsoft YaHei", sans-serif;
  color: #1d2939;
  background: #f5f7fb;
  --line: #e5e9f2;
  --muted: #667085;
  --blue: #2563eb;
}
* { box-sizing: border-box; }
body { margin: 0; background: #f5f7fb; font-size: 20px; }
button, input, select { font: inherit; }
.login-screen { display: none; min-height: 100vh; align-items: center; justify-content: center; padding: 24px; background: #f5f7fb; }
.login-card { width: min(520px, 100%); padding: 38px; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 18px 50px rgba(20, 35, 70, .1); }
.login-card h1 { margin-bottom: 10px; font-size: 38px; }
.login-note { color: var(--muted); font-size: 20px; }
.login-field { display: grid; gap: 8px; margin-top: 20px; color: #475467; font-size: 20px; }
.login-field input { width: 100%; border: 1px solid #d7ddea; border-radius: 10px; padding: 14px 16px; font-size: 22px; }
.login-error { min-height: 28px; margin: 16px 0 0; color: #b42318; font-size: 18px; }
.login-submit { width: 100%; margin-top: 4px; }
.demo-login { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }
.demo-login-title { color: #344054; font-weight: 700; font-size: 20px; }
.demo-login p { margin: 6px 0 14px; color: var(--muted); font-size: 17px; }
.demo-role-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.demo-role { padding: 11px 12px; font-size: 17px; }
.session-area { display: flex; align-items: center; gap: 14px; color: #475467; font-size: 20px; }
body.logged-out .login-screen { display: flex; }
body.logged-out .app-shell { display: none; }
.app-shell { min-height: 100vh; }
.topbar { min-height: 88px; display: flex; align-items: center; justify-content: space-between; padding: 0 5vw; background: #fff; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: baseline; gap: 14px; }
.brand strong { font-size: 30px; letter-spacing: -.03em; color: #15213b; }
.brand span { color: var(--muted); font-size: 20px; }
.role-switch { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 20px; }
.role-switch select, .filters select, .filters input { border: 1px solid #d7ddea; border-radius: 10px; background: #fff; color: #344054; padding: 14px 16px; font-size: 20px; }
.main-content { width: 100%; max-width: none; margin: 0 auto; padding: 36px 2vw 70px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.page-heading h1 { margin-bottom: 0; }
.pending-summary { display: flex; align-items: stretch; gap: 8px; min-width: 0; }
.pending-summary-title, .pending-summary-item, .pending-summary-loading { display: inline-flex; align-items: center; min-height: 48px; border-radius: 10px; }
.pending-summary-title { padding: 10px 13px; color: #7a271a; background: #fee4e2; font-size: 17px; }
.pending-summary-item { gap: 7px; padding: 9px 12px; border: 1px solid #fda29b; color: #7a271a; background: #fef3f2; font-size: 16px; white-space: nowrap; }
.pending-summary-item b { color: #b42318; font-size: 17px; }
.pending-summary-item em { color: #912018; font-style: normal; }
.pending-summary-count { color: #b42318; font-size: 1.14em; font-weight: 900; }
.pending-summary-f2 { white-space: normal; }
.pending-summary-loading { padding: 9px 12px; color: #7a271a; background: #fef3f2; font-size: 16px; }
.eyebrow { margin: 0 0 10px; color: var(--blue); font-size: 17px; font-weight: 700; letter-spacing: .12em; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 14px; font-size: clamp(40px, 4vw, 58px); letter-spacing: -.04em; }
h2 { margin-bottom: 8px; font-size: 30px; }
.subtitle, .panel-heading p { color: var(--muted); font-size: 20px; }
.panel { margin-bottom: 18px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px rgba(20, 35, 70, .04); }
.filters-panel { padding: 18px; }
.filters { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.filters input[type="search"] { min-width: 360px; flex: 1 1 420px; }
.date-filter { display: inline-flex; align-items: center; gap: 9px; color: var(--muted); font-size: 20px; }
.date-filter input { min-width: 180px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 24px 26px 18px; }
.panel-heading p { margin-bottom: 0; }
.table-wrap { overflow-x: hidden; }
.data-table { width: 100%; border-collapse: collapse; min-width: 0; table-layout: fixed; }
.data-table th, .data-table td { padding: 14px 10px; border-top: 1px solid var(--line); text-align: left; vertical-align: top; font-size: 26px; overflow-wrap: anywhere; }
.data-table th { color: #667085; background: #fbfcfe; font-size: 23px; font-weight: 600; white-space: normal; }
.data-table th:nth-child(1), .data-table td:nth-child(1) { width: 8%; }
.data-table th:nth-child(2), .data-table td:nth-child(2) { width: 11%; }
.data-table th:nth-child(3), .data-table td:nth-child(3) { width: 8%; }
.data-table th:nth-child(4), .data-table td:nth-child(4) { width: 15%; }
.data-table th:nth-child(5), .data-table td:nth-child(5) { width: 8%; }
.data-table th:nth-child(6), .data-table td:nth-child(6) { width: 16%; }
.data-table th:nth-child(7), .data-table td:nth-child(7) { width: 8%; }
.data-table th:nth-child(8), .data-table td:nth-child(8) { width: 8%; }
.data-table th:nth-child(9), .data-table td:nth-child(9) { width: 12%; }
.data-table th:nth-child(10), .data-table td:nth-child(10) { width: 11%; }
.data-table tbody tr { cursor: pointer; }
.data-table tbody tr.todo-row td:first-child { border-left: 5px solid #2563eb; }
.data-table tbody tr.preapproval-row { background: #f5f3ff; }
.data-table tbody tr.preapproval-row:hover { background: #ede9fe; }
.data-table tbody tr.returned-row { background: #fff6f4; }
.data-table tbody tr.returned-row td:first-child { border-left: 5px solid #d92d20; }
.data-table td:nth-child(6) .status-pill { white-space: nowrap; font-size: 19px; padding-left: 8px; padding-right: 8px; }
.data-table tbody tr:hover { background: #f8fbff; }
.data-table td strong { display: block; color: #1d2939; }
.data-table td small { display: block; margin-top: 5px; color: #98a2b3; font-size: 21px; }
.data-table td.description-cell { max-width: none; color: #475467; }
.status-pill { display: inline-flex; padding: 7px 10px; border-radius: 999px; font-size: 23px; white-space: normal; }
.stage-code { margin-right: 7px; font-size: .9em; letter-spacing: .02em; }
.todo-badge { display: inline-flex; margin-left: 8px; padding: 2px 7px; border-radius: 999px; background: #fff; color: #b45309; font-size: .72em; font-style: normal; font-weight: 700; white-space: nowrap; }
.joint-approval-badge { display: inline-flex; margin-left: 8px; padding: 2px 7px; border-radius: 999px; background: #eef4ff; color: #3538cd; font-size: .72em; font-style: normal; font-weight: 700; white-space: nowrap; }
.status-preapproval { flex-wrap: wrap; }
.preapproval-reminder { flex-basis: 100%; width: fit-content; margin-top: 5px; padding: 3px 7px; border-radius: 6px; color: #5b21b6; background: #ede9fe; font-size: .72em; font-style: normal; font-weight: 700; line-height: 1.35; white-space: normal; }
.return-badge { display: inline-flex; margin-left: 8px; padding: 2px 7px; border-radius: 999px; font-size: .72em; font-style: normal; font-weight: 800; white-space: nowrap; }
.return-badge-pending { color: #b42318; background: #fff; box-shadow: inset 0 0 0 1px #fda29b; }
.return-badge-history { color: #7a271a; background: #fee4e2; }
.status-pending { color: #92400e; background: #fff7ed; }
.status-confirm { color: #1d4ed8; background: #eff6ff; }
.status-approved { color: #047857; background: #ecfdf3; }
.status-returned { color: #b42318; background: #fef3f2; }
.secondary-button, .primary-button, .danger-button, .success-button, .neutral-button { border: 0; border-radius: 10px; padding: 14px 20px; cursor: pointer; font-size: 20px; }
.secondary-button, .neutral-button { background: #f2f4f7; color: #344054; }
.secondary-button { text-decoration: none; }
.primary-button, .success-button { background: var(--blue); color: #fff; }
.danger-button { background: #fff1f0; color: #b42318; }
.table-action { border: 0; min-height: 44px; padding: 10px 12px; border-radius: 8px; color: var(--blue); background: #eff6ff; cursor: pointer; white-space: normal; font-size: 26px; }
.empty-state { padding: 54px 20px; color: var(--muted); text-align: center; }
.modal-backdrop { position: fixed; inset: 0; display: none; align-items: flex-start; justify-content: flex-end; padding: 24px; background: rgba(16, 24, 40, .35); z-index: 20; }
.modal-backdrop.open { display: flex; }
.detail-modal { width: min(1880px, calc(100vw - 48px)); max-height: calc(100vh - 48px); overflow: auto; padding: 0; border-radius: 14px; background: #fff; box-shadow: 0 24px 70px rgba(16, 24, 40, .2); }
.help-backdrop { align-items: center; justify-content: center; }
.usage-help-modal { width: min(1280px, calc(100vw - 48px)); max-height: calc(100vh - 48px); overflow: auto; padding: 0; border-radius: 14px; background: #fff; box-shadow: 0 24px 70px rgba(16, 24, 40, .2); }
.usage-help-content { display: grid; gap: 26px; padding: 26px 30px 32px; }
.help-section h3 { margin-bottom: 14px; font-size: 24px; }
.help-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.help-table { width: 100%; border-collapse: collapse; font-size: 17px; }
.help-table th, .help-table td { padding: 13px 15px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; line-height: 1.55; }
.help-table th { color: #475467; background: #f8fafc; }
.help-table tr:last-child td { border-bottom: 0; }
.flow-guide { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.flow-guide > div { display: grid; grid-template-columns: 48px 1fr; gap: 3px 12px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfe; }
.flow-guide b { grid-row: 1 / 3; align-self: start; padding: 6px 0; border-radius: 8px; color: #1d4ed8; background: #eff6ff; text-align: center; }
.flow-guide strong { color: #344054; font-size: 18px; }
.flow-guide span { color: var(--muted); font-size: 16px; line-height: 1.45; }
.help-notes ul { margin: 0; padding-left: 24px; color: #475467; font-size: 17px; line-height: 1.7; }
.detail-header { display: flex; justify-content: space-between; gap: 20px; padding: 30px; border-bottom: 1px solid var(--line); }
.detail-header h2 { margin-bottom: 7px; }
.detail-header p { margin-bottom: 0; color: var(--muted); font-size: 18px; }
.return-alert { display: grid; gap: 6px; margin: 18px 30px 0; padding: 16px 18px; border: 1px solid #fda29b; border-left: 6px solid #d92d20; border-radius: 10px; color: #7a271a; background: #fff4f2; }
.return-alert strong { font-size: 22px; }
.return-alert span { font-size: 18px; line-height: 1.5; }
.joint-approval-alert { display: grid; gap: 6px; margin: 18px 30px 0; padding: 16px 18px; border: 1px solid #b2ccff; border-left: 6px solid #4e5ba6; border-radius: 10px; color: #293056; background: #f5f8ff; }
.joint-approval-alert strong { font-size: 22px; }
.joint-approval-alert span { font-size: 18px; line-height: 1.5; }
.close-button { border: 0; background: transparent; color: #667085; font-size: 36px; cursor: pointer; }
.detail-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; padding: 0 30px 30px; }
.detail-body > .detail-section { min-width: 0; }
.detail-body > .detail-section:nth-child(1) { padding-right: 28px; }
.detail-body > .detail-section:nth-child(2) { padding-left: 28px; border-left: 1px solid var(--line); }
.detail-body > .detail-section:nth-child(3) { grid-column: 1 / -1; }
.detail-section { padding: 28px 0; border-bottom: 1px solid var(--line); }
.detail-section h3 { margin-bottom: 18px; font-size: 24px; }
.detail-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 28px; }
.detail-field-wide { grid-column: 1 / -1; }
.detail-field label { display: block; margin-bottom: 6px; color: #98a2b3; font-size: 18px; }
.detail-field span { color: #344054; font-size: 22px; }
.detail-note { margin: 0; color: #475467; white-space: pre-wrap; line-height: 1.7; font-size: 20px; }
.timeline { display: grid; gap: 20px; }
.timeline-item { display: grid; grid-template-columns: 12px 180px 1fr; gap: 14px; align-items: start; color: #475467; font-size: 18px; }
.timeline-dot { width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: var(--blue); }
.timeline-item time { color: #98a2b3; }
.timeline-item strong { color: #344054; }
.timeline-item p { margin: 4px 0 0; white-space: pre-wrap; }
.detail-actions { display: flex; justify-content: flex-end; gap: 14px; padding: 22px 30px; border-top: 1px solid var(--line); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.field { display: grid; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { color: #475467; font-size: 20px; }
.field input, .field textarea { width: 100%; border: 1px solid #d7ddea; border-radius: 10px; padding: 14px; font-size: 22px; }
.field textarea { min-height: 130px; resize: vertical; }
.inline-form { padding: 24px 30px; background: #fbfcfe; border-bottom: 1px solid var(--line); }
.inline-form h3 { margin-bottom: 18px; font-size: 24px; }
.inline-form small { font-size: 17px; color: var(--muted); }
.flow-mode-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.flow-mode-option { display: flex; gap: 12px; align-items: flex-start; min-height: 112px; padding: 16px; border: 2px solid #d7ddea; border-radius: 12px; background: #fff; cursor: pointer; }
.flow-mode-option:has(input:checked) { border-color: var(--blue); background: #eff6ff; box-shadow: 0 0 0 2px rgba(37, 99, 235, .1); }
.flow-mode-option input { width: 20px; min-width: 20px; height: 20px; margin: 3px 0 0; accent-color: var(--blue); }
.flow-mode-option span { display: grid; gap: 6px; }
.flow-mode-option strong { color: #1d2939; font-size: 20px; }
.flow-mode-option small { line-height: 1.5; }
.flow-mode-summary { padding: 14px 16px; border: 1px solid #b2ccff; border-radius: 10px; background: #eff6ff; }
.flow-mode-summary strong { color: #1d4ed8; font-size: 20px; }
.flow-mode-summary span { color: var(--muted); font-size: 16px; }
.media-attachments { display: block; margin-top: 22px; }
.attachment-label { display: block; margin-bottom: 12px; color: #475467; font-weight: 700; font-size: 18px; }
.image-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.image-card { display: block; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: #344054; text-decoration: none; }
.image-card img { display: block; width: 100%; height: 150px; object-fit: cover; border-radius: 8px; background: #f2f4f7; }
.image-card img.image-load-error { object-fit: contain; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; padding: 20px; border-top: 1px solid var(--line); }
.pagination-info { color: var(--muted); font-size: 18px; }
.pagination-button:disabled { cursor: not-allowed; opacity: .45; }
@media (max-width: 900px) {
  .detail-body { grid-template-columns: 1fr; }
  .detail-body > .detail-section:nth-child(1) { padding-right: 0; }
  .detail-body > .detail-section:nth-child(2) { padding-left: 0; border-left: 0; }
  .detail-body > .detail-section:nth-child(3) { grid-column: auto; }
}
@media (max-width: 720px) {
  .topbar { height: auto; align-items: flex-start; flex-direction: column; gap: 12px; padding: 18px 5vw; }
  .main-content { padding-top: 28px; }
  .detail-fields, .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .modal-backdrop { padding: 0; }
  .detail-modal { max-height: 100vh; border-radius: 0; }
  .usage-help-modal { width: 100vw; max-height: 100vh; border-radius: 0; }
  .usage-help-content { padding: 20px 18px 24px; }
  .flow-guide { grid-template-columns: 1fr; }
}

/* 1920x1080 and smaller desktop screens: keep the complete table visible. */
@media (max-width: 1920px) {
  .topbar { padding-left: 28px; padding-right: 28px; }
  .brand strong { font-size: 26px; }
  .brand span, .session-area, .role-switch { font-size: 17px; }
  .main-content { padding: 28px 24px 56px; }
  h1 { font-size: 46px; }
  .subtitle, .panel-heading p { font-size: 17px; }
  .filters { gap: 10px; }
  .role-switch select, .filters select, .filters input { padding: 10px 12px; font-size: 17px; }
  .filters input[type="search"] { min-width: 280px; }
  .date-filter { font-size: 17px; }
  .date-filter input { min-width: 145px; }
  .data-table th, .data-table td { padding: 10px 6px; font-size: 16px; }
  .data-table th { font-size: 13px; }
  .data-table td small { font-size: 13px; }
  .data-table td:nth-child(6) .status-pill { font-size: 14px; white-space: normal; line-height: 1.35; }
  .table-action { font-size: 16px; padding: 7px 8px; }
  .detail-modal { width: min(1500px, calc(100vw - 32px)); }
  .detail-header { padding: 24px; }
  .detail-body { padding: 0 24px 24px; column-gap: 20px; }
  .detail-body > .detail-section:nth-child(1) { padding-right: 20px; }
  .detail-body > .detail-section:nth-child(2) { padding-left: 20px; }
  .detail-section { padding: 22px 0; }
  .detail-section h3 { font-size: 21px; }
  .detail-field label { font-size: 16px; }
  .detail-field span { font-size: 19px; }
  .detail-actions { padding: 18px 24px; }
}

/* Narrow desktop/tablet widths: prioritize one-screen browsing over oversized text. */
@media (max-width: 1280px) and (min-width: 721px) {
  .topbar { padding-left: 18px; padding-right: 18px; }
  .brand { gap: 8px; }
  .brand strong { font-size: 22px; }
  .brand span, .session-area, .role-switch { font-size: 15px; }
  .session-area { gap: 8px; }
  .main-content { padding: 22px 14px 44px; }
  .page-heading { align-items: flex-start; gap: 14px; }
  .pending-summary { justify-content: flex-end; flex-wrap: wrap; gap: 6px; }
  .pending-summary-title, .pending-summary-item, .pending-summary-loading { min-height: 40px; }
  .pending-summary-title, .pending-summary-item, .pending-summary-loading { padding: 7px 9px; font-size: 13px; }
  .pending-summary-item b { font-size: 14px; }
  h1 { font-size: 38px; }
  .subtitle, .panel-heading p { font-size: 15px; }
  .filters { gap: 8px; }
  .role-switch select, .filters select, .filters input { padding: 8px 10px; font-size: 15px; }
  .filters input[type="search"] { min-width: 220px; flex-basis: 260px; }
  .date-filter { font-size: 15px; gap: 5px; }
  .date-filter input { min-width: 125px; }
  .data-table th, .data-table td { padding: 7px 5px; font-size: 13px; }
  .data-table th { font-size: 11px; }
  .data-table td strong { font-size: 14px; }
  .data-table td small { font-size: 11px; }
  .data-table td:nth-child(6) .status-pill { font-size: 12px; padding: 4px 5px; }
  .table-action { min-height: 34px; padding: 5px 6px; font-size: 13px; }
  .detail-modal { width: min(1100px, calc(100vw - 24px)); }
  .detail-header { padding: 18px; }
  .detail-body { padding: 0 18px 18px; column-gap: 14px; }
  .detail-body > .detail-section:nth-child(1) { padding-right: 14px; }
  .detail-body > .detail-section:nth-child(2) { padding-left: 14px; }
  .detail-section { padding: 16px 0; }
  .detail-section h3 { font-size: 18px; }
  .detail-fields { gap: 12px 16px; }
  .detail-field label { font-size: 13px; }
  .detail-field span { font-size: 16px; }
  .detail-actions { padding: 12px 18px; }
}

/* Desktop presentation scale: leave the header usable while making the home content lighter. */
@media (min-width: 721px) {
  .main-content { zoom: .9; }
  .detail-modal { width: 75vw; max-width: 1880px; }
}

/* Mobile layout: switch the wide history table to touch-friendly cards. */
@media (max-width: 720px) {
  .page-heading { display: block; margin-bottom: 18px; }
  .page-heading h1 { margin-bottom: 12px; }
  .pending-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .pending-summary-title { display: none; }
  .pending-summary-item { min-height: 0; padding: 7px 8px; font-size: 12px; white-space: normal; }
  .pending-summary-item b { font-size: 13px; }
  .pending-summary-item em { display: none; }
  .pending-summary-f2 { grid-column: 1 / -1; }
  .pending-summary-loading { grid-column: 1 / -1; min-height: 0; padding: 7px 8px; font-size: 12px; }
  html, body { min-width: 0; overflow-x: hidden; }
  body { font-size: 16px; }
  .topbar { min-height: 0; align-items: stretch; gap: 12px; padding: 14px 16px; }
  .brand { align-items: baseline; justify-content: space-between; gap: 8px; }
  .brand strong { font-size: 23px; }
  .brand span { font-size: 15px; }
  .session-area { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; font-size: 14px; }
  .session-area > span { flex: 1 1 100%; order: -1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .session-area > a, .session-area > button { flex: 1 1 0; min-height: 44px; padding: 10px 8px; text-align: center; font-size: 14px; }
  .main-content { padding: 20px 10px 40px; }
  .page-heading { margin: 0 6px 16px; }
  h1 { margin-bottom: 0; font-size: 32px; }
  .panel { border-radius: 10px; }
  .filters-panel { padding: 10px; }
  .filters { display: grid; grid-template-columns: 1fr; gap: 8px; align-items: stretch; }
  .filters input[type="search"], .filters select, .filters input { width: 100%; min-width: 0; flex: none; min-height: 44px; padding: 9px 12px; font-size: 16px; }
  .date-filter { display: grid; grid-template-columns: 68px minmax(0, 1fr); gap: 8px; align-items: center; font-size: 15px; }
  .date-filter input { min-width: 0; }
  .filters > button { width: 100%; min-height: 44px; font-size: 16px; }
  .panel-heading { padding: 16px 14px 12px; }
  .panel-heading h2 { font-size: 22px; }
  .panel-heading p { font-size: 14px; line-height: 1.45; }
  .table-wrap { overflow: visible; }
  .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
  .data-table { border-collapse: separate; }
  .data-table thead { display: none; }
  .data-table tbody { display: grid; gap: 10px; padding: 0 10px 10px; }
  .data-table tbody tr { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: 0 4px 12px rgba(20, 35, 70, .05); }
  .data-table tbody tr.todo-row td:first-child { border-left: 0; }
  .data-table tbody tr.todo-row { border-left: 4px solid #2563eb; }
  .data-table tbody tr.returned-row { border-left: 4px solid #d92d20; }
  .data-table td { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 8px; align-items: start; padding: 7px 0; border-top: 1px solid #f0f2f6; font-size: 15px; line-height: 1.4; }
  .data-table td:first-child { display: block; padding: 0 0 9px; border-top: 0; }
  .data-table td:last-child { display: block; padding: 9px 0 0; }
  .data-table td:not(:first-child):not(:last-child)::before { color: #98a2b3; font-size: 13px; content: ""; }
  .data-table td:nth-child(2)::before { content: "设备 / 模具"; }
  .data-table td:nth-child(3)::before { content: "发生日期"; }
  .data-table td:nth-child(4)::before { content: "故障简述"; }
  .data-table td:nth-child(5)::before { content: "申请部门"; }
  .data-table td:nth-child(6)::before { content: "费用流程"; }
  .data-table td:nth-child(7)::before { content: "修理状态"; }
  .data-table td:nth-child(8)::before { content: "修理厂家"; }
  .data-table td:nth-child(9)::before { content: "修理费用"; }
  .data-table td:nth-child(10)::before { content: "最后更新"; }
  .data-table td strong { font-size: 19px; }
  .data-table td small { margin-top: 3px; font-size: 13px; }
  .data-table td:nth-child(6) .status-pill { display: inline-flex; width: fit-content; max-width: 100%; white-space: normal; font-size: 14px; line-height: 1.35; }
  .data-table td:nth-child(7) .status-pill { display: inline-flex; width: fit-content; font-size: 14px; }
  .table-action { width: 100%; min-height: 44px; font-size: 16px; }
  .empty-state { padding: 40px 16px; font-size: 16px; }
  .pagination { gap: 8px; padding: 16px 10px; }
  .pagination-button { min-height: 44px; padding: 9px 12px; font-size: 15px; }
  .pagination-info { font-size: 14px; }
  .modal-backdrop { padding: 0; align-items: stretch; }
  .detail-modal, .usage-help-modal { width: 100vw; max-width: none; height: 100dvh; max-height: 100dvh; border-radius: 0; }
  .detail-header { gap: 10px; padding: 18px 16px 14px; }
  .detail-header h2 { font-size: 22px; line-height: 1.3; }
  .detail-header p { font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
  .close-button { min-width: 44px; min-height: 44px; font-size: 32px; }
  .return-alert, .joint-approval-alert { margin: 12px 16px 0; padding: 12px 14px; }
  .return-alert strong, .joint-approval-alert strong { font-size: 16px; }
  .return-alert span, .joint-approval-alert span { font-size: 14px; }
  .inline-form { padding: 16px; }
  .inline-form h3 { font-size: 20px; }
  .form-grid { grid-template-columns: 1fr; gap: 12px; }
  .field.full { grid-column: auto; }
  .field label { font-size: 15px; }
  .field input, .field select, .field textarea { min-height: 44px; padding: 10px 12px; font-size: 16px; }
  .inline-form small { font-size: 13px; line-height: 1.45; }
  .flow-mode-options { grid-template-columns: 1fr; gap: 8px; }
  .flow-mode-option { min-height: 0; padding: 12px; }
  .flow-mode-option input { width: 20px; min-width: 20px; height: 20px; min-height: 20px; padding: 0; }
  .flow-mode-option strong, .flow-mode-summary strong { font-size: 16px; }
  .flow-mode-summary span { font-size: 13px; }
  .detail-body { display: block; overflow: visible; padding: 0 16px 18px; }
  .detail-section { padding: 18px 0; margin-bottom: 0; }
  .detail-body > .detail-section:nth-child(1), .detail-body > .detail-section:nth-child(2) { padding-right: 0; padding-left: 0; border-left: 0; }
  .detail-section h3 { margin-bottom: 12px; font-size: 19px; }
  .detail-fields { grid-template-columns: 1fr; gap: 12px; }
  .detail-field-wide { grid-column: auto; }
  .detail-field label { margin-bottom: 3px; font-size: 14px; }
  .detail-field span { font-size: 16px; line-height: 1.5; overflow-wrap: anywhere; }
  .timeline { gap: 14px; }
  .timeline-item { grid-template-columns: 10px 112px minmax(0, 1fr); gap: 8px; font-size: 14px; }
  .timeline-item time { font-size: 12px; line-height: 1.35; overflow-wrap: anywhere; }
  .timeline-item strong, .timeline-item p { font-size: 14px; line-height: 1.45; }
  .detail-actions { position: sticky; bottom: 0; z-index: 2; flex-wrap: wrap; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, .97); }
  .detail-actions > button { flex: 1 1 30%; min-height: 46px; padding: 10px 8px; font-size: 15px; }
  .detail-actions > .detail-note { flex: 1 1 100%; text-align: center; }
  .media-attachments { margin-top: 16px; }
  .attachment-label { margin-bottom: 8px; font-size: 15px; }
  .image-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .image-card { padding: 5px; border-radius: 8px; }
  .image-card img { height: 120px; border-radius: 5px; }
  .usage-help-content { padding: 16px; }
  .help-section h3 { font-size: 19px; }
  .help-table { font-size: 14px; min-width: 620px; }
  .help-table th, .help-table td { padding: 10px; }
  .flow-guide { gap: 8px; }
  .flow-guide > div { grid-template-columns: 40px 1fr; padding: 10px; }
  .flow-guide strong { font-size: 15px; }
  .flow-guide span, .help-notes ul { font-size: 14px; }
}

/* Final mobile card override: keep the history list compact after the base mobile rules. */
@media (max-width: 720px) {
  .data-table tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 12px;
    align-items: start;
    padding: 8px 10px;
  }

  .data-table td {
    display: block;
    width: auto !important;
    max-width: 100%;
    min-width: 0;
    padding: 5px 0;
    font-size: 14px;
    line-height: 1.35;
  }

  .data-table td:first-child,
  .data-table td:last-child,
  .data-table td:nth-child(4),
  .data-table td:nth-child(6),
  .data-table td:nth-child(7) {
    grid-column: 1 / -1;
  }

  .data-table td:first-child { padding-bottom: 7px; }
  .data-table td:last-child { padding-top: 8px; }
  .data-table td:not(:first-child):not(:last-child)::before {
    display: inline;
    margin-right: 5px;
    color: #98a2b3;
    font-size: 12px;
    line-height: 1.35;
  }
  .data-table td strong { font-size: 17px; }
  .data-table td small { display: inline; margin-left: 5px; font-size: 12px; }
  .data-table td:nth-child(4) { overflow-wrap: anywhere; }
  .data-table td:nth-child(6) .status-pill,
  .data-table td:nth-child(7) .status-pill {
    display: inline-flex;
    max-width: 100%;
    vertical-align: middle;
    font-size: 13px;
    line-height: 1.3;
  }
  .data-table td:nth-child(6) .stage-code { margin-right: 3px; }
  .table-action { min-height: 40px; font-size: 15px; }
}
