/* Same palette as yb-pd. System fonts only (incl. PingFang SC / Microsoft YaHei for Chinese). */
:root {
  --ink: #26211f; --ink-soft: #4a4442; --muted: #6b6561;
  --line: #e6e1dd; --line-soft: #f0ece9; --line-strong: #d6d0cb;
  --bg: #f6f4f2; --surface: #fff; --surface-2: #faf8f6;
  --accent: #7c3aed; --accent-700: #6d28d9; --accent-soft: #f5f3ff;
  --ok: #166534; --ok-soft: #dcfce7; --warn: #92400e; --warn-soft: #fef3c7;
  --err: #991b1b; --err-soft: #fee2e2; --info: #075985; --info-soft: #e0f2fe;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.5;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
a { color: var(--accent-700); text-decoration: none; } a:hover { text-decoration: underline; }
h1 { font-family: Georgia, "Times New Roman", serif; font-weight: 500; font-size: 27px; margin: 0; }
h2 { font-size: 15px; margin: 0 0 10px; }
.wrap { max-width: 1360px; margin: 0 auto; padding: 0 24px; }
main.wrap { padding-top: 24px; padding-bottom: 48px; display: flex; flex-direction: column; gap: 18px; }
.muted { color: var(--muted); } .small { font-size: 12px; } .strong { font-weight: 600; }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; }
.accent-text { color: var(--accent-700); font-weight: 600; } .late-text { color: var(--err); }

.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; padding-bottom: 14px; }
.brand { display: flex; align-items: baseline; gap: 12px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-name { font-family: Georgia, "Times New Roman", serif; font-size: 19px; letter-spacing: .14em; }
.brand-sub { font-size: 13px; color: var(--muted); }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; font-size: 13px; }
.who { color: var(--ink-soft); }
.viewas { background: var(--warn-soft); color: var(--warn); font-size: 13px; padding: 8px 0; }
.inline { display: inline; margin: 0; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent-700); font: inherit; cursor: pointer; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; }
.flash { background: var(--info-soft); color: var(--info); border-radius: 9px; padding: 10px 14px; margin: 0; }
.flash.err { background: var(--err-soft); color: var(--err); }
.empty { color: var(--muted); text-align: center; padding: 24px; margin: 0; }

.head-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; }
.head-row p { margin: 4px 0 0; }
.title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.sub { color: var(--ink-soft); }
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat-k { font-size: 12px; color: var(--muted); } .stat-v { font-size: 26px; font-weight: 600; margin-top: 4px; }
.stat-v.risk { color: var(--warn); } .stat-v.late { color: var(--err); } .stat-v.accent { color: var(--accent-700); }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tab { border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 6px 14px; font-size: 13px; }
.tab.on { background: var(--ink); border-color: var(--ink); color: #fff; } .tab:hover { text-decoration: none; }

.table-wrap { overflow-x: auto; }
.card.table-wrap { padding: 0; } .card.table-wrap h2 { padding: 16px 20px 0; } .card.table-wrap > p { padding: 0 20px 16px; }
table.grid { width: 100%; border-collapse: collapse; }
.grid th { font-size: 11.5px; font-weight: 600; color: var(--muted); text-align: left; padding: 10px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.grid td { padding: 10px; border-bottom: 1px solid var(--line-soft); font-size: 13px; white-space: nowrap; vertical-align: middle; }
.grid .r { text-align: right; } .grid td.wrap-cell { white-space: normal; min-width: 200px; }
.grid td .pill { margin: 1px 4px 1px 0; }
.sizes td, .sizes th { text-align: right; }
.sizes td:first-child, .sizes th:first-child { text-align: left; }

.pill { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--line-soft); color: var(--ink-soft); white-space: nowrap; }
.pill-issued, .pill-shipped, .pill-review { background: var(--info-soft); color: var(--info); }
.pill-delivered, .pill-received, .pill-done, .pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-late, .pill-rejected, .pill-cancelled { background: var(--err-soft); color: var(--err); }
.pill-risk { background: var(--warn-soft); color: var(--warn); }
.pill-missing { background: var(--accent-soft); color: var(--accent-700); border: 1px dashed var(--accent); padding: 1px 8px; }

.cols { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; }
.col-main { flex: 999 1 640px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.col-side { flex: 1 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.sec-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 12px; }
.sec-head h2 { margin: 0; }
.details { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 18px; margin: 0; }
.details dt { font-size: 11.5px; color: var(--muted); } .details dd { margin: 2px 0 0; font-weight: 500; }

label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
input, select, textarea { font: inherit; font-size: 13px; color: var(--ink); padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(124,58,237,.25); border-color: var(--accent); }
.qty { width: 72px; text-align: right; border-style: dashed; border-color: var(--accent); background: #faf8ff; }
.fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 14px; }
.stack { display: flex; flex-direction: column; gap: 8px; margin: 0 0 12px; }
.btn { font: inherit; font-size: 13px; padding: 8px 14px; border-radius: 9px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); cursor: pointer; min-height: 36px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn:hover { filter: brightness(.97); }

.uploads { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.upload { display: flex; flex-direction: column; gap: 8px; border: 1.5px dashed #c4b5fd; background: #faf8ff; border-radius: 12px; padding: 14px; margin: 0 0 12px; }
.drop { font-size: 13px; font-weight: 600; color: var(--ink); }
.drop input { font-weight: 400; background: transparent; border: 0; padding: 4px 0; }
.needs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.needs li, .kv { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px; }
.kv { margin: 6px 0 8px; }
.product-img { display: block; max-width: 160px; max-height: 220px; border-radius: 8px; margin-bottom: 12px; background: var(--surface-2); }
.msgs { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.msg { background: var(--surface-2); border-radius: 10px; padding: 8px 12px; } .msg.yb { background: var(--accent-soft); }
.msg-body { white-space: pre-wrap; font-size: 13px; }
textarea { resize: vertical; }
.review { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0; }
.review input { min-width: 180px; flex: 1; }
.grid td.action-cell { white-space: normal; min-width: 300px; }
h1 + p.muted { margin: -10px 0 0; }
.add-user { align-items: end; }
.login { max-width: 440px; margin: 40px auto; display: flex; flex-direction: column; gap: 14px; }
.login p { margin: 0; }

@media (max-width: 760px) {
  .cards, .details, .fields, .uploads { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.row-actions { display: flex; gap: 6px; }
.login + .muted, .login .hint { font-size: 12px; }
.swatch-img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; background: var(--line-soft); }
.pill-closed { background: var(--line-soft); color: var(--muted); }
