:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --ink: #101828;
  --muted: #667085;
  --line: #e4e7ec;
  --primary: #2563eb;
  --primary-strong: #1d4ed8;
  --primary-soft: #eff6ff;
  --success: #079455;
  --warning: #dc6803;
  --danger: #d92d20;
  --shadow: 0 16px 40px rgba(16, 24, 40, .08);
  --ease-soft: cubic-bezier(.2, .8, .2, 1);
  --ease-ui: cubic-bezier(.22, .61, .36, 1);
  --font-rounded: "YouYuan", "骞煎渾", "Microsoft YaHei UI", "Microsoft YaHei", "HarmonyOS Sans SC", "MiSans", "PingFang SC", "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--font-rounded);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; }
button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: #344054;
  border-radius: 8px;
  min-height: 38px;
  padding: 0 14px;
  cursor: pointer;
  transition: border-color .22s var(--ease-ui), box-shadow .22s var(--ease-ui), background .22s var(--ease-ui), color .22s var(--ease-ui), transform .18s var(--ease-soft);
}
button:hover {
  border-color: #b2c6ff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .06);
}
button:active { transform: translateY(.5px) scale(.995); }
button:disabled {
  cursor: wait;
  opacity: .72;
  transform: none;
  box-shadow: none;
}
.primary {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}
.primary:hover {
  border-color: var(--primary-strong);
  background: var(--primary-strong);
}
.download-list-btn {
  border-color: #ea580c;
  background: #f97316;
  color: #fff;
  font-weight: 900;
}
.download-list-btn:hover {
  border-color: #c2410c;
  background: #ea580c;
  color: #fff;
}
.notice-btn {
  border-color: var(--danger);
  background: #fff5f5;
  color: var(--danger);
  font-weight: 800;
}
.notice-btn:hover {
  border-color: #b42318;
  background: #fee4e2;
  color: #b42318;
}
.small-confirm-btn {
  min-height: 32px;
  height: 32px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 800;
}
.filter-mini-btn {
  width: 72px;
  min-width: 72px;
  max-width: 72px;
  min-height: 38px;
  height: 38px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 900;
  flex: 0 0 72px;
}
.filter-mini-btn.price-pending-filter-btn {
  width: 118px;
  min-width: 118px;
  max-width: 118px;
  border-color: #f59e0b;
  background: #fff7ed;
  color: #b45309;
  flex-basis: 118px;
}
.filter-mini-btn.price-pending-filter-btn.active {
  border-color: #d97706;
  background: #f59e0b;
  color: #fff;
}
.inventory-month-tabs .inventory-price-pending-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 110px;
  min-width: 110px;
  max-width: 110px;
  height: 30px;
  min-height: 30px;
  margin-left: auto;
  margin-right: 18%;
  padding: 0 8px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1;
}
.filter-button-pair {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: end;
}
.job-filter-confirm {
  width: 72px;
  min-width: 72px;
  max-width: 72px;
  min-height: 38px;
  height: 38px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 900;
}
.job-filter-clear {
  width: 72px;
  min-width: 72px;
  max-width: 72px;
  min-height: 38px;
  height: 38px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 900;
}
.ghost {
  background: transparent;
  color: #475467;
  border-color: var(--line);
}
.install-app-btn {
  border-color: #14b8a6;
  background: #ecfdf5;
  color: #047857;
  font-weight: 950;
}
.install-app-btn:hover {
  border-color: #0f766e;
  background: #ccfbf1;
  color: #0f766e;
}
.desktop-notifier-btn {
  border-color: #2563eb;
  background: #2563eb;
  color: #ffffff;
  font-weight: 950;
}
.desktop-notifier-btn:hover {
  border-color: #1d4ed8;
  background: #1d4ed8;
  color: #ffffff;
}
.login-form .install-app-btn {
  min-height: 42px;
  border-radius: 10px;
  background: #f0fdfa;
}
html:not(.tablet-install-allowed) .install-app-btn {
  display: none !important;
}
html.tablet-install-allowed .install-app-btn {
  display: inline-flex !important;
}
.login-form .install-app-btn {
  justify-content: center;
}
.install-guide {
  display: grid;
  gap: 12px;
}
.install-guide-card {
  padding: 14px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f8fbff;
}
.install-guide-card strong {
  display: block;
  margin-bottom: 8px;
  color: #101828;
}
.install-guide-card p {
  margin: 0;
  color: #475467;
  line-height: 1.7;
  font-weight: 800;
}
.hidden { display: none !important; }
body.auth-loading #loginView,
body.auth-loading #appView,
body.auth-login #bootScreen,
body.auth-login #appView,
body.auth-app #bootScreen,
body.auth-app #loginView {
  display: none !important;
}
body.auth-loading #bootScreen,
body.auth-login #loginView {
  display: grid !important;
}
body.auth-loading .custom-select-menu,
body.auth-loading .custom-select-menu-floating,
body.auth-login .custom-select-menu,
body.auth-login .custom-select-menu-floating {
  display: none !important;
}
body.auth-app #appView {
  display: grid !important;
}
body.auth-loading .boot-card {
  animation: shellFadeLift .34s var(--ease-soft) both;
}
body.auth-login .login-form {
  animation: shellFadeLift .38s var(--ease-soft) both;
}
body.auth-app .app-shell {
  animation: appSoftIn .32s var(--ease-soft) both;
}
@keyframes shellFadeLift {
  from {
    opacity: 0;
    transform: translateY(10px) scale(.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@keyframes appSoftIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.muted, .hint { color: var(--muted); }
.hint { margin: 0; font-size: 13px; }
.eyebrow {
  margin: 0 0 12px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  color: #0f172a;
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
  background:
    radial-gradient(circle at 50% 18%, rgba(37,99,235,.06), transparent 35%),
    linear-gradient(135deg, #ffffff, #f7f9fc);
}
.boot-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, #ffffff, #f5f7fb);
}
.boot-card {
  display: grid;
  justify-items: center;
  gap: 14px;
  width: min(360px, 100%);
  padding: 34px 28px;
  border: 1px solid #e6edf5;
  border-radius: 10px;
  background: rgba(255,255,255,.96);
  box-shadow: var(--shadow);
  text-align: center;
  font-weight: 900;
}
.boot-spinner {
  width: 36px;
  height: 36px;
  border: 4px solid #dbeafe;
  border-top-color: var(--primary);
  border-radius: 999px;
  animation: bootSpin .95s linear infinite;
}
.boot-card small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
@keyframes bootSpin {
  to { transform: rotate(360deg); }
}
.login-form {
  width: min(460px, 100%);
  align-content: center;
  gap: 16px;
  padding: 36px 34px;
  border: 1px solid #d9e2ee;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 18px 44px rgba(15, 23, 42, .10);
  backdrop-filter: none;
}
.login-form h1 {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 4px;
  color: #0f172a;
  font-size: 30px;
  line-height: 1.2;
  letter-spacing: 0;
  font-weight: 900;
  text-rendering: geometricPrecision;
}
.app-version {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  margin-left: 6px;
  white-space: nowrap;
  vertical-align: baseline;
}
.login-form h1 .app-version {
  font-size: 13px;
}
.app-version.is-updating {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.app-version.is-updating::after {
  content: "";
  width: 12px;
  height: 12px;
  border: 2px solid #cbd5e1;
  border-top-color: #2563eb;
  border-radius: 999px;
  animation: loginSpin .9s linear infinite;
}
.login-form label {
  display: grid;
  gap: 7px;
  color: #344054;
  font-size: 14px;
  font-weight: 900;
}
.login-form input,
.login-form select {
  min-height: 46px;
  border-color: #b8c4d4;
  border-radius: 10px;
  color: #0f172a;
  font-size: 15px;
}
.login-form .primary {
  min-height: 46px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 900;
}
.login-form.is-submitting button[type="submit"],
.login-form.is-updating button[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.login-form.is-submitting button[type="submit"]::before,
.login-form.is-updating button[type="submit"]::before {
  content: "";
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255,255,255,.55);
  border-top-color: #fff;
  border-radius: 999px;
  animation: loginSpin .92s linear infinite;
}
@keyframes loginSpin {
  to { transform: rotate(360deg); }
}
.login-loading-status {
  min-height: 18px;
  color: #475467;
  font-size: 13px;
  font-weight: 850;
  text-align: center;
}
.login-form:not(.is-submitting):not(.is-updating) .login-loading-status {
  color: transparent;
}
.login-account-field {
  position: relative;
}
.login-account-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}
.login-account-wrap.has-saved-logins {
  grid-template-columns: minmax(0, 1fr) 38px;
}
.login-account-wrap.has-saved-logins input {
  border-radius: 8px 0 0 8px;
}
.saved-login-toggle {
  width: 38px;
  min-width: 38px;
  min-height: 40px;
  padding: 0;
  border-left: 0;
  border-radius: 0 8px 8px 0;
  background: #f8fafc;
  color: #475467;
  font-size: 13px;
}
.saved-login-dropdown {
  position: absolute;
  z-index: 90;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  display: grid;
  gap: 4px;
  max-height: 220px;
  overflow: auto;
  padding: 6px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(16, 24, 40, .14);
  transform-origin: top center;
  animation: dropdownSoftIn .24s var(--ease-soft) both;
}
.saved-login-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  gap: 6px;
  align-items: center;
  min-height: 36px;
  padding: 4px 4px 4px 10px;
  border-radius: 6px;
  color: #344054;
  font-weight: 800;
  transition: background .18s var(--ease-ui), color .18s var(--ease-ui), transform .18s var(--ease-soft);
}
.saved-login-option:hover {
  background: #eff6ff;
  transform: translateX(2px);
}
.saved-login-option small {
  display: block;
  margin-top: 2px;
  color: #667085;
  font-size: 11px;
  font-weight: 700;
}
.saved-login-name {
  min-width: 0;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.saved-login-remove {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border-color: transparent;
  background: transparent;
  color: #98a2b3;
  font-size: 20px;
  line-height: 1;
}
.saved-login-remove:hover {
  border-color: #fecaca;
  background: #fef2f2;
  color: #d92d20;
}
.form-grid { display: grid; gap: 14px; align-content: start; }
label {
  display: grid;
  gap: 7px;
  color: #344054;
  font-size: 14px;
  font-weight: 600;
}
.field-title {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.required-mark {
  color: var(--danger);
  font-size: 15px;
  line-height: 1;
}
.required-field input,
.required-field select,
.required-field textarea {
  border-color: #d0d5dd;
  background: #fff;
}
.required-field input:invalid,
.required-field select:invalid,
.required-field textarea:invalid {
  border-color: rgba(217, 45, 32, .72);
  background: #fffafa;
}
.required-field input:invalid:focus,
.required-field select:invalid:focus,
.required-field textarea:invalid:focus {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px rgba(217, 45, 32, .12);
}
.compact-required {
  gap: 4px;
  font-size: 12px;
}
input, select, textarea {
  width: 100%;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  min-height: 40px;
  padding: 8px 11px;
  outline: none;
  transition: border-color .22s var(--ease-ui), box-shadow .22s var(--ease-ui), background .22s var(--ease-ui);
}
input:focus, select:focus, textarea:focus {
  border-color: #84adff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
}
select:hover {
  border-color: #bfdbfe;
  background-color: #f8fbff;
}
textarea { min-height: 88px; resize: vertical; }
.custom-select-shell {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
}
.custom-select-native {
  position: absolute !important;
  inset: auto auto 0 0 !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 1px !important;
  padding: 0 !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.custom-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  padding: 8px 11px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  background: #fff;
  color: #101828;
  text-align: left;
  font-weight: 850;
}
.custom-select-trigger:hover {
  border-color: #bfdbfe;
  background: #f8fbff;
}
.custom-select-trigger:disabled {
  cursor: not-allowed;
  opacity: .7;
}
.custom-select-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.custom-select-arrow {
  flex: 0 0 auto;
  color: #667085;
  transition: transform .22s var(--ease-soft);
}
.custom-select-shell.open .custom-select-arrow {
  transform: rotate(180deg);
}
.custom-select-menu {
  position: absolute;
  z-index: 1200;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  display: none;
  gap: 4px;
  max-height: 260px;
  overflow: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  padding: 7px;
  border: 1px solid #dbe4f0;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 16px 36px rgba(16, 24, 40, .16);
  transform-origin: top center;
}
.custom-select-shell.open .custom-select-menu {
  display: grid;
  animation: dropdownSoftIn .24s var(--ease-soft) both;
}
.custom-select-option {
  justify-content: flex-start;
  min-height: 32px;
  padding: 6px 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #111827;
  text-align: left;
  font-size: 13px;
  font-weight: 900;
  box-shadow: none;
  touch-action: pan-y;
}
.custom-select-option:hover {
  background: #eff6ff;
  color: #1d4ed8;
}
.custom-select-option.selected {
  background: #dbeafe;
  color: #1d4ed8;
}
.custom-select-option.custom-select-option-danger {
  color: #dc2626;
  background: #fff1f2;
  font-weight: 950;
}
.custom-select-option.custom-select-option-danger:hover,
.custom-select-option.custom-select-option-danger.selected {
  color: #b91c1c;
  background: #ffe4e6;
}
.custom-select-trigger.custom-select-danger .custom-select-value {
  color: #dc2626;
  font-weight: 950;
}
.custom-select-option:disabled {
  color: #98a2b3;
  background: #f8fafc;
}
.custom-select-menu-floating {
  position: fixed !important;
  right: auto !important;
  display: grid !important;
  z-index: 99999 !important;
  background: #fff !important;
  transform: none !important;
  filter: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  contain: paint;
}
.custom-select-menu-floating.custom-select-menu-in-dialog {
  z-index: 2147483647 !important;
  contain: none !important;
}
.field-invalid {
  border-color: #f04438 !important;
  background: #fff5f5 !important;
  box-shadow: 0 0 0 3px rgba(240, 68, 56, .12) !important;
}
.custom-select-status {
  width: 112px;
  flex: 0 0 auto;
}
.custom-select-compact .custom-select-trigger,
.custom-select-status .custom-select-trigger {
  min-height: 30px;
  padding: 5px 8px;
  font-size: 13px;
}
.custom-select-compact .custom-select-option,
.custom-select-status .custom-select-option {
  min-height: 28px;
  padding: 5px 8px;
  font-size: 12px;
}
.custom-select-table .custom-select-trigger {
  min-height: 34px;
}
.check-line {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.check-line input {
  width: 16px;
  min-height: 16px;
  height: 16px;
  padding: 0;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px 1fr;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px 16px;
  background: rgba(255,255,255,.92);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 50px;
  padding: 0 6px;
}
.brand-mark {
  display: block;
  width: 44px;
  height: 44px;
  min-width: 44px;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  object-fit: contain;
  object-position: center;
  transform: none;
}
.brand strong {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-size: 15px;
  white-space: nowrap;
}
.brand .app-version {
  font-size: 11px;
  margin-left: 0;
}
.brand small { display: block; color: var(--muted); margin-top: 3px; }
nav { display: grid; gap: 6px; }
nav button {
  justify-content: flex-start;
  text-align: left;
  background: transparent;
  color: #475467;
  border-color: transparent;
  min-height: 42px;
  font-weight: 700;
}
nav button.active {
  background: var(--primary-soft);
  border-color: #dbeafe;
  color: var(--primary);
}
nav button.nav-sub-action {
  position: relative;
  border-color: #fed7aa;
  background: #fff7ed;
  color: #c2410c;
  font-weight: 900;
}
nav button.nav-sub-action:hover {
  border-color: #fdba74;
  background: #ffedd5;
}
nav button.nav-sub-action.has-drafts::after {
  content: attr(data-badge);
  position: absolute;
  top: 5px;
  right: 8px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 900;
  line-height: 18px;
  box-shadow: 0 0 0 2px #fff;
}

nav button.inventory-nav-btn {
  position: relative;
}

nav button.inventory-nav-btn.has-direct-purchase::after {
  content: attr(data-direct-purchase-badge);
  position: absolute;
  top: 4px;
  right: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 12px;
  font-weight: 950;
  line-height: 19px;
  box-shadow: 0 0 0 2px #fff;
}

nav button.purchase-nav-btn {
  position: relative;
}

nav button.purchase-nav-btn.has-purchase-pending::after {
  content: attr(data-purchase-badge);
  position: absolute;
  top: 5px;
  right: 8px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 900;
  line-height: 18px;
  box-shadow: 0 0 0 2px #fff;
}
.online-status {
  margin-top: auto;
  position: relative;
}
.offline-status {
  margin-top: 6px;
}
.online-status:not(.hidden) ~ .current-account,
.offline-status:not(.hidden) + .current-account {
  margin-top: 0;
}
.online-status-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
  font-weight: 900;
}
.online-status-btn:hover {
  border-color: #86efac;
  background: #dcfce7;
  color: #166534;
}
.offline-status-btn {
  border-color: #e4e7ec;
  background: #f8fafc;
  color: #667085;
}
.offline-status-btn:hover {
  border-color: #d0d5dd;
  background: #f2f4f7;
  color: #344054;
}
.online-person {
  position: relative;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}
.online-person::before,
.online-person::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background: #16a34a;
}
.online-person::before {
  top: 1px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
}
.online-person::after {
  bottom: 1px;
  width: 15px;
  height: 8px;
  border-radius: 999px 999px 5px 5px;
}
.offline-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #98a2b3;
  box-shadow: 0 0 0 3px #f2f4f7;
}
.online-list {
  display: grid;
  gap: 8px;
}
.online-users-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 100;
  width: 100%;
  max-height: min(340px, calc(100vh - 180px));
  overflow-y: auto;
  overflow-x: hidden;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 16px 36px rgba(16, 24, 40, .18);
  transform-origin: bottom center;
  animation: softPopoverIn .2s var(--ease-soft) both;
}
.online-users-panel::after {
  display: none;
  content: "";
  position: absolute;
  left: 26px;
  bottom: -7px;
  width: 12px;
  height: 12px;
  transform: rotate(45deg);
  border-right: 1px solid #bbf7d0;
  border-bottom: 1px solid #bbf7d0;
  background: #ffffff;
}
.online-users-panel h4 {
  margin: 0;
  color: #166534;
  font-size: 13px;
  font-weight: 950;
}
.online-user-row {
  display: block;
  padding: 7px 9px;
  border: 1px solid #d1fadf;
  border-radius: 8px;
  background: #f6fef9;
  line-height: 1.25;
}
.online-user-row strong {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #101828;
  font-size: 13px;
}
.online-user-row small {
  display: block;
  margin-top: 3px;
  color: #667085;
  font-weight: 700;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.online-user-row .online-user-location {
  color: #2563eb;
  font-weight: 950;
}
.online-duration-line {
  display: flex !important;
  align-items: center;
  gap: 7px;
}
.online-activity-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #ef4444;
  box-shadow: 0 0 0 3px #fee2e2;
}
.online-activity-dot.active {
  background: #16a34a;
  box-shadow: 0 0 0 3px #dcfce7;
}
.online-activity-dot.idle {
  background: #ef4444;
  box-shadow: 0 0 0 3px #fee2e2;
}
.online-user-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #16a34a;
  box-shadow: 0 0 0 3px #dcfce7;
}
.offline-user-dot {
  background: #98a2b3;
  box-shadow: 0 0 0 3px #f2f4f7;
}
.current-account {
  margin-top: auto;
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1d4ed8;
}
.current-account span {
  font-size: 12px;
  font-weight: 800;
  color: #475467;
}
.current-account strong {
  font-size: 15px;
  line-height: 1.2;
  color: #101828;
  overflow-wrap: anywhere;
}
.current-account small {
  color: #2563eb;
  font-weight: 800;
}
#logoutBtn { margin-top: 0; }

.content {
  min-width: 0;
  padding: 28px;
}
.view:not(.hidden) {
  animation: viewSoftIn .22s var(--ease-soft) both;
}
@keyframes viewSoftIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.topbar h2 {
  margin: 0 0 5px;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: 0;
}
.topbar p { margin: 0; color: var(--muted); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; }
.job-draft-entry {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 900;
}
.job-draft-entry strong {
  min-width: 22px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  text-align: center;
}
.job-draft-entry.has-drafts {
  border-color: #f59e0b;
  background: #fff7ed;
  color: #c2410c;
}
.job-draft-entry.has-drafts strong {
  background: #f97316;
  color: #fff;
}

.metric-grid, .kanban, .inventory-grid, .two-col { display: grid; gap: 16px; }
.metric-grid { grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); }
.metric, .panel, .job-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}
.metric {
  position: relative;
  overflow: hidden;
  padding: 16px;
}
.metric::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), #14b8a6);
}
.metric span { color: var(--muted); font-size: 13px; font-weight: 700; }
.metric strong {
  display: block;
  margin-top: 9px;
  font-size: 31px;
  line-height: 1;
}
.two-col { grid-template-columns: 1fr 1fr; margin-top: 16px; }
.panel { padding: 16px; }
.panel h3 { margin: 0 0 12px; font-size: 16px; }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.section-head h3 { margin: 0; }

