:root {
  font-family: "Microsoft YaHei", system-ui, sans-serif;
  color: #18202b;
  background: #f4f7fb;
  line-height: 1.5;
}
* { box-sizing: border-box; }
body { margin: 0; }
.dashboard-page {
  position: relative;
  background: #f7f9fc;
  overflow-x: hidden;
}
.dashboard-page:after {
  content: "";
  position: fixed;
  z-index: 0;
  right: -12px;
  top: 126px;
  width: 410px;
  height: 760px;
  background: url("assets/login_building.png") no-repeat right bottom;
  background-size: contain;
  opacity: .25;
  filter: saturate(.65) hue-rotate(8deg);
  pointer-events: none;
}
.dashboard-page .container,
.dashboard-page .topbar { position: relative; z-index: 1; }
.topbar {
  height: 78px;
  background: #092b56;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(24px, calc((100vw - 1200px) / 2));
  box-shadow: 0 2px 8px #123d6830;
}
.brand-wrap { display: flex; align-items: center; gap: 18px; min-width: 0; }
.topbar-logo { width: 238px; height: 44px; object-fit: contain; object-position: left center; background: #fff; border-radius: 4px; padding: 4px 10px; }
.brand { font-size: 22px; font-weight: 700; letter-spacing: .01em; }
.topbar nav { display: flex; gap: 20px; align-items: center; }
.topbar a, .link-button { color: #fff; text-decoration: none; }
.topbar form { display: inline; }
.link-button { border: 0; background: none; font: inherit; cursor: pointer; }
.container { max-width: 1200px; margin: 28px auto; padding: 0 20px; }
h1 { font-size: 28px; }
.dashboard-hero {
  position: relative;
  min-height: 154px;
  margin: 0 0 8px;
  padding: 30px 500px 18px 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.dashboard-hero-copy { position: relative; z-index: 2; }
.dashboard-eyebrow { margin: 0 0 5px; color: #69319b; font-size: 13px; font-weight: 700; letter-spacing: .12em; }
.dashboard-hero h1 { margin: 0 0 8px; color: #153f67; font-size: 42px; line-height: 1.15; }
.dashboard-lead { margin: 0; color: #66788c; font-size: 15px; }
.dashboard-hero-visual { position: absolute; z-index: 1; top: 5px; right: 120px; width: 460px; height: 160px; object-fit: contain; object-position: center; }
.hero-book { position: absolute; border-radius: 8px 10px 5px 5px; box-shadow: 0 8px 18px #18334c22; }
.hero-book-back { right: 28px; bottom: 16px; width: 178px; height: 92px; background: #b38ace; transform: rotate(-10deg); }
.hero-book-mid { right: 12px; bottom: 26px; width: 184px; height: 92px; background: #6d4d9a; transform: rotate(7deg); }
.hero-book-front { right: 26px; bottom: 35px; width: 188px; height: 78px; background: #fff; border: 4px solid #173f68; transform: rotate(-2deg); padding: 13px 18px; }
.hero-book-front span { display: block; height: 5px; margin: 7px 0; border-radius: 5px; background: #9c77ba; }
.hero-scanner { position: absolute; left: 0; bottom: 24px; width: 65px; height: 82px; border-radius: 12px 12px 18px 18px; background: #173f68; transform: rotate(16deg); box-shadow: 0 9px 18px #18334c35; }
.hero-scanner:before { content: ""; position: absolute; top: 14px; left: 12px; right: 12px; height: 20px; border-radius: 4px; background: #e5d8ef; }
.hero-scanner i { position: absolute; top: 19px; left: 20px; width: 24px; height: 4px; background: #d8405d; box-shadow: 0 6px 0 #d8405d; }
.hero-scanner b { position: absolute; left: 24px; bottom: -21px; width: 18px; height: 36px; border-radius: 0 0 8px 8px; background: #173f68; }
h2 { font-size: 19px; margin-top: 0; }
.card {
  background: #fff;
  border: 1px solid #dfe7f0;
  border-radius: 12px;
  padding: 22px;
  margin: 18px 0;
  box-shadow: 0 4px 18px #18334c0a;
}
.approval-setting-card { display: flex; align-items: center; justify-content: space-between; gap: 20px; border-left: 5px solid #69319b; }
.approval-setting-card h2, .approval-setting-card p { margin: 0; }
.shortage-number { color: #b42318; font-weight: 700; }
.login-card { max-width: 420px; margin: 90px auto; }
.login-split {
  max-width: 1080px;
  min-height: 560px;
  margin: 58px auto;
  padding: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.08fr .92fr;
  border: 0;
  border-radius: 18px;
  box-shadow: 0 18px 48px #18334c24;
}
.login-split-brand {
  position: relative;
  overflow: hidden;
  padding: 34px 38px;
  color: #fff;
  background: #123d68;
}
.login-split-brand::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #123d6828 0%, #123d6818 42%, #123d68b8 100%);
  z-index: 1;
}
.login-building { position: absolute !important; inset: 0; z-index: 0 !important; width: 100% !important; height: 100% !important; max-width: none !important; padding: 0 !important; border-radius: 0 !important; object-fit: cover; opacity: .94; filter: contrast(1.04) saturate(.84); }
.login-split-brand img { position: relative; z-index: 2; width: 250px; max-width: 82%; height: auto; filter: none; background: #fff; padding: 8px 12px; border-radius: 4px; }
.login-brand-copy { position: absolute; z-index: 2; left: 38px; right: 28px; bottom: 34px; }
.login-brand-copy h1 { font-size: 27px; margin: 0 0 10px; color: #fff; }
.login-brand-copy p { margin: 0; color: #eaf3fb; letter-spacing: .08em; }
.login-split-form { background: #fff; display: flex; align-items: center; }
.login-form-inner { width: 100%; padding: 54px 54px; }
.login-kicker { color: #69319b; font-weight: 700; letter-spacing: .08em; margin-bottom: 10px; }
.login-form-inner h1 { margin: 0 0 12px; color: #173d64; }
.login-form-inner .primary { background: #176eae; width: 100%; margin-top: 8px; }
.narrow { max-width: 680px; }
.stack { display: grid; gap: 16px; }
.stack label { display: grid; gap: 7px; font-weight: 600; }
input, select {
  width: 100%;
  border: 1px solid #b9c7d8;
  border-radius: 8px;
  padding: 11px 12px;
  font: inherit;
  background: #fff;
}
input:focus, select:focus { outline: 3px solid #3087d629; border-color: #2f80c9; }
.primary, .button {
  display: inline-block;
  border: 0;
  border-radius: 8px;
  padding: 11px 18px;
  background: #1266a8;
  color: #fff;
  text-decoration: none;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.button.small { padding: 6px 12px; font-size: 13px; }
.button.secondary { background: #e7eef6; color: #24445f; }
.button.danger { background: #b62929; }
.button.danger-outline { background: #fff; color: #a92424; border: 1px solid #df9b9b; }
.button.danger-outline:hover { background: #fff1f1; border-color: #bd4545; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stats article, .stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  border-left: 5px solid #71449f;
  box-shadow: 0 4px 18px #18334c0a;
}
.stat-card {
  appearance: none;
  text-align: left;
  font: inherit;
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 9px 24px #18334c1a; }
.stat-card:focus { outline: 3px solid #3087d629; }
.stats b { display: block; font-size: 30px; color: #10588f; }
.stats span { display: block; color: #637285; }
.stats small { display: block; margin-top: 7px; color: #2b78b5; }
.dashboard-page .stats b { color: #65439a; }
.dashboard-page .stats small { color: #68419b; }
.section-head { display: flex; justify-content: space-between; align-items: center; }
.section-head h1 { margin-bottom: 2px; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid #e5ebf2; white-space: nowrap; }
th { color: #536273; background: #f7f9fc; }
.prepick-zone-orders { white-space: normal; min-width: 260px; line-height: 1.7; }
.pool-setting { display: flex; align-items: center; justify-content: space-between; border-left: 5px solid #23925a; }
.pool-setting.pool-closed { border-left-color: #b03a3a; }
.pool-setting h2, .pool-setting p { margin: 4px 0; }
.pool-assign-form { display: flex; gap: 7px; align-items: center; }
.pool-assign-form select { min-width: 190px; }
.pool-filter-form { margin: 10px 0 4px; max-width: 320px; }
.pool-quick-tools { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; margin: 10px 0 14px; padding: 10px; background: #f3f7fb; border-radius: 8px; }
.pool-quick-tools button { padding: 7px 11px; border: 1px solid #b8c8d8; background: #fff; color: #24587e; border-radius: 6px; cursor: pointer; }
.pool-quick-tools input { width: 82px; padding: 7px; }
.pool-tool-divider { height: 24px; border-left: 1px solid #cbd6e1; }
#selection-summary { color: #145b89; margin-left: auto; }
.muted, .empty { color: #748297; }
.mono { font-family: ui-monospace, monospace; }
.table-link {
  border: 0;
  background: none;
  color: #1266a8;
  padding: 0;
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.inline-form { display: inline; margin: 0; }
.status { padding: 4px 8px; border-radius: 12px; background: #e8eef5; }
.status.active, .status.completed { background: #daf3e4; color: #176f3d; }
.status.disabled, .status.cancelled { background: #ffe1e1; color: #8f2222; }
.status.picking { background: #fff0c9; color: #765500; }
.flash { padding: 13px 16px; border-radius: 8px; margin: 12px 0; }
.flash.success { background: #daf3e4; color: #176f3d; }
.flash.error { background: #ffe1e1; color: #8f2222; }
.note { background: #f1f6fb; border-left: 4px solid #2f80c9; padding: 12px; margin-top: 18px; }
.import-file-track {
  position: relative;
  display: block;
  overflow: hidden;
  border: 1px solid #b9c7d8;
  border-radius: 8px;
  background: #fff;
  min-height: 50px;
}
.import-file-track input[type="file"] {
  position: relative;
  z-index: 2;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding-right: 62px;
}
.import-file-progress {
  position: absolute;
  z-index: 1;
  inset: 0 auto 0 0;
  width: 0;
  background: linear-gradient(90deg, #d9ecfb, #9ed0f2);
  transition: width .2s ease;
}
.import-file-progress.complete { background: linear-gradient(90deg, #d8f2e4, #86d5aa); }
.import-file-progress.error { background: linear-gradient(90deg, #ffe4e4, #efaaaa); }
.import-progress-percent {
  position: absolute;
  z-index: 3;
  right: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: #245f8d;
  font-size: 13px;
  font-weight: 700;
  pointer-events: none;
}
.import-progress-message {
  min-height: 24px;
  margin-top: 12px;
  color: #5d7184;
}
.import-progress-message.active { color: #245f8d; }
.import-progress-message.success { color: #176f3d; font-weight: 700; }
.import-progress-message.error { color: #a92424; font-weight: 700; }
.download-hero { display: grid; grid-template-columns: 1fr 260px; gap: 28px; align-items: center; max-width: 920px; margin: 44px auto 18px; }
.download-hero h1 { margin: 2px 0 10px; color: #123d68; }
.download-hero .lead { font-size: 16px; color: #435569; max-width: 610px; }
.eyebrow { margin: 0; color: #1266a8; font-weight: 700; letter-spacing: .08em; font-size: 13px; }
.download-button { margin-top: 10px; font-size: 17px; padding: 13px 24px; }
.download-url { margin: 15px 0 0; font-size: 13px; color: #667789; word-break: break-all; }
.qr-panel { border-left: 1px solid #dfe7f0; padding-left: 26px; text-align: center; display: grid; gap: 8px; color: #435569; }
.qr-panel img { display: block; width: 184px; height: 184px; margin: 0 auto; border: 8px solid #fff; box-shadow: 0 2px 12px #18334c18; }
.qr-panel span { font-size: 13px; color: #738196; }
.install-guide { max-width: 920px; margin: 18px auto; }
.install-guide h2 { color: #123d68; margin-bottom: 10px; }
.install-guide li { margin: 8px 0; }
.warning-guide { border-left: 5px solid #d79b20; }
@media (max-width: 680px) {
  .login-split { display: block; min-height: 0; margin: 18px auto; }
  .login-split-brand { min-height: 220px; padding: 24px; }
  .login-brand-copy { left: 24px; bottom: 20px; }
  .login-brand-copy h1 { font-size: 21px; }
  .login-form-inner { padding: 30px 24px; }
  .download-hero { grid-template-columns: 1fr; margin-top: 18px; gap: 18px; }
  .qr-panel { border-left: 0; border-top: 1px solid #dfe7f0; padding: 20px 0 0; }
}
.import-form button:disabled { opacity: .72; cursor: wait; }
.grid-two { display: grid; grid-template-columns: minmax(280px, 380px) 1fr; gap: 20px; }
.user-admin-grid { grid-template-columns: minmax(320px, 1fr) minmax(320px, 1fr); }
.actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.actions form { margin: 0; }
.compact-actions { gap: 8px; }
.worker-stats { grid-template-columns: repeat(3, 1fr); margin-bottom: 18px; }
.filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr)) auto;
  gap: 14px;
  align-items: end;
}
.filters label { display: grid; gap: 7px; font-weight: 600; }
.filter-actions { display: flex; gap: 10px; align-items: center; }
.row-shortage { background: #fff6f6; }
.remark-cell { max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
.preview-card .section-head { gap: 16px; flex-wrap: wrap; }
.handoff-sheet {
  border: 1px solid #d9e4ef;
  border-radius: 14px;
  padding: 18px;
  background: #fcfdff;
}
.handoff-title {
  text-align: center;
  font-size: 26px;
  font-weight: 700;
  color: #163d63;
  margin-bottom: 16px;
}
.handoff-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 10px 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e3ebf3;
}
.grid-span-2 { grid-column: 1 / -1; }
.handoff-summary {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  padding: 14px 0;
  border-bottom: 1px solid #e3ebf3;
  font-weight: 700;
  color: #163d63;
}
.handoff-empty-state {
  padding: 34px 0;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  color: #1f4d76;
}
.handoff-remark {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #e3ebf3;
  color: #33485d;
}
.modal-open { overflow: hidden; }
.detail-modal {
  /* Do not use inset here: IE on XP ignores it and leaves the detail panel clipped. */
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 1000;
}
.detail-modal-backdrop {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background: #10283f99;
  background: rgba(16,40,63,.60);
}
.detail-modal-panel {
  position: absolute;
  top: 44px;
  right: 4%;
  bottom: 28px;
  left: 4%;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 70px #06152355;
  padding: 24px;
  /* Fixed sizing keeps the table scrollable in IE 8-11, where flex sizing is unreliable. */
  height: auto;
  overflow: hidden;
  min-height: 480px;
}
.detail-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  border-bottom: 1px solid #e3eaf2;
  padding-bottom: 14px;
}
.detail-modal-head h2 { margin: 0; color: #164a73; }
.detail-modal-head p { margin: 5px 0 0; }
.modal-close {
  border: 0;
  background: #edf3f8;
  color: #35546c;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.modal-message { padding: 30px; text-align: center; color: #64778a; }
.error-text { color: #a92424; }
.modal-table {
  margin-top: 14px;
  overflow-x: auto;
  overflow-y: scroll;
  height: 420px;
  min-height: 180px;
  border: 1px solid #dce7f0;
}
.modal-table table { min-width: 760px; }
.modal-table thead th { position: sticky; top: 0; z-index: 1; background: #eef4f9; }
.table-sort-button {
  border: 0;
  background: transparent;
  color: #35546c;
  padding: 0;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.table-sort-button:hover, .table-sort-button:focus { color: #1266a8; text-decoration: underline; }
.detail-modal-summary {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 9px;
  background: #eef6fc;
  color: #164a73;
  font-weight: 700;
  border-left: 4px solid #2f80c9;
}
@media (max-width: 760px) {
  .topbar { height: auto; padding: 14px; align-items: flex-start; }
  .topbar nav { gap: 9px; flex-wrap: wrap; justify-content: flex-end; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .worker-stats { grid-template-columns: 1fr; }
  .grid-two, .user-admin-grid { grid-template-columns: 1fr; }
  .filters { grid-template-columns: 1fr; }
  .handoff-grid { grid-template-columns: 1fr; }
  .grid-span-2 { grid-column: auto; }
  .detail-modal-panel { top: 12px; right: 2%; bottom: 12px; left: 2%; padding: 16px; }
  .modal-table { height: 300px; }
}
