:root {
  --bg: #f4f6fb;
  --panel: #ffffff;
  --line: #e4e8f1;
  --text: #1f2733;
  --muted: #6b7482;
  --primary: #2f6fed;
  --primary-dark: #2359c4;
  --green: #1a9c62;
  --red: #d64545;
  --amber: #d98e1f;
  --shadow: 0 4px 16px rgba(31, 39, 51, 0.08);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}
.topbar {
  height: 56px;
  background: #16305f;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { font-size: 17px; font-weight: 700; letter-spacing: .5px; }
.topbar .month-picker { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.topbar input[type=month] {
  padding: 5px 8px;
  border: 0;
  border-radius: 6px;
  background: #fff;
  color: #16305f;
  font-size: 13px;
}
.layout { display: flex; min-height: calc(100vh - 56px); }
.sidebar {
  width: 190px;
  background: #1d2b47;
  padding: 14px 10px;
  flex-shrink: 0;
}
.sidebar button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: #c7d2e8;
  padding: 11px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  margin-bottom: 4px;
}
.sidebar button:hover { background: #283a5e; color: #fff; }
.sidebar button.active { background: var(--primary); color: #fff; font-weight: 600; }
main { flex: 1; padding: 22px 26px; width: 100%; max-width: none; }
h1 { font-size: 22px; margin: 0 0 6px; }
h2 { font-size: 16px; margin: 22px 0 10px; }
.sub { color: var(--muted); margin-bottom: 18px; }
.card-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 10px; }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow);
}
.card .label { color: var(--muted); font-size: 13px; }
.card .value { font-size: 26px; font-weight: 700; margin-top: 8px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; box-shadow: var(--shadow); margin-bottom: 16px; }
table { width: 100%; border-collapse: collapse; background: var(--panel); }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 13px; background: #f8fafd; white-space: nowrap; }
.filter-row th { background: #fff; padding: 6px 8px; }
.filter-row input, .filter-row select { width: 100%; min-width: 78px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; background: #fff; font-size: 12px; color: var(--text); }
.filter-row button { white-space: nowrap; }
tr:hover td { background: #fafbfe; }
.btn {
  display: inline-block;
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #fff;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  text-decoration: none;
}
.btn:hover { background: var(--primary-dark); }
.btn.ghost { background: #fff; color: var(--primary); }
.btn.small { padding: 4px 9px; font-size: 12px; }
.btn.danger { background: #fff; color: var(--red); border-color: var(--red); }
.btn.danger:hover { background: #fdeeee; }
.target-group.collapsed tr:not(.target-group-head) { display: none; }
.target-group-head td { background: #f7f9fc; }
.target-group-head .group-toggle { margin-right: 6px; }
.target-group-head .group-name { font-weight: 700; margin-right: 8px; }
.target-group-head .group-add { margin-left: 10px; }
.confirm-modal { width: 420px; }
.prompt-modal { width: 420px; }
.prompt-modal .confirm-body input { width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; }
.img-previews { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.img-item { position: relative; width: 76px; height: 76px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.img-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-del { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border: 0; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; cursor: pointer; font-size: 14px; line-height: 20px; padding: 0; }
.confirm-body { padding: 22px 18px 6px; font-size: 15px; color: var(--text); line-height: 1.6; }
.btn.danger-solid { background: var(--red); border-color: var(--red); color: #fff; }
.btn.danger-solid:hover { background: #b93434; }
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar select, .toolbar input[type=date], .toolbar input[type=month] { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 13px; }
.toolbar label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.toolbar input[type=number] { width: 110px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 13px; }
.kpi-bases { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 10px 0 14px; }
.kpi-base-item { display: flex; align-items: center; gap: 8px; background: #f8fafd; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.kpi-base-item span { color: var(--muted); font-size: 13px; white-space: nowrap; }
.kpi-base-item input { width: 96px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 13px; }
.badge { display: inline-block; padding: 3px 8px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge.green { background: #e7f6ef; color: var(--green); }
.badge.red { background: #fdecec; color: var(--red); }
.badge.amber { background: #fdf3e3; color: var(--amber); }
.badge.gray { background: #eef1f6; color: var(--muted); }
.rate-good { color: var(--green); font-weight: 600; }
.rate-bad { color: var(--red); font-weight: 600; }
.muted { color: var(--muted); }
.mt8 { margin-top: 8px; }
.empty { color: var(--muted); text-align: center; padding: 26px; }
.issue-box { border-left: 3px solid var(--red); background: #fff7f7; padding: 8px 10px; border-radius: 6px; margin-top: 6px; }
.report-card { display: grid; grid-template-columns: 130px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.report-card:last-child { border-bottom: 0; }
.report-card .dept { font-weight: 600; }
.kpi-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.kpi-row:last-child { border-bottom: 0; }
.kpi-row .name { width: 190px; }
.kpi-row input { width: 90px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 7px; }
.kpi-row .formula { color: var(--muted); font-size: 12px; flex: 1; }
.modal-backdrop {
  position: fixed; inset: 0; background: #0f172a;
  display: flex; align-items: center; justify-content: center; z-index: 50;
}
.modal-backdrop.hidden { display: none; }
.modal { width: 520px; max-width: 94vw; max-height: 90vh; overflow: auto; background: #fff; border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--line); font-weight: 700; }
.modal-head button { border: 0; background: none; font-size: 22px; cursor: pointer; color: var(--muted); }
#modalFields { padding: 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.perms-field { flex-direction: row; align-items: flex-start; gap: 10px; }
.perms-field > label { width: 72px; flex-shrink: 0; padding-top: 9px; }
.perm-list { flex: 1; display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 8px 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.perm-item { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.perm-item input { width: auto; margin: 0; }
.field label { color: var(--muted); font-size: 12px; }
.field input, .field select, .field textarea { padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; width: 100%; }
.field textarea { min-height: 80px; resize: vertical; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--line); }
.detail { font-size: 12px; color: var(--muted); line-height: 1.5; }
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(12px);
  background: #1a9c62;
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: all .18s ease;
  z-index: 100;
}
.toast.error { background: #d64545; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.issue-thumb { width: 42px; height: 42px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); margin: 2px; cursor: zoom-in; background: #f1f5f9; }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.82); display: flex; align-items: center; justify-content: center; z-index: 300; cursor: zoom-out; }
.lightbox img { max-width: 92vw; max-height: 92vh; border-radius: 8px; box-shadow: 0 12px 48px rgba(0,0,0,.5); background: #fff; transition: transform .15s ease; will-change: transform; }
@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; display: flex; overflow-x: auto; }
  .sidebar button { white-space: nowrap; }
  .card-grid { grid-template-columns: repeat(2, 1fr); }
}

.stall-same-day { display:inline-block; border:1px solid #b7e4c7; background:#e7f6ef; color:var(--green); border-radius:8px; padding:2px 8px; font-weight:600; white-space:nowrap; }

.stall-tab { border:1px solid var(--line); background:#fff; color:var(--text); border-radius:8px; padding:6px 14px; cursor:pointer; font-weight:600; }
.stall-tab.active { background:var(--primary); color:#fff; border-color:var(--primary); }


.style-rows { display:flex; flex-direction:column; gap:6px; margin-bottom:6px; }
.style-row { display:flex; gap:6px; align-items:center; flex-wrap:wrap; }
.style-row .style-sel { flex:0 0 auto; width:150px; min-width:0; }
.style-row .color-sel { flex:0 0 auto; width:110px; min-width:0; }
.style-row input { width:90px; }


.ship-qty-hot { display:inline-block; background:#fff0e6; color:var(--red); font-weight:700; padding:1px 8px; border-radius:8px; border:1px solid #f4c4ad; }


.hidden { display:none !important; }
.login-screen { position:fixed; inset:0; background:#16305f; display:flex; align-items:center; justify-content:center; z-index:100; }
.login-box { width:360px; background:#fff; border-radius:14px; padding:28px; box-shadow:0 12px 40px rgba(0,0,0,.22); }
.login-brand { font-size:20px; font-weight:700; text-align:center; margin-bottom:18px; color:#16305f; }
.login-tabs { display:flex; gap:8px; margin-bottom:14px; }
.login-tabs button { flex:1; padding:8px; border:1px solid var(--line); background:#fff; border-radius:8px; cursor:pointer; }
.login-tabs button.active { background:var(--primary); color:#fff; border-color:var(--primary); }
.login-box input { width:100%; margin-bottom:10px; padding:10px; border:1px solid var(--line); border-radius:8px; }
.sms-row { display:flex; gap:8px; }
.sms-row input { flex:1; }
.captcha-row { display:flex; gap:8px; align-items:center; }
.captcha-row img { width:110px; height:40px; border-radius:6px; cursor:pointer; border:1px solid var(--line); }
.captcha-row input { flex:1; margin-bottom:0; }
.login-btn { width:100%; margin-top:12px; }
.login-error { color:var(--red); min-height:18px; margin-top:8px; font-size:13px; }
.login-tip { color:var(--amber); min-height:18px; margin-top:4px; font-size:13px; }
.current-user { margin-right:12px; font-size:13px; color:#dbe5f5; }

.stall-order-columns { display:grid; grid-template-columns:1fr 1fr; gap:16px; align-items:start; }
@media (max-width:1100px) { 
.style-rows { display:flex; flex-direction:column; gap:6px; margin-bottom:6px; }
.style-row { display:flex; gap:6px; align-items:center; flex-wrap:wrap; }
.style-row .style-sel { flex:0 0 auto; width:150px; min-width:0; }
.style-row .color-sel { flex:0 0 auto; width:110px; min-width:0; }
.style-row input { width:90px; }


.ship-qty-hot { display:inline-block; background:#fff0e6; color:var(--red); font-weight:700; padding:1px 8px; border-radius:8px; border:1px solid #f4c4ad; }


.hidden { display:none !important; }
.login-screen { position:fixed; inset:0; background:#16305f; display:flex; align-items:center; justify-content:center; z-index:100; }
.login-box { width:360px; background:#fff; border-radius:14px; padding:28px; box-shadow:0 12px 40px rgba(0,0,0,.22); }
.login-brand { font-size:20px; font-weight:700; text-align:center; margin-bottom:18px; color:#16305f; }
.login-tabs { display:flex; gap:8px; margin-bottom:14px; }
.login-tabs button { flex:1; padding:8px; border:1px solid var(--line); background:#fff; border-radius:8px; cursor:pointer; }
.login-tabs button.active { background:var(--primary); color:#fff; border-color:var(--primary); }
.login-box input { width:100%; margin-bottom:10px; padding:10px; border:1px solid var(--line); border-radius:8px; }
.sms-row { display:flex; gap:8px; }
.sms-row input { flex:1; }
.captcha-row { display:flex; gap:8px; align-items:center; }
.captcha-row img { width:110px; height:40px; border-radius:6px; cursor:pointer; border:1px solid var(--line); }
.captcha-row input { flex:1; margin-bottom:0; }
.login-btn { width:100%; margin-top:12px; }
.login-error { color:var(--red); min-height:18px; margin-top:8px; font-size:13px; }
.login-tip { color:var(--amber); min-height:18px; margin-top:4px; font-size:13px; }
.current-user { margin-right:12px; font-size:13px; color:#dbe5f5; }

.stall-order-columns { grid-template-columns:1fr; } }

.perms-field .perm-list input[type="checkbox"] { width: 16px; height: 16px; margin: 0; accent-color: var(--accent, #2563eb); }

.role-row { display: flex; gap: 8px; align-items: center; }
.role-row select { flex: 1; }
.role-row .btn { white-space: nowrap; }

.tabs { display: flex; gap: 8px; margin: 4px 0 12px; border-bottom: 1px solid var(--line); }
.tab-btn { border: 0; background: none; padding: 9px 14px; font-size: 14px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; }
.tab-btn.active { color: var(--primary, #2563eb); border-bottom-color: var(--primary, #2563eb); font-weight: 600; }


/* ????????????? */
.acct-toggle label.check-line { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.acct-toggle label.check-line input { width: auto; margin: 0; }
.acct-fields { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 12px; border: 1px dashed var(--line); border-radius: 8px; background: #f8fafc; }
.acct-fields .field.full { grid-column: 1 / -1; }
.acct-tip { padding: 10px 12px; border-radius: 8px; background: #fff7ed; color: #b45309; font-size: 13px; line-height: 1.5; }

.sidebar { overflow-y: auto; }
.nav-group-head { display: flex; justify-content: space-between; align-items: center; width: 100%; background: #14315f; border: 0; color: #e6eefc; padding: 12px 14px; font-size: 14px; cursor: pointer; text-align: left; border-bottom: 1px solid rgba(255,255,255,.06); }
.nav-group-head:hover { background: #1a3b74; }
.nav-group-head .na { font-size: 10px; opacity: .85; }
.nav-group-items button { padding-left: 28px !important; }

.func-select { width: 100%; box-sizing: border-box; background: #2a3a5e; color: #fff; border: 1px solid rgba(255,255,255,.25); border-radius: 6px; padding: 10px 10px; font-size: 14px; margin-bottom: 4px; }

.sidebar .side-link { margin-top: 8px; }

.quick-add-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.quick-add-row input, .quick-add-row select { flex: 1; min-width: 90px; padding: 8px 9px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; }
.quick-add-row .btn { flex: 0 0 auto; }

.sub-table { width: 100%; border-collapse: collapse; margin: 0; }
.sub-table th, .sub-table td { border: 1px solid var(--line); padding: 8px 10px; font-size: 13px; }
.tmp-parent td { font-weight: 600; }

#modalEnter { margin-right: auto; order: -1; }





.issue-modal { width: 680px; max-height: 90vh; display: flex; flex-direction: column; overflow: hidden; border-radius: 24px; box-shadow: 0 28px 90px rgba(230, 90, 140, .28); border: 1px solid #ffe3ec; }
.issue-modal .modal-head { flex-shrink: 0; background: linear-gradient(135deg, #f06292, #ff8fab); color: #fff; padding: 18px 24px; font-size: 17px; letter-spacing: .4px; font-weight: 700; }
.issue-modal .modal-head button { color: #fff; font-size: 24px; }
.issue-modal #modalForm { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.issue-modal #modalFields { overflow-y: auto; padding: 22px 24px; gap: 16px; background: #fffdfe; }
.issue-modal .field label { color: #b07a90; font-size: 12px; font-weight: 600; }
.issue-modal .field input, .issue-modal .field select, .issue-modal .field textarea { background: #fff; border: 1.5px solid #ffdbe6; border-radius: 14px; padding: 11px 14px; }
.issue-modal .field input:focus, .issue-modal .field select:focus, .issue-modal .field textarea:focus { border-color: #ff8fab; box-shadow: 0 0 0 4px rgba(255, 143, 171, .15); outline: none; }
.issue-modal .modal-actions { flex-shrink: 0; padding: 16px 24px; background: #fff; border-top: 1px solid #ffecf2; }
.issue-modal .btn { border-radius: 999px; padding: 10px 20px; font-weight: 600; }
.issue-modal #modalSave, .issue-modal #modalEnter { background: linear-gradient(135deg, #f06292, #ff8fab); border: 0; color: #fff; box-shadow: 0 6px 16px rgba(240, 98, 146, .25); }
.issue-modal #modalCancel { background: #fff; color: #e0568a; border: 1px solid #ffd3e0; border-radius: 999px; }
.issue-modal .img-upload-label { font-size: 12px; color: #b07a90; margin-bottom: 6px; }
.issue-modal .upload-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.issue-modal .upload-btn { display: inline-flex; align-items: center; padding: 7px 12px; border: 1px solid #ffd3e0; border-radius: 999px; background: #fff; color: #e0568a; font-size: 13px; cursor: pointer; }
.issue-modal .upload-btn:hover { border-color: #ff8fab; background: #fff3f7; }
.issue-modal .upload-btn input[type=file] { display: none; }
.issue-modal .img-previews { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.issue-modal .img-item { position: relative; width: 68px; height: 68px; }
.issue-modal .img-item img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; border: 1px solid #ffdbe6; }

.issue-modal .custom-select-trigger { position:relative; width:100%; text-align:left; padding:10px 12px; border:1.5px solid #ffdbe6; border-radius:14px; background:#fff; font-size:14px; color:#25273c; cursor:pointer; }
.issue-modal .custom-select-panel { position:absolute; left:0; right:0; top:calc(100% + 6px); display:flex; flex-direction:column; background:#fff; border:1px solid #ffe0e9; border-radius:14px; box-shadow:0 12px 32px rgba(240,98,146,.18); z-index:40; overflow:hidden; }
.issue-modal .custom-select-list { flex:1; overflow-y:auto; max-height:260px; }
.issue-modal .custom-select-item { display:block; width:100%; text-align:left; padding:10px 14px; background:#fff; border:0; border-bottom:1px solid #fff0f4; font-size:14px; cursor:pointer; }
.issue-modal .custom-select-item:hover { background:#fff3f7; }
.issue-modal .custom-select-footer { flex-shrink:0; padding:8px; background:#fff; border-top:1px solid #ffe0e9; }

.issue-modal .custom-select-trigger { display:flex; justify-content:space-between; align-items:center; }
.issue-modal .custom-select-text { flex:1; }
.issue-modal .custom-select-arrow { color:#b07a90; font-size:12px; }

/* ===== 客服弹窗用主界面蓝色 ===== */
.issue-modal { border: 1px solid var(--line); box-shadow: 0 28px 90px rgba(47,111,237,.18); }
.issue-modal .modal-head { background: linear-gradient(135deg, #2f6fed, #4f8cff); }
.issue-modal #modalFields { background: #f8fafd; }
.issue-modal .field label { color: var(--muted); }
.issue-modal .field input, .issue-modal .field select, .issue-modal .field textarea { border: 1.5px solid var(--line); }
.issue-modal .field input:focus, .issue-modal .field select:focus, .issue-modal .field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(47,111,237,.15); }
.issue-modal .modal-actions { border-top: 1px solid var(--line); }
.issue-modal #modalSave, .issue-modal #modalEnter { background: var(--primary); box-shadow: 0 6px 16px rgba(47,111,237,.25); }
.issue-modal #modalCancel { color: var(--primary); border: 1px solid var(--line); }
.issue-modal .img-upload-label { color: var(--muted); }
.issue-modal .upload-btn { border: 1px solid var(--line); color: var(--primary); }
.issue-modal .upload-btn:hover { border-color: var(--primary); background: #eef3ff; }
.issue-modal .img-item img { border: 1px solid var(--line); }
.issue-modal .custom-select-trigger { border: 1.5px solid var(--line); }
.issue-modal .custom-select-panel { border: 1px solid var(--line); box-shadow: 0 12px 32px rgba(47,111,237,.18); }
.issue-modal .custom-select-item:hover { background: #eef3ff; }
.issue-modal .custom-select-footer { border-top: 1px solid var(--line); }
.issue-modal .custom-select-arrow { color: var(--muted); }

/* ===== 客服弹窗蓝色调暗 ===== */
.issue-modal .modal-head { background: linear-gradient(135deg, #2359c4, #1d4fa8); }
.issue-modal #modalFields { background: #f4f6fb; }
.issue-modal #modalSave, .issue-modal #modalEnter { background: #2359c4; box-shadow: 0 6px 16px rgba(35,89,196,.22); }
.issue-modal .field input:focus, .issue-modal .field select:focus, .issue-modal .field textarea:focus { border-color: #2359c4; box-shadow: 0 0 0 4px rgba(35,89,196,.14); }
.issue-modal .upload-btn:hover { border-color: #2359c4; background: #e8eefc; }
.issue-modal .custom-select-panel { box-shadow: 0 12px 28px rgba(35,89,196,.16); }

.field-required-missing { border-color: var(--red) !important; box-shadow: 0 0 0 3px rgba(214,69,69,.15) !important; }

.issue-modal .custom-select-trigger.field-required-missing { border-color: var(--red) !important; box-shadow: 0 0 0 3px rgba(214,69,69,.15) !important; }
.issue-modal .field input.field-required-missing, .issue-modal .field select.field-required-missing, .issue-modal .field textarea.field-required-missing { border-color: var(--red) !important; box-shadow: 0 0 0 3px rgba(214,69,69,.15) !important; }
.issue-modal .field:has(.field-required-missing) label { color: var(--red); font-weight: 600; }

/* 手机端：发货订单表格精简，保证“送货”按钮可见 */
@media (max-width: 700px) {
  #courierOrders table,
  #orderSection table,
  #completedSection table {
    font-size: 12px;
    table-layout: auto;
  }
  #courierOrders table th,
  #courierOrders table td,
  #orderSection table th,
  #orderSection table td,
  #completedSection table th,
  #completedSection table td {
    padding: 6px 5px;
    white-space: nowrap;
  }
  /* 隐藏日期、档口、类型、开始时间、到货时间 */
  #courierOrders table th:nth-child(1), #courierOrders table td:nth-child(1),
  #courierOrders table th:nth-child(2), #courierOrders table td:nth-child(2),
  #courierOrders table th:nth-child(6), #courierOrders table td:nth-child(6),
  #courierOrders table th:nth-child(7), #courierOrders table td:nth-child(7),
  #courierOrders table th:nth-child(8), #courierOrders table td:nth-child(8),
  #courierOrders table th:nth-child(9), #courierOrders table td:nth-child(9) {
    display: none;
  }
  /* 款式列允许换行，避免撑开 */
  #courierOrders table tbody td:nth-child(4) {
    max-width: 110px;
    white-space: normal;
    word-break: break-word;
  }
}

/* 表头列筛选（WPS 风格） */
.col-filter-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  color: #7a8ab0;
  margin-left: 3px;
  padding: 0 2px;
  line-height: 1;
}
.col-filter-btn:hover { color: #16305f; }
.col-filter-pop {
  position: absolute;
  z-index: 500;
  background: #fff;
  border: 1px solid #d7e0f0;
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(0,0,0,.14);
  min-width: 180px;
  max-width: 280px;
  padding: 8px;
  font-size: 13px;
}
.col-filter-pop-head { font-weight: 600; color: #16305f; margin-bottom: 6px; }
.col-filter-pop-list { max-height: 200px; overflow: auto; }
.col-filter-item { display: block; padding: 3px 4px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.col-filter-item:hover { background: #f3f6fc; }
.col-filter-pop-actions { display: flex; gap: 8px; margin-top: 8px; }
.col-filter-pop-tools { display: flex; gap: 6px; margin-bottom: 6px; }
.col-filter-search { flex: 1; min-width: 0; border: 1px solid #d7e0f0; border-radius: 6px; padding: 3px 6px; font-size: 12px; }
.col-filter-sort { border: 1px solid #d7e0f0; border-radius: 6px; font-size: 12px; padding: 2px 4px; color: #16305f; background: #fff; }
.col-filter-all { font-weight: 600; border-bottom: 1px solid #eef2f8; margin-bottom: 3px; }
.col-filter-item { display: flex; align-items: center; gap: 6px; }
.col-filter-item .cfv { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.col-filter-item .cfc { color: #7a8ab0; font-size: 11px; flex-shrink: 0; }
.combobox { position:relative; display:inline-block; }
.combobox input { width:100%; box-sizing:border-box; padding-right:24px; }
.combobox-arrow { position:absolute; right:6px; top:50%; transform:translateY(-50%); background:none; border:0; cursor:pointer; color:var(--muted); font-size:12px; padding:2px; }
.combobox-panel { position:absolute; left:0; right:0; top:calc(100% + 4px); display:flex; flex-direction:column; background:#fff; border:1px solid var(--line); border-radius:10px; box-shadow:0 12px 28px rgba(35,89,196,.16); z-index:50; overflow:hidden; }
.combobox-list { flex:1; overflow-y:auto; max-height:240px; }
.combobox-item { display:block; width:100%; text-align:left; padding:9px 12px; background:#fff; border:0; border-bottom:1px solid #eef2f7; font-size:14px; cursor:pointer; }
.combobox-item:hover { background:#eef3ff; }
.combobox-empty { padding:10px 12px; color:var(--muted); font-size:13px; }
.combobox-footer { flex-shrink:0; padding:8px; background:#fff; border-top:1px solid var(--line); }
.style-row .combobox.style-sel { width:150px; }
.style-row .combobox.color-sel { width:110px; }
.style-row .combobox input { min-width:0; }.style-collapse { display:flex; flex-direction:column; gap:2px; }
.style-toggle { display:inline-block; margin-top:2px; padding:2px 6px; font-size:12px; color:var(--primary,#2f6fed); background:none; border:0; cursor:pointer; text-align:left; }@media (max-width: 700px) {
  #courierOrders, #orderSection, #completedSection { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  #orderSection table th:nth-child(6), #orderSection table td:nth-child(6),
  #orderSection table th:nth-child(7), #orderSection table td:nth-child(7),
  #orderSection table th:nth-child(8), #orderSection table td:nth-child(8),
  #orderSection table th:nth-child(9), #orderSection table td:nth-child(9),
  #orderSection table th:nth-child(10), #orderSection table td:nth-child(10) { display: none; }
  #orderSection table tbody td:nth-child(3) { max-width: 96px; white-space: normal; word-break: break-word; }
}@media (max-width: 700px) {
  main { padding: 12px 8px; }
  .panel { padding: 10px 8px; }
  .toolbar { flex-wrap: wrap; }
}.issue-table, #orderSection table, #completedSection table, #courierOrders table { table-layout: fixed; width: 100%; }
.issue-table th, .issue-table td, #orderSection table th, #orderSection table td, #completedSection table th, #completedSection table td, #courierOrders table th, #courierOrders table td { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.issue-table td { white-space: nowrap; }
#orderSection table tbody td, #completedSection table tbody td { white-space: normal; word-break: break-word; }
#orderSection table th:last-child, #orderSection table td:last-child, #completedSection table th:last-child, #completedSection table td:last-child { width: 200px; white-space: nowrap; }
.issue-table th:last-child, .issue-table td:last-child { width: 120px; white-space: nowrap; }.issue-table th:first-child, .issue-table td:first-child { width: 44px; }#orderSection table, #completedSection table, #wrongSection table { table-layout: fixed; width: 100%; }
#orderSection table th, #orderSection table td, #completedSection table th, #completedSection table td, #wrongSection table th, #wrongSection table td { padding: 6px 6px; font-size: 12px; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
#orderSection table tbody td, #completedSection table tbody td, #wrongSection table tbody td { white-space: normal; word-break: break-word; }.filter-row th { padding: 4px 6px; }
.filter-row input, .filter-row select { min-width: 36px; width: 100%; padding: 4px 6px; font-size: 12px; }
.issue-table th:nth-child(11), .issue-table td:nth-child(11) { width: 52px; }
.issue-table td:nth-child(8) { white-space: normal; overflow: visible; }.issue-table th:nth-child(4), .issue-table td:nth-child(4) { width: 118px; }.att-main { text-align:center; padding:30px 20px 20px; background:linear-gradient(180deg,#2f6fed,#5b8cff); border-radius:18px; color:#fff; }
.att-clock { font-size:56px; font-weight:700; letter-spacing:2px; line-height:1.1; }
.att-date { font-size:14px; opacity:.9; margin-top:4px; }
.att-tabs { display:flex; justify-content:center; gap:12px; margin:20px 0 0; }
.att-tab { padding:8px 22px; border-radius:20px; border:1px solid rgba(255,255,255,.6); background:rgba(255,255,255,.18); color:#fff; cursor:pointer; font-size:14px; }
.att-tab.active { background:#fff; color:#2f6fed; font-weight:600; }
.att-circle { width:150px; height:150px; border-radius:50%; margin:24px auto 14px; display:flex; align-items:center; justify-content:center; font-size:22px; font-weight:700; color:#fff; cursor:pointer; box-shadow:0 10px 30px rgba(0,0,0,.2); }
.att-circle.in { background:#34c759; }
.att-circle.out { background:#ff9500; }
.att-status { font-size:15px; margin-top:6px; }
.att-loc { font-size:13px; opacity:.85; margin-top:6px; }.dash-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:14px; }
.dash-card { background:#fff; border:1px solid var(--line); border-radius:12px; padding:12px; }
.dash-title { font-weight:600; margin-bottom:8px; }
.dash-card canvas { max-height:200px; }.nav-group-items { padding-left: 8px; }
.side-link.sub { font-size: 13px; padding-left: 24px; }@media (max-width: 700px) {
  #completedSection table th:nth-child(1), #completedSection table td:nth-child(1),
  #completedSection table th:nth-child(7), #completedSection table td:nth-child(7),
  #completedSection table th:nth-child(8), #completedSection table td:nth-child(8),
  #completedSection table th:nth-child(9), #completedSection table td:nth-child(9),
  #completedSection table th:nth-child(10), #completedSection table td:nth-child(10),
  #completedSection table th:nth-child(11), #completedSection table td:nth-child(11),
  #completedSection table th:nth-child(12), #completedSection table td:nth-child(12) { display:none; }
  #completedSection table tbody td:nth-child(4) { max-width:96px; white-space:normal; word-break:break-word; }
  #wrongSection table th:nth-child(5), #wrongSection table td:nth-child(5) { display:none; }
}
/* ===== 表格式横向滑动 + 列宽拖拽 ===== */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
#orderSection .table-scroll table, #completedSection .table-scroll table, #wrongSection .table-scroll table, #courierOrders .table-scroll table {
  table-layout: auto;
  width: max-content;
  min-width: calc(100% + 200px);
}
.table-scroll { scrollbar-width: thin; }
.table-scroll::-webkit-scrollbar { height: 10px; }
.table-scroll::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 6px; }
.table-scroll::-webkit-scrollbar-thumb { background: #b9c6dd; border-radius: 6px; }
.table-scroll::-webkit-scrollbar-thumb:hover { background: #94a3bc; }
.table-scroll th { position: relative; }
.table-scroll th .col-resizer {
  position: absolute;
  top: 0;
  right: 0;
  width: 9px;
  height: 100%;
  cursor: col-resize;
  z-index: 6;
  touch-action: none;
  user-select: none;
  border-right: 2px solid #8fa0bd;
  background: rgba(143,160,189,.12);
}
.table-scroll th .col-resizer:hover, .table-scroll th .col-resizer:active {
  border-right-color: #2f6fed;
  background: rgba(47,111,237,.16);
}

/* 手机上不再隐藏列，改用横向滑动查看全部 */
@media (max-width: 700px) {
  #courierOrders table th:nth-child(1), #courierOrders table td:nth-child(1),
  #courierOrders table th:nth-child(2), #courierOrders table td:nth-child(2),
  #courierOrders table th:nth-child(6), #courierOrders table td:nth-child(6),
  #courierOrders table th:nth-child(7), #courierOrders table td:nth-child(7),
  #courierOrders table th:nth-child(8), #courierOrders table td:nth-child(8),
  #courierOrders table th:nth-child(9), #courierOrders table td:nth-child(9),
  #orderSection table th:nth-child(6), #orderSection table td:nth-child(6),
  #orderSection table th:nth-child(7), #orderSection table td:nth-child(7),
  #orderSection table th:nth-child(8), #orderSection table td:nth-child(8),
  #orderSection table th:nth-child(9), #orderSection table td:nth-child(9),
  #orderSection table th:nth-child(10), #orderSection table td:nth-child(10),
  #completedSection table th:nth-child(1), #completedSection table td:nth-child(1),
  #completedSection table th:nth-child(7), #completedSection table td:nth-child(7),
  #completedSection table th:nth-child(8), #completedSection table td:nth-child(8),
  #completedSection table th:nth-child(9), #completedSection table td:nth-child(9),
  #completedSection table th:nth-child(10), #completedSection table td:nth-child(10),
  #completedSection table th:nth-child(11), #completedSection table td:nth-child(11),
  #completedSection table th:nth-child(12), #completedSection table td:nth-child(12),
  #wrongSection table th:nth-child(5), #wrongSection table td:nth-child(5) {
    display: table-cell;
  }
}
/* 手机隐藏编辑/删除，仅电脑显示 */
@media (max-width: 768px) {
  .desktop-only { display: none !important; }
}

/* 通用分页条 */
.stall-pager { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 10px 0; font-size: 13px; color: var(--text); }
.stall-pager .pager-info { color: var(--muted); }
.stall-pager select { padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; font-size: 12px; background: #fff; }
.stall-pager .btn.small { padding: 3px 8px; }

/* 系统选择 */
.chooser-modal { width: 360px; }
.chooser-body { display: flex; flex-direction: column; gap: 12px; padding: 18px; }
.chooser-body .btn { width: 100%; height: 46px; font-size: 16px; }

/* 新增发货订单：款式分组，多颜色件数 */
.style-group { border:1px solid var(--line); border-radius:8px; padding:8px; margin-bottom:8px; }
.style-group-head { display:flex; gap:6px; align-items:center; margin-bottom:6px; }
.style-group-head .style-sel { flex:0 0 auto; width:150px; min-width:0; }
.style-group-head .combobox.style-sel { width:150px; }
.color-list { display:flex; flex-direction:column; gap:6px; margin:6px 0; }
.color-row { display:flex; gap:6px; align-items:center; flex-wrap:wrap; }
.color-row .color-sel { flex:0 0 auto; width:110px; min-width:0; }
.color-row .combobox.color-sel { width:110px; }
.color-row input[type=number] { width:90px; }
.add-color-btn { align-self:flex-start; }
.color-tools { display:flex; gap:8px; align-items:center; }
.color-multi-panel { border:1px solid var(--line); border-radius:8px; padding:8px; margin-top:6px; }
.color-multi-list { display:flex; flex-wrap:wrap; gap:8px; max-height:150px; overflow:auto; }
.color-multi-item { display:flex; align-items:center; gap:5px; font-size:13px; }
.color-multi-actions { display:flex; justify-content:flex-end; gap:8px; margin-top:8px; }