.dashboard-board {
  display: grid;
  gap: 12px;
}
.dashboard-control-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px;
  border: 1px solid #edf0f5;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .025);
}
.dashboard-control-row label {
  min-width: 180px;
}
.dashboard-control-row select {
  width: 100%;
  min-height: 34px;
  border-color: #e4e7ec;
  background: #fff;
  color: #344054;
  font-size: 13px;
  font-weight: 800;
}
.dashboard-shop-picker {
  position: relative;
  min-width: 220px;
  max-width: 360px;
}
.dashboard-year-picker {
  position: relative;
  min-width: 126px;
}
.dashboard-production-head-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.dashboard-production-year-picker {
  min-width: 112px;
}
.dashboard-production-year-compare {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #eef2f7;
}
.dashboard-production-year-compare article {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  min-height: 78px;
  padding: 16px 18px;
  border: 1px solid #e4e7ec;
  border-radius: 7px;
  background: #fff;
}
.dashboard-completed-year-card {
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.dashboard-completed-year-card:hover,
.dashboard-completed-year-card:focus-visible {
  border-color: #84adff;
  box-shadow: 0 8px 22px rgba(23, 92, 211, .12);
  transform: translateY(-1px);
  outline: none;
}
.dashboard-production-year-compare strong {
  color: #175cd3;
  font-size: 19px;
}
.dashboard-production-year-compare span {
  color: #101828;
  font-size: 16px;
  font-weight: 900;
}
.dashboard-production-year-compare small {
  color: #667085;
  font-size: 14px;
  font-weight: 800;
}
.dashboard-completed-year-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #eff6ff;
}
.dashboard-completed-year-summary strong {
  color: #175cd3;
  font-size: 17px;
}
.dashboard-completed-year-summary span {
  color: #344054;
  font-weight: 800;
}
.dashboard-completed-year-table {
  max-height: min(62vh, 620px);
  overflow: auto;
}
.dashboard-completed-year-table .move-thumb {
  width: 46px;
  height: 46px;
}
.dashboard-shop-trigger,
.dashboard-year-trigger {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #e4e7ec;
  border-radius: 8px;
  background: #fff;
  color: #344054;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  list-style: none;
  transition: border-color .22s var(--ease-ui), box-shadow .22s var(--ease-ui), background .22s var(--ease-ui), color .22s var(--ease-ui);
}
.dashboard-shop-trigger:hover,
.dashboard-year-trigger:hover {
  border-color: #bfdbfe;
  background: #f8fbff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, .07);
}
.dashboard-shop-trigger::after,
.dashboard-year-trigger::after {
  content: "▾";
  margin-left: auto;
  color: #667085;
  transition: transform .22s var(--ease-soft), color .22s var(--ease-ui);
}
.dashboard-shop-picker.open .dashboard-shop-trigger::after,
.dashboard-year-picker.open .dashboard-year-trigger::after {
  transform: rotate(180deg);
}
.dashboard-shop-menu,
.dashboard-year-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  display: grid;
  gap: 4px;
  width: min(420px, 80vw);
  max-height: 320px;
  overflow: auto;
  padding: 8px;
  border: 1px solid #e4e7ec;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 28px rgba(16, 24, 40, .14);
  transform-origin: top center;
}
.dashboard-shop-menu {
  display: none;
}
.dashboard-shop-picker.open .dashboard-shop-menu {
  display: grid;
  animation: dropdownSoftIn .24s var(--ease-soft) both;
}
.dashboard-year-menu {
  display: none;
  width: 150px;
}
.dashboard-year-picker.open .dashboard-year-menu {
  display: grid;
  animation: dropdownSoftIn .24s var(--ease-soft) both;
}
.dashboard-shop-tools {
  display: flex;
  gap: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid #eef2f7;
}
.dashboard-shop-tools button {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}
.dashboard-shop-mode-btn {
  border-color: #2563eb;
  background: #fff;
  color: #2563eb;
}
.dashboard-shop-mode-btn.active {
  background: #2563eb;
  color: #fff;
}
.dashboard-shop-clear-btn {
  border-color: #dbeafe;
  background: #eff6ff;
  color: #1d4ed8;
}
.dashboard-shop-option,
.dashboard-year-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 30px;
  padding: 6px 8px;
  border-radius: 7px;
  color: #344054;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
  transition: background .18s var(--ease-ui), color .18s var(--ease-ui), transform .18s var(--ease-soft);
}
.dashboard-shop-single {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
}
.dashboard-shop-single.selected {
  background: #eff6ff;
  color: #1d4ed8;
}
.dashboard-control-row .dashboard-shop-option,
.dashboard-trend-tools .dashboard-year-option {
  display: flex;
  min-width: 0;
}
.dashboard-shop-option input,
.dashboard-year-option input {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  min-height: 15px;
  margin: 0;
  padding: 0;
  border-radius: 4px;
}
.dashboard-shop-option span,
.dashboard-year-option span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dashboard-shop-option:hover,
.dashboard-year-option:hover {
  background: #f8fafc;
  transform: translateX(2px);
}
.dashboard-shop-option.all-option {
  color: #1d4ed8;
  background: #eff6ff;
}
.dashboard-refresh-time {
  margin-left: auto;
  color: #667085;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}
.dashboard-kpi-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0;
  overflow: hidden;
  border: 1px solid #f5df8d;
  border-radius: 8px;
  background: #fff9df;
}
.dashboard-kpi-strip article {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 14px;
  border-right: 1px solid rgba(245, 158, 11, .24);
}
.dashboard-kpi-strip article:last-child {
  border-right: 0;
}
.dashboard-kpi-strip span {
  color: #7c5b12;
  font-size: 13px;
  font-weight: 900;
}
.dashboard-kpi-strip strong {
  color: #344054;
  font-size: 16px;
  font-weight: 950;
  white-space: nowrap;
}
.dashboard-main-grid,
.dashboard-top-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.dashboard-main-grid.dashboard-main-grid-single {
  grid-template-columns: 1fr;
}
.dashboard-bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.dashboard-panel {
  min-width: 0;
  padding: 14px 16px 16px;
  border: 1px solid #edf0f5;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}
.dashboard-panel h3 {
  margin: 0 0 12px;
  color: #101828;
  font-size: 16px;
  font-weight: 950;
}
.dashboard-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px dashed #edf0f5;
}
.dashboard-panel-head h3 {
  position: relative;
  margin: 0;
  padding-left: 10px;
}
.dashboard-panel-head h3::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  width: 3px;
  height: 15px;
  border-radius: 999px;
  background: #7a5af8;
}
.dashboard-mini-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.dashboard-mini-tabs span {
  min-height: 24px;
  padding: 4px 9px;
  border: 1px solid #e4e7ec;
  border-radius: 6px;
  color: #667085;
  background: #fff;
  font-size: 12px;
  font-weight: 900;
}
.dashboard-mini-tabs button {
  min-height: 24px;
  padding: 4px 10px;
  border: 1px solid #e4e7ec;
  border-radius: 6px;
  background: #fff;
  color: #667085;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}
.dashboard-mini-tabs span.active,
.dashboard-mini-tabs button.active {
  border-color: #7a5af8;
  color: #6941c6;
  background: #f4f0ff;
}
.dashboard-mini-tabs button:hover {
  border-color: #a78bfa;
  color: #6941c6;
}
.dashboard-trend-tools {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.dashboard-trend-tools label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #475467;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}
.dashboard-year-select {
  width: 104px;
  min-height: 30px;
  padding: 4px 8px;
  border-color: #d0d5dd;
  background: #fff;
  color: #344054;
  font-size: 13px;
  font-weight: 900;
}
.dashboard-live-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 12px;
}
.dashboard-live-metric {
  position: relative;
  min-height: 94px;
  padding: 14px;
  overflow: hidden;
  border: 1px solid #edf0f5;
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, #fbfcff);
}
.dashboard-status-link {
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.dashboard-status-link:hover,
.dashboard-status-link:focus-visible {
  transform: translateY(-1px);
  border-color: #bfdbfe;
  box-shadow: 0 10px 24px rgba(37, 99, 235, .10);
  outline: none;
}
.dashboard-live-metric::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: #7a5af8;
}
.dashboard-live-metric span {
  color: #667085;
  font-size: 13px;
  font-weight: 900;
}
.dashboard-live-metric strong {
  display: block;
  margin-top: 10px;
  color: #101828;
  font-size: 30px;
  line-height: 1;
  font-weight: 950;
}
.dashboard-live-metric small {
  display: block;
  margin-top: 8px;
  color: #98a2b3;
  font-size: 12px;
  font-weight: 800;
}
.dashboard-live-metric .dashboard-money,
.dashboard-money {
  margin-top: 8px;
  color: #dc2626;
  font-size: 13px;
  font-weight: 950;
}
.dashboard-completion-amount-card::before {
  background: #ef4444;
}
.dashboard-completion-amount-card strong {
  color: #dc2626;
  font-size: 26px;
}
.dashboard-completion-quantity-card::before {
  background: #2563eb;
}
.dashboard-status-waiting::before,
.dashboard-status-waiting .dashboard-bar-fill { background: #facc15; }
.dashboard-status-purchase::before,
.dashboard-status-purchase .dashboard-bar-fill { background: #2563eb; }
.dashboard-status-schedule::before,
.dashboard-status-schedule .dashboard-bar-fill { background: #f97316; }
.dashboard-status-production::before,
.dashboard-status-production .dashboard-bar-fill { background: #8b5cf6; }
.dashboard-status-outsourced::before,
.dashboard-status-outsourced .dashboard-bar-fill { background: #06b6d4; }
.dashboard-status-completed::before,
.dashboard-status-completed .dashboard-bar-fill { background: #16a34a; }
.dashboard-chart-panel {
  min-height: 306px;
}
.dashboard-bar-chart {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
  align-items: end;
  gap: 14px;
  min-height: 238px;
  padding: 8px 4px 0;
}
.dashboard-bar-item {
  display: grid;
  justify-items: center;
  gap: 8px;
  min-width: 0;
}
.dashboard-bar-value {
  min-height: 18px;
  color: #6941c6;
  font-size: 12px;
  font-weight: 950;
  white-space: nowrap;
}
.dashboard-amount-value {
  color: #dc2626;
}
.dashboard-bar-track {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 100%;
  height: 178px;
  border-bottom: 1px solid #edf0f5;
}
.dashboard-bar-fill {
  width: min(38px, 68%);
  min-height: 4px;
  border-radius: 7px 7px 0 0;
  background: linear-gradient(180deg, #7a5af8, #9b8afb);
  box-shadow: 0 8px 18px rgba(122, 90, 248, .18);
}
.dashboard-bar-label {
  color: #667085;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}
.dashboard-trend-chart .dashboard-bar-fill {
  background: linear-gradient(180deg, #7a5af8, #c084fc);
}
.dashboard-trend-chart small {
  color: #98a2b3;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.dashboard-month-chart {
  grid-template-columns: repeat(12, minmax(42px, 1fr));
  gap: 8px;
}
.dashboard-month-chart .dashboard-bar-fill {
  width: min(28px, 72%);
}
.dashboard-month-chart .dashboard-month-dual-track {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
}
.dashboard-month-chart .dashboard-month-dual-track.has-custom .dashboard-bar-fill {
  width: 14px;
}
.dashboard-month-chart .dashboard-bar-label {
  font-size: 11px;
}
.dashboard-year-track {
  gap: 5px;
}
.dashboard-year-track .dashboard-bar-fill {
  width: min(22px, 40%);
}
.dashboard-current-year-fill {
  background: linear-gradient(180deg, #7a5af8, #9b8afb);
}
.dashboard-amount-fill {
  background: linear-gradient(180deg, #f97316, #fb923c);
  box-shadow: 0 8px 18px rgba(249, 115, 22, .18);
}
.dashboard-custom-month-fill {
  background: linear-gradient(180deg, #10b981, #06b6d4);
  box-shadow: 0 8px 18px rgba(6, 182, 212, .18);
}
.dashboard-previous-year-fill {
  background: linear-gradient(180deg, #94a3b8, #cbd5e1);
  box-shadow: 0 8px 18px rgba(100, 116, 139, .14);
}
.dashboard-amount-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 20px;
  padding: 2px 7px;
  border: 1px solid #fecaca;
  border-radius: 999px;
  background: #fff1f2;
  color: #101828;
  font-size: 12px;
  font-weight: 950;
  white-space: nowrap;
}
.dashboard-amount-label b {
  color: #101828;
}
.dashboard-trend-chart .dashboard-amount-label,
.dashboard-trend-chart .dashboard-amount-label b {
  color: #101828;
}
.dashboard-custom-month-label {
  max-width: 96px;
  color: #0f766e;
  font-size: 11px;
  font-weight: 950;
  text-align: center;
  overflow-wrap: anywhere;
}
.dashboard-chart-legend {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  color: #667085;
  font-size: 12px;
  font-weight: 850;
}
.dashboard-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.dashboard-chart-legend i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}
.dashboard-chart-legend i.current { background: #7a5af8; }
.dashboard-chart-legend i.previous { background: #94a3b8; }
.dashboard-chart-legend i.amount { background: #dc2626; }
.dashboard-chart-legend i.custom { background: #06b6d4; }
.dashboard-compare-month {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #475467;
  font-size: 12px;
  font-weight: 900;
}
.dashboard-compare-month span {
  white-space: nowrap;
}
.dashboard-compare-pill {
  min-width: 74px;
  min-height: 30px;
  padding: 4px 10px;
  border: 1px solid #d0d5dd;
  border-radius: 999px;
  background: #fff;
  color: #101828;
  font-size: 12px;
  font-weight: 850;
}
.dashboard-time-panel {
  min-height: 240px;
}
.dashboard-time-compare {
  display: grid;
  gap: 14px;
}
.dashboard-time-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #edf0f5;
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, #fbfcff);
}
.dashboard-time-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.dashboard-time-title span {
  color: #344054;
  font-size: 14px;
  font-weight: 950;
}
.dashboard-time-title strong {
  color: #101828;
  font-size: 22px;
  font-weight: 950;
  white-space: nowrap;
}
.dashboard-time-track {
  height: 12px;
  border-radius: 999px;
  background: #eef2f7;
  overflow: hidden;
}
.dashboard-time-track i {
  display: block;
  height: 100%;
  min-width: 4px;
  border-radius: inherit;
}
.dashboard-time-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  color: #667085;
  font-size: 12px;
  font-weight: 850;
}
.dashboard-time-monthly {
  display: grid;
  grid-template-columns: repeat(12, minmax(46px, 1fr));
  align-items: end;
  gap: 8px;
  min-height: 238px;
}
.dashboard-time-month {
  display: grid;
  justify-items: center;
  gap: 7px;
  min-width: 0;
}
.dashboard-time-bars {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 5px;
  width: 100%;
  height: 154px;
  border-bottom: 1px solid #edf0f5;
}
.dashboard-time-bars i {
  display: block;
  width: min(18px, 42%);
  min-height: 4px;
  border-radius: 7px 7px 0 0;
}
.dashboard-time-bars i.single,
.dashboard-time-legend i.single {
  background: #2563eb;
}
.dashboard-time-bars i.batch,
.dashboard-time-legend i.batch {
  background: #f97316;
}
.dashboard-time-bars i.current,
.dashboard-time-legend i.current {
  background: #7a5af8;
}
.dashboard-time-bars i.custom,
.dashboard-time-legend i.custom {
  background: #06b6d4;
}
.dashboard-time-month-dual-bars.has-custom i {
  width: min(16px, 38%);
}
.dashboard-time-month strong {
  color: #667085;
  font-size: 11px;
  font-weight: 900;
}
.dashboard-time-month-values {
  display: grid;
  gap: 2px;
  color: #475467;
  font-size: 10.5px;
  font-weight: 850;
  text-align: center;
  white-space: nowrap;
}
.dashboard-time-custom-value {
  color: #0f766e;
  font-weight: 950;
}
.dashboard-time-legend {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: #667085;
  font-size: 12px;
  font-weight: 850;
}
.dashboard-time-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.dashboard-time-legend i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.dashboard-owner-ranking {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #e4e7ec;
}
.dashboard-owner-ranking-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.dashboard-owner-ranking-head > div {
  display: flex;
  align-items: baseline;
  gap: 9px;
  min-width: 0;
}
.dashboard-owner-ranking-head h4 {
  margin: 0;
  color: #101828;
  font-size: 15px;
  font-weight: 950;
}
.dashboard-owner-ranking-head > div > span {
  color: #667085;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}
.dashboard-owner-ranking-head label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #475467;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}
.dashboard-owner-ranking-head input[type="month"] {
  box-sizing: border-box;
  width: 142px;
  min-height: 32px;
  padding: 4px 8px;
  border: 1px solid #d0d5dd;
  border-radius: 6px;
  background: #fff;
  color: #344054;
  font-size: 13px;
  font-weight: 850;
}
.dashboard-owner-ranking-table table {
  min-width: 540px;
  table-layout: fixed;
}
.dashboard-owner-ranking-table th,
.dashboard-owner-ranking-table td {
  padding: 9px 8px;
  vertical-align: middle;
}
.dashboard-owner-ranking-table th:first-child,
.dashboard-owner-ranking-table td:first-child {
  width: 48px;
  text-align: center;
}
.dashboard-owner-ranking-table th:nth-child(2),
.dashboard-owner-ranking-table td:nth-child(2) {
  width: 34%;
}
.dashboard-owner-ranking-table th:nth-child(n+3),
.dashboard-owner-ranking-table td:nth-child(n+3) {
  text-align: center;
}
.dashboard-owner-rank-number span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid #d0d5dd;
  border-radius: 50%;
  background: #f8fafc;
  color: #475467;
  font-size: 12px;
  font-weight: 950;
}
.dashboard-owner-rank-number .rank-1 {
  border-color: #f59e0b;
  background: #fffbeb;
  color: #b45309;
}
.dashboard-owner-rank-number .rank-2 {
  border-color: #94a3b8;
  background: #f1f5f9;
  color: #475569;
}
.dashboard-owner-rank-number .rank-3 {
  border-color: #d97706;
  background: #fff7ed;
  color: #9a3412;
}
.dashboard-owner-name {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}
.dashboard-owner-name strong {
  min-width: 0;
  overflow: hidden;
  color: #101828;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dashboard-owner-ranking-row {
  cursor: pointer;
}
.dashboard-owner-ranking-row td {
  transition: background-color .16s ease;
}
.dashboard-owner-ranking-row:hover td,
.dashboard-owner-ranking-row:focus-visible td {
  background: #f5f8ff;
}
.dashboard-owner-ranking-row:hover .dashboard-owner-name strong,
.dashboard-owner-ranking-row:focus-visible .dashboard-owner-name strong {
  color: #1d4ed8;
}
.dashboard-owner-ranking-row:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: -2px;
}
.dashboard-owner-name small {
  flex: 0 0 auto;
  color: #667085;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}
.dashboard-owner-compare-track {
  height: 4px;
  margin-top: 6px;
  overflow: hidden;
  border-radius: 4px;
  background: #eef2f7;
}
.dashboard-owner-compare-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #2563eb;
}
.dashboard-owner-metric {
  font-size: 14px;
  font-weight: 950;
  white-space: nowrap;
}
.dashboard-owner-metric.replenishment {
  color: #c2410c;
}
.dashboard-owner-metric.purchase {
  color: #1d4ed8;
}
.dashboard-owner-metric.air {
  color: #7c3aed;
}
.dashboard-owner-metric.sea {
  color: #0f766e;
}
.dashboard-owner-ranking-table tfoot td {
  border-top: 2px solid #dbe4f0;
  background: #f8fafc;
  color: #344054;
  font-weight: 950;
}

#modal:has(.dashboard-owner-year-detail) {
  width: min(980px, calc(100vw - 32px));
}
.dashboard-owner-year-detail {
  display: grid;
  gap: 14px;
}
.dashboard-owner-year-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.dashboard-owner-year-head > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.dashboard-owner-year-head > div > strong {
  overflow: hidden;
  color: #101828;
  font-size: 18px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dashboard-owner-year-head > div > span {
  color: #667085;
  font-size: 12px;
  font-weight: 800;
}
.dashboard-owner-year-head label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #475467;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}
.dashboard-owner-year-head select {
  width: 112px;
  min-height: 34px;
}
.dashboard-owner-year-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid #dbe4f0;
  border-radius: 6px;
  background: #f8fafc;
}
.dashboard-owner-year-summary span {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 10px 12px;
  color: #667085;
  font-size: 11px;
  font-weight: 850;
}
.dashboard-owner-year-summary span + span {
  border-left: 1px solid #dbe4f0;
}
.dashboard-owner-year-summary b {
  overflow: hidden;
  color: #101828;
  font-size: 17px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dashboard-owner-year-table table {
  min-width: 740px;
  table-layout: fixed;
}
.dashboard-owner-year-table th,
.dashboard-owner-year-table td {
  padding: 8px 10px;
  vertical-align: middle;
}
.dashboard-owner-year-table th:first-child,
.dashboard-owner-year-table td:first-child {
  width: 76px;
  text-align: center;
}
.dashboard-owner-year-table th:nth-child(n+2) {
  text-align: center;
}
.dashboard-owner-year-table tbody tr.current-month td {
  background: #eff6ff;
}
.dashboard-owner-year-table tbody tr.current-month td:first-child {
  color: #1d4ed8;
}
.dashboard-owner-year-metric {
  display: grid;
  grid-template-columns: 52px minmax(50px, 1fr);
  align-items: center;
  gap: 8px;
}
.dashboard-owner-year-metric strong {
  text-align: right;
  font-size: 13px;
  font-weight: 950;
  white-space: nowrap;
}
.dashboard-owner-year-metric > span {
  height: 5px;
  overflow: hidden;
  border-radius: 5px;
  background: #eef2f7;
}
.dashboard-owner-year-metric i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: currentColor;
}
.dashboard-owner-year-metric.replenishment {
  color: #c2410c;
}
.dashboard-owner-year-metric.purchase {
  color: #1d4ed8;
}
.dashboard-owner-year-metric.air {
  color: #7c3aed;
}
.dashboard-owner-year-metric.sea {
  color: #0f766e;
}
.dashboard-owner-year-table tfoot td {
  border-top: 2px solid #dbe4f0;
  background: #f8fafc;
  color: #344054;
  font-weight: 950;
  text-align: center;
}
.dashboard-owner-year-loading {
  display: grid;
  place-items: center;
  min-height: 260px;
  color: #667085;
  font-size: 14px;
  font-weight: 850;
}
.dashboard-owner-year-loading.error {
  color: #b42318;
}
@media (max-width: 720px) {
  .dashboard-owner-year-head {
    align-items: flex-start;
  }
  .dashboard-owner-year-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dashboard-owner-year-summary span:nth-child(3) {
    border-left: 0;
    border-top: 1px solid #dbe4f0;
  }
  .dashboard-owner-year-summary span:nth-child(4) {
    border-top: 1px solid #dbe4f0;
  }
}

.dashboard-rank-wrap {
  display: grid;
  gap: 14px;
}

.dashboard-rank-table table,
.dashboard-rank-summary table {
  min-width: 100%;
}

.dashboard-rank-table td,
.dashboard-rank-summary td {
  vertical-align: top;
}

.dashboard-rank-table h4,
.dashboard-rank-summary h4 {
  margin: 0 0 8px;
  font-size: 15px;
  color: #0f172a;
}
.dashboard-rank-product {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.dashboard-rank-product.compact {
  grid-template-columns: 34px minmax(0, 1fr);
}
.dashboard-rank-thumb {
  width: 44px;
  height: 44px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  object-fit: contain;
}
.dashboard-rank-thumb.compact {
  width: 34px;
  height: 34px;
}
.dashboard-rank-thumb.placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 900;
}
.dashboard-rank-product strong,
.dashboard-rank-product .muted {
  overflow-wrap: anywhere;
}

.filter-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr)) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}
.filter-bar label {
  gap: 5px;
  font-size: 15px;
  font-weight: 800;
}
.filter-bar select,
.filter-bar input {
  font-size: 15px;
}
.outbound-filter-bar {
  grid-template-columns: 240px 180px auto auto;
  align-items: end;
  justify-content: start;
}
.outbound-filter-bar .filter-mini-btn {
  width: 72px;
  min-width: 72px;
  max-width: 72px;
  height: 38px;
  min-height: 38px;
  align-self: end;
}
.outbound-filter-bar .outbound-compare-screenshot-btn {
  width: 132px;
  min-width: 132px;
  max-width: 132px;
  color: #fff;
  border-color: #0f766e;
  background: #0f766e;
}
.inventory-batch-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 6px;
  align-self: end;
  justify-self: start;
  grid-column: 1 / -1;
  width: 100%;
  overflow-x: auto;
  padding-bottom: 2px;
}
.inventory-cost-draft-actions {
  display: flex;
  grid-column: 1 / -1;
  justify-content: flex-start;
  margin-top: -4px;
}
.inventory-filter {
  grid-template-columns: 220px 360px 180px auto;
  justify-content: start;
  align-items: end;
}
.inventory-sort-field select {
  min-width: 180px;
}
.inventory-filter .inventory-batch-btn {
  width: 128px;
  min-width: 128px;
  max-width: 128px;
  height: 38px;
  min-height: 38px;
  padding: 0 10px;
  white-space: nowrap;
  color: #fff;
  font-weight: 900;
}
.batch-replenish-btn {
  border-color: #2563eb;
  background: #2563eb;
}
.batch-replenish-btn:hover {
  border-color: #1d4ed8;
  background: #1d4ed8;
}
.batch-stock-btn {
  border-color: #079455;
  background: #12b76a;
}
.batch-stock-btn:hover {
  border-color: #067647;
  background: #079455;
}
.batch-out-btn {
  border-color: #ea580c;
  background: #f97316;
}
.batch-out-btn:hover {
  border-color: #c2410c;
  background: #ea580c;
}
.batch-draft-btn {
  border-color: #0f766e;
  background: #14b8a6;
}
.batch-draft-btn:hover {
  border-color: #0f766e;
  background: #0f766e;
}
.batch-cost-draft-btn {
  border-color: #db2777;
  background: #ec4899;
}
.batch-cost-draft-btn:hover {
  border-color: #be185d;
  background: #db2777;
}
.batch-ocr-btn {
  border-color: #6d28d9;
  background: #7c3aed;
}
.batch-ocr-btn:hover {
  border-color: #5b21b6;
  background: #6d28d9;
}
.batch-delete-btn {
  border-color: #b42318;
  background: #d92d20;
  color: #ffffff;
}
.batch-delete-btn:hover {
  border-color: #912018;
  background: #b42318;
  color: #ffffff;
}
.danger-btn.flow-batch-delete-btn {
  border-color: #98a2b3;
  background: #d0d5dd;
  color: #344054;
}
.danger-btn.flow-batch-delete-btn:hover {
  border-color: #667085;
  background: #98a2b3;
  color: #ffffff;
}
.batch-clear-btn {
  border-color: #b42318;
  background: #d92d20;
}
.batch-clear-btn:hover {
  border-color: #912018;
  background: #b42318;
}
.batch-history-btn {
  border-color: #047857;
  background: #059669;
}
.batch-history-btn:hover {
  border-color: #065f46;
  background: #047857;
}
.batch-moves-btn {
  border-color: #475467;
  background: #667085;
}
.batch-moves-btn:hover {
  border-color: #344054;
  background: #475467;
}
.batch-trend-btn {
  border-color: #1d4ed8;
  background: #2563eb;
}
.batch-trend-btn:hover {
  border-color: #1e40af;
  background: #1d4ed8;
}
.inventory-transfer-panel {
  margin-top: 12px;
}
.inventory-transfer-list {
  display: grid;
  gap: 8px;
}
.inventory-transfer-card,
.transfer-source-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f8fbff;
}
.inventory-transfer-main {
  flex: 1;
  min-width: 0;
}
.inventory-transfer-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  color: #0f766e;
  background: #ccfbf1;
  font-size: 12px;
  font-weight: 950;
}
.inventory-transfer-form .transfer-source-card {
  grid-column: 1 / -1;
  background: #fff;
}
.danger-note {
  padding: 10px 12px;
  border: 1px solid rgba(217, 45, 32, .28);
  border-radius: 8px;
  color: #b42318;
  background: #fff4f2;
  font-weight: 800;
}
.production-stats {
  margin-top: 12px;
}
.purchase-inventory-inbound-note {
  margin: 0 0 12px;
  padding: 9px 11px;
  border: 1px solid #fedf89;
  border-radius: 7px;
  background: #fffaeb;
  color: #7a2e0e;
  font-size: 12px;
  font-weight: 750;
}
.purchase-inventory-inbound-note strong {
  color: #d92d20;
  font-weight: 950;
}
.purchase-type-inventory-hint {
  margin-left: 8px;
  color: #d92d20;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}
.table-wrap {
  width: 100%;
  overflow-x: auto;
}
.date-segmented {
  display: inline-flex;
  align-items: center;
  margin: 0 0 12px;
  border: 1px solid #d0d5dd;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}
.date-segmented button {
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  border-right: 1px solid #d0d5dd;
  border-radius: 0;
  background: #fff;
  color: #344054;
  font-size: 13px;
}
.date-segmented button:last-child {
  border-right: 0;
}
.date-segmented button.active {
  background: #f4f3ff;
  color: #6941c6;
  box-shadow: inset 0 0 0 1px #7a5af8;
  font-weight: 800;
}
.outbound-custom-date {
  margin: -4px 0 12px;
}
.outbound-cost-complete-panel {
  border-color: #bbf7d0;
  background: #f0fdf4;
}
.outbound-cost-complete-panel.muted-panel {
  border-color: #e4e7ec;
  background: #f8fafc;
}
.outbound-cost-complete-tool {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.outbound-cost-complete-tool button {
  min-height: 40px;
  background: #16a34a;
  border-color: #16a34a;
}
.outbound-cost-complete-tool button:disabled {
  opacity: 0.72;
  cursor: not-allowed;
}
.outbound-cost-complete-panel.completed-panel {
  border-color: #d0d5dd;
  background: #f2f4f7;
  color: #667085;
}
.outbound-cost-complete-panel.completed-panel h3,
.outbound-cost-complete-panel.completed-panel .muted,
.outbound-cost-complete-panel.completed-panel small {
  color: #667085;
}
.outbound-cost-complete-panel.completed-panel .outbound-cost-complete-tool button,
.outbound-cost-complete-panel.completed-panel .outbound-cost-complete-tool button:disabled {
  background: #98a2b3;
  border-color: #98a2b3;
  color: #fff;
  opacity: 1;
}
.cost-completion-done-text {
  font-weight: 800;
}
.success-text {
  color: #15803d;
  font-weight: 800;
}
.outbound-metric {
  min-height: 118px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.outbound-metric::before {
  height: 4px;
  background: linear-gradient(90deg, var(--primary), #14b8a6);
}
.outbound-metric span {
  color: var(--muted);
  font-size: 16px;
  font-weight: 950;
}
.outbound-metric strong {
  margin-top: 10px;
  color: var(--ink);
  font-size: 36px;
  font-weight: 950;
  letter-spacing: 0;
}
.outbound-metric small {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}
.outbound-money-metric span,
.outbound-money-metric strong,
.outbound-money-metric small {
  color: #dc2626;
}
.outbound-money-metric.historical-settlement-metric strong {
  color: #16a34a;
}
.dashboard-money {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-top: 8px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #fef2f2;
  color: #b42318;
  font-size: 15px;
  font-weight: 950;
}
.outbound-products {
  display: block;
  max-width: 420px;
  white-space: normal;
  line-height: 1.6;
}
.outbound-batch-money {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.outbound-batch-money strong {
  color: #0f766e;
}
.outbound-batch-money .outbound-batch-total {
  color: #dc2626;
}
.outbound-batch-list-head {
  flex-wrap: wrap;
}
.outbound-average-freight,
.outbound-total-average-freight {
  color: #0f766e;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}
.outbound-total-average-freight {
  font-size: 14px;
}
.dividend-panel {
  display: grid;
  gap: 16px;
}
.dividend-head {
  align-items: stretch;
  margin-bottom: 2px;
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}
.dividend-heading {
  display: grid;
  align-content: center;
  gap: 7px;
  min-width: 320px;
}
.dividend-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.dividend-title-row h3 {
  margin: 0;
  color: #0f172a;
  font-size: 20px;
  font-weight: 950;
}
.dividend-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 950;
}
.dividend-status-pill.editing {
  border: 1px solid #86efac;
  background: #dcfce7;
  color: #15803d;
}
.dividend-status-pill.archived {
  border: 1px solid #cbd5e1;
  background: #e2e8f0;
  color: #475569;
}
.dividend-status-line {
  display: flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  max-width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 850;
}
.dividend-status-line strong {
  font-size: 15px;
  font-weight: 950;
}
.dividend-status-line.editing {
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}
.dividend-status-line.archived {
  border: 1px solid #e2e8f0;
  background: #f1f5f9;
  color: #475569;
}
.dividend-actions {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
}
.dividend-toolbar {
  align-content: center;
  justify-content: flex-end;
  min-width: 360px;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
}
.dividend-actions label {
  min-width: 220px;
}
.dividend-month-picker {
  display: grid;
  gap: 5px;
}
.dividend-month-picker span {
  color: #475569;
  font-size: 13px;
  font-weight: 950;
}
.dividend-month-menu {
  position: relative;
  min-width: 280px;
}
.dividend-month-menu summary {
  list-style: none;
}
.dividend-month-menu summary::-webkit-details-marker {
  display: none;
}
.dividend-month-current {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  padding: 7px 10px 7px 14px;
  border: 2px solid #22c55e;
  border-radius: 999px;
  background: linear-gradient(180deg, #f0fdf4, #dcfce7);
  color: #166534;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(34, 197, 94, .12);
  transition: border-color .22s var(--ease-ui), box-shadow .22s var(--ease-ui), background .22s var(--ease-ui), transform .18s var(--ease-soft);
}
.dividend-month-current:hover {
  box-shadow: 0 10px 24px rgba(34, 197, 94, .16);
  transform: translateY(-1px);
}
.dividend-month-current.archived {
  border-color: #94a3b8;
  background: linear-gradient(180deg, #f8fafc, #e2e8f0);
  color: #475569;
  box-shadow: 0 8px 20px rgba(100, 116, 139, .12);
}
.dividend-month-current b {
  font-size: 16px;
  font-weight: 950;
}
.dividend-month-current small {
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .86);
  font-size: 12px;
  font-weight: 950;
  white-space: nowrap;
}
.dividend-month-current::after {
  content: "⌄";
  color: currentColor;
  font-size: 14px;
  font-weight: 950;
  transition: transform .22s var(--ease-soft);
}
.dividend-month-menu[open] .dividend-month-current::after {
  content: "⌃";
}
.dividend-month-list {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  display: grid;
  gap: 12px;
  width: min(440px, calc(100vw - 36px));
  max-height: 430px;
  overflow: auto;
  padding: 12px;
  border: 1px solid #dbeafe;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(16, 24, 40, .18);
  transform-origin: top right;
  animation: dropdownSoftIn .26s var(--ease-soft) both;
}
.dividend-month-year-group {
  display: grid;
  gap: 8px;
}
.dividend-month-year-group h4 {
  position: sticky;
  top: -12px;
  z-index: 1;
  margin: 0;
  padding: 8px 4px 6px;
  background: #fff;
  color: #0f172a;
  font-size: 15px;
  font-weight: 950;
}
.dividend-month-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(72px, 1fr));
  gap: 8px;
}
.dividend-month-option {
  display: grid;
  align-items: center;
  justify-items: center;
  gap: 4px;
  min-height: 58px;
  padding: 8px 8px;
  border-radius: 12px;
  background: #fff;
  text-align: center;
  transition: background .18s var(--ease-ui), border-color .18s var(--ease-ui), box-shadow .18s var(--ease-ui), transform .18s var(--ease-soft);
}
.dividend-month-option:hover {
  background: #f8fbff;
  transform: translateY(-1px);
}
.dividend-month-option span,
.dividend-month-option strong,
.dividend-month-option small,
.dividend-month-option em {
  display: block;
}
.dividend-month-option strong {
  color: #111827;
  font-size: 16px;
  font-weight: 950;
}
.dividend-month-option small {
  margin-top: 0;
  color: #64748b;
  font-size: 12px;
  font-weight: 950;
  white-space: nowrap;
}
.dividend-month-option.editing {
  border-color: #bbf7d0;
}
.dividend-month-option.editing small {
  background: #dcfce7;
  color: #166534;
}
.dividend-month-option.archived {
  border-color: #e2e8f0;
}
.dividend-month-option.archived small {
  background: #f1f5f9;
  color: #475569;
}
.dividend-month-option small {
  padding: 3px 7px;
  border-radius: 999px;
}
.dividend-month-option.active {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: inset 0 0 0 1px #2563eb;
}
.dividend-toolbar button {
  min-height: 46px;
  padding-inline: 16px;
  border-radius: 8px;
  font-weight: 950;
}
.dividend-metric-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.dividend-metric {
  position: relative;
  overflow: hidden;
  min-height: 96px;
  padding: 14px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}
.dividend-metric::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: #60a5fa;
}
.dividend-metric span {
  display: block;
  color: #667085;
  font-weight: 900;
}
.dividend-metric strong {
  display: block;
  margin-top: 8px;
  color: #101828;
  font-size: 24px;
  font-weight: 950;
}
.dividend-main-metric {
  border-color: #fecaca;
  background: #fff7f7;
}
.dividend-main-metric::before {
  background: #ef4444;
}
.dividend-main-metric strong {
  color: #dc2626;
}
.dividend-money-metric {
  border-color: #fecaca;
  background: #fff7f7;
}
.dividend-money-metric::before {
  background: #ef4444;
}
.dividend-money-metric strong {
  color: #dc2626;
}
.dividend-table-wrap {
  overflow-x: hidden;
  overflow-y: auto;
  max-height: 68vh;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}
.dividend-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}
.dividend-col-short {
  width: 3.6%;
}
.dividend-col-owner {
  width: 4.8%;
}
.dividend-col-shop {
  width: 8.2%;
}
.dividend-col-money {
  width: 5.15%;
}
.dividend-col-cost {
  width: 5.7%;
}
.dividend-col-freight {
  width: 6.5%;
}
.dividend-col-rate {
  width: 4.7%;
}
.dividend-col-percent {
  width: 4.2%;
}
.dividend-col-note {
  width: 5.8%;
}
.dividend-table th {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 10px 5px;
  border-bottom: 3px solid #60a5fa;
  background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
  color: #0f172a;
  font-size: 13.5px;
  line-height: 1.2;
  font-weight: 950;
  box-shadow: 0 5px 12px rgba(37, 99, 235, 0.16);
  white-space: normal;
}
.dividend-table td {
  padding: 6px 5px;
  vertical-align: top;
  color: #0f172a;
  font-size: 13.5px;
  line-height: 1.25;
  white-space: normal;
  word-break: break-word;
}
.dividend-table td:first-child strong {
  display: block;
  color: #101828;
  font-size: 13.5px;
}
.dividend-table td:first-child small,
.dividend-table td small {
  display: block;
  margin-top: 3px;
  color: #667085;
  font-size: 11.5px;
  font-weight: 800;
}
.dividend-table tbody tr[class*="dividend-store-color-"] td {
  background: var(--store-row-bg, #fff);
}
.dividend-table tbody tr[class*="dividend-store-color-"] input,
.dividend-table tbody tr[class*="dividend-store-color-"] select {
  border-color: var(--store-input-border, #d0d5dd);
  background: var(--store-input-bg, #fff);
}
.dividend-table tbody tr[class*="dividend-store-color-"] input:focus {
  border-color: var(--store-accent, #2563eb);
  box-shadow: 0 0 0 3px var(--store-focus, rgba(37, 99, 235, .12));
}
.dividend-store-color-1 { --store-row-bg: #fffdf9; --store-input-bg: #fffaf3; --store-input-border: #fdebd1; --store-accent: #f97316; --store-focus: rgba(249, 115, 22, .10); }
.dividend-store-color-2 { --store-row-bg: #fbfffc; --store-input-bg: #f6fef9; --store-input-border: #d9f8e6; --store-accent: #16a34a; --store-focus: rgba(22, 163, 74, .10); }
.dividend-store-color-3 { --store-row-bg: #fbfdff; --store-input-bg: #f6f9ff; --store-input-border: #dbeafe; --store-accent: #2563eb; --store-focus: rgba(37, 99, 235, .10); }
.dividend-store-color-4 { --store-row-bg: #fffafd; --store-input-bg: #fff5fb; --store-input-border: #fce7f3; --store-accent: #db2777; --store-focus: rgba(219, 39, 119, .10); }
.dividend-store-color-5 { --store-row-bg: #fdfcff; --store-input-bg: #faf7ff; --store-input-border: #ede9fe; --store-accent: #7c3aed; --store-focus: rgba(124, 58, 237, .10); }
.dividend-store-color-6 { --store-row-bg: #fbfeff; --store-input-bg: #f2fcfd; --store-input-border: #cffafe; --store-accent: #0891b2; --store-focus: rgba(8, 145, 178, .10); }
.dividend-store-color-7 { --store-row-bg: #fffef7; --store-input-bg: #fffbed; --store-input-border: #fef3c7; --store-accent: #ca8a04; --store-focus: rgba(202, 138, 4, .10); }
.dividend-store-color-8 { --store-row-bg: #fbfffe; --store-input-bg: #f3fdfa; --store-input-border: #ccfbf1; --store-accent: #0f766e; --store-focus: rgba(15, 118, 110, .10); }
.dividend-store-color-9 { --store-row-bg: #fffafb; --store-input-bg: #fff5f6; --store-input-border: #ffe4e6; --store-accent: #e11d48; --store-focus: rgba(225, 29, 72, .10); }
.dividend-store-color-10 { --store-row-bg: #fcfdfe; --store-input-bg: #f8fafc; --store-input-border: #e2e8f0; --store-accent: #475569; --store-focus: rgba(71, 85, 105, .10); }
.dividend-store-color-11 { --store-row-bg: #fffdf6; --store-input-bg: #fffae8; --store-input-border: #fde68a; --store-accent: #d97706; --store-focus: rgba(217, 119, 6, .10); }
.dividend-store-color-12 { --store-row-bg: #fbfcff; --store-input-bg: #f6f7ff; --store-input-border: #e0e7ff; --store-accent: #4f46e5; --store-focus: rgba(79, 70, 229, .10); }
.dividend-share-row td:first-child {
  background: var(--store-row-bg, #fff7ed);
}
.dividend-owner-group-start td {
  border-top: 3px solid #bfdbfe;
}
.dividend-owner-name {
  color: #1d4ed8;
  font-weight: 950;
  background: var(--store-row-bg, #eff6ff);
  box-shadow: inset 4px 0 0 var(--store-accent, #1d4ed8);
}
.dividend-table input,
.dividend-table select {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 5px 6px;
  font-size: 14px;
}
.dividend-table select {
  min-width: 0;
}
.dividend-fixed-shop-cell {
  color: #111827;
  font-weight: 900;
}
.dividend-fixed-shop {
  display: block;
  max-height: 38px;
  overflow: hidden;
  color: #111827;
  font-size: 13px;
  line-height: 1.25;
}
.readonly-money {
  color: #0f766e;
  font-weight: 900;
}
.manual-sync-cell input {
  border-color: var(--store-input-border, #93c5fd);
  background: var(--store-input-bg, #f8fbff);
  color: #0f172a;
  font-weight: 900;
}
.manual-sync-cell small {
  max-width: 100%;
  white-space: normal;
  line-height: 1.25;
}
.carryover-reimbursement-note {
  color: #dc2626 !important;
  font-weight: 950 !important;
}
.result-money,
.result-percent {
  color: #1d4ed8;
  font-size: 13.5px;
  font-weight: 950;
}
.dividend-bonus-value,
.dividend-deng-value,
.dividend-partner-value {
  color: #dc2626;
}
.dividend-bonus-input-cell input {
  color: #dc2626;
  border-color: #fecaca !important;
  font-weight: 950;
}
.dividend-bonus-value small {
  color: #b42318 !important;
}
.dividend-person-fold {
  display: grid;
  gap: 10px;
  justify-items: start;
}
.dividend-person-fold-head {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: min(100%, 280px);
  min-height: 54px;
  padding: 10px 14px;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  background: #fff7ed;
  color: #111827;
  text-align: left;
}
.dividend-person-fold-head span,
.dividend-person-fold-head strong,
.dividend-person-fold-head small,
.dividend-person-fold-head em {
  display: block;
}
.dividend-person-fold-head strong {
  font-size: 15px;
  font-weight: 950;
}
.dividend-person-fold-head small {
  margin-top: 3px;
  color: #9a3412;
  font-size: 12px;
  font-weight: 900;
}
.dividend-person-fold-head em {
  min-width: 58px;
  padding: 7px 12px;
  border-radius: 999px;
  background: #f97316;
  color: #fff;
  font-style: normal;
  font-weight: 950;
  text-align: center;
}
.dividend-person-fold.open .dividend-person-fold-head {
  border-color: #fdba74;
}
.dividend-person-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}
.dividend-person-summary article {
  padding: 13px 15px;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  background: #fff7ed;
}
.dividend-person-summary span,
.dividend-owner-summary h4 {
  color: #111827;
  font-weight: 950;
}
.dividend-person-summary small {
  margin-left: 8px;
  color: #ea580c;
  font-weight: 900;
}
.dividend-person-summary strong {
  display: block;
  margin-top: 6px;
  color: #dc2626;
  font-size: 22px;
  font-weight: 950;
}
.dividend-owner-summary {
  display: grid;
  gap: 10px;
}
.compact-section-head {
  margin-bottom: 0;
}
.dividend-owner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
}
.dividend-owner-grid article {
  padding: 10px 12px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f8fbff;
}
.dividend-owner-grid strong,
.dividend-owner-grid span,
.dividend-owner-grid small {
  display: block;
}
.dividend-owner-grid span {
  margin-top: 4px;
  color: #dc2626;
  font-size: 18px;
  font-weight: 950;
}
.dividend-owner-grid small {
  margin-top: 4px;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}
.dividend-owner-grid .dividend-owner-note {
  color: #ea580c;
  font-weight: 950;
}
.dividend-archive-note {
  margin: 6px 0 0;
  color: #0f766e;
  font-size: 13px;
  font-weight: 900;
}
.dividend-rules {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.dividend-rules span {
  padding: 7px 10px;
  border: 1px solid #dbeafe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 900;
}
.outbound-proof {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #475467;
  font-size: 12px;
  font-weight: 800;
}
.outbound-proof-thumb {
  width: 54px;
  height: 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: contain;
  background: #fff;
}
.outbound-shop-name {
  color: #101828;
  font-size: 17px;
  font-weight: 950;
}
.outbound-shipment-code {
  display: inline-flex;
  width: fit-content;
  margin-top: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #eef4ff;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 950;
}
.outbound-product-row {
  margin-top: 8px;
}
.segmented-control {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.segmented-control button {
  min-height: 32px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
}
.segmented-control button:last-child { border-right: 0; }
.segmented-control button.active {
  background: var(--primary);
  color: #fff;
}
.outbound-compare-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.outbound-compare-month {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}
.outbound-compare-month span {
  white-space: nowrap;
}
.outbound-year-pair-picker em {
  color: #475467;
  font-style: normal;
  font-weight: 950;
}
.outbound-compare-toggle {
  min-height: 34px;
  padding: 6px 14px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 950;
}
.outbound-compare-toggle.active {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}
.outbound-compare-pill {
  min-width: 86px;
  min-height: 34px;
  padding: 6px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-weight: 850;
}
.outbound-compare-pill-month {
  min-width: 78px;
}
.outbound-compare-pill-date {
  min-width: 148px;
  border-radius: 999px;
}
.outbound-compare-pill:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  outline: none;
}
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 12px 0 4px;
  color: #667085;
  font-size: 13px;
  font-weight: 800;
}
.pager button {
  min-height: 32px;
  padding: 0 12px;
}
.pager button:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.bar-chart {
  display: flex;
  align-items: end;
  gap: 10px;
  min-height: 230px;
  overflow-x: auto;
  padding: 12px 0 4px;
}
.bar-item {
  display: grid;
  justify-items: center;
  gap: 6px;
  min-width: 74px;
}
.bar-track {
  display: flex;
  align-items: end;
  width: 34px;
  height: 160px;
  border-radius: 8px;
  background: #eef2f7;
  overflow: hidden;
}
.bar-fill {
  width: 100%;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, #34d399, #2563eb);
}
.bar-value {
  color: #0f766e;
  font-size: 15px;
  font-weight: 950;
}
.bar-label {
  max-width: 104px;
  color: #101828;
  font-size: 14px;
  font-weight: 950;
  text-align: center;
  overflow-wrap: anywhere;
}
.bar-note {
  max-width: 138px;
  color: #475467;
  font-size: 12px;
  font-weight: 850;
  text-align: center;
  line-height: 1.35;
}
.period-compare-chart .bar-item {
  min-width: 118px;
}
.outbound-chart-stack {
  display: grid;
  gap: 18px;
}
.outbound-year-month-section {
  padding-top: 6px;
  border-top: 1px dashed #d0d5dd;
}
.outbound-year-month-section:first-child {
  padding-top: 0;
  border-top: 0;
}
.outbound-chart-title {
  margin: 0 0 8px;
  color: #101828;
  font-size: 15px;
  font-weight: 950;
}
.outbound-chart-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: -2px 0 8px;
  color: #475467;
  font-size: 12px;
  font-weight: 900;
}
.outbound-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.outbound-chart-legend i {
  width: 18px;
  height: 8px;
  border-radius: 999px;
}
.outbound-chart-legend .legend-current {
  background: linear-gradient(90deg, #60a5fa, #2563eb);
}
.outbound-chart-legend .legend-custom {
  background: linear-gradient(90deg, #fdba74, #f97316);
}
.year-month-chart .bar-item {
  min-width: 74px;
}
.year-month-chart .bar-track {
  width: 30px;
}
.year-month-chart .year-month-dual-track {
  justify-content: center;
  gap: 4px;
  width: 42px;
  padding: 0 5px;
}
.year-month-chart .year-month-dual-track .bar-fill {
  flex: 0 0 22px;
  width: 22px;
}
.year-month-chart .year-month-dual-track.has-custom .bar-fill {
  flex-basis: 13px;
  width: 13px;
}
.year-month-chart .current-year-fill {
  background: linear-gradient(180deg, #60a5fa, #2563eb);
}
.year-month-chart .custom-compare-fill {
  background: linear-gradient(180deg, #fdba74, #f97316);
}
.custom-compare-note {
  max-width: 124px;
  color: #c2410c;
  font-weight: 950;
}
.year-compare-chart .bar-item {
  min-width: 96px;
}
.custom-time-chart .bar-item {
  min-width: 138px;
}
.shop-period-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 4px 0 12px;
  padding: 10px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #eff6ff;
}
.shop-period-picker > span {
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 950;
}
.shop-period-toggle-all {
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid #2563eb;
  border-radius: 999px;
  background: #2563eb;
  color: #fff;
  font-size: 12px;
  font-weight: 950;
}
.shop-period-toggle-all:hover {
  border-color: #1d4ed8;
  background: #1d4ed8;
}
.shop-period-picker label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 4px 9px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #fff;
  color: #1e3a8a;
  font-size: 12px;
  font-weight: 900;
}
.shop-period-picker input {
  width: 14px;
  height: 14px;
  min-height: 14px;
  margin: 0;
}
.shop-period-chart {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
}
.shop-period-row {
  display: grid;
  grid-template-columns: minmax(140px, 190px) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid #e4e7ec;
  border-radius: 8px;
  background: #fff;
}
.shop-period-row > strong {
  color: #101828;
  font-size: 16px;
  font-weight: 950;
  overflow-wrap: anywhere;
}
.shop-period-bars {
  display: grid;
  gap: 10px;
}
.shop-period-group {
  display: grid;
  gap: 5px;
}
.shop-period-group + .shop-period-group {
  padding-top: 8px;
  border-top: 1px dashed #d0d5dd;
}
.shop-period-label {
  color: #344054;
  font-size: 13px;
  font-weight: 950;
}
.shop-period-line {
  display: grid;
  grid-template-columns: 82px minmax(80px, 1fr) 88px;
  gap: 8px;
  align-items: center;
}
.shop-period-line span {
  color: #475467;
  font-size: 13px;
  font-weight: 950;
}
.shop-period-line b {
  font-size: 14px;
  font-weight: 950;
  text-align: right;
}
.shop-period-track {
  height: 12px;
  border-radius: 999px;
  background: #eef2f7;
  overflow: hidden;
}
.shop-period-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
}
.shop-period-product-cost .shop-period-track i {
  background: #3b82f6;
}
.shop-period-product-cost b {
  color: #1d4ed8;
}
.shop-period-freight-cost .shop-period-track i {
  background: #f97316;
}
.shop-period-freight-cost b {
  color: #c2410c;
}
@media (max-width: 1180px) {
  .shop-period-chart {
    grid-template-columns: 1fr;
  }
}

.metric small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-weight: 700;
}
.flow-note-display {
  grid-column: 1 / -1;
  min-height: 24px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: #344054;
  font-size: 13px;
  font-weight: 800;
}
.job-duration {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--duration-border, #e2e8f0);
  background: var(--duration-bg, #ffffff);
  color: var(--duration-text, #1d4ed8);
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 1px 4px var(--duration-shadow, rgba(37, 99, 235, .08));
}
.completed-toolbar {
  grid-template-columns: max-content auto auto;
  justify-content: start;
  align-items: end;
}
.completed-toolbar label {
  width: 220px;
}
.completed-toolbar select {
  width: 220px;
}
.completed-custom-date {
  align-items: end;
}
.completed-custom-date label {
  width: auto;
  min-width: 140px;
}
.completed-custom-date select,
.completed-month-pill {
  min-width: 116px;
  min-height: 34px;
  padding: 6px 12px;
  border: 1px solid #d0d5dd;
  border-radius: 999px;
  background: #fff;
  color: #101828;
  font-size: 13px;
  font-weight: 850;
}
.completed-total {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  color: var(--muted);
}
.completed-total strong {
  color: var(--ink);
}
.completed-total span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: #ecfdf3;
  color: #067647;
  font-weight: 900;
}
.completed-batch-out-btn {
  border-color: #ea580c;
  background: #f97316;
  color: #fff;
  font-weight: 900;
}
.completed-batch-out-btn:hover {
  border-color: #c2410c;
  background: #ea580c;
  color: #fff;
}

.kanban {
  grid-template-columns: repeat(7, minmax(220px, 1fr));
  align-items: start;
  overflow-x: auto;
  padding-bottom: 10px;
}
.lane {
  min-width: 220px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fafb;
}
.lane-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 800;
}
.job-card {
  padding: 13px;
  margin-bottom: 10px;
}
.flow-list {
  display: grid;
  gap: 8px;
}
.batch-lines {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}
.batch-lines.collapsed {
  display: none;
}
.batch-collapsed-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  padding: 8px;
  border: 1px dashed #fed7aa;
  border-radius: 8px;
  background: #fffaf5;
}
.batch-collapsed-summary span {
  display: inline-flex;
  align-items: center;
  max-width: 360px;
  padding: 5px 8px;
  border-radius: 999px;
  background: #fff;
  color: #9a3412;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.batch-group {
  --batch-border: #fed7aa;
  --batch-bg: #fffaf5;
  --batch-rail: #fdba74;
  --batch-text: #9a3412;
  --batch-on-rail: var(--batch-text);
  padding: 12px;
  border: 2px solid var(--batch-border);
  border-radius: 8px;
  background: var(--batch-bg);
  box-shadow: inset 3px 0 0 var(--batch-rail), 0 2px 8px rgba(16, 24, 40, .06);
  cursor: pointer;
  position: relative;
  overflow: visible;
}
.batch-progress-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid var(--batch-border);
  background: var(--batch-bg);
  color: var(--batch-on-rail);
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 1px 3px rgba(16, 24, 40, .06);
}
.batch-download-count {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid #d0d5dd;
  background: #f8fafc;
  color: #667085;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}
.batch-status-counts {
  display: grid;
  grid-template-columns: repeat(6, 54px);
  align-items: center;
  justify-content: start;
  justify-self: stretch;
  column-gap: 7px;
  row-gap: 6px;
  min-height: 28px;
  min-width: 0;
  margin: 0;
}
.batch-status-count {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  width: 54px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  color: #334155 !important;
  background: transparent !important;
  white-space: nowrap;
  appearance: none;
  cursor: pointer;
}
.batch-status-count:hover .batch-status-item {
  filter: brightness(1.02);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .46), inset 0 -2px 0 rgba(15, 23, 42, .14);
}
.batch-status-count.active .batch-status-item {
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .36), inset 0 -2px 0 rgba(15, 23, 42, .16);
}
.batch-status-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  min-height: 24px;
  padding: 3px 7px;
  border-radius: 999px;
  color: #fff !important;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .38), inset 0 -2px 0 rgba(15, 23, 42, .12);
  white-space: nowrap;
  box-sizing: border-box;
  overflow: hidden;
  transition: box-shadow .16s ease, filter .16s ease;
}
.batch-status-item.status-waiting { background: #16a34a; }
.batch-status-item.status-purchase { background: #eab308; }
.batch-status-item.status-schedule,
.batch-status-item.status-production,
.batch-status-item.status-outsourced { background: #ef4444; }
.batch-status-item.status-completed { background: #64748b; }
.batch-status-number {
  min-width: 16px;
  background: transparent !important;
  color: #334155 !important;
  font-size: 15px;
  font-weight: 950;
  line-height: 1;
  text-align: center;
}
.batch-status-count.status-waiting .batch-status-number { color: #15803d !important; }
.batch-status-count.status-purchase .batch-status-number { color: #a16207 !important; }
.batch-status-count.status-schedule .batch-status-number,
.batch-status-count.status-production .batch-status-number,
.batch-status-count.status-outsourced .batch-status-number { color: #dc2626 !important; }
.batch-status-count.status-completed .batch-status-number { color: #475569 !important; }
.batch-owner-shop {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 28px;
  padding: 4px 11px;
  border: 1px solid rgba(251, 146, 60, .24);
  border-radius: 999px;
  background: #ffffff;
  color: #101828;
  font-size: 15px;
  font-weight: 950;
  line-height: 1.25;
  box-shadow: 0 1px 4px rgba(249, 115, 22, .08);
}
.batch-head {
  display: grid;
  grid-template-columns: minmax(420px, 1.35fr) 360px auto auto;
  align-items: center;
  gap: 12px;
}
.batch-duration {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: stretch;
  min-height: 32px;
  padding: 4px 12px;
  border: 1px dashed var(--duration-border, #e2e8f0);
  border-radius: 8px;
  background: var(--duration-bg, #ffffff);
  color: var(--duration-text, var(--batch-text));
  font-size: 14px;
  font-weight: 950;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 1px 4px var(--duration-shadow, rgba(16, 24, 40, .06));
}
.batch-group button,
.batch-group input,
.batch-group select,
.batch-group textarea,
.batch-group label,
.batch-group img,
.batch-group .clickable-image {
  cursor: auto;
}
.batch-line, .batch-form-line {
  display: grid;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid #e6edf5;
  border-radius: 8px;
  background: #ffffff;
}
.batch-line {
  grid-template-columns: minmax(160px, 1fr) auto auto;
}
.batch-form-line {
  grid-template-columns: minmax(150px, 1fr) minmax(130px, .9fr) minmax(86px, 108px) minmax(200px, 1.2fr);
}
.batch-product-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.batch-product-summary > span:last-child {
  min-width: 0;
}
.batch-product-thumb {
  width: 56px;
  height: 56px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef2f7;
  flex: 0 0 auto;
  object-fit: contain;
}
.batch-product-thumb.placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.batch-form-list {
  display: grid;
  gap: 8px;
}
.batch-form-line input {
  width: 100%;
}
.stock-source-field,
.batch-source-cell {
  display: grid;
  gap: 6px;
}
.stock-source-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.stock-source-picker.compact {
  grid-template-columns: 1fr;
  gap: 6px;
}
.stock-source-choice {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}
.stock-source-choice input {
  width: 16px;
  height: 16px;
  min-height: 16px;
  padding: 0;
  accent-color: #2563eb;
  flex: 0 0 auto;
}
.stock-source-choice span {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.stock-source-choice strong {
  color: #0f172a;
  font-size: 13px;
  font-weight: 950;
  white-space: nowrap;
}
.stock-source-choice small {
  color: #2563eb;
  font-size: 12px;
  font-weight: 850;
}
.stock-source-choice:has(input:checked) {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.stock-source-choice.disabled {
  opacity: .55;
  cursor: not-allowed;
}
.stock-source-choice.disabled small {
  color: #64748b;
}
.batch-out-form .batch-form-line {
  grid-template-columns: minmax(300px, 1fr) minmax(210px, 240px) minmax(130px, 150px) minmax(120px, 150px) auto;
}
.batch-out-add {
  display: grid;
  grid-template-columns: minmax(150px, .8fr) auto minmax(260px, 1.2fr) auto auto;
  gap: 8px;
  align-items: center;
}
.batch-out-add input {
  min-width: 150px;
}
.batch-out-add select {
  min-width: 260px;
}
.batch-job-fnsku-add {
  grid-template-columns: minmax(220px, 1fr) auto;
  max-width: 460px;
}
.batch-job-fnsku-add input {
  min-width: 220px;
}
.batch-draft-image-preview {
  grid-column: 1 / span 2;
  align-self: center;
}
.batch-out-form .batch-out-line {
  grid-template-columns: minmax(300px, 1fr) minmax(210px, 240px) minmax(130px, 150px) minmax(120px, 150px) auto;
}
.batch-out-new-section {
  display: grid;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.batch-out-form .batch-out-new-line {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  border-color: #93c5fd;
  background: #f8fbff;
}
.batch-new-product-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(135px, 1fr));
  gap: 10px;
  align-items: end;
}
.batch-new-image-field {
  grid-column: span 2;
  display: grid !important;
  grid-template-columns: minmax(160px, 1fr) auto;
  align-items: center;
  column-gap: 12px;
  min-height: 74px;
  padding: 8px 10px;
}
.batch-new-image-field .batch-product-thumb {
  grid-column: 2;
  grid-row: 1 / span 3;
  width: 58px;
  height: 58px;
  margin-top: 0;
  object-fit: contain;
}
.batch-new-image-field .field-title,
.batch-new-image-field input,
.batch-new-image-field .muted {
  grid-column: 1;
}
.batch-new-price-field.price-autosave-missing {
  padding: 6px;
  border: 1px solid #ef4444;
  border-radius: 8px;
  background: #fff7f7;
}
.batch-new-price-hint {
  align-self: center;
  padding: 10px;
}
.batch-out-price-cell {
  display: grid;
  gap: 6px;
  align-self: center;
}
.batch-out-price-cell input {
  min-height: 40px;
}
.batch-out-line-price-missing {
  border-color: #ef4444 !important;
  background: #fff7f7 !important;
  box-shadow: inset 4px 0 0 #ef4444;
}
.batch-out-price-missing {
  padding: 8px;
  border: 1px solid #ef4444;
  border-radius: 8px;
  background: #fff;
}
.batch-out-price-missing input {
  border-color: #ef4444 !important;
  background: #fff !important;
}
.batch-out-price-current {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  color: #047857;
  font-weight: 950;
}
.hidden-price-cell {
  min-height: 1px;
}
.batch-out-remove {
  align-self: center;
  min-height: 40px;
  padding: 0 14px;
  white-space: nowrap;
}
.outbound-draft-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #f8fbff;
}
.outbound-draft-actions button {
  min-height: 34px;
  padding: 0 12px;
  font-weight: 850;
}
.outbound-draft-actions .draft-save-btn {
  border-color: #0284c7;
  background: #0ea5e9;
  color: #fff;
}
.outbound-draft-actions .draft-save-btn:hover {
  border-color: #0369a1;
  background: #0284c7;
  color: #fff;
}
.outbound-draft-actions .muted {
  font-size: 13px;
  font-weight: 800;
}
.outbound-draft-list {
  display: grid;
  gap: 10px;
}
.outbound-draft-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid #e4e7ec;
  border-radius: 8px;
  background: #fff;
}
.outbound-draft-card strong {
  display: block;
  color: #101828;
  font-size: 15px;
  font-weight: 950;
}
.outbound-draft-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-left: 8px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  vertical-align: middle;
}
.outbound-draft-status.normal {
  color: #075985;
  background: #e0f2fe;
}
.outbound-draft-status.price-review {
  color: #b42318;
  background: #fee4e2;
}
.outbound-draft-section + .outbound-draft-section {
  margin-top: 18px;
}
.outbound-draft-section > h4 {
  margin: 0 0 10px;
  color: #344054;
}
.outbound-draft-card p,
.outbound-draft-card small,
.outbound-draft-card em {
  display: block;
  margin: 4px 0 0;
  color: #475467;
  font-style: normal;
  font-weight: 800;
}
.outbound-draft-card small {
  color: #667085;
  font-size: 12px;
}
.outbound-draft-card em {
  color: #98a2b3;
  font-size: 12px;
}
.outbound-draft-card-actions {
  display: inline-flex;
  gap: 8px;
}
.outbound-draft-card.price-inline-card {
  align-items: stretch;
}
.outbound-draft-card.price-inline-card .outbound-draft-card-actions {
  align-self: end;
}
.outbound-draft-inline-submit {
  min-width: 76px;
}
.outbound-draft-inline-submit:disabled {
  border-color: #cbd5e1;
  background: #cbd5e1;
  color: #fff;
  cursor: not-allowed;
  opacity: 1;
}
.outbound-draft-products {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(284px, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.outbound-draft-product {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  min-height: 66px;
  padding: 8px;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  background: #f8fafc;
}
.outbound-draft-product.is-price-missing {
  border-color: #ef4444;
  background: #fff7f7;
  box-shadow: inset 3px 0 0 #ef4444;
}
.outbound-draft-product-image {
  width: 52px;
  height: 52px;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  background: #fff;
  object-fit: contain;
}
.outbound-draft-product-image.placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 800;
}
.outbound-draft-product-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.outbound-draft-product-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.outbound-draft-product-copy span {
  overflow: hidden;
  color: #64748b;
  font-size: 12px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.outbound-draft-price-status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}
.outbound-draft-price-status.missing {
  background: #fee2e2;
  color: #dc2626;
}
.outbound-draft-price-status.ready {
  background: #dcfce7;
  color: #15803d;
}
.outbound-draft-price-entry {
  display: grid;
  grid-template-columns: auto 104px;
  align-items: center;
  gap: 6px;
  color: #475467;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}
.outbound-draft-price-entry input {
  box-sizing: border-box;
  width: 104px;
  min-width: 0;
  height: 32px;
  padding: 0 8px;
  border-radius: 7px;
  font-weight: 850;
}
.outbound-draft-price-entry.missing input {
  border-color: #ef4444;
  background: #fff;
}
.outbound-draft-price-entry.ready input {
  border-color: #22c55e;
  background: #f0fdf4;
}
.outbound-draft-products-empty {
  margin-top: 10px !important;
}
.cost-draft-page {
  display: grid;
  gap: 14px;
}
.cost-draft-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  background: #eff6ff;
}
.cost-draft-header h3 {
  margin: 0;
  color: #0f172a;
  font-size: 20px;
}
.cost-draft-header p {
  margin: 4px 0 0;
  color: #475569;
  font-size: 14px;
}
.cost-draft-header button {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #ffffff;
  color: #1d4ed8;
  font-weight: 900;
}
.cost-draft-summary {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  justify-self: start;
  padding: 8px 14px;
  border: 1px solid #fed7aa;
  border-radius: 999px;
  background: #fff7ed;
  color: #c2410c;
  font-weight: 900;
}
.cost-draft-summary strong {
  color: #ea580c;
  font-size: 20px;
}
.historical-transfer-table-wrap {
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.historical-transfer-table {
  margin: 0;
}
.historical-transfer-table th,
.historical-transfer-table td {
  padding: 10px 12px;
  vertical-align: middle;
}
.historical-settlement-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid #fdba74;
  border-radius: 8px;
  background: #fff7ed;
}
.historical-settlement-summary strong,
.historical-settlement-value {
  color: #dc2626;
  font-weight: 950;
}
.historical-qty-input {
  width: 120px;
  margin-right: 6px;
  font-weight: 900;
}
.historical-manager-panel {
  display: grid;
  gap: 14px;
  width: 100%;
  min-width: 0;
}
.historical-manager-form {
  display: grid;
  gap: 12px;
}
.historical-manager-filters {
  display: grid;
  grid-template-columns: 180px minmax(260px, 420px) 180px;
  gap: 12px;
  align-items: end;
  justify-content: start;
}
.historical-manager-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 10px;
}
.historical-manager-card {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid #dbeafe;
  border-left: 4px solid #2f6bff;
  border-radius: 10px;
  background: #fff;
}
.historical-manager-card span,
.historical-manager-card small {
  color: var(--muted);
  font-weight: 800;
}
.historical-manager-card strong {
  color: var(--ink);
  font-size: 20px;
  font-weight: 950;
}
.historical-manager-card.amount-card strong {
  color: #dc2626;
}
.historical-manager-card.settlement-card strong {
  color: #059669;
}
.historical-manager-card.warning-card {
  border-color: #fed7aa;
  border-left-color: #f97316;
  background: #fff7ed;
}
.historical-manager-section {
  display: grid;
  gap: 8px;
}
.historical-manager-section h4 {
  margin: 0;
  color: var(--ink);
}
.historical-manager-table-wrap {
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.historical-manager-table th,
.historical-manager-table td {
  white-space: nowrap;
}
.historical-manager-shop-row.is-expanded > td {
  background: #f8fbff;
}
.historical-manager-detail-row > td {
  padding: 0;
  background: #fbfdff;
}
.historical-manager-product-list {
  display: grid;
  gap: 8px;
  padding: 12px;
}
.historical-manager-product-line {
  display: grid;
  grid-template-columns: 52px minmax(260px, 1fr) repeat(5, minmax(92px, max-content));
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #e5edf7;
  border-radius: 10px;
  background: #fff;
}
.historical-manager-product-line > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.historical-manager-product-line span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.historical-manager-product-line b,
.historical-manager-product-line strong {
  color: var(--ink);
  font-weight: 950;
}
.historical-manager-product-main strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.historical-manager-inline-empty {
  padding: 14px;
}
.historical-record-list {
  display: grid;
  gap: 10px;
}
.historical-record-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}
.historical-record-card summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  background: #f8fafc;
}
.historical-record-meta {
  padding: 10px 14px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}
.historical-record-products {
  display: grid;
  gap: 8px;
  padding: 10px 14px 14px;
}
.historical-record-product {
  display: grid;
  grid-template-columns: 46px minmax(220px, 1fr) 80px 110px 110px;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border: 1px solid #e5eaf3;
  border-radius: 8px;
  background: #fff;
}
.historical-record-product span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.money-red {
  color: #dc2626;
  font-weight: 950;
}
.money-green {
  color: #059669;
  font-weight: 950;
}
.batch-replenish-remove {
  align-self: end;
  min-height: 34px;
  white-space: nowrap;
}
.ocr-box {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px dashed #93c5fd;
  border-radius: 10px;
  background: #f8fbff;
}
.ocr-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.ocr-paste-zone {
  display: grid;
  place-items: center;
  min-height: 84px;
  border: 2px dashed #7c3aed;
  border-radius: 12px;
  background: #ffffff;
  color: #4c1d95;
  font-weight: 900;
  cursor: text;
  outline: none;
}
.ocr-paste-zone:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .14);
  background: #f8fbff;
}
.ocr-paste-zone.active {
  border-color: #2563eb;
  background: #eff6ff;
}
.ocr-result {
  display: grid;
  gap: 10px;
}
.ocr-confirm-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.ocr-table th,
.ocr-table td {
  padding: 8px;
}
.ocr-qty-input {
  width: 92px;
  min-height: 34px;
  border: 1px solid #98a2b3;
  border-radius: 8px;
  padding: 0 8px;
  font-weight: 900;
  text-align: center;
}
.ocr-price-locked {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  background: #f0fdf4;
  color: #047857;
  font-weight: 900;
  white-space: nowrap;
}
.ocr-price-missing-row {
  background: #fff7f7;
}
.ocr-price-missing-row td {
  border-top-color: #fecaca;
  border-bottom-color: #fecaca;
}
.ocr-price-missing-input {
  border-color: #ef4444 !important;
  background: #fff !important;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.1);
}
.price-autosave-required.price-autosave-missing {
  border-color: #ef4444 !important;
  background: #fff7f7 !important;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.12);
}
.ocr-thumb {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: contain;
  border: 1px solid var(--line);
}
.ocr-thumb.placeholder {
  display: grid;
  place-items: center;
  background: #eef2ff;
  color: #4f46e5;
  font-size: 12px;
  font-weight: 900;
}
.ocr-edit-section {
  display: grid;
  gap: 8px;
}
.ocr-edit-section h3 {
  margin: 4px 0 0;
  font-size: 15px;
}
.ocr-edit-line {
  display: grid;
  grid-template-columns: 52px minmax(220px, 1fr) minmax(120px, 160px);
  gap: 10px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
}
.ocr-edit-line.missing {
  grid-template-columns: 52px minmax(150px, 1fr) minmax(170px, 1.1fr) minmax(180px, 1.1fr) minmax(110px, .75fr) minmax(150px, .9fr);
  border-color: #c4b5fd;
  background: #fbfaff;
}
.ocr-edit-line input,
.ocr-edit-line select {
  width: 100%;
  min-height: 42px;
}
.ocr-edit-line.missing .ocr-price-field input {
  min-width: 150px;
  font-size: 15px;
  font-weight: 900;
}
.ocr-edit-line.missing .ocr-image-field {
  grid-column: 2 / -1;
}
.danger-text {
  color: #dc2626;
  font-weight: 800;
}
.ocr-result pre {
  max-height: 120px;
  overflow: auto;
  white-space: pre-wrap;
  margin: 0;
  padding: 8px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid var(--line);
}
.batch-note-field textarea {
  min-height: 48px;
  resize: vertical;
}
.batch-note-default-field {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  min-width: 0;
}
.batch-note-default-field .batch-note-field {
  flex: 0 1 min(380px, 72%);
  min-width: 180px;
}
.batch-note-default-field .batch-note-field textarea {
  width: 100%;
}
.batch-default-note {
  align-self: end;
  white-space: nowrap;
}
.batch-add-head {
  margin: 4px 0 0;
}
.batch-add-bottom {
  display: flex;
  justify-content: flex-start;
  margin-top: 8px;
}
.batch-add-bottom .primary {
  min-width: 120px;
}
.batch-new-product-line {
  display: grid;
  grid-template-columns: repeat(5, minmax(105px, 1fr)) auto;
  align-items: end;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.batch-image-field {
  grid-column: 1 / span 2;
}
.batch-new-product-line .batch-note-default-field {
  grid-column: 3 / span 3;
}
.batch-new-product-line button {
  align-self: end;
}
.batch-job-form {
  max-height: min(78vh, 820px);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 6px;
}
.batch-job-form .batch-form-line {
  grid-template-columns: minmax(240px, 1.3fr) minmax(170px, .8fr) minmax(110px, 120px) minmax(240px, 1fr) minmax(110px, auto) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
}
.batch-job-form .batch-default-note {
  grid-column: auto;
  justify-self: start;
}
.batch-job-form .batch-new-product-line {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.batch-job-form .batch-image-field {
  grid-column: span 2;
}
.batch-job-form .batch-new-product-line .batch-note-default-field {
  grid-column: span 3;
}
.batch-job-form .batch-new-product-line button {
  grid-column: auto;
  justify-self: end;
}
.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.action-grid button {
  min-height: 64px;
  font-size: 16px;
}
.picker-list {
  display: grid;
  gap: 8px;
  max-height: 440px;
  overflow: auto;
}
.picker-line {
  grid-template-columns: 22px 58px 1fr;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.picker-thumb {
  width: 58px;
  height: 58px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}
.picker-thumb.placeholder {
  display: grid;
  place-items: center;
  color: #98a2b3;
  font-size: 12px;
  font-weight: 800;
}
.picker-line input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
}
.picker-line small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.picker-shop-filter {
  max-width: 320px;
}
.flow-row {
  display: grid;
  grid-template-columns: minmax(280px, 1.35fr) minmax(250px, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  background: #fcfdff;
  border: 1px solid #e6edf5;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .025);
  position: relative;
  overflow: visible;
}
.new-job-badge {
  position: absolute;
  z-index: 80;
  top: -7px;
  left: -7px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  box-shadow: 0 3px 8px rgba(239, 68, 68, .28);
  font-size: 12px;
  font-weight: 950;
  line-height: 1;
  pointer-events: none;
}

.batch-group.is-new-job {
  z-index: 5;
  overflow: visible !important;
}
.job-draft-list {
  max-height: min(68vh, 720px);
  overflow: auto;
}
.job-draft-card {
  align-items: center;
}
.job-draft-card > div:first-child {
  display: grid;
  gap: 5px;
}
.job-draft-type {
  width: fit-content;
  padding: 3px 8px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 900;
}
.flow-main {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.flow-check {
  width: 18px;
  height: 18px;
  min-height: 18px;
  flex: 0 0 auto;
  padding: 0;
}
.batch-check {
  margin: 0;
}
.flow-thumb {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border: 1px solid #e6edf5;
  border-radius: 8px;
  background: #f8fafc;
}
.flow-thumb.placeholder {
  display: grid;
  place-items: center;
  color: #98a2b3;
  font-size: 12px;
  font-weight: 800;
}
.flow-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
  font-size: 14px;
}
.flow-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(110px, 1fr));
  gap: 4px 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}
.clickable-image { cursor: zoom-in; }
.inline-number,
.inline-date {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.inline-number input {
  width: 82px;
  min-height: 30px;
  padding: 5px 9px;
  font-size: 13px;
  font-weight: 800;
}
.inline-date input {
  width: 138px;
  min-height: 30px;
  padding: 5px 9px;
  font-size: 13px;
  font-weight: 800;
}
.batch-created-date {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 3px 10px;
  border: 1px solid var(--batch-border);
  border-radius: 999px;
  background: var(--batch-bg);
  color: var(--batch-on-rail);
  font-size: 14px;
  font-weight: 950;
  box-shadow: 0 1px 3px rgba(16, 24, 40, .06);
}
.status-select {
  width: 112px;
  min-height: 30px;
  padding: 5px 8px;
  font-size: 13px;
  font-weight: 800;
}
.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
}
.status-waiting { color: #166534; background: #dcfce7; }
.status-purchase { color: #a16207; background: #fef3c7; }
.status-schedule { color: #b91c1c; background: #fee2e2; }
.status-production { color: #b91c1c; background: #fee2e2; }
.status-outsourced { color: #b91c1c; background: #fee2e2; }
.status-completed { color: #475467; background: #e5e7eb; }
.status-inventory { color: #0369a1; background: #e0f2fe; }
.status-outbound { color: #b91c1c; background: #fee2e2; }
.creator-locked-field {
  color: #475467;
  background: #f2f4f7;
  cursor: not-allowed;
}
.creator-field-hint {
  display: block;
  margin-top: 5px;
  color: #b54708;
  font-size: 12px;
  font-weight: 700;
}
.job-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef2f6;
}
.job-thumb.placeholder {
  display: grid;
  place-items: center;
  color: #98a2b3;
  font-size: 13px;
  font-weight: 800;
}
.job-card h4 {
  margin: 0 0 7px;
  font-size: 15px;
  line-height: 1.35;
}
.meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 11px 0; }
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef2f6;
  color: #475467;
  font-size: 12px;
  font-weight: 700;
}
.actions { display: flex; gap: 5px; flex-wrap: wrap; }
.actions button { min-height: 28px; padding: 0 8px; font-size: 12px; }
.flow-row .actions button,
.batch-head .actions button {
  min-height: 30px;
  padding: 0 9px;
  font-size: 13px;
  font-weight: 750;
}
.danger-btn {
  border-color: #fecaca;
  background: #fef2f2;
  color: #475467;
}
.danger-btn:hover {
  border-color: #fca5a5;
  background: #fee2e2;
}
.inline-confirm {
  display: inline-flex;
  position: absolute;
  z-index: 80;
  align-items: center;
  gap: 8px;
  width: max-content;
  padding: 8px 10px;
  border: 1px solid #d0d5dd;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(16, 24, 40, .16);
  color: #475467;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}
.inline-confirm > span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
}
.inline-confirm button {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 900;
  border-color: #d0d5dd;
  background: #fff;
  color: #344054;
}

#modalSave.is-saving,
.inline-confirm button:disabled {
  cursor: wait;
  opacity: .78;
}

#modalSave.is-saving::before {
  content: "";
  display: inline-block;
  width: 13px;
  height: 13px;
  margin-right: 7px;
  border: 2px solid rgba(255, 255, 255, .52);
  border-top-color: currentColor;
  border-radius: 50%;
  vertical-align: -2px;
  animation: spin .75s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
.recycle-panel {
  margin-bottom: 14px;
}
.recycle-batch-panel {
  background: #f8fbff;
  border-color: #dbeafe;
}
.recycle-toolbar,
.recycle-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.recycle-toolbar {
  flex-wrap: wrap;
}
.recycle-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.recycle-select,
.recycle-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #344054;
  font-size: 13px;
  font-weight: 850;
  white-space: nowrap;
}
.recycle-select input,
.recycle-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}
.recycle-selected-count {
  margin-right: auto;
  color: #0f766e;
  font-size: 14px;
  font-weight: 950;
}
.recycle-list {
  display: grid;
  gap: 8px;
}
.recycle-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.recycle-item-card {
  grid-template-columns: 28px 58px minmax(0, 1fr) auto;
}
.recycle-check {
  justify-content: center;
}
.delete-approval-card {
  border-color: #f59e0b;
  background: #fffbeb;
}
.recycle-thumb {
  width: 58px;
  height: 58px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f2f4f7;
}
.recycle-thumb.placeholder {
  display: grid;
  place-items: center;
  color: #98a2b3;
  font-size: 12px;
  font-weight: 800;
}

.inventory-grid {
  position: relative;
  z-index: 0;
  display: flex;
  flex-direction: column;
  grid-template-columns: 1fr;
  gap: 0;
  min-height: 420px;
  overflow: hidden;
}
.inventory-grid table {
  width: 100%;
  table-layout: fixed;
}
.inventory-grid-head {
  flex: 0 0 auto;
}
.inventory-grid-head th {
  background: #f8fafc;
}
.inventory-grid-body {
  flex: 1 1 auto;
  min-height: 360px;
  overflow: auto;
}
.inventory-grid th,
.inventory-grid td {
  padding: 6px 8px;
  border-bottom-color: #cbd5e1;
  vertical-align: middle;
  font-size: 13px;
}
.inventory-grid tbody tr:not(:last-child) td {
  box-shadow: inset 0 -1px 0 rgba(148, 163, 184, .18);
}
.inventory-grid .inventory-check-col,
.inventory-grid .check-cell {
  width: 42px;
  min-width: 42px;
  max-width: 42px;
}
.inventory-grid .inventory-name-col,
.inventory-grid .inventory-name-cell { width: 22%; }
.inventory-grid .inventory-shop-col,
.inventory-grid .inventory-shop-cell { width: 13%; }
.inventory-grid .inventory-type-col,
.inventory-grid .inventory-type-cell { width: 6%; }
.inventory-grid .inventory-price-col,
.inventory-grid .inventory-price-cell { width: 14%; }
.inventory-grid .inventory-qty-col,
.inventory-grid .inventory-qty-cell { width: 16%; }
.inventory-grid .inventory-warning-col,
.inventory-grid .inventory-warning-cell { width: 7%; text-align: center; }
.inventory-grid .inventory-max-col,
.inventory-grid .inventory-max-cell { width: 7%; text-align: center; font-weight: 850; }
.inventory-grid .inventory-actions-col,
.inventory-grid td.actions { width: 15%; }
.inventory-grid .inventory-no-price-table .inventory-name-col,
.inventory-grid .inventory-no-price-table .inventory-name-cell { width: 26%; }
.inventory-grid .inventory-no-price-table .inventory-shop-col,
.inventory-grid .inventory-no-price-table .inventory-shop-cell { width: 15%; }
.inventory-grid .inventory-no-price-table .inventory-type-col,
.inventory-grid .inventory-no-price-table .inventory-type-cell { width: 7%; }
.inventory-grid .inventory-no-price-table .inventory-qty-col,
.inventory-grid .inventory-no-price-table .inventory-qty-cell { width: 21%; }
.inventory-grid .inventory-no-price-table .inventory-warning-col,
.inventory-grid .inventory-no-price-table .inventory-warning-cell { width: 8%; }
.inventory-grid .inventory-no-price-table .inventory-max-col,
.inventory-grid .inventory-no-price-table .inventory-max-cell { width: 8%; }
.inventory-grid .inventory-no-price-table .inventory-actions-col,
.inventory-grid .inventory-no-price-table td.actions { width: 15%; }
.inventory-grid th.check-cell,
.inventory-grid td.check-cell {
  padding-left: 4px;
  padding-right: 4px;
  text-align: center;
}
.inventory-tool-row th {
  height: 50px;
  padding: 8px;
  border-bottom: 0;
  background: #f3f6fb;
  vertical-align: middle;
}
.inventory-tool-row .inventory-table-date-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
}
.inventory-tool-row .inventory-table-date-list button,
.inventory-tool-row .price-pending-filter-btn,
.inventory-table-limit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}
.inventory-tool-row .inventory-table-date-list button {
  border-color: #bfdbfe;
  background: #fff;
  color: #1d4ed8;
}
.inventory-tool-row .inventory-table-date-list button.active {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}
.inventory-tool-price-cell,
.inventory-tool-limit-cell {
  text-align: center;
  vertical-align: middle;
}
.inventory-price-tool-split {
  display: grid;
  grid-template-columns: minmax(74px, 1fr) minmax(90px, 1fr);
  align-items: center;
  gap: 8px;
  width: 100%;
}
.inventory-price-tool-split > div:first-child {
  display: flex;
  justify-content: center;
}
.inventory-tool-row .price-pending-filter-btn {
  width: 118px;
  min-width: 118px;
  max-width: 118px;
}
.inventory-table-limit-btn {
  color: #fff;
}
.inventory-price-head,
.inventory-price-pair {
  display: grid;
  grid-template-columns: minmax(74px, 1fr) minmax(90px, 1fr);
  align-items: center;
  gap: 8px;
  max-width: 100%;
}
.inventory-price-head span:nth-child(2),
.inventory-price-pair > strong {
  text-align: center;
}
.inventory-price-head span {
  color: #344054;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}
.inventory-price-pair > div {
  min-width: 0;
  color: #101828;
  font-size: 12px;
  font-weight: 950;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inventory-price-pair > strong {
  min-width: 0;
  color: #dc2626;
  font-size: 12px;
  font-weight: 950;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inventory-price-pair .price-pending-text {
  color: #f97316;
}
.inventory-name-cell .stock-name > div {
  min-width: 0;
}
.inventory-name-cell .stock-name strong,
.inventory-name-cell .stock-name .muted {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inventory-grid td.actions {
  display: table-cell;
  vertical-align: middle;
}
.inventory-grid .inventory-actions-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(60px, 1fr));
  gap: 5px;
  align-items: center;
}
.inventory-grid .inventory-actions-grid button {
  min-height: 28px;
  padding: 0 6px;
  font-size: 12px;
  white-space: nowrap;
}
.batch-limit-btn {
  background: #0ea5e9;
}
.inventory-max-modal {
  display: grid;
  gap: 12px;
}
.inventory-max-tools {
  display: flex;
  align-items: end;
  gap: 10px;
  padding: 10px;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  background: #f8fbff;
}
.inventory-max-tools label {
  display: grid;
  gap: 5px;
  min-width: 180px;
}
.inventory-max-list {
  display: grid;
  gap: 8px;
  max-height: 58vh;
  overflow: auto;
}
.inventory-max-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 130px 130px;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid #dbe4f0;
  border-radius: 10px;
  background: #fff;
}
.inventory-max-info {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.inventory-max-input {
  display: grid;
  gap: 5px;
  font-weight: 800;
}
.inventory-max-input input {
  min-height: 38px;
  text-align: center;
  font-weight: 900;
}
.money-cell {
  color: #0f766e;
  font-weight: 900;
  white-space: nowrap;
}
.inventory-price-view {
  display: inline-grid;
  gap: 4px;
  justify-items: start;
}
.inventory-price-display {
  border: 0;
  background: transparent;
  padding: 0;
  color: #0f766e;
  font-weight: 900;
  font-size: 13px;
  cursor: pointer;
}
.inventory-price-display.editable {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.inventory-price-display.editable:hover {
  color: #0369a1;
}
.inventory-price-readonly {
  color: #0f766e;
  font-weight: 900;
}
.price-pending-text {
  color: #d97706 !important;
  font-weight: 950;
}
.price-paid-text {
  color: #047857;
  font-weight: 950;
  margin-top: 2px;
}
.inventory-inbound-modal {
  display: grid;
  gap: 12px;
}
.inventory-inbound-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}
.inventory-inbound-table table {
  min-width: 420px;
}
.inventory-inbound-table th,
.inventory-inbound-table td {
  white-space: nowrap;
}
.inventory-fifo-note {
  margin: 0;
  color: #475467;
  font-size: 13px;
  font-weight: 800;
}
.inventory-age-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(92px, 1fr));
  gap: 8px;
}
.inventory-age-card {
  padding: 9px 10px;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  background: #f8fbff;
}
.inventory-age-card span {
  display: block;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}
.inventory-age-card strong {
  display: block;
  margin-top: 4px;
  color: #1f2937;
  font-size: 15px;
  font-weight: 900;
}
.inventory-age-card.danger {
  border-color: #fecaca;
  background: #fff1f2;
}
.inventory-age-card.danger span,
.inventory-age-card.danger strong {
  color: #dc2626;
}
.inventory-batch-over-year td {
  color: #dc2626;
  background: #fff1f2;
  font-weight: 900;
}
.inventory-batch-age-tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin-left: 10px;
  padding: 0 8px;
  border: 1px solid #fda4af;
  border-radius: 999px;
  background: #fff;
  color: #dc2626;
  font-size: 12px;
  font-weight: 900;
}
label.check-line.price-pending-check {
  display: flex !important;
  grid-template-columns: none !important;
  flex-direction: row !important;
  align-self: end;
  align-items: center !important;
  justify-content: flex-start;
  gap: 7px;
  width: max-content;
  min-height: 38px;
  height: 38px;
  margin: 0;
  padding: 0;
  color: #92400e;
  font-weight: 800;
  line-height: 16px;
  white-space: nowrap;
}
label.check-line.price-pending-check input[type="checkbox"] {
  flex: 0 0 16px;
  width: 16px !important;
  min-width: 16px;
  height: 16px !important;
  min-height: 16px !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 16px;
  vertical-align: middle;
}
label.check-line.price-pending-check span {
  display: block;
  height: 16px;
  margin: 0;
  padding: 0;
  line-height: 16px;
}
.price-history-inline,
.price-history-modal-btn {
  border: 1px solid #d0d5dd;
  background: #f8fafc;
  color: #475467;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}
.price-history-inline {
  min-height: 22px;
  padding: 0 8px;
}
.price-history-modal-btn {
  justify-self: start;
  min-height: 30px;
  padding: 0 12px;
}
.price-edit-summary,
.price-history-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #e4e7ec;
  border-radius: 8px;
  background: #f8fafc;
}
.price-edit-summary span,
.price-history-summary span {
  color: #475467;
  font-weight: 800;
}
.price-history-table {
  max-height: 420px;
  overflow: auto;
}
.price-history-table th,
.price-history-table td {
  white-space: nowrap;
}
.inventory-qty-cell {
  min-width: 136px;
  vertical-align: middle;
}
.inventory-qty-head-label {
  display: block;
  width: 158px;
  max-width: 100%;
  text-align: center;
}
.inventory-qty-lines {
  display: grid;
  grid-template-columns: minmax(126px, max-content) minmax(80px, 1fr);
  column-gap: 12px;
  align-items: center;
  gap: 14px;
  width: 100%;
}
.inventory-qty-line {
  display: grid;
  grid-template-columns: 58px minmax(64px, 1fr);
  align-items: baseline;
  column-gap: 10px;
  white-space: nowrap;
}
.inventory-qty-lines .inventory-qty-line:not(.inventory-qty-total) {
  grid-column: 1;
  width: 158px;
  max-width: 100%;
  justify-self: center;
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 8px;
}
.inventory-qty-total {
  grid-column: 2;
  grid-row: 1 / 4;
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 8px;
  align-self: center;
  justify-self: center;
}
.inventory-qty-out {
  padding-top: 10px;
  border-top: 1px dashed #e4e7ec;
}
.inventory-qty-line span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}
.inventory-qty-line strong {
  color: #0f172a;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.15;
  text-align: left;
  font-variant-numeric: tabular-nums;
}
.inventory-qty-total span,
.inventory-qty-total strong {
  text-align: center;
}
.inventory-qty-history strong {
  color: #64748b;
}
.inventory-qty-clickable {
  cursor: pointer;
  border-radius: 6px;
  transition: color 160ms ease, background 160ms ease;
}
.inventory-qty-clickable span,
.inventory-qty-clickable strong {
  color: #ea580c;
}
.inventory-qty-clickable strong {
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}
.inventory-qty-clickable:hover,
.inventory-qty-clickable:focus-visible {
  background: #fff7ed;
  outline: none;
}
.inventory-qty-clickable:hover span,
.inventory-qty-clickable:hover strong,
.inventory-qty-clickable:focus-visible span,
.inventory-qty-clickable:focus-visible strong {
  color: #c2410c;
}
.inventory-qty-out span,
.inventory-qty-out strong {
  color: #dc2626;
}
.inventory-year-end-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid #f59e0b;
  border-radius: 12px;
  background: #fffbeb;
  box-shadow: 0 6px 18px rgba(245, 158, 11, .16);
  overflow: hidden;
}
.inventory-year-end-track {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}
.inventory-year-end-flow {
  display: inline-flex;
  gap: 72px;
  min-width: max-content;
  animation: inventoryYearEndFlow 18s linear infinite;
}
.inventory-year-end-flow span {
  color: #b45309;
  font-size: 15px;
  font-weight: 950;
}
.inventory-year-end-confirm {
  flex: 0 0 auto;
  min-height: 34px;
  border-color: #f97316;
  background: #f97316;
  color: #fff;
  font-weight: 950;
}
.inventory-year-end-confirm:hover {
  border-color: #ea580c;
  background: #ea580c;
}
@keyframes inventoryYearEndFlow {
  from { transform: translateX(0); }
  to { transform: translateX(calc(-50% - 36px)); }
}
.inventory-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 10px;
  align-items: stretch;
  margin: 10px 0 12px;
}
.inventory-summary article {
  display: flex;
  min-height: 62px;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 5px;
  padding: 10px 12px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f8fbff;
}
.inventory-summary span {
  display: block;
  width: 100%;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
  font-weight: 800;
  white-space: nowrap;
}
.inventory-summary strong {
  display: block;
  width: 100%;
  color: #0f172a;
  font-size: 18px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-align: left;
}
.inventory-summary .inventory-period-card {
  border-color: #dbeafe;
  background: #f8fbff;
}
.inventory-summary .inventory-movement-filter-card {
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.inventory-summary .inventory-movement-filter-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(15, 23, 42, .08);
}
.inventory-summary .inventory-movement-filter-card.active {
  border-width: 2px;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .10);
}
.inventory-summary .inventory-in-card {
  border-color: #bbf7d0;
  background: #f0fdf4;
}
.inventory-summary .inventory-in-card span,
.inventory-summary .inventory-in-card strong {
  color: #15803d;
}
.inventory-summary .inventory-out-card {
  border-color: #fed7aa;
  background: #fff7ed;
}
.inventory-summary .inventory-out-card span,
.inventory-summary .inventory-out-card strong {
  color: #ea580c;
}
.inventory-summary .inventory-total-money {
  border-color: #fecaca;
  background: #fff7f7;
}
.inventory-summary .inventory-total-money span,
.inventory-summary .inventory-total-money strong {
  color: #dc2626;
}
.inventory-summary .inventory-trend-card {
  position: relative;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease;
}
.inventory-summary .inventory-trend-card:hover,
.inventory-summary .inventory-trend-card:focus-visible {
  transform: translateY(-1px);
  border-color: #93c5fd;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .10);
  outline: none;
}
.inventory-summary .inventory-trend-card small {
  display: inline-flex;
  width: auto;
  margin-top: 1px;
  color: #64748b;
  font-size: 11px;
  line-height: 1;
  font-weight: 800;
}
.inventory-trend-panel {
  display: grid;
  gap: 14px;
}
dialog:has(.inventory-trend-panel) {
  width: min(940px, calc(100vw - 24px));
}
dialog:has(.inventory-trend-panel-wide-values) {
  width: min(1040px, calc(100vw - 24px));
}
.inventory-trend-panel-wide-values {
  --inventory-trend-table-width: 420px;
}
.inventory-trend-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.inventory-trend-tabs button,
.inventory-trend-month-select {
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #fff;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 900;
}
.inventory-trend-tabs button {
  cursor: pointer;
  transition: background .16s ease, color .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.inventory-trend-tabs button:hover {
  border-color: #60a5fa;
  box-shadow: 0 5px 14px rgba(37, 99, 235, .12);
}
.inventory-trend-tabs button.active {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
  box-shadow: 0 7px 16px rgba(37, 99, 235, .20);
}
.inventory-trend-month-select {
  min-width: 132px;
  border-radius: 10px;
  color: #0f172a;
}
.inventory-trend-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  background: #f8fbff;
}
.inventory-trend-head div {
  display: grid;
  gap: 4px;
}
.inventory-trend-head strong {
  color: #0f172a;
  font-size: 16px;
}
.inventory-trend-head span {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}
.inventory-trend-head b {
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}
.inventory-trend-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--inventory-trend-table-width, 320px);
  gap: 14px;
  align-items: stretch;
}
.inventory-trend-chart {
  display: block;
  width: 100%;
  min-height: 260px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
}
.inventory-trend-chart line {
  stroke: #e2e8f0;
  stroke-width: 1.4;
}
.inventory-trend-chart path[stroke] {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.inventory-trend-chart circle {
  fill: #fff;
  stroke: currentColor;
  stroke-width: 2;
}
.inventory-trend-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
}
.inventory-trend-table th,
.inventory-trend-table td {
  padding: 9px 10px;
  border-bottom: 1px solid #edf2f7;
  color: #334155;
  font-size: 12px;
  text-align: left;
  white-space: nowrap;
  font-weight: 800;
}
.inventory-trend-table th {
  background: #f8fafc;
  color: #64748b;
}
.inventory-trend-table th:last-child,
.inventory-trend-table td:last-child {
  text-align: right;
}
.inventory-trend-table tr:last-child td {
  border-bottom: 0;
}
.inventory-trend-change {
  display: inline-flex;
  min-width: 64px;
  align-items: center;
  justify-content: flex-end;
  font-variant-numeric: tabular-nums;
  font-weight: 900;
}
.inventory-trend-change.positive {
  color: #dc2626;
}
.inventory-trend-change.negative {
  color: #16a34a;
}
.inventory-trend-change.zero {
  color: #64748b;
}
.inventory-trend-empty {
  padding: 28px;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  color: #64748b;
  text-align: center;
  font-weight: 800;
}
@media (max-width: 900px) {
  .inventory-trend-grid {
    grid-template-columns: 1fr;
  }
}
dialog:has(.inventory-trend-workspace),
dialog:has(.inventory-trend-loading) {
  width: min(1240px, calc(100vw - 20px));
}
dialog:has(.inventory-trend-workspace) #modalBody {
  max-height: calc(100dvh - 150px);
  overflow: auto;
}
.inventory-trend-loading {
  display: grid;
  min-height: 300px;
  place-items: center;
  color: #64748b;
  font-size: 14px;
  font-weight: 850;
}
.inventory-trend-workspace {
  display: grid;
  gap: 14px;
  min-width: 0;
}
.inventory-trend-combined-panel {
  display: grid;
  gap: 12px;
  min-width: 0;
}
.inventory-trend-combined-panel .inventory-trend-comparison-chart {
  min-width: 820px;
  min-height: 360px;
}
.inventory-trend-toolbar {
  display: grid;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
}
.inventory-trend-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}
.inventory-trend-metrics button {
  display: flex;
  min-width: 0;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid #d0d5dd;
  border-radius: 6px;
  background: #fff;
  color: #475467;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}
.inventory-trend-metrics button i {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--metric-color);
}
.inventory-trend-metrics button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inventory-trend-metrics button:hover {
  border-color: var(--metric-color);
  color: #101828;
}
.inventory-trend-metrics button.active {
  border-color: var(--metric-color);
  background: #f8fafc;
  color: #101828;
  box-shadow: inset 0 -2px 0 var(--metric-color);
}
.inventory-trend-period-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.inventory-trend-periods {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
}
.inventory-trend-periods button {
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid #d0d5dd;
  border-radius: 0;
  background: #fff;
  color: #475467;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}
.inventory-trend-periods button + button {
  margin-left: -1px;
}
.inventory-trend-periods button:first-child {
  border-radius: 6px 0 0 6px;
}
.inventory-trend-periods button:last-child {
  border-radius: 0 6px 6px 0;
}
.inventory-trend-periods button:hover {
  position: relative;
  border-color: #84adff;
  color: #1d4ed8;
}
.inventory-trend-periods button.active {
  position: relative;
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
}
.inventory-trend-compare-toggle {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid #d0d5dd;
  border-radius: 6px;
  background: #fff;
  color: #344054;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
  cursor: pointer;
}
.inventory-trend-compare-toggle input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #2563eb;
}
.inventory-trend-custom-range {
  display: flex;
  align-items: end;
  gap: 8px;
}
.inventory-trend-custom-range label {
  display: grid;
  gap: 4px;
  color: #475467;
  font-size: 11px;
  font-weight: 850;
}
.inventory-trend-custom-range input {
  width: 156px;
  min-height: 36px;
  padding: 5px 8px;
  border: 1px solid #d0d5dd;
  border-radius: 6px;
  background: #fff;
  color: #101828;
  font-size: 13px;
  font-weight: 800;
}
.inventory-trend-custom-range button {
  min-height: 36px;
  border-radius: 6px;
}
.inventory-trend-date-separator {
  align-self: end;
  padding-bottom: 9px;
  color: #667085;
  font-size: 12px;
  font-weight: 800;
}
.inventory-trend-workspace .inventory-trend-head {
  padding: 10px 12px;
  border-color: #dbe4f0;
  border-radius: 6px;
  background: #f8fafc;
}
.inventory-trend-current {
  display: flex !important;
  align-items: center;
  justify-content: flex-end;
  gap: 14px !important;
}
.inventory-trend-current > span {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  white-space: nowrap;
}
.inventory-trend-current b {
  color: var(--trend-color);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}
.inventory-trend-chart-shell {
  overflow-x: auto;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
}
.inventory-trend-chart-stage {
  position: relative;
  min-width: 0;
}
.inventory-trend-comparison-chart {
  display: block;
  width: 100%;
  min-width: 760px;
  min-height: 330px;
  border: 0;
  border-radius: 0;
  color: #667085;
}
.inventory-trend-grid-lines line {
  stroke: #e7edf5;
  stroke-width: 1;
}
.inventory-trend-grid-lines text,
.inventory-trend-x-labels text {
  fill: #667085;
  font-size: 11px;
  font-weight: 750;
}
.inventory-trend-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.inventory-trend-line.current {
  stroke: var(--series-color, var(--trend-color));
  stroke-width: 1.6;
}
.inventory-trend-line.compare {
  stroke: var(--series-color, #94a3b8);
  stroke-width: 1;
  stroke-dasharray: 6 5;
  opacity: .55;
}
.inventory-trend-comparison-chart circle {
  fill: #fff;
  stroke-width: 1;
}
.inventory-trend-comparison-chart .current-point {
  stroke: var(--series-color, var(--trend-color));
}
.inventory-trend-comparison-chart .compare-point {
  stroke: var(--series-color, #94a3b8);
  opacity: .55;
}
.inventory-trend-combined-chart {
  cursor: crosshair;
}
.inventory-trend-combined-chart .inventory-trend-line,
.inventory-trend-combined-chart .current-point,
.inventory-trend-combined-chart .compare-point {
  pointer-events: none;
}
.inventory-trend-hover-layer {
  pointer-events: none;
}
.inventory-trend-hover-layer line {
  stroke: #64748b;
  stroke-width: 1;
  stroke-dasharray: 3 4;
  opacity: .75;
  vector-effect: non-scaling-stroke;
}
.inventory-trend-hover-layer circle {
  fill: #fff;
  stroke: var(--series-color);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}
.inventory-trend-combined-tooltip {
  position: absolute;
  z-index: 4;
  width: min(320px, calc(100% - 16px));
  padding: 10px 12px;
  border: 1px solid #d0d5dd;
  border-radius: 6px;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 8px 24px rgba(15, 23, 42, .16);
  color: #101828;
  pointer-events: none;
}
.inventory-trend-combined-tooltip[hidden] {
  display: none;
}
.inventory-trend-tooltip-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e2e8f0;
}
.inventory-trend-tooltip-head strong {
  font-size: 13px;
}
.inventory-trend-tooltip-head span {
  color: #667085;
  font-size: 11px;
  font-weight: 800;
  text-align: right;
}
.inventory-trend-tooltip-values {
  display: grid;
}
.inventory-trend-tooltip-row {
  display: grid;
  grid-template-columns: minmax(108px, 1fr) minmax(76px, auto);
  align-items: center;
  gap: 10px;
  min-height: 30px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 12px;
}
.inventory-trend-tooltip-row.with-compare {
  grid-template-columns: minmax(96px, 1fr) minmax(68px, auto) minmax(68px, auto);
}
.inventory-trend-tooltip-row:last-child {
  border-bottom: 0;
}
.inventory-trend-tooltip-row.headings {
  min-height: 28px;
  color: #667085;
  font-size: 11px;
  font-weight: 850;
}
.inventory-trend-tooltip-row > span {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
  font-weight: 850;
  white-space: nowrap;
}
.inventory-trend-tooltip-row > span i {
  display: inline-block;
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--series-color);
}
.inventory-trend-tooltip-row > strong,
.inventory-trend-tooltip-row > em,
.inventory-trend-tooltip-row > b {
  font-size: 12px;
  font-style: normal;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}
.inventory-trend-tooltip-row > em {
  color: #667085;
  font-weight: 750;
}
.inventory-trend-period-key,
.inventory-trend-combined-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}
.inventory-trend-period-key {
  justify-content: flex-end;
  gap: 14px;
  color: #475467;
  font-size: 12px;
  font-weight: 850;
}
.inventory-trend-period-key span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}
.inventory-trend-period-key i {
  display: inline-block;
  width: 24px;
  height: 0;
  border-top: 2px solid #475467;
}
.inventory-trend-period-key i.compare {
  border-top-width: 1px;
  border-top-style: dashed;
}
.inventory-trend-combined-legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px 14px;
}
.inventory-trend-series-key {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
  color: #344054;
  font-size: 12px;
}
.inventory-trend-series-key i,
.inventory-trend-table-metric i {
  display: inline-block;
  flex: 0 0 auto;
  width: 20px;
  height: 2px;
  background: var(--series-color);
}
.inventory-trend-series-key b {
  white-space: nowrap;
}
.inventory-trend-series-key em {
  overflow: hidden;
  margin-left: auto;
  color: #667085;
  font-style: normal;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inventory-trend-combined-table table {
  min-width: 720px;
}
.inventory-trend-period-summary-table table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}
.inventory-trend-period-summary-table th:first-child,
.inventory-trend-period-summary-table td:first-child {
  width: 34%;
}
.inventory-trend-period-summary-table th:nth-child(2),
.inventory-trend-period-summary-table td:nth-child(2) {
  width: 26%;
}
.inventory-trend-period-summary-table th:nth-child(3),
.inventory-trend-period-summary-table td:nth-child(3) {
  width: 40%;
}
.inventory-trend-combined-table th,
.inventory-trend-combined-table td {
  padding: 8px 10px;
  text-align: right;
  white-space: nowrap;
}
.inventory-trend-combined-table th:first-child,
.inventory-trend-combined-table td:first-child {
  text-align: left;
}
.inventory-trend-table-metric {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 850;
}
.inventory-trend-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  color: #475467;
  font-size: 12px;
  font-weight: 850;
}
.inventory-trend-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.inventory-trend-legend i,
.inventory-trend-compare-table td:first-child i {
  display: inline-block;
  width: 22px;
  height: 3px;
  margin-right: 7px;
  border-radius: 2px;
  vertical-align: middle;
}
.inventory-trend-legend i.current,
.inventory-trend-compare-table i.current {
  background: var(--trend-color);
}
.inventory-trend-legend i.compare,
.inventory-trend-compare-table i.compare {
  height: 0;
  border-top: 2px dashed #94a3b8;
}
.inventory-trend-compare-table table {
  min-width: 680px;
}
.inventory-trend-compare-table th,
.inventory-trend-compare-table td {
  padding: 8px 10px;
  text-align: right;
  white-space: nowrap;
}
.inventory-trend-compare-table th:first-child,
.inventory-trend-compare-table td:first-child,
.inventory-trend-compare-table th:nth-child(2),
.inventory-trend-compare-table td:nth-child(2) {
  text-align: left;
}
.inventory-trend-workspace .inventory-trend-change.positive {
  color: #15803d;
}
.inventory-trend-workspace .inventory-trend-change.negative {
  color: #dc2626;
}
@media (max-width: 760px) {
  .inventory-trend-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .inventory-trend-period-row,
  .inventory-trend-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .inventory-trend-period-key {
    justify-content: flex-start;
  }
  .inventory-trend-current {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .inventory-trend-custom-range {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: end;
  }
  .inventory-trend-custom-range input {
    width: 100%;
  }
  .inventory-trend-custom-range button {
    grid-column: 1 / -1;
  }
}
.inventory-month-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-content: center;
  justify-content: flex-start;
  grid-column: 1 / -1;
}
.inventory-month-tabs button {
  min-height: 30px;
  padding: 0 10px;
  border-color: #bfdbfe;
  background: #fff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 900;
}
.inventory-month-tabs button.active {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}
.inventory-summary .inventory-month-tabs {
  display: grid;
  grid-template-columns: 54px 18fr 14fr 13fr 6fr 10fr 14fr 5fr 20fr;
  align-items: center;
}
.inventory-date-preset-list {
  grid-column: 1 / 6;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.inventory-summary .inventory-month-tabs .inventory-price-pending-inline {
  grid-column: 6;
  justify-self: center;
  margin: 0;
}
.inventory-custom-date {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
  clear: both;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0 0 18px;
  padding: 12px;
  border: 1px solid #ecebff;
  border-radius: 8px;
  background: #fff;
  isolation: isolate;
}
.inventory-calendar-tools {
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.inventory-calendar-tools > strong {
  min-width: 0;
  color: #344054;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.inventory-date-mode {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  min-height: 34px;
  padding: 3px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #fff;
}
.inventory-date-mode button {
  min-height: 28px;
  padding: 0 12px;
  border-color: transparent;
  background: transparent;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 900;
}
.inventory-date-mode button.active {
  background: #2563eb;
  color: #fff;
}
.inventory-custom-date button {
  min-height: 34px;
}
.inventory-calendar {
  width: min(360px, 100%);
  max-width: 100%;
  color: #344054;
}
.inventory-calendar-head {
  display: grid;
  grid-template-columns: 60px 1fr 60px;
  align-items: center;
  min-height: 34px;
  margin-bottom: 8px;
}
.inventory-calendar-head strong {
  text-align: center;
  color: #101828;
  font-size: 14px;
  font-weight: 900;
}
.inventory-calendar-nav {
  display: flex;
  gap: 2px;
}
.inventory-calendar-nav:last-child {
  justify-content: flex-end;
}
.inventory-calendar-nav button {
  min-width: 24px;
  min-height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #98a2b3;
  font-size: 18px;
  line-height: 1;
}
.inventory-calendar-weekdays,
.inventory-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
}
.inventory-calendar-weekdays span {
  display: grid;
  place-items: center;
  height: 28px;
  color: #475467;
  font-size: 14px;
  font-weight: 800;
}
.inventory-calendar-day {
  display: grid;
  place-items: center;
  min-width: 0;
  height: 30px;
  min-height: 30px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #344054;
  font-size: 14px;
  font-weight: 700;
}
.inventory-calendar-day.outside {
  color: #d0d5dd;
}
.inventory-calendar-day.in-range {
  background: #eeeaff;
}
.inventory-calendar-day.selected {
  border-radius: 4px;
  background: #7a5af8;
  color: #fff;
  box-shadow: inset 0 0 0 1px #6941c6;
}
.inventory-calendar-day.selected + .inventory-calendar-day.in-range,
.inventory-calendar-day.in-range + .inventory-calendar-day.selected {
  border-radius: 4px;
}
.inventory-custom-date + .inventory-grid {
  margin-top: 4px;
}
.inventory-moves-panel {
  margin-top: 12px;
}
.inventory-moves-modal {
  display: grid;
  gap: 12px;
}
.inventory-moves-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}
.inventory-moves-modal-head strong {
  display: block;
  font-size: 15px;
  color: var(--ink);
}
.inventory-moves-modal-head span {
  font-size: 12px;
  color: var(--muted);
}
.inventory-moves-count {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eef4ff;
  color: #1d4ed8 !important;
  font-weight: 900;
}
.inventory-moves-filter-row {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(160px, 220px) max-content;
  gap: 10px;
  align-items: end;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.inventory-moves-filter-row label {
  display: grid;
  gap: 5px;
  color: #344054;
  font-size: 12px;
  font-weight: 900;
}
.inventory-moves-filter-row select,
.inventory-moves-filter-row input {
  height: 34px;
  min-height: 34px;
}
.inventory-moves-filter-row button {
  height: 34px;
  min-height: 34px;
  padding: 0 14px;
}
.inventory-moves-modal-list {
  max-height: min(62vh, 620px);
  overflow: auto;
  padding-right: 4px;
}
.inventory-moves-modal-pager {
  margin-top: 0;
}
.inventory-moves-toggle {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}
.inventory-moves-toggle button {
  min-width: 126px;
  height: 38px;
  min-height: 38px;
}
.inventory-move-item,
.dashboard-due-item {
  display: flex;
  align-items: center;
  gap: 10px;
}
.move-thumb {
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef2f6;
}
.move-thumb.placeholder {
  display: grid;
  place-items: center;
  color: #98a2b3;
  font-size: 12px;
  font-weight: 800;
}
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}
th, td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.check-cell {
  width: 54px;
  min-width: 54px;
  max-width: 54px;
  padding-left: 0;
  padding-right: 0;
  text-align: center;
  vertical-align: middle;
}
.check-cell input[type="checkbox"],
.inventory-check,
#inventoryCheckAll {
  width: 16px;
  height: 16px;
  min-height: 16px;
  padding: 0;
  margin: 0 auto;
  vertical-align: middle;
}
th {
  background: #f9fafb;
  color: #475467;
  font-size: 12px;
  font-weight: 800;
}
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fcfcfd; }
.low { color: var(--danger); font-weight: 800; }
.stock-name {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.stock-thumb {
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef2f6;
}
.stock-thumb.placeholder {
  display: grid;
  place-items: center;
  color: #98a2b3;
  font-size: 12px;
  font-weight: 800;
}
.tiny-img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.stock-name strong,
.stock-name .muted {
  word-break: break-word;
  line-height: 1.3;
}
.list { display: grid; gap: 8px; }
.logs-toolbar {
  margin-bottom: 12px;
  align-items: end;
}
.logs-toolbar label {
  max-width: 260px;
}
.security-log-row {
  background: #f8fbff;
}
.security-log-row td:first-child,
.security-log-row td:nth-child(2) {
  color: #2563eb;
  font-weight: 800;
}
.log-groups {
  display: grid;
  gap: 14px;
}
.log-user-group {
  display: grid;
  gap: 8px;
}
.log-user-group h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #101828;
  font-size: 16px;
}
.log-user-group h3 span {
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef2ff;
  color: #475467;
  font-size: 12px;
  font-weight: 900;
}
.list-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.list-item:last-child { border-bottom: 0; }
.notice-unread {
  padding: 12px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
}
.notice-image {
  display: block;
  width: 140px;
  height: 100px;
  object-fit: contain;
  margin: 8px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef2f6;
}
.notice-dot {
  display: inline-flex;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 12px;
}
.notice-read-dot {
  display: inline-flex;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #e5e7eb;
  color: #475467;
  font-size: 12px;
}
.notice-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}
.record-dot {
  display: inline-flex;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #ecfdf3;
  color: #067647;
  font-size: 12px;
  font-weight: 900;
}
.notify-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

dialog {
  border: 0;
  border-radius: 8px;
  padding: 0;
  width: min(680px, calc(100vw - 24px));
  box-shadow: 0 24px 64px rgba(16, 24, 40, .2);
}
dialog:has(.batch-job-form) {
  width: min(1320px, calc(100vw - 32px));
}
dialog:has(.ocr-outbound-form) {
  width: min(1180px, calc(100vw - 32px));
}
dialog:has(.batch-out-form) {
  width: min(1120px, calc(100vw - 32px));
}
dialog:has(.outbound-compare-result) {
  width: min(980px, calc(100vw - 32px));
}
dialog:has(.inventory-moves-modal) {
  width: min(1120px, calc(100vw - 32px));
}
dialog.historical-products-dialog {
  width: min(1320px, calc(100vw - 28px));
  height: min(860px, calc(100dvh - 28px));
  max-height: calc(100dvh - 28px);
}
dialog.historical-products-dialog .modal-box {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100%;
  max-height: inherit;
}
dialog.historical-products-dialog .modal-box header,
dialog.historical-products-dialog .modal-box footer {
  flex: 0 0 auto;
}
.historical-products-modal {
  display: grid;
  gap: 12px;
  min-height: 0;
  overflow: auto;
  padding: 16px;
  background: #f8fafc;
}
.historical-products-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
  align-items: start;
}
.historical-products-summary span {
  display: grid;
  gap: 4px;
  align-content: center;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid #dbe7f6;
  border-radius: 10px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.historical-products-summary b {
  color: var(--ink);
  font-size: 16px;
  font-weight: 950;
}
dialog.historical-products-dialog .historical-manager-product-list {
  padding: 0;
}
dialog.historical-products-dialog .historical-manager-product-line {
  grid-template-columns: 76px minmax(300px, 1fr) repeat(5, minmax(92px, max-content));
  gap: 12px;
  padding: 10px 12px;
  min-height: 92px;
}
dialog.historical-products-dialog .tiny-img {
  width: 72px;
  height: 72px;
}
dialog:has(.historical-manager-panel) {
  width: calc(100vw - 24px);
  height: calc(100dvh - 24px);
  max-height: calc(100dvh - 24px);
}
dialog::backdrop {
  background: rgba(15, 23, 42, .30);
  backdrop-filter: blur(8px) saturate(1.06);
  -webkit-backdrop-filter: blur(8px) saturate(1.06);
}
dialog[open]::backdrop {
  animation: softBackdropIn .22s var(--ease-ui) both;
}
.modal-box {
  margin: 0;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
}
dialog[open] .modal-box {
  animation: modalSoftIn .24s var(--ease-soft) both;
}
.modal-box header, .modal-box footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}
.modal-box footer {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  justify-content: flex-end;
  background: #f9fafb;
}
.modal-box h3 { margin: 0; font-size: 18px; }
#modalBody { padding: 16px; display: grid; gap: 12px; }
dialog:has(.historical-manager-panel) .modal-box {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100%;
  max-height: inherit;
}
dialog:has(.historical-manager-panel) #modalBody {
  overflow: auto;
  padding: 18px;
}
.form-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.inventory-stock-form .form-2 > label {
  align-self: start;
  align-content: start;
}
.inventory-stock-form .inventory-stock-field {
  gap: 6px;
}
.inventory-stock-form .inventory-stock-field > input,
.inventory-stock-form .inventory-stock-field > select {
  height: 40px;
  min-height: 40px;
}
.inventory-stock-form .inventory-history-field .hint {
  line-height: 1.35;
}
.shop-scope-field { grid-column: 1 / -1; }
.shop-scope-field .field-title {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}
.shop-scope-search {
  margin-bottom: 8px;
  background: #fff;
}
.shop-check-list {
  display: grid;
  gap: 8px;
  max-height: 180px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fafb;
}
.shop-scope-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.shop-check-column {
  display: grid;
  align-content: start;
  gap: 8px;
}
.shop-check-column > strong {
  color: var(--ink);
  font-size: 13px;
}
.shop-check {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid #e4e7ec;
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
  font-weight: 700;
}
.shop-check input {
  width: 16px;
  height: 16px;
  min-height: 16px;
  padding: 0;
}
.permission-editor {
  display: grid;
  gap: 12px;
  grid-column: 1 / -1;
  margin-top: 4px;
  padding: 12px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f8fbff;
}
.permission-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.permission-editor-head strong {
  display: block;
  color: #101828;
  font-size: 15px;
  font-weight: 950;
}
.permission-editor-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}
.permission-editor-actions button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}
.permission-editor-grid {
  display: grid;
  gap: 10px;
}
.permission-group {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #e4e7ec;
  border-radius: 8px;
  background: #fff;
}
.permission-group > strong {
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 950;
}
.permission-check-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.permission-check {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 6px 8px;
  border: 1px solid #eef2f6;
  border-radius: 8px;
  background: #fcfcfd;
  color: #344054;
  font-size: 12px;
  font-weight: 800;
}
.permission-check input {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  min-height: 16px;
  padding: 0;
}
.account-submenu-panel {
  margin-bottom: 10px;
  padding: 12px 14px;
}
.account-submenu-head {
  align-items: center;
  margin-bottom: 0;
}
.account-submenu-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.role-template-panel {
  margin-bottom: 14px;
}
.role-template-head p {
  margin: 4px 0 0;
  color: #667085;
  font-size: 12px;
  font-weight: 800;
}
.role-template-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}
.role-template-tabs button {
  min-height: 32px;
  padding: 0 14px;
  border-color: #d0d5dd;
  border-radius: 999px;
  background: #fff;
  color: #344054;
  font-weight: 900;
}
.role-template-tabs button.active {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}
.role-template-editor {
  margin-top: 0;
}
.role-template-save-status {
  min-width: 80px;
  color: #667085;
  font-size: 12px;
  font-weight: 950;
  text-align: right;
}
.role-template-save-status.saving {
  color: #f97316;
}
.role-template-save-status.saved {
  color: #059669;
}
.role-template-save-status.error {
  color: #dc2626;
}
.system-init-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.system-init-menu {
  display: grid;
  gap: 10px;
}
.system-init-menu button {
  justify-content: center;
  min-height: 38px;
}
.system-init-actions button {
  min-height: 34px;
  padding: 0 14px;
}
.danger-soft-btn {
  border-color: #fca5a5;
  background: #fff1f2;
  color: #b91c1c;
  font-weight: 950;
}
.shop-name-list {
  display: grid;
  gap: 4px;
  min-width: 150px;
}
.shop-name-list span {
  display: block;
  padding: 2px 0;
  line-height: 1.35;
  color: var(--ink);
  font-weight: 700;
}
.image-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fafb;
}
.image-preview img {
  width: 78px;
  height: 58px;
  object-fit: contain;
  border-radius: 8px;
}
.image-dropzone {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  min-height: 78px;
  padding: 10px 92px 10px 12px;
  border: 1.5px dashed #b9c7dc;
  border-radius: 8px;
  background: #f8fbff;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.image-dropzone.drag-over {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.image-dropzone input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.image-dropzone-hint {
  display: grid;
  gap: 2px;
  color: #475467;
  font-size: 13px;
  font-weight: 800;
}
.image-dropzone-hint strong {
  color: #1d4ed8;
  font-size: 14px;
  font-weight: 950;
}
.image-dropzone-preview:empty {
  display: none;
}
.image-dropzone-preview {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.image-dropzone-preview img {
  width: 62px;
  height: 52px;
  object-fit: contain;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #fff;
}
.image-dropzone-status {
  color: #667085;
  font-size: 12px;
  font-weight: 800;
  word-break: break-all;
}
.detail-image {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fafb;
}
.outbound-compare-paste {
  grid-column: 1 / -1;
}
.outbound-compare-result {
  display: grid;
  gap: 14px;
}
.compare-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  background: #f0fdf4;
}
.outbound-compare-result.mismatch .compare-result-head {
  border-color: #fecaca;
  background: #fff1f2;
}
.compare-result-head strong {
  color: #15803d;
  font-size: 24px;
  font-weight: 950;
}
.outbound-compare-result.mismatch .compare-result-head strong {
  color: #dc2626;
}
.compare-result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 10px;
}
.compare-result-grid article {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.compare-result-grid span {
  display: block;
  color: #667085;
  font-size: 13px;
  font-weight: 800;
}
.compare-result-grid strong {
  display: block;
  margin-top: 5px;
  color: #0f172a;
  font-size: 22px;
  font-weight: 950;
}
.outbound-compare-result tr.compare-row-mismatch td {
  background: #fff1f2;
  color: #b42318;
  font-weight: 900;
}
.ok-text {
  color: #15803d;
  font-weight: 900;
}
.preview-image {
  width: 100%;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 8px;
  background: #f9fafb;
}
img.outbound-proof-thumb,
img.batch-product-thumb,
img.ocr-thumb,
img.picker-thumb,
img.flow-thumb,
img.job-thumb,
img.recycle-thumb,
img.move-thumb,
img.stock-thumb,
img.notice-image,
.image-preview img {
  background: #fff;
}
.icon-btn {
  width: 36px;
  padding: 0;
  font-size: 22px;
  line-height: 1;
  color: #667085;
}
.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 2147483647;
  max-width: 360px;
  background: #101828;
  color: #fff;
  padding: 12px 14px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  animation: toastSoftIn .24s var(--ease-soft) both;
}

@keyframes softPopoverIn {
  from {
    opacity: 0;
    transform: translateY(4px) scale(.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@keyframes dropdownSoftIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  70% {
    opacity: 1;
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes dropdownTabletIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes softBackdropIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes modalSoftIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@keyframes modalTabletSoftIn {
  from {
    opacity: 0;
    transform: translateY(4px) scale(.992);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes toastSoftIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}

@media (min-width: 1181px) and (max-width: 1366px),
       (hover: none) and (pointer: coarse) and (min-width: 1181px) and (max-width: 1920px),
       (min-width: 1600px) and (max-width: 1920px) and (min-height: 1100px) and (max-height: 1220px) {
  .app-shell {
    grid-template-columns: 180px minmax(0, 1fr);
  }
  .sidebar {
    gap: 8px;
    padding: 10px 8px;
  }
  .brand {
    gap: 7px;
    min-height: 34px;
    padding: 0;
  }
  .brand-mark {
    width: 34px;
    height: 34px;
    min-width: 34px;
    aspect-ratio: 1 / 1;
    transform: none;
  }
  .brand strong {
    flex-wrap: wrap;
    gap: 4px 6px;
    font-size: 12px;
    line-height: 1.15;
  }
  .brand .app-version {
    font-size: 10px;
  }
  nav {
    gap: 5px;
  }
  nav button {
    min-height: 30px;
    padding: 0 8px;
    font-size: 12px;
  }
  .online-status-btn,
  .offline-status-btn,
  #logoutBtn {
    min-height: 30px;
  }
  .current-account {
    padding: 7px;
  }
  .current-account strong {
    font-size: 12px;
  }
  .current-account span,
  .current-account small {
    font-size: 11px;
  }
  .content {
    padding: 12px;
  }
  .topbar {
    gap: 8px;
    margin-bottom: 10px;
  }
  .topbar h2 {
    font-size: 21px;
  }
  .topbar p,
  .hint {
    font-size: 12px;
  }
  .toolbar {
    gap: 6px;
  }
  .toolbar button,
  .filter-bar button,
  .batch-head .actions button {
    min-height: 30px;
    padding: 0 9px;
    font-size: 12px;
  }
  .filter-bar {
    grid-template-columns: minmax(170px, .9fr) minmax(170px, .9fr) minmax(260px, 1.2fr) minmax(180px, 1fr) auto;
    gap: 5px;
    padding: 7px;
    margin-bottom: 8px;
  }
  .filter-bar label {
    font-size: 12px;
  }
  .filter-bar select,
  .filter-bar input {
    min-height: 30px;
    font-size: 12px;
  }
  .outbound-filter-bar {
    grid-template-columns: 178px 178px auto auto;
    justify-content: start;
  }
  .inventory-filter {
    grid-template-columns: 190px 280px 150px auto;
    justify-content: start;
  }
  .inventory-batch-actions {
    grid-column: 1 / -1;
  }
  .inventory-filter .inventory-batch-btn {
    width: 108px;
    min-width: 108px;
    max-width: 108px;
    height: 30px;
    min-height: 30px;
    font-size: 12px;
  }
  .metric-grid,
  .inventory-summary {
    grid-template-columns: repeat(7, minmax(84px, 1fr));
    gap: 5px;
  }
  .metric,
  .inventory-summary article {
    padding: 7px 8px;
  }
  .metric strong {
    font-size: 21px;
  }
  .inventory-summary strong {
    font-size: 19px;
  }
  .dashboard-kpi-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .dashboard-main-grid,
  .dashboard-top-grid,
  .dashboard-bottom-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-panel {
    padding: 10px;
  }
  .dashboard-month-chart {
    grid-template-columns: repeat(12, minmax(36px, 1fr));
  }
  .completed-toolbar {
    grid-template-columns: max-content max-content max-content;
  }
  .flow-row {
    grid-template-columns: minmax(300px, 1.08fr) minmax(260px, .92fr);
    align-items: start;
    gap: 6px;
    padding: 6px;
  }
  .flow-row .actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
  .flow-thumb {
    width: 52px;
    height: 52px;
  }
  .flow-meta {
    grid-template-columns: repeat(2, minmax(118px, 1fr));
    gap: 4px 6px;
  }
  .batch-head {
    grid-template-columns: minmax(300px, 1fr) 360px auto;
    gap: 5px;
  }
  .batch-duration {
    min-height: 26px;
    padding: 2px 7px;
    font-size: 11px;
  }
  .batch-head > .actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
  .batch-line {
    grid-template-columns: minmax(180px, 1fr) auto auto;
    padding: 5px;
  }
  .batch-form-line {
    grid-template-columns: minmax(140px, 1fr) minmax(120px, .8fr) minmax(88px, 110px) minmax(180px, 1.1fr);
    padding: 5px;
  }
  .batch-product-thumb {
    width: 44px;
    height: 44px;
  }
  .batch-product-summary {
    gap: 6px;
  }
  .outbound-products {
    gap: 8px;
  }
  .outbound-product-row {
    grid-template-columns: minmax(220px, 1.1fr) minmax(150px, .8fr) minmax(100px, 120px) minmax(210px, 1fr) minmax(96px, auto) auto;
  }
  .outbound-batch-money {
    justify-content: flex-start;
  }
  .table-wrap,
  .inventory-grid {
    overflow-x: auto;
  }
  .inventory-grid {
    display: block;
  }
  .inventory-grid table {
    min-width: 1040px;
  }
  .inventory-grid th,
  .inventory-grid td {
    padding: 3px 5px;
    font-size: 11px;
  }
  .inventory-grid .inventory-actions-grid {
    grid-template-columns: repeat(3, minmax(54px, 1fr));
    gap: 4px;
  }
  .inventory-grid .inventory-actions-grid button {
    min-height: 25px;
    padding: 0 4px;
    font-size: 11px;
  }
  .inventory-qty-lines {
    column-gap: 6px;
    gap: 6px;
  }
  .batch-out-form .batch-form-line,
  .batch-out-form .batch-out-line {
    grid-template-columns: minmax(260px, 1fr) minmax(190px, 230px) minmax(120px, 145px) minmax(112px, 140px) auto;
  }
  .batch-out-add {
    grid-template-columns: minmax(150px, .8fr) auto minmax(240px, 1fr) auto;
  }
  .batch-job-form .batch-form-line {
    grid-template-columns: minmax(210px, 1fr) minmax(150px, .8fr) minmax(96px, 112px) minmax(190px, 1fr) minmax(104px, auto) auto;
  }
  .batch-job-form .batch-new-product-line {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }
  .batch-job-form .batch-image-field {
    grid-column: span 2;
  }
  .ocr-edit-line {
    grid-template-columns: 52px minmax(190px, 1fr) minmax(130px, 160px);
  }
  .ocr-edit-line.missing {
    grid-template-columns: 52px minmax(160px, 1fr) minmax(170px, 1fr) minmax(170px, 1fr) minmax(110px, .75fr) minmax(140px, .8fr);
  }
  dialog {
    width: min(860px, calc(100vw - 48px));
    max-height: calc(100dvh - 24px);
  }
  dialog:has(.batch-job-form),
  dialog:has(.batch-out-form),
  dialog:has(.ocr-outbound-form) {
    width: min(1180px, calc(100vw - 48px));
  }
  .modal-box {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    max-height: inherit;
  }
  #modalBody {
    overflow: auto;
    padding: 10px;
  }
}

@media (min-width: 1181px) and (max-width: 1260px) {
  .app-shell {
    grid-template-columns: 172px minmax(0, 1fr);
  }
  .brand strong {
    font-size: 13px;
  }
  .content {
    padding: 10px;
  }
  .filter-bar,
  .inventory-filter {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .inventory-filter {
    grid-template-columns: 190px 280px 150px auto;
    justify-content: start;
  }
  .inventory-batch-actions,
  .filter-bar > .download-list-btn,
  .filter-bar > .flow-batch-delete-btn {
    grid-column: 1 / -1;
  }
  .batch-head {
    grid-template-columns: minmax(260px, 1fr) 360px auto;
  }
  .batch-duration,
  .batch-head > .actions {
    grid-column: auto;
    justify-content: flex-start;
  }
  .flow-row,
  .outbound-product-row {
    grid-template-columns: minmax(210px, .95fr) minmax(320px, 1.05fr) max-content;
  }
  .flow-row .actions,
  .batch-head > .actions {
    justify-content: flex-start;
  }
  .metric-grid,
  .inventory-summary {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (min-width: 1181px) and (max-width: 1366px),
       (hover: none) and (pointer: coarse) and (min-width: 1181px) and (max-width: 1920px),
       (min-width: 1600px) and (max-width: 1920px) and (min-height: 1100px) and (max-height: 1220px) {
  .flow-list {
    gap: 4px;
  }
  .batch-group {
    padding: 5px 6px;
    border-width: 1px;
    border-radius: 7px;
    box-shadow: inset 3px 0 0 var(--batch-rail), 0 1px 4px rgba(16, 24, 40, .04);
  }
  .batch-lines {
    gap: 4px;
    margin-top: 4px;
  }
  .batch-collapsed-summary {
    gap: 4px;
    margin-top: 4px;
    padding: 4px;
  }
  .batch-collapsed-summary span {
    max-width: 300px;
    padding: 2px 6px;
    font-size: 11px;
  }
  .batch-created-date,
  .batch-owner-shop {
    min-height: 21px;
    padding: 1px 7px;
    font-size: 12px;
    line-height: 1.15;
  }
  .batch-progress-pill,
  .batch-download-count {
    min-height: 19px;
    padding: 0 6px;
    font-size: 11px;
  }
  .flow-row {
    gap: 5px;
    padding: 4px 5px;
    border-radius: 6px;
  }
  .flow-main {
    gap: 5px;
  }
  .flow-check,
  .batch-check {
    width: 14px;
    height: 14px;
    min-height: 14px;
  }
  .flow-thumb {
    width: 40px;
    height: 40px;
    border-radius: 6px;
  }
  .flow-title {
    gap: 4px;
    margin-bottom: 1px;
    font-size: 12px;
    line-height: 1.15;
  }
  .flow-meta {
    gap: 2px 5px;
    font-size: 11px;
    line-height: 1.15;
  }
  .flow-note-display {
    min-height: 16px;
    font-size: 11px;
    line-height: 1.2;
  }
  .inline-number,
  .inline-date {
    gap: 4px;
    font-size: 11px;
    line-height: 1.15;
  }
  .inline-number input {
    width: 58px;
    min-height: 23px;
    padding: 1px 5px;
    font-size: 11px;
  }
  .inline-date input {
    width: 108px;
    min-height: 23px;
    padding: 1px 5px;
    font-size: 11px;
  }
  .status-select {
    width: 90px;
    min-height: 23px;
    padding: 1px 5px;
    font-size: 11px;
    border-radius: 6px;
  }
  .status-badge {
    min-height: 18px;
    padding: 1px 6px;
    font-size: 11px;
  }
  .actions {
    gap: 3px;
  }
  .flow-row .actions button,
  .batch-head .actions button,
  .actions button {
    min-height: 23px;
    padding: 0 6px;
    border-radius: 6px;
    font-size: 11px;
  }
  .batch-line,
  .batch-form-line {
    gap: 5px;
    padding: 4px;
    border-radius: 6px;
  }
  .batch-product-thumb {
    width: 38px;
    height: 38px;
    border-radius: 6px;
  }
  .batch-product-summary {
    gap: 5px;
    font-size: 12px;
    line-height: 1.15;
  }
  .stock-source-picker {
    gap: 5px;
  }
  .stock-source-choice {
    min-height: 34px;
    gap: 5px;
    padding: 4px 6px;
    border-radius: 7px;
  }
  .stock-source-choice input {
    width: 13px;
    height: 13px;
    min-height: 13px;
  }
  .stock-source-choice strong {
    font-size: 11px;
  }
  .stock-source-choice small {
    font-size: 10px;
  }
}

@media (min-width: 1500px) and (max-width: 1920px) and (min-height: 980px) and (max-height: 1220px) {
  .flow-row {
    grid-template-columns: minmax(260px, 1fr) minmax(220px, .78fr) auto;
  }
  .flow-row .actions {
    grid-column: auto;
    justify-content: flex-end;
  }
  .batch-head {
    grid-template-columns: minmax(420px, 1fr) 360px auto auto;
  }
  .batch-head > .actions {
    grid-column: auto;
    justify-content: flex-end;
  }
}

@media (min-width: 1181px) and (max-width: 1366px),
       (hover: none) and (pointer: coarse) and (min-width: 1181px) and (max-width: 1920px),
       (min-width: 1500px) and (max-width: 1920px) and (min-height: 900px) and (max-height: 1220px) {
  .app-shell,
  dialog {
    font-size: 12px;
  }
  .flow-row {
    grid-template-columns: minmax(230px, .9fr) minmax(420px, 1.15fr) max-content;
    gap: 4px;
    padding: 3px 4px;
    align-items: center;
  }
  .flow-main {
    gap: 4px;
  }
  .flow-thumb {
    width: 34px;
    height: 34px;
  }
  .flow-title {
    display: block;
    max-width: 100%;
    margin-bottom: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
  }
  .flow-meta {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 5px;
    min-width: 0;
    overflow: hidden;
    font-size: 10.5px;
    line-height: 1.1;
  }
  .flow-meta > * {
    flex: 0 0 auto;
    min-width: 0;
  }
  .flow-note-display {
    grid-column: auto;
    max-width: 160px;
    min-height: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 10.5px;
    line-height: 1.1;
  }
  .inline-number,
  .inline-date {
    gap: 3px;
    font-size: 10.5px;
    white-space: nowrap;
  }
  .inline-number input {
    width: 50px;
  }
  .inline-date input {
    width: 96px;
  }
  .status-select,
  .inline-number input,
  .inline-date input {
    min-height: 20px;
    height: 20px;
    padding: 0 4px;
    font-size: 10.5px;
    border-radius: 5px;
  }
  .status-select {
    width: 78px;
  }
  .status-badge {
    min-height: 16px;
    padding: 0 5px;
    font-size: 10px;
  }
  .flow-row .actions {
    grid-column: auto;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 2px;
    max-width: 320px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .flow-row .actions::-webkit-scrollbar {
    display: none;
  }
  .flow-row .actions button,
  .batch-head .actions button,
  .actions button {
    min-height: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 5px;
    font-size: 10.5px;
    line-height: 1;
  }
  .batch-group {
    padding: 4px 5px;
    border-radius: 6px;
  }
  .batch-head {
    grid-template-columns: minmax(360px, 1fr) 360px max-content;
    gap: 4px;
  }
  .batch-head > .actions {
    grid-column: auto;
    flex-wrap: nowrap;
    justify-content: flex-end;
    max-width: 360px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .batch-head > .actions::-webkit-scrollbar {
    display: none;
  }
  .batch-created-date,
  .batch-owner-shop,
  .batch-progress-pill,
  .batch-download-count {
    min-height: 18px;
    padding: 0 5px;
    font-size: 10.5px;
    line-height: 1;
  }
  .batch-owner-shop {
    max-width: 430px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .batch-duration {
    min-height: 20px;
    padding: 1px 6px;
    font-size: 10.5px;
  }
  .batch-lines {
    gap: 3px;
    margin-top: 3px;
  }
  .batch-line,
  .batch-form-line {
    gap: 4px;
    padding: 3px;
    border-radius: 5px;
  }
  .batch-line {
    grid-template-columns: minmax(180px, 1fr) minmax(110px, auto) max-content;
  }
  .batch-product-summary {
    gap: 4px;
    font-size: 11px;
    line-height: 1.1;
  }
  .batch-product-thumb {
    width: 32px;
    height: 32px;
    border-radius: 5px;
  }
  .batch-collapsed-summary {
    gap: 3px;
    margin-top: 3px;
    padding: 3px;
  }
  .batch-collapsed-summary span {
    max-width: 260px;
    padding: 1px 5px;
    font-size: 10.5px;
  }
}

@media (min-width: 1181px) and (max-width: 1260px) {
  .flow-row {
    grid-template-columns: minmax(200px, .8fr) minmax(360px, 1.15fr) max-content;
  }
  .flow-row .actions {
    max-width: 280px;
  }
  .batch-head {
    grid-template-columns: minmax(300px, 1fr) 360px max-content;
  }
  .batch-head > .actions {
    max-width: 300px;
  }
  .batch-owner-shop {
    max-width: 340px;
  }
}

@media (max-width: 1100px) {
  .metric-grid { grid-template-columns: repeat(3, 1fr); }
  .dashboard-main-grid,
  .dashboard-top-grid,
  .dashboard-bottom-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-kpi-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dashboard-kpi-strip article {
    border-right: 0;
    border-bottom: 1px solid rgba(245, 158, 11, .24);
  }
  .filter-bar { grid-template-columns: repeat(2, minmax(160px, 1fr)); }
  .outbound-filter-bar {
    grid-template-columns: 220px 220px auto;
    justify-content: start;
  }
  .inventory-summary { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
  .inventory-month-tabs { justify-content: flex-start; }
}

@media (max-width: 960px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    display: grid;
    grid-template-columns: 1fr;
  }
  nav { grid-template-columns: repeat(4, 1fr); }
  nav button { justify-content: center; text-align: center; }
  .current-account { margin-top: 0; }
  .online-status { margin-top: 0; }
  .online-users-panel {
    width: min(260px, calc(100vw - 32px));
    right: auto;
  }
  #logoutBtn { margin-top: 0; }
  .two-col, .inventory-grid { grid-template-columns: 1fr; }
  .batch-head { grid-template-columns: 1fr; align-items: stretch; }
  .batch-duration { justify-content: flex-start; }
  .batch-form-line,
  .batch-new-product-line {
    grid-template-columns: 1fr 1fr;
  }
  .picker-line {
    grid-template-columns: 22px 1fr;
  }
  .batch-new-product-line .batch-note-default-field {
    grid-column: 1 / -1;
  }
  .batch-image-field {
    grid-column: 1 / -1;
  }
  .batch-new-product-line button {
    grid-column: 1 / -1;
    justify-self: end;
  }
}

@media (min-width: 621px) and (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 212px minmax(0, 1fr);
  }
  .sidebar {
    gap: 14px;
    padding: 16px 12px;
  }
  .brand {
    gap: 10px;
    padding: 0;
  }
  .brand-mark {
    width: 42px;
    height: 42px;
    min-width: 42px;
    aspect-ratio: 1 / 1;
    transform: none;
  }
  nav {
    gap: 5px;
  }
  nav button {
    min-height: 39px;
    padding: 0 10px;
  }
  .content {
    padding: 20px;
  }
  .topbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .dashboard-control-row {
    flex-wrap: wrap;
  }
  .dashboard-refresh-time {
    width: 100%;
    margin-left: 0;
  }
  .topbar h2 {
    font-size: 25px;
  }
  .toolbar {
    justify-content: flex-start;
  }
  .toolbar button {
    min-height: 36px;
    padding: 0 12px;
  }
  .filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .filter-button-pair {
    align-self: end;
  }
  .filter-bar > .download-list-btn,
  .filter-bar > .flow-batch-delete-btn {
    min-height: 36px;
  }
  .outbound-filter-bar {
    grid-template-columns: 220px 220px auto;
    justify-content: start;
  }
  .inventory-filter {
    grid-template-columns: 190px 260px 150px auto;
    justify-content: start;
  }
  .inventory-batch-actions {
    grid-column: 1 / -1;
  }
  .inventory-filter .inventory-batch-btn {
    width: 122px;
    min-width: 122px;
    max-width: 122px;
  }
  .completed-toolbar {
    grid-template-columns: max-content max-content max-content;
  }
  .metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .two-col {
    grid-template-columns: 1fr;
  }
  .flow-row {
    grid-template-columns: minmax(300px, 1.08fr) minmax(260px, .92fr);
    align-items: start;
    padding: 10px;
  }
  .flow-row .actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
  .flow-thumb {
    width: 68px;
    height: 68px;
  }
  .flow-meta {
    grid-template-columns: repeat(2, minmax(118px, 1fr));
  }
  .batch-head {
    grid-template-columns: minmax(260px, 1fr) auto;
    align-items: start;
  }
  .batch-duration {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
  .batch-head > .actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
  .outbound-batch-money {
    justify-content: flex-start;
  }
  .outbound-proof {
    justify-content: flex-end;
  }
  .inventory-grid {
    display: block;
    overflow-x: auto;
  }
  .inventory-grid table {
    min-width: 1040px;
  }
  .inventory-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .batch-out-add {
    grid-template-columns: minmax(140px, .85fr) auto minmax(220px, 1.15fr) auto;
  }
  .batch-job-form .batch-form-line {
    grid-template-columns: minmax(210px, 1fr) minmax(150px, .8fr) minmax(96px, 112px) minmax(190px, 1fr) minmax(104px, auto) auto;
  }
  .batch-job-form .batch-new-product-line {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .batch-job-form .batch-image-field,
  .batch-job-form .batch-new-product-line .batch-note-default-field {
    grid-column: span 3;
  }
  .ocr-edit-line {
    grid-template-columns: 52px minmax(180px, 1fr) minmax(120px, 150px);
  }
  dialog {
    width: min(760px, calc(100vw - 32px));
    max-height: calc(100dvh - 32px);
  }
  dialog:has(.batch-job-form) {
    width: min(1080px, calc(100vw - 32px));
  }
  dialog:has(.ocr-outbound-form) {
    width: min(1080px, calc(100vw - 32px));
  }
  .modal-box {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    max-height: inherit;
  }
  #modalBody {
    overflow: auto;
  }
}

@media (min-width: 621px) and (max-width: 960px) {
  .app-shell {
    display: block;
  }
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 60;
    height: auto;
    padding: 12px 16px;
    gap: 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .brand {
    min-height: 42px;
  }
  nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    overflow-x: auto;
    padding-bottom: 2px;
  }
  nav button {
    min-width: 112px;
    white-space: nowrap;
  }
  .current-account {
    grid-template-columns: auto 1fr;
    align-items: center;
  }
  .current-account small {
    grid-column: 2;
  }
  .content {
    padding: 18px;
  }
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }
  .toolbar button {
    flex: 0 0 auto;
  }
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dashboard-kpi-strip,
  .dashboard-main-grid,
  .dashboard-top-grid,
  .dashboard-bottom-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-month-chart {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  .dashboard-panel-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .filter-bar,
  .outbound-filter-bar,
  .inventory-filter,
  .completed-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .inventory-filter {
    grid-template-columns: 190px 260px 150px auto;
    justify-content: start;
  }
  .outbound-filter-bar {
    grid-template-columns: 200px 200px auto;
    justify-content: start;
  }
  .inventory-batch-actions,
  .completed-total,
  .completed-batch-out-btn,
  .filter-bar > .download-list-btn,
  .filter-bar > .flow-batch-delete-btn {
    grid-column: 1 / -1;
  }
  .flow-row,
  .outbound-product-row {
    grid-template-columns: 1fr;
  }
  .flow-row .actions {
    justify-content: flex-start;
  }
  .batch-head {
    grid-template-columns: 1fr;
  }
  .batch-duration { justify-content: flex-start; }
  .batch-head > .actions {
    justify-content: flex-start;
  }
  .outbound-batch-money {
    justify-content: flex-start;
  }
  .inventory-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .batch-out-add,
  .batch-out-form .batch-out-line,
  .batch-job-form .batch-form-line,
  .batch-job-form .batch-new-product-line,
  .ocr-edit-line,
  .ocr-edit-line.missing {
    grid-template-columns: 1fr 1fr;
  }
  .batch-out-add select,
  .batch-job-form .batch-image-field,
  .batch-job-form .batch-new-product-line .batch-note-default-field,
  .ocr-edit-line.missing .ocr-image-field,
  .ocr-edit-line.missing .batch-image-field {
    grid-column: 1 / -1;
  }
}

@media (max-width: 620px) {
  .content { padding: 16px; }
  .topbar { align-items: stretch; flex-direction: column; }
  nav { grid-template-columns: repeat(2, 1fr); }
  .metric-grid { grid-template-columns: 1fr; }
  .dashboard-control-row {
    align-items: stretch;
    flex-direction: column;
  }
  .dashboard-control-row label,
  .dashboard-control-row .filter-mini-btn {
    width: 100%;
  }
  .dashboard-refresh-time {
    width: 100%;
    margin-left: 0;
    white-space: normal;
  }
  .dashboard-kpi-strip,
  .dashboard-main-grid,
  .dashboard-top-grid,
  .dashboard-bottom-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-kpi-strip article {
    border-right: 0;
    border-bottom: 1px solid rgba(245, 158, 11, .24);
  }
  .dashboard-panel-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .dashboard-bar-chart {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dashboard-month-chart {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .filter-bar { grid-template-columns: 1fr; }
  .inventory-summary { grid-template-columns: 1fr; }
  .inventory-calendar-tools {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .inventory-calendar-tools > strong {
    order: 3;
  }
  .inventory-calendar-tools .filter-mini-btn {
    justify-self: start;
  }
  .form-2 { grid-template-columns: 1fr; }
  .shop-scope-columns { grid-template-columns: 1fr; }
  .flow-row { grid-template-columns: 1fr; }
  .flow-meta { grid-template-columns: 1fr; }
  .batch-form-line,
  .batch-new-product-line,
  .ocr-edit-line,
  .ocr-edit-line.missing {
    grid-template-columns: 1fr;
  }
  .picker-line {
    grid-template-columns: 1fr;
  }
  .picker-line input[type="checkbox"] {
    justify-self: start;
  }
  .batch-new-product-line .batch-note-default-field,
  .batch-image-field,
  .ocr-edit-line.missing .ocr-image-field,
  .batch-new-product-line button {
    grid-column: auto;
  }
  .batch-note-default-field {
    flex-wrap: wrap;
  }
  .batch-note-default-field .batch-note-field {
    flex-basis: 100%;
    min-width: 0;
  }
  .login-form { padding: 20px; }
}

/* Dashboard period analysis */
.dashboard-analysis-open-btn {
  min-height: 36px;
  padding: 0 18px;
  border: 1px solid #7c3aed;
  border-radius: 10px;
  background: linear-gradient(135deg, #7c3aed 0%, #db2777 100%);
  color: #fff;
  font-weight: 800;
  letter-spacing: .04em;
  white-space: nowrap;
  box-shadow: 0 6px 16px rgba(124, 58, 237, .3);
}

.dashboard-analysis-open-btn:hover {
  border-color: #6d28d9;
  background: linear-gradient(135deg, #6d28d9 0%, #be185d 100%);
  box-shadow: 0 7px 18px rgba(124, 58, 237, .38);
}

#modal:has(.dashboard-analysis-workspace) {
  width: min(1280px, calc(100vw - 28px));
  height: min(900px, calc(100vh - 28px));
  max-width: none;
  max-height: none;
}

#modal:has(.dashboard-analysis-workspace) .modal-box {
  height: 100%;
  min-height: 0;
}

#modal:has(.dashboard-analysis-workspace) #modalBody {
  display: block;
  min-height: 0;
  overflow: auto;
  background: #f5f8fc;
}

.dashboard-analysis-workspace {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.dashboard-analysis-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid #dbe5f2;
  border-radius: 14px;
  background: #fff;
}

.dashboard-analysis-preset-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-right: auto;
}

.dashboard-analysis-preset-tabs button {
  min-height: 36px;
  padding: 0 16px;
  border: 1px solid #cdd9ea;
  border-radius: 10px;
  background: #fff;
  color: #334155;
  font-weight: 800;
}

.dashboard-analysis-preset-tabs button.active {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}

.dashboard-analysis-controls > label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.dashboard-analysis-controls input,
.dashboard-analysis-controls select {
  width: 150px;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid #cdd9ea;
  border-radius: 10px;
  background: #fff;
  color: #1e293b;
  font-weight: 700;
}

.dashboard-analysis-period-head {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) minmax(210px, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid #cfdded;
  border-radius: 14px;
  background: linear-gradient(135deg, #eff6ff, #f8fbff);
}

.dashboard-analysis-period-head > div {
  display: grid;
  gap: 3px;
}

.dashboard-analysis-period-head strong {
  color: #1d4ed8;
  font-size: 19px;
}

.dashboard-analysis-period-head span,
.dashboard-analysis-period-head small {
  color: #64748b;
}

.dashboard-analysis-period-head em {
  max-width: 360px;
  padding: 7px 11px;
  overflow: hidden;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #fff;
  color: #1e40af;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-analysis-card-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.dashboard-analysis-card {
  position: relative;
  display: grid;
  align-content: start;
  gap: 5px;
  min-height: 145px;
  padding: 15px 14px 12px 17px;
  overflow: hidden;
  border: 1px solid #dbe4ef;
  border-radius: 14px;
  background: #fff;
}

.dashboard-analysis-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: #2563eb;
  content: "";
}

.dashboard-analysis-card.tone-green::before { background: #16a34a; }
.dashboard-analysis-card.tone-purple::before { background: #7c3aed; }
.dashboard-analysis-card.tone-cyan::before { background: #0891b2; }
.dashboard-analysis-card.tone-orange::before { background: #f97316; }
.dashboard-analysis-card.tone-yellow::before { background: #eab308; }
.dashboard-analysis-card.tone-red::before { background: #dc2626; }

.dashboard-analysis-card > span {
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
}

.dashboard-analysis-card > strong {
  overflow: hidden;
  color: #172033;
  font-size: clamp(22px, 2vw, 30px);
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-analysis-card > p {
  min-height: 18px;
  margin: 0;
  color: #64748b;
  font-size: 12px;
}

.dashboard-analysis-delta {
  display: block;
  margin-top: auto;
  font-weight: 800;
}

.dashboard-analysis-delta.positive { color: #15803d; }
.dashboard-analysis-delta.negative { color: #dc2626; }
.dashboard-analysis-delta.neutral { color: #64748b; }

.dashboard-analysis-section,
.dashboard-analysis-insights {
  min-width: 0;
  padding: 14px;
  border: 1px solid #dbe4ef;
  border-radius: 14px;
  background: #fff;
}

.dashboard-analysis-section h4,
.dashboard-analysis-insights h4 {
  margin: 0 0 11px;
  color: #1e293b;
  font-size: 15px;
}

.dashboard-analysis-status-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px;
}

.dashboard-analysis-status-grid article {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 4px 10px;
  padding: 11px 12px;
  border-radius: 11px;
  background: #f7f9fc;
}

.dashboard-analysis-status-grid span {
  color: #475569;
  font-weight: 800;
}

.dashboard-analysis-status-grid strong {
  color: #172033;
  font-size: 21px;
}

.dashboard-analysis-status-grid small {
  grid-column: 1 / -1;
  color: #64748b;
}

.dashboard-analysis-insights {
  border-color: #c7d9fa;
  background: #f2f7ff;
}

.dashboard-analysis-insights ul {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: #334155;
  line-height: 1.55;
}

.dashboard-analysis-insights li {
  position: relative;
  padding: 10px 12px 10px 31px;
  border: 1px solid #d8e4f6;
  border-radius: 10px;
  background: rgba(255, 255, 255, .78);
}

.dashboard-analysis-insights li::before {
  position: absolute;
  top: 12px;
  left: 12px;
  color: #2563eb;
  font-weight: 900;
  content: "•";
}

.dashboard-analysis-recommendations {
  min-width: 0;
  padding: 14px;
  border: 1px solid #fed7aa;
  border-radius: 14px;
  background: #fff8ed;
}

.dashboard-analysis-recommendations-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 11px;
}

.dashboard-analysis-recommendations-head h4 {
  margin: 0;
  color: #9a3412;
  font-size: 15px;
}

.dashboard-analysis-recommendations-head span {
  color: #c2410c;
  font-size: 12px;
  font-weight: 800;
}

.dashboard-analysis-recommendation-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.dashboard-analysis-recommendation-list article {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
  border: 1px solid #fed7aa;
  border-left: 4px solid #f59e0b;
  border-radius: 11px;
  background: #fff;
}

.dashboard-analysis-recommendation-list article.priority-high { border-left-color: #dc2626; }
.dashboard-analysis-recommendation-list article.priority-normal { border-left-color: #16a34a; }

.dashboard-analysis-recommendation-list article > span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: #ffedd5;
  color: #9a3412;
  font-weight: 900;
}

.dashboard-analysis-recommendation-list strong {
  display: block;
  margin-bottom: 4px;
  color: #7c2d12;
}

.dashboard-analysis-recommendation-list p {
  margin: 0;
  color: #475569;
  line-height: 1.55;
}

.dashboard-analysis-tables {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr);
  gap: 12px;
  align-items: start;
}

.dashboard-analysis-tables table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
}

.dashboard-analysis-tables .table-wrap {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
}

.dashboard-analysis-tables th,
.dashboard-analysis-tables td {
  padding: 9px 10px;
  border-bottom: 1px solid #e7edf5;
  text-align: left;
  white-space: nowrap;
}

.dashboard-analysis-tables th {
  background: #f7f9fc;
  color: #475569;
  font-size: 12px;
}

.dashboard-analysis-tables td small {
  display: block;
  margin-top: 2px;
  color: #64748b;
}

.dashboard-analysis-tables td:nth-child(2) strong {
  display: block;
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-analysis-loading {
  display: grid;
  min-height: 360px;
  place-items: center;
  border: 1px dashed #bfcee1;
  border-radius: 14px;
  background: #fff;
  color: #2563eb;
  font-size: 17px;
  font-weight: 800;
}

.dashboard-analysis-loading.error { color: #dc2626; }

@media (max-width: 1100px) {
  .dashboard-analysis-card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dashboard-analysis-tables { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 760px) {
  #modal:has(.dashboard-analysis-workspace) {
    width: calc(100vw - 12px);
    height: calc(100vh - 12px);
  }

  .dashboard-analysis-open-btn {
    flex: 0 0 auto;
    padding: 0 13px;
  }

  .dashboard-analysis-controls {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .dashboard-analysis-preset-tabs {
    width: 100%;
    overflow-x: auto;
  }

  .dashboard-analysis-preset-tabs button { flex: 0 0 auto; }

  .dashboard-analysis-controls > label {
    flex: 1 1 210px;
    justify-content: space-between;
  }

  .dashboard-analysis-controls input,
  .dashboard-analysis-controls select {
    width: min(160px, 58vw);
  }

  .dashboard-analysis-period-head { grid-template-columns: minmax(0, 1fr); }
  .dashboard-analysis-period-head em { max-width: 100%; justify-self: start; }
  .dashboard-analysis-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-analysis-status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-analysis-insights ul { grid-template-columns: minmax(0, 1fr); }
  .dashboard-analysis-recommendation-list { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 460px) {
  .dashboard-analysis-card-grid { grid-template-columns: minmax(0, 1fr); }
  .dashboard-analysis-status-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (orientation: portrait) and (min-width: 700px) and (max-width: 1300px) {
  .app-shell {
    display: block;
  }
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 70;
    height: auto;
    display: grid;
    grid-template-columns: minmax(150px, auto) minmax(0, 1fr);
    gap: 8px 10px;
    padding: 8px 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .brand {
    min-height: 32px;
    gap: 7px;
    padding: 0;
  }
  .brand-mark {
    width: 32px;
    height: 32px;
    min-width: 32px;
    aspect-ratio: 1 / 1;
    border-radius: 7px;
    transform: none;
  }
  .brand strong {
    flex-wrap: wrap;
    gap: 3px 5px;
    font-size: 12px;
    line-height: 1.1;
  }
  .brand .app-version {
    font-size: 10px;
  }
  nav {
    grid-column: 1 / -1;
    display: flex;
    gap: 5px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: thin;
  }
  nav button {
    flex: 0 0 auto;
    min-width: 84px;
    min-height: 30px;
    padding: 0 8px;
    justify-content: center;
    text-align: center;
    font-size: 12px;
    white-space: nowrap;
  }
  .online-status,
  .offline-status,
  .current-account,
  #logoutBtn {
    margin-top: 0;
  }
  .online-status,
  .offline-status {
    grid-column: auto;
    align-self: center;
  }
  .online-status-btn,
  .offline-status-btn,
  #logoutBtn {
    min-height: 30px;
    padding: 0 8px;
    font-size: 12px;
  }
  .current-account {
    grid-column: 1 / -1;
    grid-template-columns: auto auto 1fr;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
  }
  .current-account span,
  .current-account strong,
  .current-account small {
    font-size: 11px;
    line-height: 1.15;
  }
  .online-users-panel {
    left: auto;
    right: 0;
    bottom: auto;
    top: calc(100% + 6px);
    width: min(300px, calc(100vw - 20px));
    max-height: min(360px, calc(100vh - 160px));
  }
  .online-users-panel::after {
    display: none;
  }
  .content {
    padding: 10px;
  }
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
  }
  .topbar h2 {
    font-size: 21px;
  }
  .toolbar {
    gap: 6px;
  }
  .toolbar button {
    min-height: 30px;
    padding: 0 9px;
    font-size: 12px;
  }
  .filter-bar,
  .inventory-filter,
  .outbound-filter-bar,
  .completed-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding: 7px;
    margin-bottom: 8px;
  }
  .inventory-filter {
    grid-template-columns: 180px 240px 150px auto;
    justify-content: start;
  }
  .filter-bar label,
  .filter-bar select,
  .filter-bar input {
    font-size: 12px;
  }
  .filter-bar select,
  .filter-bar input {
    min-height: 30px;
  }
  .inventory-batch-actions,
  .completed-total,
  .completed-batch-out-btn,
  .filter-bar > .download-list-btn,
  .filter-bar > .flow-batch-delete-btn {
    grid-column: 1 / -1;
  }
  .inventory-filter .inventory-batch-btn {
    width: 108px;
    min-width: 108px;
    max-width: 108px;
    height: 30px;
    min-height: 30px;
    font-size: 12px;
  }
  .metric-grid,
  .inventory-summary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
  }
  .metric,
  .inventory-summary article {
    padding: 7px 8px;
  }
  .metric strong,
  .inventory-summary strong {
    font-size: 19px;
  }
  .dashboard-kpi-strip,
  .dashboard-main-grid,
  .dashboard-top-grid,
  .dashboard-bottom-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-month-chart {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  .flow-list {
    gap: 4px;
  }
  .batch-group {
    padding: 5px 6px;
    border-width: 1px;
    border-radius: 7px;
  }
  .batch-head {
    grid-template-columns: 1fr;
    gap: 5px;
  }
  .batch-duration,
  .batch-head > .actions {
    grid-column: auto;
    justify-content: flex-start;
  }
  .batch-created-date,
  .batch-owner-shop,
  .batch-progress-pill,
  .batch-download-count {
    min-height: 20px;
    padding: 1px 6px;
    font-size: 11px;
  }
  .batch-lines {
    gap: 4px;
    margin-top: 4px;
  }
  .flow-row,
  .outbound-product-row {
    grid-template-columns: 1fr;
    gap: 5px;
    padding: 4px 5px;
    border-radius: 6px;
  }
  .flow-row .actions {
    grid-column: auto;
    justify-content: flex-start;
  }
  .flow-main {
    gap: 5px;
  }
  .flow-thumb {
    width: 40px;
    height: 40px;
    border-radius: 6px;
  }
  .flow-title {
    gap: 4px;
    margin-bottom: 1px;
    font-size: 12px;
    line-height: 1.15;
  }
  .flow-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2px 5px;
    font-size: 11px;
    line-height: 1.15;
  }
  .inline-number,
  .inline-date {
    gap: 4px;
    font-size: 11px;
  }
  .inline-number input {
    width: 58px;
  }
  .inline-date input {
    width: 108px;
  }
  .status-select,
  .inline-number input,
  .inline-date input {
    min-height: 23px;
    padding: 1px 5px;
    font-size: 11px;
  }
  .actions {
    gap: 3px;
  }
  .actions button,
  .flow-row .actions button,
  .batch-head .actions button {
    min-height: 23px;
    padding: 0 6px;
    border-radius: 6px;
    font-size: 11px;
  }
  .inventory-grid {
    display: block;
    overflow-x: auto;
  }
  .inventory-grid table {
    min-width: 980px;
  }
  .inventory-grid th,
  .inventory-grid td {
    padding: 3px 5px;
    font-size: 11px;
  }
  dialog {
    width: min(900px, calc(100vw - 20px));
    max-height: calc(100dvh - 20px);
  }
  dialog:has(.batch-job-form),
  dialog:has(.batch-out-form),
  dialog:has(.ocr-outbound-form) {
    width: min(980px, calc(100vw - 20px));
  }
  #modalBody {
    padding: 10px;
    overflow: auto;
  }
}

@media (orientation: portrait) and (min-width: 900px) and (max-width: 1300px) {
  .flow-row,
  .outbound-product-row {
    grid-template-columns: minmax(220px, .8fr) minmax(360px, 1fr) max-content;
  }
  .flow-meta {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 5px;
    overflow: hidden;
  }
  .flow-note-display {
    grid-column: auto;
    max-width: 160px;
    min-height: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .flow-row .actions {
    grid-column: auto;
    flex-wrap: nowrap;
    justify-content: flex-end;
    max-width: 300px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .flow-row .actions::-webkit-scrollbar {
    display: none;
  }
  .batch-head {
    grid-template-columns: minmax(360px, 1fr) 360px max-content;
  }
  .batch-duration,
  .batch-head > .actions {
    grid-column: auto;
  }
  .batch-head > .actions {
    flex-wrap: nowrap;
    justify-content: flex-end;
    max-width: 340px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .batch-head > .actions::-webkit-scrollbar {
    display: none;
  }
}

html.tablet-desktop-mode,
html.tablet-desktop-mode body {
  min-width: 1600px;
}
html.tablet-desktop-mode body {
  overflow-x: auto;
}
html.tablet-desktop-mode .login-shell,
html.tablet-desktop-mode .boot-screen {
  min-width: 1600px;
}
html.tablet-desktop-mode .app-shell {
  min-width: 1600px;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}
html.tablet-desktop-mode .sidebar {
  position: sticky;
  top: 0;
  z-index: auto;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px 16px;
  border-right: 1px solid var(--line);
  border-bottom: 0;
}
html.tablet-desktop-mode .brand {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 50px;
  padding: 0 6px;
}
html.tablet-desktop-mode .brand-mark {
  width: 44px;
  height: 44px;
  min-width: 44px;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  transform: none;
}
html.tablet-desktop-mode .brand strong {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: nowrap;
  gap: 6px;
  font-size: 15px;
  line-height: normal;
  white-space: nowrap;
}
html.tablet-desktop-mode .brand .app-version {
  font-size: 11px;
}
html.tablet-desktop-mode nav {
  grid-column: auto;
  display: grid;
  gap: 6px;
  overflow: visible;
  padding-bottom: 0;
}
html.tablet-desktop-mode nav button {
  flex: initial;
  min-width: 0;
  min-height: 42px;
  padding: 0 14px;
  justify-content: flex-start;
  text-align: left;
  font-size: 14px;
  white-space: normal;
}
html.tablet-desktop-mode .online-status {
  grid-column: auto;
  margin-top: auto;
}
html.tablet-desktop-mode .offline-status,
html.tablet-desktop-mode .current-account,
html.tablet-desktop-mode #logoutBtn {
  grid-column: auto;
  margin-top: 0;
}
html.tablet-desktop-mode .online-status-btn,
html.tablet-desktop-mode .offline-status-btn {
  min-height: 40px;
  padding: 0 14px;
  font-size: 14px;
}
html.tablet-desktop-mode .current-account {
  display: grid;
  grid-template-columns: none;
  gap: 4px;
  padding: 12px;
}
html.tablet-desktop-mode .current-account span {
  font-size: 12px;
}
html.tablet-desktop-mode .current-account strong {
  font-size: 15px;
}
html.tablet-desktop-mode .current-account small {
  font-size: 13px;
}
html.tablet-desktop-mode .online-users-panel {
  left: 0;
  right: 0;
  top: auto;
  bottom: calc(100% + 8px);
  width: 100%;
  max-height: min(340px, calc(100vh - 180px));
}
html.tablet-desktop-mode .online-users-panel::after {
  display: none;
}
html.tablet-desktop-mode .content {
  padding: 28px;
}
html.tablet-desktop-mode .topbar {
  display: flex;
  align-items: center;
  flex-direction: row;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
html.tablet-desktop-mode .topbar h2 {
  font-size: 28px;
}
html.tablet-desktop-mode .topbar p,
html.tablet-desktop-mode .hint {
  font-size: 13px;
}
html.tablet-desktop-mode .toolbar {
  gap: 10px;
}
html.tablet-desktop-mode .toolbar button,
html.tablet-desktop-mode .filter-bar button,
html.tablet-desktop-mode .batch-head .actions button {
  min-height: 38px;
  padding: 0 14px;
  font-size: 14px;
}
html.tablet-desktop-mode .filter-bar {
  grid-template-columns: repeat(4, minmax(160px, 1fr)) auto;
  gap: 10px;
  padding: 12px;
  margin-bottom: 16px;
}
html.tablet-desktop-mode .filter-bar label {
  font-size: 15px;
}
html.tablet-desktop-mode .filter-bar select,
html.tablet-desktop-mode .filter-bar input {
  min-height: 40px;
  font-size: 15px;
}
html.tablet-desktop-mode .inventory-filter {
  grid-template-columns: 220px 360px 180px auto;
  justify-content: start;
}
html.tablet-desktop-mode .outbound-filter-bar {
  grid-template-columns: 240px 180px auto auto;
}
html.tablet-desktop-mode .inventory-batch-actions {
  grid-column: 1 / -1;
}
html.tablet-desktop-mode .inventory-filter .inventory-batch-btn {
  width: 128px;
  min-width: 128px;
  max-width: 128px;
  height: 38px;
  min-height: 38px;
  font-size: 14px;
}
html.tablet-desktop-mode .metric-grid,
html.tablet-desktop-mode .inventory-summary {
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 16px;
}
html.tablet-desktop-mode .metric,
html.tablet-desktop-mode .inventory-summary article {
  padding: 16px;
}
html.tablet-desktop-mode .metric strong {
  font-size: 31px;
}
html.tablet-desktop-mode .inventory-summary strong {
  font-size: 22px;
}
html.tablet-desktop-mode .dashboard-kpi-strip {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
html.tablet-desktop-mode .dashboard-main-grid,
html.tablet-desktop-mode .dashboard-top-grid,
html.tablet-desktop-mode .dashboard-bottom-grid {
  grid-template-columns: 1fr 1fr;
}
html.tablet-desktop-mode .dashboard-panel {
  padding: 16px;
}
html.tablet-desktop-mode .dashboard-month-chart {
  grid-template-columns: repeat(12, minmax(42px, 1fr));
}
html.tablet-desktop-mode .flow-list {
  gap: 8px;
}
html.tablet-desktop-mode .batch-group {
  padding: 12px;
  border-width: 2px;
  border-radius: 8px;
  box-shadow: inset 3px 0 0 var(--batch-rail), 0 2px 8px rgba(16, 24, 40, .06);
}
html.tablet-desktop-mode .batch-head {
  grid-template-columns: minmax(420px, 1.35fr) 360px auto auto;
  gap: 12px;
  align-items: center;
}
html.tablet-desktop-mode .batch-head > .actions {
  grid-column: auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: none;
  overflow: visible;
}
html.tablet-desktop-mode .batch-duration {
  min-height: 32px;
  padding: 4px 12px;
  font-size: 14px;
}
html.tablet-desktop-mode .batch-created-date {
  min-height: 28px;
  padding: 3px 10px;
  font-size: 14px;
}
html.tablet-desktop-mode .batch-owner-shop {
  min-height: 28px;
  max-width: 100%;
  padding: 4px 11px;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  font-size: 15px;
  line-height: 1.25;
}
html.tablet-desktop-mode .batch-progress-pill,
html.tablet-desktop-mode .batch-download-count {
  min-height: 24px;
  padding: 0 9px;
  font-size: 12px;
}
html.tablet-desktop-mode .batch-lines {
  gap: 8px;
  margin-top: 8px;
}
html.tablet-desktop-mode .flow-row {
  display: grid;
  grid-template-columns: minmax(280px, 1.35fr) minmax(250px, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border-radius: 8px;
}
html.tablet-desktop-mode .flow-row .actions {
  grid-column: auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
  max-width: none;
  overflow: visible;
}
html.tablet-desktop-mode .flow-main {
  gap: 9px;
}
html.tablet-desktop-mode .flow-check,
html.tablet-desktop-mode .batch-check {
  width: 18px;
  height: 18px;
  min-height: 18px;
}
html.tablet-desktop-mode .flow-thumb {
  width: 72px;
  height: 72px;
  border-radius: 8px;
}
html.tablet-desktop-mode .flow-title {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 3px;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  font-size: 14px;
  line-height: normal;
}
html.tablet-desktop-mode .flow-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(110px, 1fr));
  gap: 4px 10px;
  overflow: visible;
  font-size: 13px;
  line-height: normal;
}
html.tablet-desktop-mode .flow-meta > * {
  flex: initial;
}
html.tablet-desktop-mode .flow-note-display {
  grid-column: 1 / -1;
  max-width: none;
  min-height: 24px;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  font-size: 13px;
  line-height: normal;
}
html.tablet-desktop-mode .inline-number,
html.tablet-desktop-mode .inline-date {
  gap: 8px;
  font-size: 13px;
}
html.tablet-desktop-mode .inline-number input {
  width: 82px;
  min-height: 30px;
  height: auto;
  padding: 5px 9px;
  font-size: 13px;
}
html.tablet-desktop-mode .inline-date input {
  width: 138px;
  min-height: 30px;
  height: auto;
  padding: 5px 9px;
  font-size: 13px;
}
html.tablet-desktop-mode .status-select {
  width: 112px;
  min-height: 30px;
  height: auto;
  padding: 5px 8px;
  font-size: 13px;
}
html.tablet-desktop-mode .status-badge {
  min-height: 23px;
  padding: 2px 9px;
  font-size: 13px;
}
html.tablet-desktop-mode .actions button,
html.tablet-desktop-mode .flow-row .actions button,
html.tablet-desktop-mode .batch-head .actions button {
  min-height: 30px;
  height: auto;
  padding: 0 9px;
  border-radius: 8px;
  font-size: 13px;
  line-height: normal;
}
html.tablet-desktop-mode .batch-line,
html.tablet-desktop-mode .batch-form-line {
  gap: 10px;
  padding: 8px;
  border-radius: 8px;
}
html.tablet-desktop-mode .batch-line {
  grid-template-columns: minmax(160px, 1fr) auto auto;
}
html.tablet-desktop-mode .batch-form-line {
  grid-template-columns: minmax(150px, 1fr) minmax(130px, .9fr) minmax(86px, 108px) minmax(200px, 1.2fr);
}
html.tablet-desktop-mode .batch-product-summary {
  gap: 10px;
  font-size: 14px;
  line-height: normal;
}
html.tablet-desktop-mode .batch-product-thumb {
  width: 56px;
  height: 56px;
  border-radius: 8px;
}
html.tablet-desktop-mode .batch-collapsed-summary {
  gap: 6px;
  margin-top: 10px;
  padding: 8px;
}
html.tablet-desktop-mode .batch-collapsed-summary span {
  max-width: 360px;
  padding: 5px 8px;
  font-size: 13px;
}
html.tablet-desktop-mode .inventory-grid {
  display: grid;
  overflow-x: visible;
}
html.tablet-desktop-mode .inventory-grid table {
  min-width: 0;
  table-layout: fixed;
}
html.tablet-desktop-mode .inventory-grid th,
html.tablet-desktop-mode .inventory-grid td {
  padding: 6px 8px;
  font-size: 13px;
}
html.tablet-desktop-mode .inventory-grid .inventory-actions-grid {
  grid-template-columns: repeat(3, minmax(60px, 1fr));
  gap: 5px;
}
html.tablet-desktop-mode .inventory-grid .inventory-actions-grid button {
  min-height: 28px;
  padding: 0 6px;
  font-size: 12px;
}
html.tablet-desktop-mode dialog {
  width: min(720px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
}
html.tablet-desktop-mode dialog::backdrop {
  background: rgba(15, 23, 42, .24);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transition: opacity .18s ease-out, background-color .18s ease-out;
}
html.tablet-desktop-mode dialog[open]::backdrop {
  animation: softBackdropIn .18s ease-out both;
}
html.tablet-desktop-mode dialog[open] .modal-box {
  animation: none !important;
  transform: none !important;
}
html.tablet-desktop-mode dialog:has(.batch-job-form),
html.tablet-desktop-mode dialog:has(.batch-out-form),
html.tablet-desktop-mode dialog:has(.ocr-outbound-form) {
  width: min(1180px, calc(100vw - 32px));
}
html.tablet-desktop-mode #modalBody {
  padding: 16px;
  overflow: auto;
}

html.tablet-desktop-mode .saved-login-dropdown,
html.tablet-desktop-mode .dashboard-shop-menu,
html.tablet-desktop-mode .dashboard-year-menu,
html.tablet-desktop-mode .dividend-month-list,
html.tablet-desktop-mode .online-users-panel,
html.tablet-desktop-mode .custom-select-menu {
  padding: 5px !important;
  gap: 4px !important;
  border-radius: 8px !important;
}
html.tablet-desktop-mode .custom-select-menu {
  max-height: 220px !important;
  background: #fff !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 12px 26px rgba(16, 24, 40, .14) !important;
  transform: none !important;
  filter: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  opacity: 1 !important;
  will-change: auto !important;
  contain: none !important;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
html.tablet-desktop-mode .custom-select-menu-floating {
  position: fixed !important;
  display: grid !important;
  z-index: 99999 !important;
  background: #fff !important;
  opacity: 1 !important;
  transform: none !important;
  filter: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  isolation: auto;
  contain: none !important;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
html.tablet-desktop-mode .custom-select-menu-in-dialog {
  z-index: 2147483647 !important;
}
html.tablet-desktop-mode .custom-select-menu,
html.tablet-desktop-mode .custom-select-menu * {
  -webkit-font-smoothing: antialiased !important;
  text-shadow: none !important;
  filter: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
html.tablet-desktop-mode .custom-select-shell.open .custom-select-menu {
  animation: none !important;
}
html.tablet-desktop-mode .custom-select-menu-floating.custom-select-menu {
  animation: none !important;
}
html.tablet-desktop-mode .custom-select-option {
  min-height: 32px !important;
  padding: 7px 10px !important;
  border-radius: 6px !important;
  color: #111827 !important;
  font-size: 14px !important;
  font-weight: 900 !important;
  line-height: 1.25 !important;
  text-shadow: none !important;
  transform: none !important;
  filter: none !important;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
html.tablet-desktop-mode .custom-select-trigger {
  min-height: 36px !important;
  padding: 6px 9px !important;
  border-radius: 7px !important;
  color: #111827 !important;
  font-size: 14px !important;
  font-weight: 900 !important;
  transform: none !important;
  filter: none !important;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
html.tablet-desktop-mode .custom-select-option:hover {
  color: #1d4ed8 !important;
  background: #eff6ff !important;
  transform: none !important;
}
html.tablet-desktop-mode .custom-select-option.selected {
  color: #1d4ed8 !important;
  background: #dbeafe !important;
}
html.tablet-desktop-mode .filter-bar .custom-select-trigger,
html.tablet-desktop-mode .completed-toolbar .custom-select-trigger,
html.tablet-desktop-mode .inventory-filter .custom-select-trigger,
html.tablet-desktop-mode .outbound-filter-bar .custom-select-trigger {
  min-height: 34px !important;
  font-size: 12.5px !important;
}
html.tablet-desktop-mode .custom-select-status {
  width: 94px !important;
}
html.tablet-desktop-mode .custom-select-status .custom-select-trigger,
html.tablet-desktop-mode .custom-select-compact .custom-select-trigger {
  min-height: 30px !important;
  padding: 5px 7px !important;
  font-size: 13px !important;
}
html.tablet-desktop-mode .custom-select-status .custom-select-option,
html.tablet-desktop-mode .custom-select-compact .custom-select-option {
  min-height: 28px !important;
  padding: 5px 7px !important;
  font-size: 13px !important;
}
html.tablet-desktop-mode *,
html.tablet-desktop-mode *::before,
html.tablet-desktop-mode *::after {
  filter: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  text-shadow: none !important;
}
html.tablet-desktop-mode .sidebar {
  background: #fff !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
html.tablet-desktop-mode .custom-select-menu,
html.tablet-desktop-mode .custom-select-menu *,
html.tablet-desktop-mode .dashboard-shop-menu,
html.tablet-desktop-mode .dashboard-shop-menu *,
html.tablet-desktop-mode .dashboard-year-menu,
html.tablet-desktop-mode .dashboard-year-menu *,
html.tablet-desktop-mode .saved-login-dropdown,
html.tablet-desktop-mode .saved-login-dropdown * {
  transform: none !important;
  animation: none !important;
  -webkit-font-smoothing: auto !important;
  text-rendering: auto !important;
}
html.tablet-desktop-mode body.tablet-input-settling,
html.tablet-desktop-mode body.tablet-input-settling .app-shell,
html.tablet-desktop-mode body.tablet-input-settling .content,
html.tablet-desktop-mode body.tablet-input-settling .view,
html.tablet-desktop-mode body.tablet-input-settling dialog {
  filter: none !important;
  backdrop-filter: none !important;
  transform: none !important;
  transition: filter .22s ease-out, backdrop-filter .22s ease-out, transform .22s ease-out, opacity .22s ease-out !important;
  animation-duration: .12s !important;
  animation-timing-function: ease-out !important;
}
html.tablet-desktop-mode input,
html.tablet-desktop-mode textarea,
html.tablet-desktop-mode select,
html.tablet-desktop-mode button {
  text-rendering: auto;
  -webkit-font-smoothing: auto;
}

/* Final tablet clarity override: keep tablet UI crisp, especially floating menus. */
html.tablet-desktop-mode,
html.tablet-desktop-mode body,
html.tablet-desktop-mode .app-shell,
html.tablet-desktop-mode .content,
html.tablet-desktop-mode .view,
html.tablet-desktop-mode dialog,
html.tablet-desktop-mode .modal-box {
  filter: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  transform-style: flat !important;
  perspective: none !important;
}

html.tablet-desktop-mode dialog::backdrop,
html.tablet-desktop-mode dialog[open]::backdrop {
  background: rgba(15, 23, 42, .20) !important;
  filter: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  animation: none !important;
  transition: none !important;
}

html.tablet-desktop-mode .custom-select-menu-floating,
html.tablet-desktop-mode .custom-select-menu-floating *,
html.tablet-desktop-mode .saved-login-dropdown,
html.tablet-desktop-mode .saved-login-dropdown *,
html.tablet-desktop-mode .dashboard-shop-menu,
html.tablet-desktop-mode .dashboard-shop-menu *,
html.tablet-desktop-mode .dashboard-year-menu,
html.tablet-desktop-mode .dashboard-year-menu *,
html.tablet-desktop-mode .dividend-month-list,
html.tablet-desktop-mode .dividend-month-list *,
html.tablet-desktop-mode .online-users-panel,
html.tablet-desktop-mode .online-users-panel * {
  filter: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  transform: none !important;
  animation: none !important;
  transition: background-color .12s ease-out, color .12s ease-out, border-color .12s ease-out !important;
  text-shadow: none !important;
  -webkit-font-smoothing: auto !important;
  text-rendering: auto !important;
}

html.tablet-desktop-mode .custom-select-menu-floating {
  position: fixed !important;
  z-index: 2147483647 !important;
  display: grid !important;
  background: #fff !important;
  color: #0f172a !important;
  border: 1px solid #94a3b8 !important;
  box-shadow: 0 4px 12px rgba(15, 23, 42, .12) !important;
  opacity: 1 !important;
  contain: none !important;
  isolation: auto !important;
  backface-visibility: visible !important;
  -webkit-backface-visibility: visible !important;
  will-change: auto !important;
  transform: none !important;
  -webkit-transform: none !important;
  font-family: Arial, "Microsoft YaHei", "PingFang SC", sans-serif !important;
}

html.tablet-desktop-mode .custom-select-menu-floating .custom-select-option {
  min-height: 30px !important;
  padding: 6px 9px !important;
  color: #0f172a !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
  background: #fff !important;
  font-family: Arial, "Microsoft YaHei", "PingFang SC", sans-serif !important;
  -webkit-font-smoothing: auto !important;
  text-rendering: auto !important;
}

html.tablet-desktop-mode .custom-select-menu-floating .custom-select-option:hover,
html.tablet-desktop-mode .custom-select-menu-floating .custom-select-option.selected {
  color: #1d4ed8 !important;
  background: #eaf2ff !important;
}

html.tablet-desktop-mode body.tablet-input-settling,
html.tablet-desktop-mode body.tablet-input-settling * {
  filter: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  transform: none !important;
  animation: none !important;
  transition: none !important;
}

/* True final guard: compact top filters and slightly deepen batch product-list background. */
#jobsView > .filter-bar {
  grid-template-columns: 280px 280px 280px minmax(320px, 520px) max-content !important;
  justify-content: start !important;
  align-items: end;
}

#jobsView > .filter-bar .download-list-btn {
  grid-column: 1 / 2 !important;
  width: 280px !important;
  max-width: 280px !important;
}

#purchaseView .purchase-filter-grid {
  grid-template-columns: 220px 300px minmax(360px, 560px) max-content !important;
  justify-content: start !important;
  align-items: end;
}

#purchaseView .purchase-filter-actions {
  justify-content: flex-start !important;
}

#purchaseView .purchase-filter-actions button {
  width: auto;
  min-width: 68px;
  white-space: nowrap;
}

.batch-collapsed-summary,
.batch-lines {
  background: #eef5ff !important;
}

.batch-group {
  border-color: var(--batch-rail, #22c55e) !important;
  box-shadow: inset 3px 0 0 var(--batch-rail, #22c55e), 0 2px 8px rgba(16, 24, 40, .06) !important;
}

.batch-group .flow-row,
.batch-group .job-card {
  border-left-color: var(--batch-rail, #22c55e) !important;
}

@media (max-width: 1180px) {
  #jobsView > .filter-bar,
  #purchaseView .purchase-filter-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr)) !important;
  }

  #jobsView > .filter-bar .download-list-btn {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    max-width: none !important;
  }
}

/* Final toolbar width tune: avoid stretched controls on wide screens. */
#jobsView > .filter-bar {
  grid-template-columns: 280px 280px 280px minmax(320px, 520px) max-content !important;
  justify-content: start !important;
  align-items: end;
}

#jobsView > .filter-bar label,
#purchaseView .purchase-filter-grid label {
  min-width: 0;
}

#jobsView > .filter-bar select,
#jobsView > .filter-bar input,
#jobsView > .filter-bar .custom-select-trigger,
#purchaseView .purchase-filter-grid select,
#purchaseView .purchase-filter-grid input,
#purchaseView .purchase-filter-grid .custom-select-trigger {
  width: 100%;
  max-width: 100%;
}

#jobsView > .filter-bar .filter-button-pair {
  width: max-content;
}

#jobsView > .filter-bar .download-list-btn {
  grid-column: 1 / 2 !important;
  width: 280px !important;
  max-width: 280px !important;
}

#purchaseView .purchase-filter-grid {
  grid-template-columns: 220px 300px minmax(360px, 560px) max-content !important;
  justify-content: start !important;
  align-items: end;
}

#purchaseView .purchase-filter-actions {
  justify-content: flex-start !important;
}

#purchaseView .purchase-filter-actions button {
  width: auto;
  min-width: 68px;
  white-space: nowrap;
}

.batch-collapsed-summary,
.batch-lines {
  background: #eef5ff !important;
}

@media (max-width: 1180px) {
  #jobsView > .filter-bar,
  #purchaseView .purchase-filter-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr)) !important;
  }

  #jobsView > .filter-bar .download-list-btn {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    max-width: none !important;
  }
}

/* Global soft-rounding pass: keep the ERP professional, but remove the hard-edged feel. */
:root {
  --radius-xs: 8px;
  --radius-sm: 10px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
}

button,
.ghost,
.primary,
.download-list-btn,
.notice-btn,
.filter-mini-btn,
.small-confirm-btn,
.desktop-notifier-btn,
.install-app-btn,
.inventory-batch-btn,
.completed-batch-out-btn,
.shop-period-toggle-all {
  border-radius: var(--radius-sm);
}

input,
select,
textarea,
.custom-select-trigger,
.login-account-wrap,
.completed-month-pill,
.date-range-single,
.date-range-input,
.form-grid input,
.form-grid select,
.form-grid textarea {
  border-radius: var(--radius-md);
}

.login-form,
.boot-card,
.panel,
.dashboard-panel,
.filter-bar,
.inventory-filter,
.outbound-filter-bar,
.completed-toolbar,
.purchase-filter-panel,
.purchase-board,
.inventory-grid,
.outbound-card,
.card,
.job-card,
.lane,
.metric,
.inventory-summary article,
.outbound-summary-grid article,
.dashboard-kpi-strip article,
.purchase-group,
.outbound-draft-card,
.cost-draft-card {
  border-radius: var(--radius-lg);
}

.modal-box,
dialog .modal-box,
.image-preview-modal,
.draft-page-card,
.system-init-card,
.notification-card {
  border-radius: var(--radius-xl);
}

.modal-box header,
.modal-box footer {
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.modal-box footer {
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

.sidebar {
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}

.brand-mark,
.app-icon,
.flow-thumb,
.inventory-thumb,
.purchase-image-thumb,
.notice-image,
.clickable-image,
.draft-product-image,
.product-image-preview img {
  border-radius: var(--radius-md);
}

nav button,
.nav-sub-action,
.online-status-btn,
.current-account,
#passwordBtn,
#systemInitBtn,
#logoutBtn {
  border-radius: var(--radius-md);
}

.batch-group,
.completed-batch-group,
.outbound-batch-card {
  border-radius: var(--radius-lg);
}

.batch-line,
.batch-form-line,
.flow-row,
.inventory-row,
.purchase-row,
.batch-collapsed-summary,
.transport-complete-box,
.batch-status-count,
.draft-product-card {
  border-radius: var(--radius-md);
}

.batch-status-item,
.batch-date-pill,
.batch-owner-shop,
.batch-progress-pill,
.batch-download-count,
.status-badge,
.pill,
.purchase-status-pill,
.purchase-type-pill,
.radio-pill,
.shop-period-picker label,
.completed-total span,
.job-duration {
  border-radius: 999px;
}

.batch-duration {
  border-radius: var(--radius-md);
}

.custom-select-menu,
.custom-select-menu-floating,
.dashboard-shop-menu,
.dashboard-year-menu,
.saved-login-dropdown,
.online-users-panel,
.dividend-month-list {
  border-radius: var(--radius-lg);
}

.custom-select-option,
.saved-login-option {
  border-radius: var(--radius-sm);
}

table,
.purchase-table {
  border-radius: var(--radius-md);
}

th:first-child {
  border-top-left-radius: var(--radius-md);
}

th:last-child {
  border-top-right-radius: var(--radius-md);
}

/* Final finance color overrides: outbound total is payable red, historical settlement is receivable green. */
.outbound-metric.outbound-money-metric strong {
  color: #dc2626 !important;
}

.outbound-metric.outbound-money-metric.historical-settlement-metric strong {
  color: #16a34a !important;
}

/* Batch product list color tune: soften the warm block so it fits the blue-white ERP chrome. */
.batch-collapsed-summary {
  border-color: #d9e3f2 !important;
  background: #f8fbff !important;
}

.batch-collapsed-summary span {
  border: 1px solid #e4ebf5 !important;
  background: #ffffff !important;
  color: #40516a !important;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .03);
}

.batch-lines,
.batch-line {
  border-color: #d9e3f2 !important;
  background: #f8fbff !important;
}

.batch-line,
.batch-form-line {
  background: #ffffff !important;
  border-color: #e3ebf6 !important;
}

.batch-product-summary,
.batch-product-summary strong,
.batch-product-summary span {
  color: #344054;
}

/* Batch summary chips: keep FNSKU visible first and keep status counts inside the pill. */
.batch-collapsed-summary .product-summary-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 300px;
  min-width: 0;
}

.batch-collapsed-summary .summary-fnsku {
  flex: 0 0 auto;
  color: #1f2937;
  font-size: 13px;
  font-weight: 950;
  line-height: 1;
}

.batch-collapsed-summary .summary-name {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 118px;
  overflow: hidden;
  color: #60708a;
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Inventory finance emphasis: current total amount should stay red. */
.inventory-summary .inventory-total-money strong {
  color: #dc2626 !important;
}

.inventory-summary .inventory-total-money span {
  color: #b42318 !important;
}

/* Production batch headers: keep progress on the left rail and align every status row. */
.batch-group,
html.tablet-desktop-mode .batch-group {
  border: 2px solid var(--batch-rail);
  background: #fff;
  box-shadow: inset 3px 0 0 var(--batch-rail), 0 2px 8px rgba(16, 24, 40, .06);
}

.batch-head,
html.tablet-desktop-mode .batch-head {
  grid-template-columns: minmax(0, 1fr) 460px 230px 300px;
  gap: 12px;
  align-items: center;
}

.batch-head-main {
  min-width: 0;
  overflow: hidden;
}

.batch-status-counts {
  display: flex;
  flex-wrap: nowrap;
  grid-template-columns: none;
  gap: 14px;
  width: 460px;
  min-width: 460px;
  justify-self: start;
}

.batch-status-count {
  width: auto;
  min-width: 66px;
  justify-content: center;
  overflow: hidden;
  border-radius: 999px;
  box-sizing: border-box;
}

.batch-status-count .batch-status-item {
  gap: 5px;
  width: auto;
  min-width: 66px;
  padding: 4px 8px;
}

.batch-status-label,
.batch-status-number {
  display: inline-flex;
  align-items: center;
  color: inherit !important;
  line-height: 1;
}

.batch-status-count .batch-status-number {
  min-width: 12px;
  color: #fff !important;
  font-size: 13px;
  font-weight: 950;
  text-align: left;
}

.batch-duration,
html.tablet-desktop-mode .batch-duration {
  box-sizing: border-box;
  width: 230px;
  min-width: 230px;
  max-width: 230px;
}

.batch-head > .actions,
html.tablet-desktop-mode .batch-head > .actions {
  box-sizing: border-box;
  grid-column: auto;
  width: 300px;
  min-width: 300px;
  max-width: 300px;
  justify-content: flex-end;
}

@media (min-width: 961px) and (max-width: 1499px) {
  .batch-head {
    grid-template-columns: minmax(0, 1fr) 460px 230px;
  }

  .batch-head > .actions {
    grid-column: 1 / -1;
    width: auto;
    min-width: 0;
    max-width: none;
    justify-content: flex-end;
  }
}

@media (max-width: 960px) {
  .batch-head {
    grid-template-columns: 1fr;
  }

  .batch-status-counts {
    width: min(100%, 460px);
    min-width: 0;
    overflow-x: auto;
  }

  .batch-duration,
  .batch-head > .actions {
    width: auto;
    min-width: 0;
    max-width: none;
  }
}

/* Final batch summary/status override: compact name first, full FNSKU second; number stays inside pill. */
.batch-collapsed-summary .product-summary-chip,
html.tablet-desktop-mode .batch-collapsed-summary .product-summary-chip {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  max-width: 320px !important;
  min-width: 0 !important;
}

.batch-collapsed-summary .summary-name,
html.tablet-desktop-mode .batch-collapsed-summary .summary-name {
  flex: 0 1 auto !important;
  min-width: 0 !important;
  max-width: 118px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.batch-collapsed-summary .summary-fnsku,
html.tablet-desktop-mode .batch-collapsed-summary .summary-fnsku {
  flex: 0 0 auto !important;
  white-space: nowrap !important;
}

.batch-status-count,
html.tablet-desktop-mode .batch-status-count {
  justify-content: center !important;
  min-width: 66px !important;
  overflow: hidden !important;
  border-radius: 999px !important;
}

.batch-status-count .batch-status-item,
html.tablet-desktop-mode .batch-status-count .batch-status-item {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  width: auto !important;
  min-width: 66px !important;
  padding: 4px 8px !important;
  color: #fff !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

.batch-status-count .batch-status-number,
html.tablet-desktop-mode .batch-status-count .batch-status-number {
  display: inline-flex !important;
  align-items: center !important;
  min-width: 12px !important;
  color: #fff !important;
  font-size: 13px !important;
  font-weight: 950 !important;
  line-height: 1 !important;
}

/* Batch status buttons: make the clickable pill itself carry the color. */
.batch-status-count.status-waiting,
html.tablet-desktop-mode .batch-status-count.status-waiting {
  background: #e7f7ee !important;
  border-color: #16a34a !important;
}

.batch-status-count.status-purchase,
html.tablet-desktop-mode .batch-status-count.status-purchase {
  background: #fff5d6 !important;
  border-color: #eab308 !important;
}

.batch-status-count.status-schedule,
.batch-status-count.status-production,
.batch-status-count.status-outsourced,
html.tablet-desktop-mode .batch-status-count.status-schedule,
html.tablet-desktop-mode .batch-status-count.status-production,
html.tablet-desktop-mode .batch-status-count.status-outsourced {
  background: #ffe8e8 !important;
  border-color: #ef4444 !important;
}

.batch-status-count.status-completed,
html.tablet-desktop-mode .batch-status-count.status-completed {
  background: #eef2f7 !important;
  border-color: #64748b !important;
}

.batch-status-count,
html.tablet-desktop-mode .batch-status-count {
  min-height: 26px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  transition: background-color .14s ease, filter .14s ease !important;
}

.batch-status-count.status-waiting,
.batch-status-count.status-purchase,
.batch-status-count.status-schedule,
.batch-status-count.status-production,
.batch-status-count.status-outsourced,
.batch-status-count.status-completed,
html.tablet-desktop-mode .batch-status-count.status-waiting,
html.tablet-desktop-mode .batch-status-count.status-purchase,
html.tablet-desktop-mode .batch-status-count.status-schedule,
html.tablet-desktop-mode .batch-status-count.status-production,
html.tablet-desktop-mode .batch-status-count.status-outsourced,
html.tablet-desktop-mode .batch-status-count.status-completed {
  background: transparent !important;
  border: 0 !important;
}

.batch-status-count:hover,
html.tablet-desktop-mode .batch-status-count:hover {
  filter: brightness(.98) !important;
}

.batch-status-count .batch-status-item,
html.tablet-desktop-mode .batch-status-count .batch-status-item {
  box-shadow: none !important;
  filter: none !important;
  transform: none !important;
}

.batch-status-count:hover .batch-status-item,
.batch-status-count.active .batch-status-item,
html.tablet-desktop-mode .batch-status-count:hover .batch-status-item,
html.tablet-desktop-mode .batch-status-count.active .batch-status-item {
  background: transparent !important;
  box-shadow: none !important;
  filter: none !important;
  transform: none !important;
}

.batch-status-count.status-waiting .batch-status-item,
html.tablet-desktop-mode .batch-status-count.status-waiting .batch-status-item {
  background: #e7f7ee !important;
  border: 1px solid #bbf7d0 !important;
}

.batch-status-count.status-purchase .batch-status-item,
html.tablet-desktop-mode .batch-status-count.status-purchase .batch-status-item {
  background: #fff5d6 !important;
  border: 1px solid #fde68a !important;
}

.batch-status-count.status-schedule .batch-status-item,
.batch-status-count.status-production .batch-status-item,
.batch-status-count.status-outsourced .batch-status-item,
html.tablet-desktop-mode .batch-status-count.status-schedule .batch-status-item,
html.tablet-desktop-mode .batch-status-count.status-production .batch-status-item,
html.tablet-desktop-mode .batch-status-count.status-outsourced .batch-status-item {
  background: #ffe8e8 !important;
  border: 1px solid #fecaca !important;
}

.batch-status-count.status-completed .batch-status-item,
html.tablet-desktop-mode .batch-status-count.status-completed .batch-status-item {
  background: #eef2f7 !important;
  border: 1px solid #d5dce7 !important;
}

.batch-status-count.status-waiting .batch-status-label,
.batch-status-count.status-waiting .batch-status-number,
html.tablet-desktop-mode .batch-status-count.status-waiting .batch-status-label,
html.tablet-desktop-mode .batch-status-count.status-waiting .batch-status-number {
  color: #111827 !important;
}

.batch-status-count.status-purchase .batch-status-label,
.batch-status-count.status-purchase .batch-status-number,
html.tablet-desktop-mode .batch-status-count.status-purchase .batch-status-label,
html.tablet-desktop-mode .batch-status-count.status-purchase .batch-status-number {
  color: #111827 !important;
}

.batch-status-count.status-schedule .batch-status-label,
.batch-status-count.status-schedule .batch-status-number,
.batch-status-count.status-production .batch-status-label,
.batch-status-count.status-production .batch-status-number,
.batch-status-count.status-outsourced .batch-status-label,
.batch-status-count.status-outsourced .batch-status-number,
html.tablet-desktop-mode .batch-status-count.status-schedule .batch-status-label,
html.tablet-desktop-mode .batch-status-count.status-schedule .batch-status-number,
html.tablet-desktop-mode .batch-status-count.status-production .batch-status-label,
html.tablet-desktop-mode .batch-status-count.status-production .batch-status-number,
html.tablet-desktop-mode .batch-status-count.status-outsourced .batch-status-label,
html.tablet-desktop-mode .batch-status-count.status-outsourced .batch-status-number {
  color: #111827 !important;
}

.batch-status-count.status-completed .batch-status-label,
.batch-status-count.status-completed .batch-status-number,
html.tablet-desktop-mode .batch-status-count.status-completed .batch-status-label,
html.tablet-desktop-mode .batch-status-count.status-completed .batch-status-number {
  color: #111827 !important;
}

/* Login saved-account dropdown: keep the remove buttons aligned and away from the scrollbar. */
.saved-login-dropdown,
html.tablet-desktop-mode .saved-login-dropdown {
  scrollbar-gutter: stable !important;
  padding-right: 10px !important;
}

.saved-login-option,
html.tablet-desktop-mode .saved-login-option {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 34px !important;
  align-items: center !important;
  column-gap: 8px !important;
  min-height: 38px !important;
  padding: 4px 2px 4px 10px !important;
  box-sizing: border-box !important;
}

.saved-login-name,
html.tablet-desktop-mode .saved-login-name {
  align-self: center !important;
  min-width: 0 !important;
}

.saved-login-remove,
html.tablet-desktop-mode .saved-login-remove {
  justify-self: center !important;
  align-self: center !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  min-height: 28px !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1 !important;
  box-sizing: border-box !important;
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  margin: 0;
  border: 0;
  background: transparent;
  display: grid;
  place-items: center;
  padding: 24px;
}

.image-lightbox:not([open]) {
  display: none;
}

.image-lightbox::backdrop {
  background: rgba(15, 23, 42, .68);
}

.image-lightbox-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.image-lightbox-panel {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  max-width: 94vw;
  max-height: 92vh;
  padding: 14px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 64px rgba(15, 23, 42, .32);
}

.image-lightbox-image {
  display: block;
  max-width: calc(94vw - 28px);
  max-height: calc(92vh - 28px);
  object-fit: contain;
}

.image-lightbox-close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid #cbd5e1;
  border-radius: 50%;
  color: #0f172a;
  background: rgba(255, 255, 255, .94);
  font-size: 24px;
  line-height: 30px;
}

.batch-transport-toolbar {
  display: flex;
  align-items: end;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
}
.batch-transport-toolbar label {
  display: grid;
  gap: 5px;
  min-width: 210px;
}
.transport-split-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 8px;
}
.transport-split-fields.hidden {
  display: none;
}
.transport-actual-grid {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  width: max-content;
  max-width: 100%;
}
.transport-actual-grid .inline-number {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  padding: 4px 6px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  white-space: nowrap;
}
.transport-actual-label {
  color: #475467;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}
.plan-quantity-number {
  color: #dc2626;
  font-weight: 900;
}
.transport-actual-grid input[type="number"] {
  width: 66px;
  min-height: 30px;
  padding: 3px 6px;
}
.transport-actual-grid .transport-posted {
  border-color: #bbf7d0;
  background: #f0fdf4;
}
.transport-complete-btn {
  min-height: 30px;
  padding: 3px 8px;
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.transport-complete-btn:disabled {
  border-color: #86efac;
  background: #dcfce7;
  color: #166534;
  opacity: 1;
}

.notice-list-item {
  position: relative;
}

.notice-important {
  border-color: #f59e0b !important;
  background: #fff8e8 !important;
  box-shadow: inset 4px 0 #ef4444;
}

.notice-important-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin: 4px 0 6px;
  padding: 2px 10px;
  border-radius: 999px;
  color: #b91c1c;
  background: #fee2e2;
  font-size: 12px;
  font-weight: 800;
}

.notice-item-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.purchase-filter-panel {
  margin-bottom: 14px;
  padding: 12px;
}
.purchase-filter-grid {
  display: grid;
  grid-template-columns: minmax(150px, .7fr) minmax(220px, 1fr) minmax(260px, 1.4fr) auto;
  gap: 12px;
  align-items: end;
}
.purchase-filter-grid label,
.purchase-form label {
  font-weight: 800;
  color: #1f2937;
}
.purchase-filter-grid input,
.purchase-filter-grid select,
.purchase-form input,
.purchase-form select,
.purchase-form textarea {
  width: 100%;
  min-height: 40px;
}
.purchase-filter-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}
.purchase-board {
  display: grid;
  gap: 14px;
}
.purchase-group {
  overflow: hidden;
  border: 1px solid #dbe5f1;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .045);
}
.purchase-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid #e5edf7;
  background: #f8fbff;
}
.purchase-group-head > div:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.purchase-group-head strong {
  font-size: 16px;
  color: #0f172a;
}
.purchase-group-head span,
.purchase-group-total {
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
}
.purchase-status-pending {
  border-color: #bfdbfe;
}
.purchase-status-pending .purchase-group-head {
  background: #eff6ff;
}
.purchase-status-approved {
  border-color: #bbf7d0;
}
.purchase-status-approved .purchase-group-head {
  background: #f0fdf4;
}
.purchase-status-completed {
  border-color: #fed7aa;
}
.purchase-status-completed .purchase-group-head {
  background: #fff7ed;
}
.purchase-table-wrap {
  overflow: auto;
}
.purchase-table {
  min-width: 1360px;
}
.purchase-table.purchase-table-with-stock {
  min-width: 1510px;
}
.purchase-table th {
  background: #fbfdff;
  color: #334155;
  font-weight: 900;
}
.purchase-table td {
  vertical-align: middle;
}
.purchase-table tbody tr {
  transition: opacity .48s cubic-bezier(.22, 1, .36, 1), transform .48s cubic-bezier(.22, 1, .36, 1), background-color .8s ease, box-shadow .8s ease;
}
#purchaseView .purchase-table tbody .purchase-applicant-group-row {
  height: 96px;
}
#purchaseView .purchase-table tbody .purchase-applicant-group-row > td {
  height: 96px;
  min-height: 96px;
}
.purchase-table tbody .purchase-applicant-group-row td {
  padding: 0;
  border-top: 1px solid #dbe5f1;
  border-bottom: 1px solid #dbe5f1;
  background: #f8fafc;
}
.purchase-table tbody .purchase-applicant-group-row:first-child td {
  border-top: 0;
}
#purchaseView .purchase-applicant-group-toggle {
  width: 100%;
  height: 96px;
  min-height: 96px;
  max-height: none;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 16px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #0f172a;
  text-align: left;
  box-shadow: none;
  cursor: pointer;
}
.purchase-applicant-group-toggle:hover {
  background: rgba(255, 255, 255, .72);
}
.purchase-applicant-group-toggle:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: -2px;
}
.purchase-applicant-group-summary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}
.purchase-applicant-group-summary strong {
  min-width: 72px;
  color: #0f172a;
  font-size: 14px;
}
.purchase-applicant-group-summary > span:last-child {
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
}
.purchase-applicant-group-chevron {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-right: 2px solid #2563eb;
  border-bottom: 2px solid #2563eb;
  transform: rotate(-45deg);
  transition: transform .18s ease;
}
.purchase-applicant-group-row.is-expanded .purchase-applicant-group-chevron {
  transform: rotate(45deg);
}
.purchase-applicant-group-action {
  color: #2563eb;
  font-size: 13px;
  font-weight: 900;
}
.purchase-status-pending .purchase-applicant-group-row td {
  background: #f5f9ff;
}
.purchase-status-approved .purchase-applicant-group-row td {
  background: #f5fcf7;
}
.purchase-status-completed .purchase-applicant-group-row td {
  background: #fffaf5;
}
.purchase-applicant-group-item[hidden] {
  display: none !important;
}
.purchase-applicant-group-item td:first-child {
  box-shadow: inset 3px 0 0 #dbeafe;
}
.purchase-board {
  transition: opacity .48s cubic-bezier(.22, 1, .36, 1), filter .48s ease, transform .48s cubic-bezier(.22, 1, .36, 1);
}
.purchase-board-soft-out {
  opacity: .78;
  filter: saturate(.96);
  transform: translateY(1px);
}
.purchase-board-soft-enter {
  animation: purchaseBoardSoftEnter .92s cubic-bezier(.16, 1, .3, 1) both;
}
.purchase-group-soft-enter {
  animation: purchaseGroupSoftEnter 1.18s cubic-bezier(.16, 1, .3, 1) both;
}
.purchase-row-status-preparing {
  background: #f8fbff;
}
.purchase-row-status-preparing td {
  transition: background-color .48s ease;
  background: rgba(248, 251, 255, .82);
}
.purchase-row-status-leaving {
  opacity: .66;
  transform: translateY(1px) scale(.998);
}
.purchase-row-travel {
  position: relative;
  z-index: 20;
  transform-origin: center;
  will-change: transform, opacity;
}
.purchase-row-travel td {
  background: #fff;
}
.purchase-row-soft-land {
  animation: purchaseSoftLand 1.45s cubic-bezier(.16, 1, .3, 1) both;
}
@keyframes purchaseBoardSoftEnter {
  0% {
    opacity: .68;
    filter: saturate(.94);
    transform: translateY(3px);
  }
  100% {
    opacity: 1;
    filter: saturate(1);
    transform: translateY(0);
  }
}
@keyframes purchaseGroupSoftEnter {
  0% {
    opacity: .58;
    filter: saturate(.92);
    transform: translateY(6px);
  }
  45% {
    opacity: .86;
    filter: saturate(.96);
    transform: translateY(2px);
  }
  100% {
    opacity: 1;
    filter: saturate(1);
    transform: translateY(0);
  }
}
@keyframes purchaseSoftLand {
  0% {
    background: #eefbf5;
    box-shadow: inset 3px 0 0 rgba(34, 197, 94, .62);
  }
  55% {
    background: #f5fdf8;
    box-shadow: inset 3px 0 0 rgba(34, 197, 94, .32);
  }
  100% {
    background: transparent;
    box-shadow: inset 0 0 0 rgba(34, 197, 94, 0);
  }
}
.purchase-table th.purchase-quantity-col,
.purchase-table td.purchase-quantity-col {
  width: 88px;
  min-width: 88px;
  text-align: center;
  font-weight: 900;
}
.purchase-table td.purchase-quantity-col {
  color: #dc2626;
}
.purchase-actual-col {
  padding-left: 6px;
  padding-right: 6px;
}
.purchase-actual-input {
  width: 74px;
  min-width: 74px;
  height: 30px;
  min-height: 30px;
  padding: 4px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #dc2626;
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}
.purchase-actual-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .14);
  outline: 0;
}
.purchase-actual-input.saving {
  background: #f8fafc;
  color: #94a3b8;
}
.purchase-item-name {
  min-width: 150px;
  max-width: 220px;
}
.purchase-applicant-cell {
  min-width: 92px;
  max-width: 130px;
  white-space: nowrap;
  color: #334155;
  font-weight: 900;
}
.purchase-item-name strong {
  display: block;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.purchase-shop-col,
.purchase-shop {
  min-width: 260px;
  max-width: 360px;
}
.purchase-shop {
  white-space: normal;
  word-break: break-all;
  line-height: 1.45;
}
.purchase-stock-col {
  width: 150px;
  min-width: 150px;
  text-align: left;
}
.purchase-stock-summary {
  display: grid;
  gap: 3px;
  color: #475569;
  font-size: 12px;
  line-height: 1.35;
  white-space: nowrap;
}
.purchase-stock-summary strong {
  color: #166534;
  font-size: 13px;
}
.purchase-actions-col,
.purchase-actions-cell {
  width: 150px;
  min-width: 150px;
  text-align: right;
  white-space: nowrap;
}
.purchase-table td.actions.purchase-actions-cell {
  display: table-cell;
}
.purchase-actions-cell button {
  min-height: 28px;
  padding: 0 8px;
}
.purchase-repurchase-btn {
  color: #047857;
  border-color: #bbf7d0;
  background: #ecfdf5;
  font-weight: 900;
}
.purchase-note {
  min-width: 150px;
  max-width: 240px;
  white-space: normal;
}
.purchase-note-input {
  width: 100%;
  min-width: 150px;
  max-width: 230px;
  height: 34px;
  min-height: 34px;
  max-height: 72px;
  padding: 6px 8px;
  overflow-y: hidden;
  overflow-wrap: anywhere;
  resize: none;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font-size: 13px;
  line-height: 1.35;
}
.purchase-note-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
  outline: 0;
}
.purchase-note-input.saving {
  background: #f8fafc;
  color: #94a3b8;
}
.purchase-type-pill,
.purchase-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}
.purchase-type-0 { color: #be123c; background: #ffe4e6; }
.purchase-type-1 { color: #92400e; background: #fef3c7; }
.purchase-type-2 { color: #1d4ed8; background: #dbeafe; }
.purchase-type-3 { color: #047857; background: #d1fae5; }
.purchase-type-4 { color: #7c3aed; background: #ede9fe; }
.purchase-status-pill.purchase-status-pending { color: #1d4ed8; background: #dbeafe; border: 0; }
.purchase-status-pill.purchase-status-approved { color: #047857; background: #d1fae5; border: 0; }
.purchase-status-pill.purchase-status-completed { color: #c2410c; background: #ffedd5; border: 0; }
.purchase-status-select {
  width: 148px;
  min-width: 148px;
  max-width: 148px;
  min-height: 30px;
  height: 30px;
  padding: 3px 22px 3px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.1;
}
.purchase-image-thumb {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
}
.purchase-image-thumb.large {
  width: 112px;
  height: 112px;
}
.purchase-current-image {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  margin: 2px 0 8px;
  padding: 8px;
  border: 1px solid #dbe5f1;
  border-radius: 8px;
  background: #f8fafc;
  color: #64748b;
  font-weight: 800;
}
.purchase-link {
  color: #2563eb;
  font-weight: 900;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.purchase-link-note-only {
  color: #475569;
}
.purchase-links {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 96px;
}
.purchase-link-editor {
  display: grid;
  gap: 8px;
}
.purchase-link-line {
  display: grid;
  grid-template-columns: minmax(120px, .55fr) minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}
.purchase-link-line button,
.purchase-add-link {
  min-height: 36px;
  padding: 0 12px;
}
.purchase-add-link {
  width: fit-content;
  color: #2563eb;
  border-color: #bfdbfe;
  background: #eff6ff;
  font-weight: 900;
}
.purchase-form {
  display: grid;
  gap: 12px;
}
#modal:has(.purchase-form) {
  width: min(980px, calc(100vw - 36px));
}
.purchase-common-grid {
  padding: 12px;
  border: 1px solid #dbe5f1;
  border-radius: 10px;
  background: #f8fbff;
}
.purchase-approval-grid {
  padding: 12px;
  border: 1px solid #e5edf7;
  border-radius: 10px;
  background: #fbfdff;
}
.purchase-info-list {
  display: grid;
  gap: 12px;
}
.purchase-info-row {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid #dbe5f1;
  border-radius: 10px;
  background: #fff;
}
.purchase-info-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 6px;
  border-bottom: 1px dashed #e2e8f0;
}
.purchase-info-row-head strong {
  color: #0f172a;
  font-size: 15px;
  font-weight: 950;
}
.purchase-row-remove {
  min-height: 30px;
  padding: 0 10px;
  border-color: #fecaca;
  background: #fff5f5;
  color: #b42318;
  font-weight: 900;
}
.purchase-add-info {
  justify-self: start;
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 950;
}
.purchase-info-grid {
  align-items: end;
}
.purchase-fnsku-field {
  transition: opacity .18s ease;
}
.purchase-fnsku-field.hidden {
  display: none !important;
}
.form-grid.two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.purchase-unit-field {
  display: grid;
  gap: 6px;
}
.radio-pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.radio-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
}
.radio-pill input {
  width: 15px;
  height: 15px;
  min-height: 15px;
}
.radio-pill span {
  font-weight: 900;
}
.number-cell {
  text-align: right;
  font-weight: 900;
}
.nowrap {
  white-space: nowrap;
}

@media (max-width: 900px) {
  .purchase-filter-grid,
  .form-grid.two {
    grid-template-columns: 1fr;
  }
  .purchase-filter-actions {
    justify-content: flex-start;
  }
}

/* Last rule wins for tablets: keep soft backdrop blur, but keep dropdown text crisp. */
html.tablet-desktop-mode,
html.tablet-desktop-mode body,
html.tablet-desktop-mode .app-shell,
html.tablet-desktop-mode .content,
html.tablet-desktop-mode .view,
html.tablet-desktop-mode dialog,
html.tablet-desktop-mode .modal-box {
  filter: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  transform-style: flat !important;
  perspective: none !important;
}

html.tablet-desktop-mode dialog::backdrop,
html.tablet-desktop-mode dialog[open]::backdrop {
  background: rgba(15, 23, 42, .28) !important;
  filter: none !important;
  backdrop-filter: blur(8px) saturate(1.08) !important;
  -webkit-backdrop-filter: blur(8px) saturate(1.08) !important;
  animation: none !important;
  transition: background-color .16s ease-out, backdrop-filter .16s ease-out !important;
}

html.tablet-desktop-mode .custom-select-menu-floating,
html.tablet-desktop-mode .custom-select-menu-floating *,
html.tablet-desktop-mode .saved-login-dropdown,
html.tablet-desktop-mode .saved-login-dropdown *,
html.tablet-desktop-mode .dashboard-shop-menu,
html.tablet-desktop-mode .dashboard-shop-menu *,
html.tablet-desktop-mode .dashboard-year-menu,
html.tablet-desktop-mode .dashboard-year-menu *,
html.tablet-desktop-mode .dividend-month-list,
html.tablet-desktop-mode .dividend-month-list *,
html.tablet-desktop-mode .online-users-panel,
html.tablet-desktop-mode .online-users-panel * {
  filter: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  transform: none !important;
  animation: none !important;
  transition: background-color .12s ease-out, color .12s ease-out, border-color .12s ease-out !important;
  text-shadow: none !important;
  -webkit-font-smoothing: auto !important;
  text-rendering: auto !important;
}

html.tablet-desktop-mode .custom-select-menu-floating {
  position: fixed !important;
  z-index: 2147483647 !important;
  display: grid !important;
  background: #fff !important;
  color: #0f172a !important;
  border: 1px solid #94a3b8 !important;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .14) !important;
  opacity: 1 !important;
  contain: none !important;
  isolation: auto !important;
  backface-visibility: visible !important;
  -webkit-backface-visibility: visible !important;
  will-change: auto !important;
  transform: none !important;
  -webkit-transform: none !important;
  font-family: Arial, "Microsoft YaHei", "PingFang SC", sans-serif !important;
}

html.tablet-desktop-mode .custom-select-menu-floating .custom-select-option {
  min-height: 30px !important;
  padding: 6px 9px !important;
  color: #0f172a !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
  background: #fff !important;
  font-family: Arial, "Microsoft YaHei", "PingFang SC", sans-serif !important;
  -webkit-font-smoothing: auto !important;
  text-rendering: auto !important;
}

html.tablet-desktop-mode .custom-select-menu-floating .custom-select-option:hover,
html.tablet-desktop-mode .custom-select-menu-floating .custom-select-option.selected {
  color: #1d4ed8 !important;
  background: #eaf2ff !important;
}

html.tablet-desktop-mode body.tablet-input-settling,
html.tablet-desktop-mode body.tablet-input-settling * {
  filter: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  transform: none !important;
  animation: none !important;
  transition: none !important;
}

/* True final guard: compact top filters and slightly deepen batch product-list background. */
#jobsView > .filter-bar {
  grid-template-columns: 280px 280px 280px minmax(320px, 520px) max-content !important;
  justify-content: start !important;
  align-items: end;
}

#jobsView > .filter-bar .download-list-btn {
  grid-column: 1 / 2 !important;
  width: 280px !important;
  max-width: 280px !important;
}

#purchaseView .purchase-filter-grid {
  grid-template-columns: 220px 300px minmax(360px, 560px) max-content !important;
  justify-content: start !important;
  align-items: end;
}

#purchaseView .purchase-filter-actions {
  justify-content: flex-start !important;
}

#purchaseView .purchase-filter-actions button {
  width: auto;
  min-width: 68px;
  white-space: nowrap;
}

.batch-collapsed-summary,
.batch-lines {
  background: #eef5ff !important;
}

@media (max-width: 1180px) {
  #jobsView > .filter-bar,
  #purchaseView .purchase-filter-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr)) !important;
  }

  #jobsView > .filter-bar .download-list-btn {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    max-width: none !important;
  }
}

/* Final batch progress rail: left bar follows completion progress color. */
.batch-group {
  border-color: var(--batch-rail, #22c55e) !important;
  box-shadow: inset 3px 0 0 var(--batch-rail, #22c55e), 0 2px 8px rgba(16, 24, 40, .06) !important;
}

/* Inventory table tools live outside the sticky table header so controls never overlap product rows. */

/* Purchase toolbar final layout: keep Clear by Search and Create at the far right. */
#purchaseView .purchase-filter-grid {
  position: relative;
  grid-template-columns: 220px 300px minmax(360px, 560px) max-content !important;
  justify-content: start !important;
}

#purchaseView .purchase-filter-actions {
  width: auto;
  justify-content: flex-start !important;
}

#purchaseView .purchase-filter-actions .primary {
  position: absolute;
  right: 0;
  bottom: 0;
  margin-left: 0;
}

@media (max-width: 1180px) {
  #purchaseView .purchase-filter-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr)) !important;
  }

  #purchaseView .purchase-filter-actions .primary {
    position: static;
  }
}

@media (max-width: 900px) {
  #purchaseView .purchase-filter-grid {
    grid-template-columns: 1fr !important;
  }
}
.inventory-table-tools {
  display: grid;
  align-items: center;
  min-height: 50px;
  padding: 8px;
  gap: 8px;
  border: 1px solid #dce5f0;
  border-bottom: 0;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: #f3f6fb;
  box-sizing: border-box;
}

.inventory-table-tools.has-price {
  grid-template-columns: 42px minmax(220px, 22fr) minmax(130px, 13fr) minmax(70px, 6fr) minmax(130px, 14fr) minmax(170px, 16fr) minmax(78px, 7fr) minmax(78px, 7fr) minmax(150px, 15fr);
}

.inventory-table-tools.no-price {
  grid-template-columns: 42px minmax(240px, 26fr) minmax(140px, 15fr) minmax(74px, 7fr) minmax(180px, 21fr) minmax(82px, 8fr) minmax(82px, 8fr) minmax(150px, 15fr);
}

.inventory-table-tools .inventory-table-date-list {
  grid-column: 1 / 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  min-width: 0;
}

.inventory-table-tools .inventory-table-date-list button,
.inventory-table-tools .price-pending-filter-btn,
.inventory-table-tools .inventory-table-limit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.inventory-table-tools .inventory-table-date-list button {
  border-color: #bfdbfe;
  background: #fff;
  color: #1d4ed8;
}

.inventory-table-tools .inventory-table-date-list button.active {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}

.inventory-table-price-slot {
  grid-column: 5;
  justify-self: center;
}

.inventory-table-limit-slot {
  grid-column: 8 / 10;
  justify-self: center;
}

.inventory-table-tools.no-price .inventory-table-limit-slot {
  grid-column: 6 / 9;
}

.inventory-table-tools .price-pending-filter-btn {
  width: 118px;
  min-width: 118px;
  max-width: 118px;
}

.inventory-table-tools + .inventory-grid {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

/* Keep the batch progress rail slim: one colored left edge, no doubled inset stripe. */
.batch-group,
html.tablet-desktop-mode .batch-group {
  border-width: 1px 1px 1px 3px !important;
  border-style: solid !important;
  border-color: #dce5f0 !important;
  border-left-color: var(--batch-rail, #22c55e) !important;
  box-shadow: 0 2px 8px rgba(16, 24, 40, .06) !important;
}

/* Inventory uses an inner product scroller: filters and stats stay put, only rows move. */
#inventoryView {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: calc(100dvh - 12px);
  overflow: hidden;
}

#inventoryView > .inventory-grid {
  flex: 1 1 auto;
}

.inventory-qty-period {
  display: flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  gap: 8px;
  width: 158px;
  max-width: 100%;
  padding-top: 8px;
  margin-top: 2px;
  border-top: 1px dashed #e4e7ec;
}

.inventory-qty-period span,
.inventory-qty-period strong {
  color: #ea580c;
  white-space: nowrap;
}

.inventory-qty-period span {
  text-align: center;
}

.inventory-qty-period strong {
  text-align: center;
}

.batch-stock-existing-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fbff;
}

.batch-stock-existing-tools input {
  width: 220px;
}

.batch-stock-existing-tools select {
  min-width: 280px;
  max-width: 420px;
}

.batch-stock-add-footer {
  display: flex;
  justify-content: flex-end;
  padding: 8px 2px 2px;
}

#modal {
  max-height: calc(100dvh - 24px);
}

#modal .modal-box {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: calc(100dvh - 24px);
  overflow: hidden;
}

#modal .modal-box > header,
#modal .modal-box > footer {
  position: relative;
  z-index: 4;
  flex: 0 0 auto;
  background: #fff;
}

