:root {
  font:
    15px/1.6 system-ui,
    -apple-system,
    "Microsoft YaHei",
    sans-serif;
  color: #18332d;
  background: #f3f6f4;
  --green: #17664d;
  --line: #dce5df;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
header {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 28px;
  background: white;
  border-bottom: 1px solid var(--line);
}
.brand {
  color: var(--green);
  font-weight: 800;
  font-size: 24px;
  text-decoration: none;
  letter-spacing: 1px;
}
.brand span {
  font-size: 14px;
  color: #65776d;
  font-weight: 400;
  margin-left: 15px;
}
#account {
  display: flex;
  align-items: center;
  gap: 10px;
}
.shell {
  display: grid;
  grid-template-columns: 185px minmax(0, 1fr);
  min-height: 75vh;
}
nav {
  padding: 24px 14px;
  border-right: 1px solid var(--line);
}
nav button {
  display: block;
  width: 100%;
  text-align: left;
  margin-bottom: 6px;
  background: transparent;
  color: #365548;
  border-color: transparent;
}
nav button.active {
  background: #dfebe4;
  color: #115a41;
  font-weight: 700;
}
main {
  padding: 28px;
  min-width: 0;
  max-width: 1500px;
  width: 100%;
}
h1,
h2,
h3 {
  line-height: 1.35;
  margin: 0 0 18px;
}
h2 {
  font-size: 23px;
}
h3 {
  font-size: 17px;
  margin-top: 14px;
}
p {
  margin: 10px 0;
}
.muted {
  color: #687b70;
  font-size: 13px;
}
.card {
  background: white;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin: 16px 0;
  overflow-wrap: anywhere;
}
.row,
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.row {
  justify-content: space-between;
}
button {
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--green);
  border-radius: 6px;
  padding: 8px 14px;
  background: var(--green);
  color: white;
}
button.secondary,
td button {
  background: white;
  color: var(--green);
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
button:hover {
  filter: brightness(0.95);
}
td button {
  padding: 5px 9px;
  margin: 3px;
}
.table-wrap {
  overflow: auto;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
th,
td {
  text-align: left;
  vertical-align: top;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
th {
  background: #eef4ef;
  color: #466151;
  font-weight: 600;
}
td:last-child {
  white-space: normal;
}
label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 14px;
  color: #3d594b;
}
input,
select,
textarea {
  font: inherit;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid #bccdc1;
  border-radius: 5px;
  background: white;
  color: #163a29;
  min-width: 0;
}
textarea {
  min-height: 80px;
  resize: vertical;
}
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid #83b89c;
  outline-offset: 1px;
}
.fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}
.wide {
  grid-column: 1/-1;
}
.repeat-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
  background: #f5f8f5;
  border: 1px solid var(--line);
  border-radius: 6px;
  margin-bottom: 12px;
}
.repeat-row button {
  justify-self: start;
  align-self: end;
}
.repeat-row input[type="hidden"] {
  display: none;
}
dialog {
  border: 0;
  border-radius: 12px;
  width: min(920px, 94vw);
  padding: 28px;
  max-height: 91vh;
  box-shadow: 0 20px 90px #193e3340;
}
dialog::backdrop {
  background: #15372970;
}
.actions {
  margin-top: 22px;
}
.form-error {
  color: #ac302c;
  font-weight: 600;
}
#notice {
  position: sticky;
  bottom: 10px;
  margin: 0 auto;
  width: fit-content;
  max-width: 95%;
  background: #213f34;
  color: white;
  border-radius: 8px;
  padding: 10px 18px;
  z-index: 20;
}
#notice:empty {
  display: none;
}
footer {
  padding: 25px;
  color: #6b7d72;
  font-size: 12px;
  text-align: center;
}
footer a {
  color: inherit;
}
.asset {
  color: var(--green);
}
.metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}
.metrics > div {
  padding: 16px;
  background: #eef5ee;
  border-radius: 8px;
  min-width: 145px;
}
.metrics strong {
  display: block;
  font-size: 23px;
}
.status {
  border-radius: 5px;
  background: #edf4ee;
  padding: 2px 7px;
}
.orders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}
.orders-grid .card {
  margin: 0;
}
.order-open {
  font-size: 19px;
  text-align: left;
  background: none;
  color: #17664d;
  border: 0;
  padding: 0;
  font-weight: 700;
}
.picture {
  max-width: 160px;
  max-height: 130px;
  object-fit: contain;
}
.tabstrip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
}
.tabstrip button {
  white-space: nowrap;
}
.note {
  padding: 12px;
  background: #fff7e7;
  border-left: 3px solid #c78c28;
}
.report-items {
  white-space: normal;
  min-width: 180px;
}
@media (max-width: 700px) {
  header {
    height: auto;
    min-height: 66px;
    padding: 12px 16px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .brand span {
    display: none;
  }
  #account {
    font-size: 12px;
  }
  .shell {
    display: block;
  }
  nav {
    padding: 10px 12px;
    display: flex;
    gap: 7px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  nav button {
    width: auto;
    white-space: nowrap;
    margin: 0;
  }
  main {
    padding: 16px;
  }
  .fields {
    grid-template-columns: 1fr;
  }
  .repeat-row {
    grid-template-columns: 1fr 1fr;
  }
  .card {
    padding: 16px;
  }
  dialog {
    padding: 20px;
  }
  .metrics > div {
    flex: 1;
    min-width: 120px;
  }
  .metrics strong {
    font-size: 20px;
  }
  h2 {
    font-size: 21px;
  }
  td,
  th {
    padding: 9px;
  }
  #notice {
    font-size: 13px;
  }
}
 .record-activity { text-align:right; color:#627970; font-size:12px; margin-top:18px; min-width:160px; }
 .ledger-actions { min-width:180px; }
 .table-wrap td:has(>button) { min-width:180px; }
 .record-activity summary { cursor:pointer; }
 .record-activity ol { list-style:none; line-height:1.9; padding:0; }
 .record-activity li { overflow-wrap:anywhere; }
 .order-activity { padding:8px 16px; }
 .attachment-view { max-width:1100px; margin:auto; padding:28px; }
 #preview video,#preview img { max-width:100%; max-height:75vh; }
 #preview iframe { width:100%; height:75vh; border:0; }
 .compact-roll { border-bottom:1px solid #dbe5df; padding:10px 0; }
 .roll-line { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)) auto auto; align-items:end; gap:10px; }
 @media(max-width:700px){.roll-line{grid-template-columns:repeat(2,minmax(0,1fr));}.roll-line label:nth-child(3){grid-column:1/-1;}}
 .compact-roll details { margin:8px 0; }
 .compact-roll summary { cursor:pointer; color:#1b705c; }
 .compact-roll .fields { margin-top:12px; }
 [data-roll-total] { font-weight:bold; }
 .ocr-layout { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:20px; }
 .ocr-source { width:100%; position:sticky; top:0; }
 .ocr-row { display:grid; grid-template-columns:1fr 1fr auto; gap:8px; margin:12px 0; align-items:end; }
 .ocr-row small { grid-column:1/-1; color:#805a16; }
 @media(max-width:700px){.ocr-layout{grid-template-columns:1fr;}.ocr-source{max-height:40vh;object-fit:contain;}}
 .customer-view { max-width:1100px; margin:auto; padding:28px; }
 .customer-view form { display:grid; gap:18px; max-width:520px; }
 [hidden] { display:none !important; }
 .finishing-requirements { border:1px solid var(--line); border-radius:10px; padding:14px 18px; margin:12px 0; background:#f4f8f5; }
 .finishing-requirements h3 { margin:0; }
 .finishing-requirements p { margin:10px 0 0; white-space:pre-wrap; overflow-wrap:anywhere; }
 .publish-report { border-bottom:1px solid #dbe5df; padding:14px 0; }
 .route-editor { display:block; }
 .route-toolbar { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:14px; flex-wrap:wrap; }
 .route-toolbar [data-route-status] { font-weight:600; color:#17634f; }
 .route-fields { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; min-width:0; border:0; padding:0; margin:0; }
 .route-fields:disabled input,.route-fields:disabled select,.route-fields:disabled textarea { color:#354a43; background:#edf3ef; opacity:1; }
 .route-editor [data-route-error]:empty { display:none; }
 .route-error { color:#b52e28; font-weight:600; }
 .library-search { max-width:520px; margin:20px 0; }
 .fabric-picker { border:1px solid var(--line); border-radius:8px; background:#f5f8f5; padding:14px; }
 .fabric-picker .actions { margin-top:12px; }
 .route-pending { border-top:1px solid var(--line); padding-top:12px; }
 .route-history-entry { margin:12px 0; text-align:left; }
 .route-history-entry td { white-space:pre-wrap; overflow-wrap:anywhere; }
 @media(max-width:700px){.route-fields{grid-template-columns:1fr;}.route-toolbar .actions{flex-wrap:wrap;}}
.production-step{border:1px solid #c9dcd4;border-radius:12px;padding:20px;margin:12px 0;background:#fff}
.production-step>h3{font-size:1.35rem;margin-top:0;color:#164d40}
.production-step .route-fields{grid-template-columns:repeat(2,minmax(0,1fr))}
.production-step>summary{cursor:pointer;font-weight:600}
.production-step .finishing-requirements{margin-bottom:16px}
@media(max-width:700px){.production-step{padding:14px}.production-step .route-fields{grid-template-columns:1fr}}
