* { box-sizing: border-box; }
body { margin: 0; font-family: "Microsoft YaHei", "微软雅黑", sans-serif; background: #f5f4f1; color: #222; }
header { display: flex; justify-content: space-between; align-items: center;
  background: #6b3f1d; color: #fff; padding: 10px 18px; }
.brand { font-size: 16px; font-weight: bold; letter-spacing: 1px; }
header .actions { display: flex; gap: 8px; }
button { font: inherit; border: 1px solid #c9bda9; background: #fff; border-radius: 5px;
  padding: 5px 12px; cursor: pointer; }
button:hover { background: #f3ede3; }
button.primary { background: #6b3f1d; color: #fff; border-color: #6b3f1d; }
button.primary:hover { background: #7d4a24; }
button.primary2 { background: #b8362a; color: #fff; border-color: #b8362a; }
button.primary2:hover { background: #c74437; }
button.small { padding: 2px 8px; font-size: 12px; }
header button, header label.btn { background: rgba(255,255,255,.15); color: #fff; border-color: rgba(255,255,255,.4); }
header button:hover { background: rgba(255,255,255,.28); }
label.btn { font: inherit; border: 1px solid #c9bda9; background: #fff; border-radius: 5px;
  padding: 5px 12px; cursor: pointer; font-size: 14px; }
.toolbar { display: flex; gap: 10px; align-items: center; padding: 10px 18px; background: #fff;
  border-bottom: 1px solid #e4ddd0; flex-wrap: wrap; }
.toolbar select, .toolbar input { font: inherit; padding: 5px 8px; border: 1px solid #c9bda9; border-radius: 5px; }
.toolbar input[type=text], .toolbar input[type=search] { width: 260px; }
.stats { color: #666; font-size: 13px; }
.batchbar { display: flex; gap: 8px; align-items: center; padding: 8px 18px; }
.batchbar .spacer { flex: 1; }
table { width: 100%; border-collapse: collapse; background: #fff; font-size: 13px; }
th, td { border-bottom: 1px solid #eee; padding: 7px 8px; text-align: left; vertical-align: top; }
th { background: #faf7f2; color: #555; font-weight: bold; position: sticky; top: 0; }
tr:hover td { background: #fdfbf7; }
td.c { text-align: center; } td.r { text-align: right; }
.mono { font-family: Consolas, monospace; font-size: 12px; }
.badge { display: inline-block; font-size: 11px; border-radius: 8px; padding: 1px 8px; margin-right: 4px;
  border: 1px solid transparent; }
.badge.fix { background: #fff3cd; border-color: #e6c24a; color: #8a6d1a; cursor: default; }
.badge.pickup { background: #fde8c8; border-color: #d9822b; color: #a3540e; }
.badge.pending { background: #e8f1fb; color: #2a5caa; }
.badge.closed { background: #eee; color: #777; }
.badge.dn { background: #e3f2e6; color: #2c7a3d; }
.badge.lb { background: #fdeae8; color: #b0392c; }
.badge.none { background: #f3f3f3; color: #999; }
.addr-old { color: #aaa; text-decoration: line-through; font-size: 12px; word-break: break-all; }
.addr-new { background: #fff3cd; padding: 0 3px; border-radius: 3px; word-break: break-all; }
.addr { max-width: 340px; }
.note-cell { max-width: 150px; color: #b8860b; font-size: 12px; word-break: break-all; }
.ops { white-space: nowrap; }
.ops button { margin-right: 4px; }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex;
  align-items: center; justify-content: center; z-index: 50; }
.modal.hidden { display: none; }
.modal-box { background: #fff; border-radius: 8px; padding: 18px 22px; width: 520px;
  max-width: calc(100vw - 32px); box-sizing: border-box; max-height: 86vh; overflow: auto; }
.modal-box h3 { margin: 0 0 12px; }
.form-row { display: flex; align-items: center; margin-bottom: 9px; gap: 8px; }
.form-row label { width: 130px; color: #555; flex: none; text-align: right; }
.form-row input, .form-row select { flex: 1; min-width: 0; font: inherit; padding: 5px 8px; border: 1px solid #c9bda9; border-radius: 5px; }
.form-row input[type=checkbox] { flex: none; }
.form-row input.num { flex: none; width: 80px; }
.hint { font-size: 12px; color: #999; margin: 10px 0 0; line-height: 1.6; }
.modal-actions { text-align: right; margin-top: 14px; }
.modal-actions button { margin-left: 8px; }
.prod-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.prod-table th, .prod-table td { border-bottom: 1px solid #eee; padding: 6px 4px; text-align: left; }
.prod-table th { background: #faf7f2; color: #555; }
.prod-table input { width: 120px; padding: 5px 8px; font: inherit; border: 1px solid #c9bda9; border-radius: 5px; }
.nu-row label { width: auto; flex: none; text-align: left; margin-right: 4px; }
.nu-row input, .nu-row select, .nu-row button { flex: 1; min-width: 0; }
#modal-users td.ops { white-space: normal; }
#modal-users td.ops button { display: block; margin: 3px 0; width: 100px; }
#modal-users .role-sel { display: block; width: 100px; margin-bottom: 4px; font: inherit;
  padding: 3px 4px; border: 1px solid #c9bda9; border-radius: 5px; }
.toast { position: fixed; top: 60px; right: 20px; background: #333; color: #fff; padding: 9px 16px;
  border-radius: 6px; z-index: 99; opacity: .95; }
.empty { text-align: center; color: #999; padding: 40px; }
.me-label { color: #e8d9c4; font-size: 13px; margin-left: 4px; }
#login-view { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #5a3215 0%, #6b3f1d 55%, #8a5a2b 100%); }
#login-view.hidden { display: none; }
.login-card { background: #fffdf8; border-radius: 12px; padding: 38px 46px 34px; width: 390px;
  text-align: center; box-shadow: 0 18px 50px rgba(0,0,0,.35); }
.login-logo { width: 190px; max-width: 100%; margin-bottom: 2px; mix-blend-mode: multiply; }
.login-title { font-size: 24px; font-weight: bold; color: #6b3f1d; letter-spacing: 5px; }
.login-sub { font-size: 13px; color: #a08a6b; margin: 5px 0 24px; letter-spacing: 3px; }
.login-form input { display: block; width: 100%; margin-bottom: 12px; padding: 11px 14px;
  font: inherit; border: 1px solid #d8cbb4; border-radius: 6px; box-sizing: border-box; }
.login-form input:focus { outline: none; border-color: #6b3f1d;
  box-shadow: 0 0 0 2px rgba(107,63,29,.15); }
.login-form button { display: block; width: 100%; padding: 11px; font-size: 16px; letter-spacing: 10px; }
.login-err { color: #b8362a; font-size: 13px; min-height: 20px; margin-bottom: 2px; }