#modal .modal-box > footer {
  background: #f9fafb;
}

#modalBody {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

#modal .modal-box > footer.has-draft-actions {
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
}

.modal-draft-actions-host {
  flex: 1 1 auto;
  min-width: 0;
}

.modal-draft-actions-host .outbound-draft-actions {
  gap: 6px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.modal-draft-actions-host .outbound-draft-actions button {
  min-height: 34px;
}

.modal-draft-actions-host .outbound-draft-actions .muted {
  min-width: 180px;
  flex: 1 1 220px;
}

@media (max-width: 900px) {
  #modal .modal-box > footer.has-draft-actions {
    flex-wrap: wrap;
  }

  .modal-draft-actions-host {
    flex: 1 0 100%;
  }

  .modal-draft-actions-host .outbound-draft-actions .muted {
    flex-basis: 100%;
  }

  #modal .modal-box > footer.has-draft-actions #modalCancel {
    margin-left: auto;
  }
}

@media (max-width: 620px) {
  #modal:has(.batch-job-form) {
    width: calc(100vw - 16px);
  }

  #modal .batch-job-form {
    padding-right: 0;
  }

  #modal .batch-job-form .batch-form-line,
  #modal .batch-job-form .batch-new-product-line {
    grid-template-columns: minmax(0, 1fr);
  }

  #modal .batch-job-form .batch-image-field,
  #modal .batch-job-form .batch-new-product-line .batch-note-default-field,
  #modal .batch-job-form .batch-new-product-line button {
    grid-column: 1;
    justify-self: stretch;
  }

  #modal .batch-job-form .section-head.batch-add-head {
    align-items: stretch;
    flex-direction: column;
  }

  #modal .batch-job-form .batch-out-add,
  #modal .batch-job-form .batch-job-fnsku-add {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
  }

  #modal .batch-job-form .batch-out-add button {
    width: 100%;
  }

  #modal .modal-box > footer.has-draft-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  #modal .modal-box > footer.has-draft-actions .modal-draft-actions-host {
    grid-column: 1 / -1;
    width: 100%;
  }

  #modal .modal-box > footer.has-draft-actions .outbound-draft-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  #modal .modal-box > footer.has-draft-actions .outbound-draft-actions button {
    width: 100%;
    min-width: 0;
    padding-right: 6px;
    padding-left: 6px;
  }

  #modal .modal-box > footer.has-draft-actions .outbound-draft-actions .muted {
    grid-column: 1 / -1;
    min-width: 0;
  }

  #modal .modal-box > footer.has-draft-actions #modalCancel,
  #modal .modal-box > footer.has-draft-actions #modalSave {
    width: 100%;
    margin-left: 0;
  }
}

