/* BOM 协同工具：克制、可信、高密度的工业运营控制台 */
:root {
  --canvas: #f3f6fa;
  --surface: #ffffff;
  --surface-subtle: #f7f9fc;
  --surface-strong: #edf2f8;
  --ink: #162033;
  --ink-soft: #42516a;
  --muted: #718096;
  --line: #dfe6ef;
  --line-strong: #cbd5e1;
  --brand: #2456d8;
  --brand-dark: #183eaa;
  --brand-soft: #eaf0ff;
  --success: #087a55;
  --success-soft: #e7f7f0;
  --warning: #9a5b08;
  --warning-soft: #fff4dd;
  --danger: #b42335;
  --danger-soft: #fff0f2;
  --info: #2463a8;
  --info-soft: #eaf4ff;
  --shadow-sm: 0 1px 2px rgba(20, 32, 51, .04), 0 4px 14px rgba(20, 32, 51, .04);
  --shadow-md: 0 16px 40px rgba(20, 32, 51, .10);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shell: 1440px;
  --font-sans: Inter, "SF Pro Text", "Segoe UI", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { color: var(--ink); background: var(--canvas); font-family: var(--font-sans); line-height: 1.5; -webkit-font-smoothing: antialiased; }
body { margin: 0; min-width: 320px; background: var(--canvas); color: var(--ink); font-size: 14px; user-select: text; -webkit-user-select: text; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, input[type="checkbox"], input[type="file"], select { cursor: pointer; }
button { border: 0; }
img, svg { max-width: 100%; }
form { margin: 0; }
.shell { width: min(calc(100% - 48px), var(--shell)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 100; left: 16px; top: -80px; padding: 10px 14px; color: #fff; background: var(--brand); border-radius: var(--radius-sm); }
.skip-link:focus { top: 12px; }

/* Header */
.app-header { position: sticky; top: 0; z-index: 20; height: 66px; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 11px; min-width: 0; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: #f5f5f5; }
.brand-mark img { display: block; width: 100%; height: 100%; object-fit: cover; }
.brand-copy { display: flex; flex-direction: column; line-height: 1.18; }
.brand-copy strong { font-size: 14px; letter-spacing: -.01em; }
.brand-copy small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.user-chip { display: inline-flex; align-items: center; gap: 8px; margin-right: 4px; color: var(--ink-soft); font-size: 13px; }
.user-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.app-main { padding-block: 36px 64px; }

/* Type and page framing */
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { color: var(--ink); letter-spacing: -.025em; }
h1 { margin-bottom: 10px; font-size: clamp(26px, 3vw, 38px); line-height: 1.14; font-weight: 720; }
h2 { margin: 0; font-size: 18px; line-height: 1.3; font-weight: 690; }
.eyebrow, .section-kicker { margin-bottom: 7px; color: var(--brand); font-size: 11px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; margin-bottom: 28px; }
.page-heading > div:first-child { flex: 1 1 auto; min-width: 0; }
.page-lead { margin-bottom: 0; color: var(--ink-soft); font-size: 15px; }
.heading-meta { display: flex; align-items: center; gap: 20px; padding-bottom: 5px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.heading-meta span { display: inline-flex; align-items: center; gap: 7px; }
.heading-meta strong { display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--ink-soft); font-size: 10px; }
.breadcrumb { display: flex; align-items: center; gap: 8px; margin: -4px 0 22px; color: var(--muted); font-size: 12px; }
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb span:last-child { color: var(--ink-soft); }

/* Panels */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 24px 26px 20px; }
.panel-header.compact { padding-bottom: 16px; }
.panel-header.table-heading { align-items: center; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, .8fr); gap: 20px; margin-bottom: 20px; }
.upload-panel { min-height: 310px; }
.file-badge { padding: 5px 9px; border: 1px solid #b9c8ed; border-radius: 5px; color: var(--brand); background: var(--brand-soft); font-size: 10px; font-weight: 800; letter-spacing: .1em; }
.upload-form { padding: 0 26px 26px; }
.process-panel { background: var(--ink); border-color: var(--ink); color: #fff; }
.process-panel h2 { color: #fff; }
.process-panel .section-kicker { color: #9bb7ff; }
.process-list { display: grid; gap: 3px; margin: 0; padding: 0 24px; list-style: none; }
.process-list li { display: grid; grid-template-columns: 29px 1fr; gap: 12px; align-items: start; padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,.10); }
.process-list li > span { display: grid; place-items: center; width: 26px; height: 26px; border: 1px solid rgba(255,255,255,.22); border-radius: 50%; color: #a9c0ff; font-size: 11px; font-weight: 700; }
.process-list strong, .process-list small { display: block; }
.process-list strong { font-size: 13px; }
.process-list small { margin-top: 3px; color: #aeb8ca; font-size: 11px; line-height: 1.5; }
.stub-note { display: grid; gap: 3px; margin: 18px 24px 24px; padding: 12px 14px; border-radius: 8px; color: #cbd5e6; background: rgba(255,255,255,.07); font-size: 11px; }
.stub-note strong { color: #fff; font-size: 12px; }
.recent-panel { overflow: hidden; }
.record-count { color: var(--muted); font-size: 12px; }

/* Forms */
.field-group { display: grid; gap: 7px; position: relative; }
.field-group + .field-group { margin-top: 18px; }
.field-group label { color: var(--ink); font-size: 12px; font-weight: 670; }
input[type="text"], input[type="password"], input[type="number"], input[type="email"], input[type="date"], input[type="file"], select, textarea {
  width: 100%; min-height: 42px; padding: 9px 11px; color: var(--ink); background: #fff; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); outline: none; transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
textarea { min-height: 78px; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: #aebacc; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(36, 86, 216, .14); }
input[type="file"] { padding: 8px; background: var(--surface-subtle); }
input[type="file"]::file-selector-button { margin-right: 12px; padding: 7px 12px; border: 1px solid var(--line-strong); border-radius: 5px; color: var(--ink); background: #fff; font-weight: 650; }
.file-input-wrap { padding: 18px; border: 1px dashed #b9c6d8; border-radius: var(--radius-md); background: var(--surface-subtle); }
.field-help { display: flex; justify-content: space-between; gap: 16px; color: var(--muted); font-size: 11px; }
.field-help-single { margin: -1px 0 0; color: var(--muted); font-size: 11px; }
.field-error, .inline-error { margin: 0; color: var(--danger); font-size: 12px; }
.field-error { position: absolute; top: 100%; left: 0; right: 0; margin-top: 4px; line-height: 1.3; }
.work-order-fields .field-group { padding-bottom: 20px; }
.input-error { border-color: var(--danger) !important; box-shadow: 0 0 0 3px rgba(214, 40, 40, .14); }
.inline-error { margin: 0 26px 14px; padding: 10px 12px; border-radius: 6px; background: var(--danger-soft); }
.required { margin-left: 5px; color: var(--danger); font-size: 10px; font-weight: 650; }
.form-stack { padding: 0 22px 23px; }
.form-panel + .form-panel { margin-top: 16px; }

/* Buttons and links */
.button { user-select: none; -webkit-user-select: none; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 12px; padding: 9px 16px; border: 1px solid transparent; border-radius: var(--radius-sm); font-weight: 670; font-size: 13px; line-height: 1; transition: background .15s ease, border-color .15s ease, color .15s ease, transform .12s ease; }
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button:focus-visible, .text-link:focus-visible, .text-button:focus-visible, a:focus-visible { outline: 3px solid rgba(36, 86, 216, .28); outline-offset: 2px; }
.button-primary { color: #fff; background: var(--brand); border-color: var(--brand); box-shadow: 0 6px 16px rgba(36,86,216,.16); }
.button-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.button-ghost { color: var(--ink-soft); background: #fff; border-color: var(--line-strong); }
.button-ghost:hover { color: var(--ink); border-color: #aebacc; }
.button-quiet { color: var(--ink-soft); background: transparent; }
.button-quiet:hover { color: var(--brand); background: var(--brand-soft); }
.button-sm { min-height: 34px; padding: 7px 11px; font-size: 12px; }
.button-block { width: 100%; }
.text-link, .text-button { color: var(--brand); font-size: 12px; font-weight: 680; }
.text-link:hover, .text-button:hover { color: var(--brand-dark); }
.text-button { padding: 4px; background: transparent; }
.text-button-danger { color: var(--danger); }
.text-button-danger:hover { color: #8e1b2b; background: var(--danger-soft); }

/* Messages and states */
.message-stack { display: grid; gap: 10px; margin-bottom: 20px; }
.message { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 11px 14px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); color: var(--ink-soft); font-size: 13px; }
.message-indicator { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: var(--info); }
.message-success { border-color: #bde5d5; background: var(--success-soft); }
.message-success .message-indicator { background: var(--success); }
.message-error, .message-danger { border-color: #f1bdc5; background: var(--danger-soft); color: #7f1d2d; }
.message-error .message-indicator, .message-danger .message-indicator { background: var(--danger); }
.status { display: inline-flex; align-items: center; gap: 7px; min-height: 24px; padding: 3px 9px; border-radius: 999px; color: var(--ink-soft); background: var(--surface-strong); font-size: 11px; font-weight: 650; white-space: nowrap; }
.status > span { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.status-parsed, .status-completed, .status-configured, .status-generated { color: var(--success); background: var(--success-soft); }
.status-parsed > span, .status-completed > span, .status-configured > span, .status-generated > span { background: var(--success); }
.status-pending, .status-draft { color: var(--warning); background: var(--warning-soft); }
.status-pending > span, .status-draft > span { background: var(--warning); }
.status-failed, .status-error { color: var(--danger); background: var(--danger-soft); }
.status-failed > span, .status-error > span { background: var(--danger); }

/* Tables */
.table-scroll { width: 100%; overflow-x: auto; border-top: 1px solid var(--line); }
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.data-table th, .data-table td { padding: 13px 16px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); }
.data-table th:first-child, .data-table td:first-child { padding-left: 26px; }
.data-table th:last-child, .data-table td:last-child { padding-right: 26px; }
.data-table thead th { position: sticky; top: 0; z-index: 2; color: var(--muted); background: var(--surface-subtle); font-size: 10px; font-weight: 750; letter-spacing: .055em; text-transform: uppercase; white-space: nowrap; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background .12s ease; }
.data-table tbody tr:hover { background: #f8faff; }
.numeric { text-align: right !important; font-variant-numeric: tabular-nums; }
.align-right { text-align: right !important; }
.tabular { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.muted { color: var(--muted); }
.file-name { display: flex; align-items: center; gap: 11px; min-width: 220px; }
.file-name strong, .file-name small, .material-cell strong, .material-cell span { display: block; }
.file-name strong { max-width: 460px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.file-name small, .material-cell span { margin-top: 2px; color: var(--muted); font-size: 11px; }
.file-icon { display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 auto; border-radius: 7px; color: var(--success); background: var(--success-soft); font-size: 9px; font-weight: 850; letter-spacing: .04em; }
.empty-state { display: grid; justify-items: center; gap: 5px; padding: 42px 20px; text-align: center; }
.empty-state strong { font-size: 14px; }
.empty-state span { color: var(--muted); font-size: 12px; }

/* Workflow */
.workflow-heading { align-items: center; }
.workflow-progress { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.workflow-progress span { display: flex; align-items: center; gap: 6px; }
.workflow-progress b { display: grid; place-items: center; width: 23px; height: 23px; border: 1px solid var(--line-strong); border-radius: 50%; background: #fff; font-size: 10px; }
.workflow-progress span.active { color: var(--ink); font-weight: 650; }
.workflow-progress span.active b { color: #fff; background: var(--brand); border-color: var(--brand); }
.workflow-progress i { display: block; width: 24px; height: 1px; background: var(--line-strong); }
.workflow-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.material-panel { min-width: 0; overflow: hidden; }
.material-table-wrap { max-height: 650px; }
.material-table thead th { top: 0; }
.material-table tbody tr:has(.row-check:checked) { background: var(--brand-soft); }
.check-col { width: 48px; text-align: center !important; }
.row-check { width: 17px; height: 17px; accent-color: var(--brand); }
.material-code { color: #243c68; font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: 12px; white-space: nowrap; }
.buyer-text { display: inline-block; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-soft); font-size: 12px; }
.selection-tools { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 11px; }
.workflow-sidebar { position: sticky; top: 86px; }
.generate-button { min-height: 48px; margin-top: 16px; }
.submit-note { margin: 9px 10px 0; color: var(--muted); text-align: center; font-size: 10px; line-height: 1.5; }

/* Results */
.result-hero { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; margin-bottom: 22px; padding: 24px 26px; border: 1px solid #bde5d5; border-radius: var(--radius-lg); background: linear-gradient(110deg, #effbf6 0%, #f8fcfa 70%); }
.success-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; color: #fff; background: var(--success); font-size: 20px; font-weight: 800; }
.result-hero h1 { margin-bottom: 6px; font-size: clamp(22px, 2.4vw, 30px); }
.result-hero p:last-child { max-width: 760px; margin: 0; color: var(--ink-soft); font-size: 13px; }
.result-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) 340px; gap: 20px; align-items: start; }
.result-main { overflow: hidden; }
.metric { min-width: 130px; padding-left: 20px; border-left: 1px solid var(--line); text-align: right; }
.metric small, .metric strong { display: block; }
.metric small { color: var(--muted); font-size: 10px; }
.metric strong { margin-top: 3px; font-size: 21px; font-variant-numeric: tabular-nums; }
.total-quantity strong { color: var(--brand); font-size: 15px; }
.total-quantity span { color: var(--muted); font-size: 11px; }
.order-summary { padding-bottom: 20px; }
.summary-list { margin: 0; padding: 0 22px 18px; }
.summary-list > div { display: grid; gap: 4px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.summary-list dt { color: var(--muted); font-size: 10px; }
.summary-list dd { margin: 0; font-size: 13px; font-weight: 650; overflow-wrap: anywhere; }
.order-summary > .button { width: calc(100% - 44px); margin-inline: 22px; }
.order-summary > .button + .button { margin-top: 8px; }

/* Login */
.login-page { background: #eef2f7; }
.login-page .app-header .header-actions { display: none; }
.login-page .app-main { min-height: calc(100vh - 66px); display: grid; align-items: center; padding-block: 48px; }
.login-layout { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: clamp(50px, 9vw, 140px); align-items: center; width: min(1080px, 100%); margin-inline: auto; }
.login-intro h1 { max-width: 650px; font-size: clamp(36px, 5vw, 58px); line-height: 1.08; letter-spacing: -.045em; }
.login-intro > p:not(.eyebrow) { max-width: 520px; color: var(--ink-soft); font-size: 16px; }
.login-proof { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 34px; }
.login-proof span { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-soft); font-size: 12px; }
.login-proof strong { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; color: var(--brand); background: var(--brand-soft); font-size: 10px; }
.login-card { padding: 34px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-md); }
.login-card-head { margin-bottom: 24px; }
.login-card-head h2 { margin-bottom: 7px; font-size: 25px; }
.login-card-head p:last-child { margin: 0; color: var(--muted); font-size: 13px; }
.auth-form { margin-top: 18px; }
.auth-form .button { min-height: 46px; margin-top: 24px; }
.login-footnote { margin: 18px 0 0; color: var(--muted); text-align: center; font-size: 11px; }

/* Compact utility layouts */
.page-heading-simple { align-items: center; margin-bottom: 20px; }
.page-heading-simple h1 { margin: 0; font-size: 28px; }
.workflow-heading-simple .page-lead { margin-top: 5px; font-size: 13px; }
.upload-panel-simple { min-height: 0; margin-bottom: 20px; }
.upload-form-simple { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: end; }
.upload-form-simple .message { grid-column: 1 / -1; }
.upload-form-simple .button { min-height: 42px; margin-bottom: 23px; }
.upload-field { min-width: 0; }
.login-layout-simple { display: block; width: min(400px, 100%); margin-inline: auto; }
.login-layout-simple .login-card-head { margin-bottom: 20px; }
.login-layout-simple .login-card-head h1 { margin: 0; font-size: 25px; }
.result-hero-simple { padding-block: 20px; }
.result-hero-simple h1 { margin-bottom: 3px; font-size: 24px; }
.result-hero-simple p { margin: 0; color: var(--ink-soft); font-size: 12px; }

/* Numbered work orders */
.work-order-upload-panel { width: 100%; }
.work-order-upload-form { padding: 0 26px 26px; }
.bom-recognition-status { display: flex; align-items: center; gap: 10px; margin-top: 20px; padding: 12px 14px; border: 1px solid #bfdbfe; border-radius: var(--radius-md); color: #1d4ed8; background: #eff6ff; font-weight: 700; }
.bom-recognition-status[hidden] { display: none; }
.recognition-spinner { width: 18px; height: 18px; flex: 0 0 auto; border: 2px solid #bfdbfe; border-top-color: #2563eb; border-radius: 50%; animation: recognition-spin .75s linear infinite; }
@keyframes recognition-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .recognition-spinner { animation-duration: 1.5s; } }
.purchasing-agent-panel + .purchasing-agent-panel { margin-top: 24px; }
.purchasing-agent-import-body { display: grid; gap: 18px; padding: 0 26px 26px; }
.purchasing-agent-import-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.purchasing-agent-import-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px; }
.purchasing-agent-import-form .button { white-space: nowrap; }
.agent-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.agent-actions form { margin: 0; }
.purchasing-agent-edit-panel { max-width: 680px; }
.purchasing-agent-edit-form { padding-top: 4px; }
.form-actions, .sticky-form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.form-actions { margin-top: 24px; }
.work-order-heading { align-items: center; }
.work-order-heading h1 { margin-bottom: 7px; font-size: 30px; }
.work-order-heading .page-lead strong { color: var(--ink); }
#main-content h1,
.selectable-text,
.material-code,
.selectable-table th,
.selectable-table td,
.work-order-lines-table th,
.work-order-lines-table td {
  cursor: text;
  user-select: text !important;
  -webkit-user-select: text !important;
}
.meta-divider { margin-inline: 9px; color: var(--line-strong); }
.work-order-header-panel { margin-bottom: 20px; }
.drawing-field-button { width: 100%; min-height: 42px; padding: 9px 11px; cursor: pointer; }
.drawing-field input[data-drawing-upload] { display: none; }
fieldset:disabled .drawing-field-button { cursor: not-allowed; opacity: .6; }
.work-order-fields { display: grid; grid-template-columns: repeat(5, minmax(150px, 1fr)); gap: 18px 16px; padding: 0 26px 26px; }
.work-order-fields .field-group + .field-group { margin-top: 0; }
.drawing-match-list { margin-top: 4px; font-size: 11px; font-weight: 400; line-height: 1.45; }
.drawing-match-list a { font: inherit; font-weight: 400; }
.drawing-match-item { display: flex; align-items: center; justify-content: center; gap: 6px; }
.drawing-match-item > a:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawing-delete-link { flex: 0 0 auto; color: var(--danger); font-size: 10px; text-decoration: none; }
.drawing-delete-link:hover { text-decoration: underline; }
.work-order-lines-table select { font: inherit; font-size: 13px; font-weight: 400; }
.work-order-lines-panel { overflow: hidden; }
.work-order-lines-table { font-size: 15px; }
.work-order-lines-table th,
.work-order-lines-table td { text-align: center; vertical-align: middle; }
.work-order-lines-table thead th { font-size: 11px; }
.work-order-lines-table .choice-col { width: 76px; padding-inline: 6px; text-align: center; }
.work-order-lines-table .material-col { min-width: 190px; }
.work-order-lines-table .drawing-action-col { width: 96px; text-align: center; }
.line-drawing-upload-button { display: inline-flex; align-items: center; justify-content: center; width: 80px; min-width: 80px; max-width: 80px; height: 40px; min-height: 40px; max-height: 40px; padding: 0 8px; box-sizing: border-box; font-size: 12px; cursor: pointer; }
.line-drawing-upload-button input { display: none; }
.line-drawing-upload-button.is-loading { opacity: .6; pointer-events: none; }
.work-order-lines-table .purchasing-agent-col { width: 312px; }
.purchasing-agent-col select { width: 300px; min-width: 300px; max-width: 300px; }
.work-order-lines-table .quantity-col,
.work-order-lines-table .unit-usage-col { width: 106px; padding-inline: 8px; }
.work-order-lines-table .unit-col { width: 32px; padding-inline: 0; white-space: nowrap; }
.work-order-lines-table input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--brand); }
.work-order-lines-table input[type="number"] { font-size: 14px; font-variant-numeric: tabular-nums; }
.unit-usage-col input { width: 90px; min-width: 90px; max-width: 90px; height: 40px; min-height: 40px; max-height: 40px; flex: 0 0 90px; box-sizing: border-box; }
.quantity-col input { width: 90px; min-width: 90px; max-width: 90px; height: 40px; min-height: 40px; max-height: 40px; box-sizing: border-box; }
.work-order-lines-table .material-code { font-size: 14px; }
.work-order-lines-table tr.is-inactive,
.work-order-lines-table tr.is-inactive:hover { color: #8792a5; background: #f1f4f8; }
.work-order-lines-table tr.is-inactive .material-code { color: #8792a5; }
.work-order-lines-table tr.is-inactive input:disabled { color: #8f99aa; background: #e7ebf1; border-color: #d8dee8; cursor: not-allowed; }
.usage-input-wrap { display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 90px; }
.unit-warning { display: inline-grid; place-items: center; width: 18px; height: 18px; flex: 0 0 auto; border-radius: 50%; color: #fff; background: var(--warning); font-size: 12px; font-weight: 800; cursor: help; }
.unit-warning[hidden] { display: none; }
.sticky-form-actions { position: sticky; z-index: 4; bottom: 16px; width: max-content; max-width: 100%; margin: 18px 0 0 auto; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius-md); background: rgba(255,255,255,.96); box-shadow: var(--shadow-md); backdrop-filter: blur(10px); flex-wrap: wrap; }
@media (max-width: 640px) {
  .sticky-form-actions { position: sticky; left: 0; right: 0; bottom: 0; width: 100%; max-width: 100%; margin: 18px 0 0; border-radius: 0; display: grid; grid-auto-flow: row; gap: 8px; padding: 12px; }
  .sticky-form-actions .button, .sticky-form-actions .inline-action-form { width: 100%; }
  .sticky-form-actions .inline-action-form .button { width: 100%; }
}
#work-order-form > fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.submitted-lock-note { margin-top: 18px; }
.inline-action-form { display: inline-flex; }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 14px; white-space: nowrap; }
.row-actions form { margin: 0; }
.text-button { padding: 0; border: 0; color: var(--brand); background: transparent; font: inherit; font-weight: 650; cursor: pointer; }
.text-button-danger { color: var(--danger); }
.text-button-danger:hover { text-decoration: underline; }
.file-name-plain { display: block; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Responsive */
@media (max-width: 1040px) {
  .dashboard-grid, .result-grid { grid-template-columns: 1fr; }
  .workflow-layout { grid-template-columns: 1fr; }
  .workflow-sidebar { position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .workflow-sidebar .form-panel + .form-panel { margin-top: 0; }
  .workflow-sidebar .generate-button, .workflow-sidebar .submit-note, .workflow-sidebar > .message { grid-column: 1 / -1; }
  .order-summary { max-width: none; }
  .work-order-fields { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
}

@media (max-width: 760px) {
  .shell { width: min(calc(100% - 28px), var(--shell)); }
  .app-header { height: 60px; }
  .header-actions .button-sm { min-height: 42px; }
  .brand-copy small { display: none; }
  .app-main { padding-block: 26px 44px; }
  .page-heading { display: block; margin-bottom: 22px; }
  .heading-meta, .workflow-progress { margin-top: 20px; overflow-x: auto; padding-bottom: 4px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .panel-header { padding: 20px 18px 16px; }
  .upload-form { padding: 0 18px 20px; }
  .upload-form-simple { grid-template-columns: 1fr; }
  .upload-form-simple .button { width: 100%; margin-bottom: 0; }
  .process-list { padding-inline: 18px; }
  .stub-note { margin-inline: 18px; }
  .data-table th, .data-table td { padding: 12px; }
  .data-table th:first-child, .data-table td:first-child { padding-left: 18px; }
  .data-table th:last-child, .data-table td:last-child { padding-right: 18px; }
  .workflow-sidebar { grid-template-columns: 1fr; }
  .workflow-sidebar .generate-button, .workflow-sidebar .submit-note, .workflow-sidebar > .message { grid-column: auto; }
  .result-hero { grid-template-columns: auto 1fr; padding: 20px; }
  .result-hero > .status { grid-column: 2; justify-self: start; }
  .login-layout { grid-template-columns: 1fr; gap: 28px; }
  .login-intro h1 { font-size: clamp(30px, 10vw, 42px); }
  .login-intro > p:not(.eyebrow), .login-proof { display: none; }
  .login-card { padding: 26px 22px; }
  .work-order-fields { grid-template-columns: repeat(2, minmax(130px, 1fr)); padding-inline: 18px; }

  .work-order-upload-form { padding: 0 18px 20px; }
  .purchasing-agent-import-body { padding: 0 18px 20px; }
  .purchasing-agent-import-form { grid-template-columns: 1fr; }
  .purchasing-agent-import-form .button { width: 100%; }
  .page-heading-simple .button { margin-top: 16px; }
}

@media (max-width: 480px) {
  .header-actions { gap: 4px; }
  .header-actions .button-sm { min-height: 38px; padding-inline: 10px; font-size: 13px; }
  .user-chip { font-size: 12px; padding-inline: 6px; gap: 4px; }
  .brand-mark { width: 32px; height: 32px; }
  h1 { font-size: 27px; }
  .heading-meta { gap: 10px; }
  .heading-meta span { gap: 4px; font-size: 10px; }
  .field-help { display: grid; gap: 2px; }
  .result-hero { display: block; }
  .success-mark { margin-bottom: 15px; }
  .result-hero > .status { margin-top: 14px; }
  .metric { min-width: auto; }
  .work-order-fields { grid-template-columns: 1fr; }

  .meta-divider { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
