:root {
  color-scheme: light;
  --nav: #14243e;
  --ink: #1a2c45;
  --muted: #435a74;
  --line: #dce5f0;
  --surface: #f2f6fc;
  --blue: #2359ca;
  --blue-soft: #eaf1ff;
  --red: #a83045;
  --red-soft: #fce9ee;
  --amber: #8c4c03;
  --amber-soft: #fff0d9;
  --yellow: #70570c;
  --yellow-soft: #fff4bc;
  --green: #126948;
  --green-soft: #e3f6ed;
  font: 16px/1.5 "Microsoft YaHei UI", "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
}
* {box-sizing:border-box}
body {margin:0;color:var(--ink);background:var(--surface)}
button,input,select,textarea {font:inherit;color:inherit}
button,a.button {cursor:pointer}
a {color:var(--blue)}
h1,h2,h3,p {margin:0}
.loading {margin:3rem}
.layout {display:grid;grid-template-columns:210px minmax(0,1fr);min-height:100vh}
.sidebar {display:flex;flex-direction:column;gap:30px;background:var(--nav);color:#dce6f7;padding:28px 15px 19px;min-height:100vh;position:sticky;top:0;height:100vh}
.brand {display:flex;align-items:center;gap:.7rem;padding-left:.5rem;color:white;font-size:16px;font-weight:700;line-height:1.35}
.brand-mark {width:34px;height:34px;flex:none;background:#2b62d6;border-radius:9px;display:grid;place-items:center;font-size:1.35rem}
.sidebar .brand {gap:8px;padding-left:4px}
.sidebar .brand-title {white-space:nowrap}
.sidebar nav {display:grid;gap:.35rem}
.sidebar button {border:0;background:none;color:#e0e9f7;text-align:left;border-radius:7px;padding:.65rem .8rem;font-size:16px;white-space:nowrap}
.sidebar button:hover,.sidebar button[aria-current="page"] {background:#294263;color:white}
.account {margin-top:auto;padding-left:.55rem;font-size:.88rem}
.account button {display:block;padding:.35rem .35rem;margin:.2rem 0 0 -.35rem}
.workspace {min-width:0;padding:30px clamp(15px,3.1vw,42px) 45px}
.page-head {display:flex;justify-content:space-between;align-items:center;gap:1rem;margin-bottom:23px}
h1 {font-size:32px;line-height:1.25}
.page-head p {margin-top:.42rem;color:var(--muted);font-size:16px}
.actions {display:flex;flex-wrap:wrap;align-items:center;gap:.5rem}
button,.button {display:inline-flex;align-items:center;justify-content:center;padding:.5rem .9rem;background:#fff;border:1px solid var(--line);border-radius:7px;color:var(--ink);text-decoration:none;font-size:15px;min-height:37px}
button:hover,.button:hover {border-color:#a9bdeb;background:#f6f9ff}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible {outline:2px solid #3b73ed;outline-offset:2px}
button[disabled] {opacity:.6;cursor:progress}
.primary {background:var(--blue);border-color:var(--blue);color:white;font-weight:700}
.primary:hover {background:#1747af;color:white;border-color:#1747af}
.danger {color:var(--red);border-color:#efd0d7}
.metrics {display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:13px;margin:0 0 20px}
.metric {display:grid;justify-items:start;gap:.26rem;padding:.84rem 1.05rem;color:var(--muted);text-align:left;font-size:16px}
.metric strong {font-size:1.75rem;line-height:1.15;color:var(--ink);font-variant-numeric:tabular-nums}
.metric[aria-pressed="true"] {border-color:var(--blue)}
.metric.late strong {color:var(--red)}
.metric.soon strong {color:var(--amber)}
.metric.upcoming strong {color:var(--yellow)}
.metric {white-space:normal}
.metric small {font-size:.85rem;color:var(--muted)}
.sidebar {overflow-y:auto}
.sidebar nav {gap:.18rem}
.audit-record {padding:.75rem .95rem;border-top:1px solid var(--line);overflow-wrap:anywhere}
summary {cursor:pointer}
.audit-record time {color:var(--muted);font-variant-numeric:tabular-nums}
.audit-record summary > * {margin-right:.45rem}
.audit-record p {margin:.65rem 0}
.audit-record table {table-layout:fixed;white-space:normal}
.audit-record th:first-child {width:22%}
.audit-record td {white-space:pre-wrap}
.outside-warning {color:var(--amber);background:var(--amber-soft);padding:.4rem .65rem;border-radius:6px}
input[readonly] {background:#f1f5fb}
.stack {grid-template-columns:minmax(0,1fr)}
dialog strong, dialog p {overflow-wrap:anywhere}
.panel {background:#fff;border:1px solid var(--line);border-radius:10px;overflow:hidden}
.section-pad {padding:1.25rem}
.filters {display:flex;flex-wrap:wrap;gap:.6rem;padding:14px}
.filters input {flex:1 1 235px}
input:not([type="checkbox"]),select,textarea {min-width:0;min-height:38px;border:1px solid #cbd8e8;border-radius:6px;padding:.42rem .65rem;background:white}
textarea {resize:vertical;min-height:75px}
input[type="checkbox"] {accent-color:var(--blue);width:1rem;height:1rem}
.scroll {overflow:auto}
table {width:100%;border-collapse:collapse;font-size:.875rem;white-space:nowrap}
th,td {padding:.65rem .7rem;text-align:left;border-bottom:1px solid #e9eef6}
th {background:#eaf0f9;color:#263e59;font-weight:700}
.orders-table {font-size:15px}
.orders-table th,.orders-table td {padding-inline:.55rem}
.orders-table th {border-bottom-color:#c8d7e8}
.orders-table th + th {border-inline-start:1px solid #cddaea}
.orders-table tbody tr > * + * {border-inline-start:1px solid #e6edf6}
.orders-table thead th:is(:nth-child(6),:nth-child(7)) {background:#f7f0e1}
.orders-table thead th:nth-child(n+8):nth-child(-n+10) {background:#e4eefb}
.orders-table thead th:is(:nth-child(11),:nth-child(12)) {background:#e5efed}
.orders-table thead th:is(:nth-child(6),:nth-child(8),:nth-child(11),:last-child),.orders-table tbody .column-section {border-inline-start-color:#b7cadf}
.orders-table .order-group tr {cursor:pointer}
.orders-table .order-group + .order-group tr:first-child > * {border-top:2px solid #b9cce5}
.orders-table .order-contract {background:inherit;border-bottom-color:#e9eef6;border-inline-end:1px solid #e6edf6;font-weight:600}
.orders-table .grouped tr:not(:hover) {background:#f6f9ff}
.orders-table .grouped .order-contract {background:#eaf2ff;box-shadow:inset 3px 0 #5083d4;padding-inline-start:.8rem;vertical-align:top}
.contract-quick-ship {display:flex;width:max-content;margin-top:.35rem;min-height:30px;padding:.2rem .55rem;border-color:#bfd1ef;color:var(--blue);font-size:.8rem;font-weight:650}
.orders-table .grouped .order-shared {background:#eef4fc;vertical-align:top}
.order-product {display:grid;justify-items:start;gap:.2rem}
.order-product-name {display:flex;align-items:center;gap:.4rem}
.order-group-count {display:block;color:var(--muted);font-size:.8rem;font-weight:400}
.contract-table {font-size:15px}
.contract-table .actions {flex-wrap:nowrap}
.shipment-batch-table input[data-ship-quantity] {width:7rem}
tbody tr:nth-child(even) {background:#fbfcff}
tbody tr:hover {background:#f1f6ff}
td:first-child button,.order-product button {padding:0;min-height:0;border:0;background:none;color:var(--blue);font-size:inherit;font-weight:650}
.order-product button:hover {text-decoration:underline}
td.note {max-width:16rem;text-overflow:ellipsis;overflow:hidden}
.num {text-align:right;font-variant-numeric:tabular-nums}
.pill {display:inline-block;border-radius:5px;padding:.13rem .45rem;color:#48617d;background:#ebf0f7;font-size:.81rem}
.pill.blue {background:var(--blue-soft);color:#1d53bc}
.drawing-cell {display:grid;justify-items:start;gap:3px}
.drawing-count {font-weight:700}
.pill.amber {background:var(--amber-soft);color:var(--amber)}
.pill.yellow {background:var(--yellow-soft);color:var(--yellow)}
.pill.red {background:var(--red-soft);color:var(--red)}
.pill.green {background:var(--green-soft);color:var(--green)}
.due-days {font-size:inherit;font-weight:650;font-variant-numeric:tabular-nums}
.foot {padding:.7rem .9rem;color:var(--muted);font-size:15px}
.empty {padding:3.2rem 2rem;text-align:center;color:var(--muted)}
.auth {min-height:100vh;display:grid;place-items:center;padding:1.3rem;background:linear-gradient(135deg,#eaf1ff,#f5f8fd 65%)}
.auth .panel {padding:2rem;width:min(440px,100%);box-shadow:0 15px 55px #283e6921}
.auth .brand {color:var(--ink);padding:0;margin-bottom:1.2rem}
.auth .brand-mark {color:white}
.auth h1 {font-size:1.55rem}
.auth p {margin:.5rem 0 1rem;color:var(--muted)}
.auth button {width:100%}
.mfa-qr {display:block;width:180px;max-width:100%;height:auto;margin:0 auto .75rem;border:1px solid var(--line)}
.mfa-manual {margin-bottom:1rem;overflow-wrap:anywhere}
.mfa-manual code {display:block;margin-top:.45rem;font-size:.875rem}
.recovery-codes-panel pre {margin:0;padding:.75rem 1rem;border:1px solid var(--line);border-radius:6px;background:var(--surface);font-size:.96rem;line-height:1.65}
.grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:13px 17px}
form.stack,.stack {display:grid;gap:.9rem}
.product-line {min-width:0;margin:0;padding:.8rem;border:1px solid var(--line);border-radius:8px;background:#f8fbff}
.product-line legend {padding:0 .25rem;font-weight:700}
.product-line:only-child .product-remove {display:none}
label.field {display:grid;gap:.3rem;font-size:.91rem;font-weight:650}
.span {grid-column:1/-1}
.check {display:flex;align-items:center;gap:.5rem;font-weight:500}
.muted {color:var(--muted);font-size:.91rem}
.error {color:var(--red);min-height:1.5em;font-size:.88rem}
dialog {color:var(--ink);border:1px solid var(--line);border-radius:12px;width:min(780px,calc(100vw - 28px));max-height:90vh;padding:0;box-shadow:0 18px 70px #132a4b45}
dialog::backdrop {background:#16284270}
dialog header {padding:1.15rem 1.35rem;border-bottom:1px solid var(--line);display:flex;align-items:start;justify-content:space-between;gap:.7rem}
dialog header h2 {font-size:1.39rem}
dialog header button {min-width:36px;padding:.25rem .5rem}
.dialog-body {padding:1.2rem 1.35rem}
.details {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.7rem;margin:0}
.details div {min-width:0;background:var(--surface);border-radius:6px;padding:.6rem .7rem}
.details dt {font-size:.81rem;color:var(--muted);margin-bottom:.14rem}
.details dd {margin:0;overflow-wrap:anywhere}
.subhead {display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:.5rem}
.filelist {list-style:none;padding:0;margin:0}
.filelist li {display:flex;justify-content:space-between;gap:.5rem;align-items:center;padding:.55rem 0;border-bottom:1px solid var(--line);overflow-wrap:anywhere}
.filelist li:last-child {border-bottom:0}
.filelist .actions {flex-wrap:nowrap}
#toast {position:fixed;bottom:1rem;right:1rem;background:var(--nav);color:white;z-index:10;border-radius:9px;padding:.75rem 1rem;max-width:min(28rem,90vw);box-shadow:0 6px 25px #14243e35}
.print-sheet {display:none}

@media print {
  @page {size:A4;margin:14mm}
  body.printing-order {background:white;color:#172334}
  body.printing-order > :not(#print-sheet) {display:none!important}
  body.printing-order .print-sheet {display:block;font-size:10.5pt}
  .print-sheet header {padding-bottom:10pt;border-bottom:1pt solid #172334;margin-bottom:10pt}
  .print-sheet h1 {font-size:20pt;margin-bottom:4pt}
  .print-sheet h2 {font-size:13pt;margin-bottom:8pt}
  .print-sheet table {width:100%;font-size:10pt;white-space:normal}
  .print-sheet th,.print-sheet td {padding:5pt 4pt;border-bottom:0.6pt solid #b5bec9;vertical-align:top;overflow-wrap:anywhere}
  .print-sheet th {color:inherit;background:none}
  .print-sheet .num {white-space:nowrap}
  .print-sheet thead {display:table-header-group}
  .print-sheet tr {break-inside:avoid}
  .print-sheet .print-note {white-space:pre-wrap}
  .print-sheet .print-total {margin-top:10pt;text-align:right;break-inside:avoid}
}
@media(max-width:1000px) {
  .metrics {grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(max-width:820px) {
  .layout {grid-template-columns:minmax(0,1fr)}
  .sidebar {position:static;min-height:0;height:auto;gap:.6rem;padding:12px}
  .sidebar nav {display:flex;overflow:auto}
  .sidebar .account {display:flex;align-items:center;justify-content:space-between}
  .account button {margin:0}
  .workspace {padding-top:20px}
}
@media(max-width:550px) {
  .metrics {grid-template-columns:repeat(2,minmax(0,1fr))}
  .page-head {align-items:start;flex-direction:column}
  .grid,.details {grid-template-columns:1fr}
  .subhead {align-items:start}
}