/* Final placement: create replenishment inside the production filter card. */
#jobsView > .filter-bar {
  grid-template-columns: minmax(200px, 280px) minmax(200px, 280px) minmax(200px, 280px) minmax(280px, 520px) max-content minmax(0, 1fr) max-content !important;
}

#jobsView > .filter-bar .job-filter-add-btn {
  grid-column: 7;
  grid-row: 1;
  min-width: 104px;
  min-height: 38px;
  align-self: end;
  justify-self: end;
  border-radius: var(--radius-md);
  white-space: nowrap;
}

/* Match inventory action buttons to the rounded inventory cards below. */
#inventoryView .inventory-filter .inventory-batch-actions .inventory-batch-btn {
  border-radius: var(--radius-lg) !important;
}

/* Keep inventory shortcuts compact and distinguish actions with the ERP palette. */
#inventoryView .inventory-filter .inventory-batch-actions {
  column-gap: 4px !important;
  row-gap: 6px !important;
}

#inventoryView .inventory-filter .inventory-batch-actions .inventory-batch-btn {
  color: #344054 !important;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .06);
}

#inventoryView .inventory-filter .inventory-batch-actions .batch-replenish-btn {
  border-color: #93c5fd !important;
  background: #eff6ff !important;
  color: #1d4ed8 !important;
}
#inventoryView .inventory-filter .inventory-batch-actions .batch-replenish-btn:hover {
  background: #dbeafe !important;
}

#inventoryView .inventory-filter .inventory-batch-actions .batch-out-btn {
  border-color: #fdba74 !important;
  background: #fff7ed !important;
  color: #c2410c !important;
}
#inventoryView .inventory-filter .inventory-batch-actions .batch-out-btn:hover {
  background: #ffedd5 !important;
}

#inventoryView .inventory-filter .inventory-batch-actions .batch-stock-btn {
  border-color: #86efac !important;
  background: #ecfdf3 !important;
  color: #067647 !important;
}
#inventoryView .inventory-filter .inventory-batch-actions .batch-stock-btn:hover {
  background: #dcfce7 !important;
}

#inventoryView .inventory-filter .inventory-batch-actions .batch-draft-btn {
  border-color: #cbd5e1 !important;
  background: #f8fafc !important;
  color: #475569 !important;
}
#inventoryView .inventory-filter .inventory-batch-actions .batch-draft-btn:hover {
  background: #f1f5f9 !important;
}

#inventoryView .inventory-filter .inventory-batch-actions .batch-history-btn {
  border-color: #cbd5e1 !important;
  background: #eef2f6 !important;
  color: #344054 !important;
}
#inventoryView .inventory-filter .inventory-batch-actions .batch-history-btn:hover {
  background: #e2e8f0 !important;
}

#inventoryView .inventory-filter .inventory-batch-actions .batch-moves-btn {
  border-color: #a5d8e6 !important;
  background: #ecfeff !important;
  color: #0e7490 !important;
}
#inventoryView .inventory-filter .inventory-batch-actions .batch-moves-btn:hover {
  background: #cffafe !important;
}

#inventoryView .inventory-filter .inventory-batch-actions .batch-trend-btn {
  border-color: #c4b5fd !important;
  background: #f5f3ff !important;
  color: #6d28d9 !important;
}
#inventoryView .inventory-filter .inventory-batch-actions .batch-trend-btn:hover {
  background: #ede9fe !important;
}

@media (max-width: 1180px) {
  #jobsView > .filter-bar {
    grid-template-columns: repeat(2, minmax(180px, 1fr)) !important;
  }

  #jobsView > .filter-bar .job-filter-add-btn {
    grid-column: 1 / -1;
    grid-row: auto;
    width: 100%;
    justify-self: stretch;
  }
}

/* Desktop: anchor create replenishment at the far-right edge of the filter card. */
@media (min-width: 1181px) {
  #jobsView > .filter-bar {
    position: relative;
    padding-right: 136px;
  }

  #jobsView > .filter-bar .job-filter-add-btn {
    position: absolute !important;
    top: 50%;
    right: 16px;
    z-index: 1;
    width: 104px;
    transform: translateY(-50%);
  }
}

/* Final soft-action tune: highlight drafts and align the limit tool with the palette above. */
#inventoryView .inventory-filter .inventory-batch-actions .batch-draft-btn {
  border-color: #fbbf24 !important;
  background: #fffbeb !important;
  color: #b45309 !important;
  box-shadow: 0 1px 3px rgba(180, 83, 9, .12);
}

#inventoryView .inventory-filter .inventory-batch-actions .batch-draft-btn:hover {
  border-color: #f59e0b !important;
  background: #fef3c7 !important;
  color: #92400e !important;
}

#inventoryView .inventory-table-tools .inventory-table-limit-btn {
  border-color: #93c5fd !important;
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: 0 1px 2px rgba(37, 99, 235, .08);
}

#inventoryView .inventory-table-tools .inventory-table-limit-btn:hover {
  border-color: #60a5fa !important;
  background: #dbeafe !important;
  color: #1e40af !important;
}

/* Wide desktop: keep the production download and create actions on one line. */
@media (min-width: 1500px) {
  #jobsView > .filter-bar {
    padding-right: 428px;
  }

  #jobsView > .filter-bar .download-list-btn {
    position: absolute !important;
    top: 50%;
    right: 132px !important;
    left: auto !important;
    grid-column: auto !important;
    grid-row: auto !important;
    z-index: 1;
    width: 280px !important;
    max-width: 280px !important;
    transform: translateY(-50%);
  }
}

/* Production filter actions: keep download and create together at the far right. */
@media (min-width: 1500px) {
  #jobsView > .filter-bar {
    position: relative;
    padding-right: 428px !important;
  }

  #jobsView > .filter-bar .job-filter-right-actions {
    position: absolute;
    top: 50%;
    right: 16px;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 8px;
    transform: translateY(-50%);
  }

  #jobsView > .filter-bar .job-filter-right-actions > .download-list-btn,
  #jobsView > .filter-bar .job-filter-right-actions > .job-filter-add-btn {
    position: static !important;
    top: auto !important;
    right: auto !important;
    left: auto !important;
    grid-column: auto !important;
    grid-row: auto !important;
    transform: none !important;
  }

  #jobsView > .filter-bar .job-filter-right-actions > .download-list-btn {
    width: 280px !important;
    max-width: 280px !important;
  }

  #jobsView > .filter-bar .job-filter-right-actions > .job-filter-add-btn {
    width: 104px !important;
  }
}

@media (max-width: 1499px) {
  #jobsView > .filter-bar .job-filter-right-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    width: 100%;
  }

  #jobsView > .filter-bar .job-filter-right-actions > .download-list-btn,
  #jobsView > .filter-bar .job-filter-right-actions > .job-filter-add-btn {
    position: static !important;
    width: 100% !important;
    max-width: none !important;
    transform: none !important;
  }
}

/* Production actions sit directly below the shop filter. */
#jobsView > .filter-bar {
  padding-right: 12px !important;
}

#jobsView > .filter-bar .job-filter-right-actions {
  position: static !important;
  top: auto !important;
  right: auto !important;
  grid-column: 1 / span 2 !important;
  grid-row: 2 !important;
  justify-self: start;
  display: flex !important;
  align-items: stretch;
  gap: 8px;
  width: auto !important;
  transform: none !important;
}

#jobsView > .filter-bar .job-filter-right-actions > .download-list-btn,
#jobsView > .filter-bar .job-filter-right-actions > .job-filter-add-btn {
  position: static !important;
  min-height: 38px;
  transform: none !important;
}

#jobsView > .filter-bar .job-filter-right-actions > .download-list-btn {
  width: 280px !important;
  max-width: 280px !important;
}

#jobsView > .filter-bar .job-filter-right-actions > .job-filter-add-btn {
  width: 104px !important;
}

@media (max-width: 640px) {
  #jobsView > .filter-bar .job-filter-right-actions {
    grid-column: 1 / -1 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 104px;
    width: 100% !important;
  }

  #jobsView > .filter-bar .job-filter-right-actions > .download-list-btn,
  #jobsView > .filter-bar .job-filter-right-actions > .job-filter-add-btn {
    width: 100% !important;
    min-width: 0;
    max-width: none !important;
  }
}

/* RC469: compact inventory rows without changing thumbnail size. */
.inventory-name-cell .stock-name > div {
  display: grid;
  gap: 2px;
  align-content: center;
}

.inventory-name-cell .stock-name strong,
.inventory-name-cell .stock-name .muted {
  line-height: 1.16;
}

.inventory-grid td {
  padding-top: 4px;
  padding-bottom: 4px;
}

.outbound-batch-note {
  margin-top: 4px;
  color: #7c2d12;
  font-size: 12px;
  font-weight: 850;
}

.direct-purchase-label {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 9px;
  border: 1px solid #f59e0b;
  border-radius: 999px;
  color: #92400e;
  background: #fffbeb;
  font-size: 12px;
  font-weight: 900;
}

.direct-purchase-label.stocked {
  border-color: #34d399;
  color: #047857;
  background: #ecfdf5;
}

.direct-purchase-quantity {
  color: #92400e;
  font-weight: 850;
}

.direct-purchase-submit-btn {
  border-color: #93c5fd !important;
  color: #1d4ed8 !important;
  background: #eff6ff !important;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .06);
}

.direct-purchase-submit-btn:hover {
  border-color: #60a5fa !important;
  background: #dbeafe !important;
}

#inventoryView .inventory-filter .inventory-batch-actions .direct-purchase-inbound-btn {
  position: relative;
  padding-right: 36px !important;
  border-color: #93c5fd !important;
  color: #1d4ed8 !important;
  background: #eff6ff !important;
  gap: 7px;
}

#inventoryView .inventory-filter .inventory-batch-actions .direct-purchase-inbound-btn:hover {
  border-color: #60a5fa !important;
  background: #dbeafe !important;
}

.direct-purchase-count {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  border: 1px solid #fff;
  color: #fff;
  background: #ef4444;
  font-size: 12px;
  font-weight: 950;
  line-height: 18px;
  box-shadow: 0 2px 6px rgba(239, 68, 68, .32);
}

dialog:has(.direct-purchase-inbound-list) {
  width: min(960px, calc(100vw - 32px));
}

.direct-purchase-inbound-list {
  display: grid;
  gap: 8px;
}

.direct-purchase-inbound-row {
  display: grid;
  grid-template-columns: auto minmax(360px, 1fr) minmax(130px, 170px) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #fde68a;
  border-radius: 10px;
  background: #fffbeb;
}

.direct-purchase-inbound-info {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.direct-purchase-inbound-info span {
  color: #667085;
  font-size: 12px;
}

.direct-purchase-owner-line {
  white-space: nowrap;
}

.direct-purchase-inbound-row label {
  display: grid;
  gap: 4px;
  color: #475467;
  font-size: 12px;
  font-weight: 850;
}

.direct-purchase-inbound-row > button {
  align-self: end;
}

.tablet-refresh-btn {
  display: none;
}

html.tablet-desktop-mode,
html.tablet-desktop-mode body {
  overscroll-behavior-x: none;
  overscroll-behavior-y: none;
}

html.tablet-desktop-mode .tablet-refresh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

html.tablet-desktop-mode .image-lightbox,
html.tablet-desktop-mode .image-lightbox-panel,
html.tablet-desktop-mode .image-lightbox-image {
  overscroll-behavior: none;
  touch-action: none;
}

html.tablet-desktop-mode .image-lightbox {
  overflow: hidden;
  padding: 12px;
}

html.tablet-desktop-mode .image-lightbox-panel {
  width: calc(100vw - 24px);
  height: calc(100dvh - 24px);
  max-width: none;
  max-height: none;
  padding: 12px;
}

html.tablet-desktop-mode .image-lightbox-image {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

@media (max-width: 760px) {
  .direct-purchase-inbound-row {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .direct-purchase-inbound-row label,
  .direct-purchase-inbound-row button {
    grid-column: 2;
  }
  .direct-purchase-owner-line {
    white-space: normal;
  }
}
