:root {
  color-scheme: light;
  --bg: #eef2f5;
  --panel: #ffffff;
  --panel-soft: #f7faf9;
  --line: #d9e2e4;
  --text: #162022;
  --muted: #647276;
  --green: #17845f;
  --green-soft: #dff4ec;
  --blue: #2667b9;
  --blue-soft: #e3efff;
  --gold: #ac6c14;
  --gold-soft: #fff1d7;
  --red: #ba3f32;
  --red-soft: #fde8e4;
  --ink: #0f1819;
  --shadow: 0 18px 50px rgba(34, 47, 51, 0.08);
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 1180px;
  background: var(--bg);
  color: var(--text);
}

body:not(.is-login-view) {
  overflow: hidden;
}

body.is-login-view {
  min-width: 1040px;
  background: #eaf0f1;
  overflow: auto;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(620px, 1fr) minmax(520px, 560px);
  gap: 72px;
  align-items: center;
  position: relative;
  padding: 44px 84px;
  background:
    linear-gradient(90deg, rgba(16, 23, 25, 0.97) 0%, rgba(16, 23, 25, 0.94) 56%, rgba(234, 240, 241, 0) 56%),
    #eaf0f1;
}

.register-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  position: relative;
  padding: 44px 72px 72px;
  background: #eaf0f1;
}

.site-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 28px;
  color: #657477;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.6;
}

.register-footer {
  position: absolute;
  left: 72px;
  right: 72px;
  bottom: 24px;
}

.login-side {
  width: 100%;
  display: grid;
  gap: 22px;
}

.login-footer {
  min-height: 72px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  justify-content: initial;
  gap: 20px;
  padding: 18px 24px;
  border: 1px solid rgba(217, 226, 228, 0.95);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 12px 30px rgba(34, 47, 51, 0.06);
}

.login-footer span {
  white-space: nowrap;
}

.login-footer span:last-child {
  text-align: right;
}

.login-brand-panel {
  color: #f4f7f7;
  max-width: 760px;
}

.login-brand-panel .brand {
  max-width: 720px;
  align-items: flex-start;
  padding: 0 0 34px;
  border-bottom-color: rgba(255, 255, 255, 0.16);
}

.login-brand-panel .brand .brand-mark {
  width: 58px;
  height: 58px;
  border-radius: 12px;
  font-size: 30px;
  flex: 0 0 auto;
}

.login-brand-panel .brand strong {
  max-width: 620px;
  color: #ffffff;
  font-size: 30px;
  line-height: 1.18;
  letter-spacing: 0;
}

.login-brand-panel .brand span {
  display: block;
}

.login-brand-subtitle {
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.5;
}

.login-intro {
  padding-top: 46px;
}

.login-intro h1 {
  max-width: 720px;
  margin: 0;
  color: #ffffff;
  font-size: 48px;
  line-height: 1.14;
}

.login-intro p:not(.eyebrow) {
  max-width: 700px;
  margin: 24px 0 0;
  color: #c4d0d1;
  font-size: 18px;
  line-height: 1.75;
}

.login-intro-copy {
  display: grid;
  gap: 8px;
}

.login-feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 38px;
}

.login-feature-grid div {
  min-height: 96px;
  display: grid;
  grid-template-columns: 40px 1fr;
  grid-template-rows: auto 1fr;
  column-gap: 12px;
  row-gap: 5px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.login-feature-grid em {
  grid-row: 1 / span 2;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(40, 167, 121, 0.2);
  color: #7ee0ba;
  font-style: normal;
  font-weight: 900;
}

.login-feature-grid strong,
.login-feature-grid span {
  display: block;
}

.login-feature-grid strong {
  color: white;
  font-size: 15px;
}

.login-feature-grid span {
  color: #aebabb;
  font-size: 12px;
  line-height: 1.45;
}

.login-card {
  width: 100%;
  min-height: 620px;
  padding: 38px 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.register-card {
  width: min(920px, 100%);
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.register-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.register-card-header h2 {
  margin: 0;
  font-size: 30px;
}

.register-card-header span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.login-card-header h2 {
  margin: 0;
  font-size: 31px;
  line-height: 1.2;
}

.login-card-header span {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.65;
}

.login-form {
  display: grid;
  gap: 18px;
  margin-top: 28px;
}

.login-form label {
  display: grid;
  gap: 10px;
  color: var(--muted);
  font-weight: 700;
}

.login-form input,
.login-form select {
  height: 56px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--text);
  background: white;
  font-weight: 700;
}

.login-form select {
  appearance: auto;
  padding-right: 34px;
}

.login-form input:focus,
.login-form select:focus {
  outline: 2px solid rgba(23, 132, 95, 0.18);
  border-color: var(--green);
}

.login-submit {
  width: 100%;
  height: 58px;
  margin-top: 8px;
  justify-content: center;
}

.login-secondary-actions {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.login-secondary-actions .ghost-button {
  width: 100%;
  justify-content: center;
}

.login-demo-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.login-demo-list span {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.login-demo-list button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf9;
  color: var(--text);
  padding: 0 10px;
  font-weight: 800;
}

.login-demo-list button:hover {
  border-color: var(--green);
  color: var(--green);
}

.login-card-note {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

@media (max-width: 1180px) {
  .login-screen {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
    padding: 36px 28px;
    background: #eaf0f1;
  }

  .login-brand-panel {
    max-width: none;
    color: var(--text);
  }

  .login-brand-panel .brand {
    max-width: none;
  }

  .login-side {
    max-width: 620px;
    margin: 0 auto;
  }
}

@media (max-width: 620px) {
  .login-card {
    min-height: auto;
    padding: 24px;
  }

  .login-card-header h2 {
    font-size: 27px;
  }

  .login-footer {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .login-footer span,
  .login-footer span:last-child {
    text-align: center;
    white-space: normal;
  }
}

.public-register-form {
  gap: 14px;
  margin-top: 22px;
}

.register-type-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 28px;
}

.register-type-card {
  min-height: 128px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #f7faf9;
  color: var(--text);
  text-align: left;
}

.register-type-card strong,
.register-type-card span {
  display: block;
}

.register-type-card strong {
  font-size: 18px;
}

.register-type-card span {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.55;
}

.register-type-card.is-selected {
  border-color: var(--green);
  background: var(--green-soft);
  box-shadow: inset 0 0 0 1px var(--green);
}

.login-region-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.login-region-grid input,
.login-region-grid select {
  min-width: 0;
}

.sms-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 138px;
  gap: 10px;
  align-items: stretch;
}

.sms-code-row input {
  min-width: 0;
}

.sms-code-button {
  width: 100%;
  min-height: 48px;
  justify-content: center;
  white-space: nowrap;
}

.sms-code-button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.app-shell {
  display: flex;
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}

.sidebar {
  width: 260px;
  flex: 0 0 260px;
  height: 100vh;
  background: #101719;
  color: #f4f7f7;
  display: flex;
  flex-direction: column;
  padding: 22px 18px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(174, 186, 187, 0.55) transparent;
}

.sidebar::-webkit-scrollbar {
  width: 8px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(174, 186, 187, 0.35);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 6px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand > div:last-child {
  min-width: 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  background: #28a779;
  color: white;
  border-radius: 8px;
  font-size: 22px;
  font-weight: 800;
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.brand span {
  margin-top: 4px;
  color: #aebabb;
  font-size: 12px;
  line-height: 1.35;
}

.nav {
  display: grid;
  gap: 6px;
  padding-top: 18px;
}

.nav-item {
  border: 0;
  background: transparent;
  color: #cdd6d7;
  min-height: 42px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  text-align: left;
}

.nav-item span {
  width: 20px;
  color: #7dd8ba;
  text-align: center;
}

.nav-item:hover,
.nav-item.is-active {
  background: #263437;
  color: white;
}

.nav-parent {
  margin-top: 4px;
  position: relative;
  padding-right: 34px;
}

.nav-parent::after {
  content: "⌄";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%) rotate(-90deg);
  color: #8ea0a2;
  font-size: 14px;
  line-height: 1;
  transition: transform 0.18s ease, color 0.18s ease;
}

.nav-parent.has-expanded-subnav::after {
  transform: translateY(-50%) rotate(0deg);
  color: #7dd8ba;
}

.nav-sub {
  display: grid;
  gap: 4px;
  margin: -2px 0 4px 30px;
  padding-left: 12px;
  border-left: 1px solid rgba(255, 255, 255, 0.14);
}

.nav-sub.is-collapsed {
  display: none;
}

.nav-sub-item {
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  padding: 0 10px;
  background: transparent;
  color: #aebabb;
  text-align: left;
}

.nav-sub-item:hover,
.nav-sub-item.is-active {
  background: #223033;
  color: white;
}

.sidebar-status {
  margin-top: auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 14px;
}

.sidebar-status span,
.sidebar-status strong,
.sidebar-status small {
  display: block;
}

.sidebar-status span,
.sidebar-status small {
  color: #b6c1c2;
  font-size: 12px;
}

.sidebar-status strong {
  margin: 6px 0;
  font-size: 15px;
}

.main {
  flex: 1;
  min-width: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
}

.app-footer {
  margin: 28px 28px 24px;
  padding: 18px 0 0;
  border-top: 1px solid rgba(217, 226, 228, 0.9);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 22px 28px;
  background: rgba(238, 242, 245, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(217, 226, 228, 0.9);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 28px;
  line-height: 1.2;
}

h2 {
  margin-bottom: 0;
  font-size: 20px;
  line-height: 1.3;
}

h3 {
  font-size: 17px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-widget {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 4px 4px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.auth-widget div {
  min-width: 120px;
  display: grid;
  gap: 2px;
}

.auth-widget span {
  color: var(--muted);
  font-size: 12px;
}

.auth-widget strong {
  max-width: 180px;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-widget .ghost-button {
  min-height: 30px;
  padding: 0 10px;
}

.select-field {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  border: 1px solid var(--line);
  background: white;
  border-radius: 8px;
  padding: 0 10px;
}

.select-field span {
  color: var(--muted);
  font-size: 12px;
}

select {
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.icon-button,
.primary-button,
.ghost-button,
.table-action {
  min-height: 38px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}

.icon-button {
  width: 40px;
  padding: 0;
  background: white;
  border-color: var(--line);
}

.primary-button {
  background: var(--green);
  color: white;
  border-color: var(--green);
}

.ghost-button,
.table-action {
  background: white;
  color: var(--text);
  border-color: var(--line);
}

.table-action {
  min-height: 32px;
  padding: 0 10px;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.readonly-action {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border-radius: 8px;
  padding: 0 10px;
  background: #eef2f4;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.form-action-label {
  align-self: end;
}

.form-action-label > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.form-action-label .primary-button {
  width: 100%;
}

.modal-panel.sales-region-panel {
  width: min(980px, calc(100vw - 48px));
  max-height: min(86vh, 820px);
}

.modal-panel.sales-region-panel .modal-body {
  display: grid;
  gap: 16px;
}

.form-grid.sales-region-picker-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
}

.sales-region-section {
  display: grid;
  gap: 12px;
  border-radius: 14px;
}

.sales-region-primary-section {
  padding: 16px;
  border: 2px solid rgba(24, 142, 99, 0.28);
  background: linear-gradient(180deg, #f3fbf7 0%, #ffffff 100%);
  box-shadow: 0 10px 26px rgba(24, 142, 99, 0.08);
}

.sales-region-bulk-section {
  padding: 14px;
  border: 1px solid var(--line);
  background: #fbfcfc;
}

.sales-region-section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.sales-region-section-title strong {
  color: var(--text);
  font-size: 20px;
  font-weight: 950;
}

.sales-region-primary-section .sales-region-section-title strong {
  color: var(--green-dark);
}

.sales-region-section-title span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.55;
  text-align: right;
}

.sales-region-picker-grid label {
  font-size: 15px;
  font-weight: 950;
}

.sales-region-picker-grid select,
.sales-region-picker-grid .primary-button {
  min-height: 52px;
  font-size: 17px;
}

.sales-region-bulk-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 220px)) minmax(240px, 1fr);
  gap: 12px;
  align-items: center;
}

.sales-region-bulk-actions .ghost-button {
  min-height: 42px;
  justify-content: center;
  font-size: 15px;
  font-weight: 900;
}

.sales-region-bulk-actions span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.55;
}

.sales-region-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 2px;
}

.sales-region-list-header strong {
  color: var(--text);
  font-size: 17px;
}

.sales-region-list-header span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.region-chip-list {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 10px;
  min-height: 96px;
  max-height: min(34vh, 280px);
  overflow: auto;
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fbfdfc;
}

.region-chip-list:empty::before {
  content: "暂未添加授权县区";
  color: var(--muted);
  font-weight: 700;
}

.region-chip-list button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(24, 142, 99, 0.22);
  background: var(--green-soft);
  color: var(--green-dark);
  padding: 0 12px;
  font-weight: 800;
}

.inline-code-editor {
  display: inline-grid;
  gap: 4px;
  min-width: 120px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.inline-code-editor input,
.inline-code-editor select {
  width: 120px;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--text);
  font: inherit;
  background: white;
}

.vertical-actions {
  align-items: flex-start;
}

.table-action.danger {
  color: var(--red);
  border-color: #efc5bd;
  background: var(--red-soft);
}

.table-action.danger:hover {
  background: #f9d5cf;
}

.table-action.success-action {
  border-color: rgba(18, 136, 94, 0.32);
  background: #e6f7ef;
  color: #0b7a50;
}

.table-action.success-action:hover {
  background: #d3f2e4;
}

.page {
  display: none;
  padding: 24px 28px 34px;
}

.page:not(.is-active) {
  display: none !important;
}

.page.is-active {
  display: block;
}

.notice-strip {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: 8px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
}

.notice-strip strong {
  flex: 0 0 auto;
}

.dashboard-code-quota {
  display: grid;
  gap: 14px;
  margin: 16px 0 0;
  padding: 18px;
  background: linear-gradient(135deg, #ffffff 0%, #f3fbf7 100%);
}

.dashboard-code-quota .quota-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #dcebea;
  padding-bottom: 12px;
}

.dashboard-code-quota .quota-heading strong {
  color: var(--green-dark);
  font-size: 22px;
}

.dashboard-code-quota .quota-heading span {
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  padding: 7px 12px;
  font-size: 14px;
  font-weight: 950;
}

.dashboard-code-quota .quota-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.dashboard-code-quota .quota-stats div {
  border: 1px solid #d6e7e4;
  border-radius: 8px;
  background: white;
  padding: 14px;
}

.dashboard-code-quota .quota-stats span,
.dashboard-code-quota .quota-stats strong,
.dashboard-code-quota .quota-stats em {
  display: block;
}

.dashboard-code-quota .quota-stats span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.dashboard-code-quota .quota-stats strong {
  color: var(--text);
  margin-top: 6px;
  font-size: 26px;
  line-height: 1.15;
}

.dashboard-code-quota .quota-stats em {
  margin-top: 6px;
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  font-weight: 850;
}

.dashboard-code-quota .quota-stats .quota-remaining {
  border-color: #bfe8d6;
  background: #effbf5;
}

.dashboard-code-quota .quota-stats .quota-remaining strong {
  color: var(--green);
}

.dashboard-code-quota p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 850;
  line-height: 1.65;
}

.dashboard-code-quota .quota-period {
  border: 1px solid #d6e7e4;
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
  color: var(--text);
}

.dashboard-code-quota .quota-period.warning {
  border-color: #f0c2b9;
  background: #fff5f2;
  color: #b6412f;
}

.dashboard-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.dashboard-hero h2 {
  margin: 0 0 8px;
  font-size: 28px;
}

.dashboard-hero p:not(.eyebrow) {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.dashboard-hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  flex: 0 0 auto;
}

.dashboard-grid,
.dashboard-card-grid {
  display: grid;
  gap: 18px;
}

.dashboard-grid {
  grid-template-columns: minmax(420px, 1.05fr) minmax(360px, 0.95fr);
  align-items: stretch;
}

.dashboard-card-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dashboard-bottom-grid {
  margin-top: 0;
}

.dashboard-todo-panel {
  border-left: 4px solid var(--gold);
}

.todo-list,
.process-stack,
.summary-list,
.rank-list,
.risk-list {
  display: grid;
  gap: 10px;
}

.todo-list button,
.risk-list button {
  width: 100%;
  border: 1px solid #dbe5e7;
  background: #fbfdfd;
  border-radius: 8px;
  padding: 14px;
  text-align: left;
  cursor: pointer;
}

.todo-list button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 14px;
  align-items: center;
}

.todo-list button:hover,
.risk-list button:hover {
  border-color: #a9d8c6;
  background: #f4fbf8;
}

.todo-list strong,
.risk-list strong {
  color: var(--ink);
  font-size: 15px;
}

.todo-list span {
  color: var(--muted);
  line-height: 1.5;
}

.todo-list i {
  grid-row: span 2;
  color: var(--green);
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.process-stack div,
.summary-list div,
.rank-list div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #edf1f2;
}

.process-stack div:first-child,
.summary-list div:first-child,
.rank-list div:first-child {
  padding-top: 0;
}

.process-stack div:last-child,
.summary-list div:last-child,
.rank-list div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.process-stack strong,
.summary-list span,
.rank-list strong {
  font-weight: 800;
  color: var(--ink);
}

.process-stack span,
.summary-list small,
.rank-list span {
  color: var(--muted);
  line-height: 1.5;
}

.process-stack em {
  grid-row: span 2;
  font-style: normal;
}

.summary-list strong {
  font-size: 22px;
  color: var(--ink);
}

.rank-list em {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-style: normal;
  font-weight: 900;
}

.risk-list button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.risk-list strong {
  line-height: 1.5;
}

.compact-notice {
  margin-top: 16px;
  box-shadow: none;
  background: #fbfdfd;
  align-items: flex-start;
  flex-wrap: wrap;
}

.compact-notice span {
  min-width: 0;
  line-height: 1.7;
}

.compact-notice code {
  white-space: normal;
  overflow-wrap: anywhere;
}

.dashboard-events {
  margin-top: 16px;
}

code {
  background: #eef6f2;
  color: #126247;
  border: 1px solid #c9e4d9;
  border-radius: 5px;
  padding: 2px 6px;
  font-family: "SFMono-Regular", Consolas, monospace;
}

.metrics-grid,
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 18px 0;
}

.metrics-grid.circulation-metrics-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.circulation-section-panel {
  margin-top: 24px;
}

.circulation-section-panel .panel-header span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.compact-stat-filter {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 16px;
}

.circulation-rank-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0;
  justify-content: flex-start;
}

.circulation-rank-tabs button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 900;
  padding: 10px 16px;
}

.circulation-rank-tabs button.active {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green);
}

.circulation-region-rank-list {
  margin-bottom: 16px;
}

.metric,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric {
  padding: 18px;
  min-height: 134px;
  display: grid;
  align-content: space-between;
  border-top-width: 4px;
}

.metric span,
.metric small {
  color: var(--muted);
}

.metric strong {
  display: block;
  font-size: 30px;
  line-height: 1;
  margin: 12px 0;
}

.code-summary-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.code-library-layout {
  display: grid;
  gap: 18px;
}

.code-hero-panel {
  display: grid;
  gap: 16px;
}

.code-hero-panel .panel-header {
  align-items: center;
}

.code-hero-panel .code-summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.code-hero-panel .primary-button {
  min-width: 150px;
}

.code-url-note {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px 12px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid #cfe0e4;
  border-radius: 8px;
  background: #f6faf9;
}

.code-url-note span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.code-url-note code {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #0f6f4f;
  font-size: 15px;
  font-weight: 900;
}

.code-url-note p {
  grid-column: 1 / -1;
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.55;
}

.code-config-grid,
.code-table-grid {
  display: grid;
  grid-template-columns: minmax(420px, 0.82fr) minmax(560px, 1.18fr);
  gap: 18px;
  align-items: start;
}

.code-table-grid {
  grid-template-columns: minmax(0, 1fr);
}

.code-config-grid > .panel,
.code-table-grid > .panel {
  min-width: 0;
}

.code-config-grid .table-scroll,
.code-table-grid .table-scroll {
  width: 100%;
  overflow-x: auto;
}

.code-level-table {
  min-width: 760px;
}

.code-table-grid .data-table {
  min-width: 760px;
}

.accent-green {
  border-top-color: var(--green);
}

.accent-blue {
  border-top-color: var(--blue);
}

.accent-gold {
  border-top-color: var(--gold);
}

.accent-red {
  border-top-color: var(--red);
}

.two-col,
.page-grid,
.trace-preview-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.8fr);
  gap: 18px;
}

.page-grid {
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, 0.75fr);
}

.wide {
  grid-column: span 2;
}

.panel {
  padding: 18px;
  margin-bottom: 18px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 16px;
}

.panel-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.status-pill,
.tag,
.verified-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  background: #eef2f4;
  color: #445154;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-pill.success,
.tag.ok,
.verified-badge {
  background: var(--green-soft);
  color: var(--green);
}

.status-pill.warning,
.tag.pending {
  background: var(--gold-soft);
  color: var(--gold);
}

.tag.danger {
  background: #ffe8e3;
  color: #c93524;
}

.danger-text {
  color: #c93524 !important;
  font-weight: 800;
}

.tag.muted {
  background: #edf0f1;
  color: var(--muted);
}

.muted-row {
  opacity: 0.62;
}

.flow-lane {
  display: grid;
  grid-template-columns: repeat(6, minmax(92px, 1fr));
  align-items: center;
  gap: 8px;
  position: relative;
  margin: 24px 0;
}

.flow-lane span {
  display: none;
}

.flow-node {
  min-height: 58px;
  display: grid;
  place-items: center;
  text-align: center;
  border-radius: 8px;
  background: #eef3f3;
  border: 1px solid #d9e2e4;
  font-weight: 800;
  color: #263133;
  position: relative;
}

.flow-node:not(:last-child)::after {
  content: "→";
  position: absolute;
  right: -15px;
  color: #7d8c8f;
}

.flow-node.verified {
  background: var(--green-soft);
  border-color: #b9e5d5;
  color: var(--green);
}

.flow-node.muted {
  background: var(--gold-soft);
  border-color: #f3d7a7;
  color: var(--gold);
}

.event-list {
  display: grid;
  gap: 10px;
}

.event-list div {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid #edf1f2;
}

.event-list strong {
  color: var(--green);
}

.event-list span,
.body-text,
.hint {
  color: var(--muted);
  line-height: 1.7;
}

.qr-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 18px;
  align-items: center;
}

.qr-mock {
  width: 168px;
  height: 168px;
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 4px;
  padding: 12px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.qr-mock i {
  background: #182326;
  border-radius: 2px;
}

.qr-mock i:nth-child(3n),
.qr-mock i:nth-child(7n),
.qr-mock i:nth-child(11n) {
  background: transparent;
}

.qr-mock i:nth-child(1),
.qr-mock i:nth-child(2),
.qr-mock i:nth-child(9),
.qr-mock i:nth-child(10),
.qr-mock i:nth-child(91),
.qr-mock i:nth-child(92),
.qr-mock i:nth-child(99),
.qr-mock i:nth-child(100) {
  background: #182326;
}

.code-spec {
  display: grid;
  gap: 10px;
}

.code-spec label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.role-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.certification-page {
  display: grid;
  gap: 18px;
}

.certification-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  border-top: 4px solid var(--green);
}

.certification-hero > div {
  flex: 1;
  min-width: 0;
}

.certification-hero h2 {
  margin: 2px 0 8px;
  font-size: 32px;
  line-height: 1.28;
}

.certification-hero p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  font-weight: 800;
  line-height: 1.7;
}

.producer-certification-notice {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid #f3c86b;
  border-left: 6px solid var(--gold);
  background: #fff7df;
}

.producer-certification-notice > div {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.producer-certification-notice strong {
  color: #8a5b00;
  font-size: 20px;
}

.producer-certification-notice p {
  margin: 0;
  color: #5c4a1f;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.8;
}

.extra-code-pack-rule {
  display: flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  max-width: 100%;
  padding: 10px 14px;
  border: 1px solid rgba(190, 132, 30, 0.36);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.extra-code-pack-rule strong {
  flex: 0 0 auto;
  color: #7a4d00;
  font-size: 17px;
}

.extra-code-pack-rule span {
  min-width: 0;
  color: #5c4a1f;
  font-size: 15px;
  font-weight: 850;
  line-height: 1.55;
}

.membership-rule-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 8px;
  margin: 2px 0 0;
  padding: 0;
  list-style: none;
}

.membership-rule-list li {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid rgba(190, 132, 30, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.56);
}

.membership-rule-list li strong {
  color: #7a4d00;
  font-size: 16px;
  line-height: 1.25;
}

.membership-rule-list li span {
  color: #5c4a1f;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.55;
}

.sample-alert-button {
  margin-top: 6px;
  min-width: 190px;
  min-height: 66px;
  flex: 0 0 auto;
  border: 1px solid rgba(186, 63, 50, 0.28);
  border-radius: 10px;
  background: #d83b2f;
  color: #fff;
  font-size: 22px;
  font-weight: 950;
  box-shadow: 0 12px 28px rgba(186, 63, 50, 0.18);
}

.sample-alert-button:hover {
  background: #c63127;
}

@media (max-width: 980px) {
  .producer-certification-notice {
    align-items: stretch;
    flex-direction: column;
  }

  .membership-rule-list {
    grid-template-columns: 1fr;
  }

  .extra-code-pack-rule {
    align-items: flex-start;
    flex-direction: column;
    width: 100%;
  }

  .sample-alert-button {
    width: 100%;
  }

  .form-grid.sales-region-picker-grid,
  .sales-region-bulk-actions {
    grid-template-columns: 1fr;
  }

  .sales-region-section-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .sales-region-section-title span {
    text-align: left;
  }
}

.producer-sample-modal {
  width: min(760px, calc(100vw - 64px));
}

.producer-sample-body {
  gap: 16px;
  background: #f7faf9;
}

.producer-sample-body img {
  width: min(420px, 100%);
  max-height: calc(100vh - 260px);
  justify-self: center;
  display: block;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  box-shadow: 0 16px 42px rgba(34, 47, 51, 0.12);
}

.certification-form {
  display: grid;
  gap: 16px;
}

.certification-action-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.75fr);
  gap: 18px;
}

.certification-action-card {
  display: flex;
  min-height: 160px;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  border-top: 4px solid var(--green);
}

.certification-action-card h2 {
  margin: 4px 0 8px;
  font-size: 24px;
}

.certification-action-card p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.certification-action-card.commitment-card {
  border-top-color: var(--gold);
  background: linear-gradient(180deg, #fffaf0 0%, #ffffff 78%);
}

.certification-action-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.certification-action-buttons button,
.certification-submit-button {
  min-height: 48px;
  padding-inline: 22px;
  font-size: 16px;
}

.cert-section {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
  background: #fbfcfc;
}

.cert-section h3 {
  margin: 0 0 16px;
  font-size: 22px;
}

.cert-section-note {
  margin: -6px 0 16px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.7;
}

.cert-grid .field-wide {
  grid-column: span 2;
}

.cert-grid select,
.cert-grid input {
  min-height: 54px;
  font-size: 16px;
}

.cert-grid label {
  font-size: 15px;
  color: #536468;
}

.cert-grid input[type="file"] {
  padding: 13px 14px;
  background: #fff;
}

[data-certification-form="producer"] .cert-section:first-child {
  border-color: rgba(22, 137, 96, 0.28);
  background: #f5fffb;
}

[data-certification-form="producer"] .cert-section:first-child select,
[data-certification-form="producer"] .cert-section:first-child input {
  border-color: rgba(22, 137, 96, 0.32);
  background: #fff;
}

[data-certification-form="producer"] .cert-section:nth-child(3) {
  border-color: rgba(198, 124, 0, 0.28);
  background: #fffaf0;
}

.certification-table td:first-child span,
.certification-table td:nth-child(2) span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.certification-table td:last-child {
  min-width: 420px;
}

.producer-admin-actions {
  display: grid;
  width: min(420px, 100%);
  gap: 8px;
  border: 1px solid #e2ecea;
  border-radius: 8px;
  background: #fbfdfc;
  padding: 10px;
}

.producer-admin-action-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.producer-admin-action-row.quota-row {
  grid-template-columns: 1fr 1fr 96px;
}

.producer-admin-actions .table-action,
.producer-pending-actions .table-action {
  min-width: 0;
  width: 100%;
  justify-content: center;
  white-space: nowrap;
}

.producer-admin-actions .inline-code-editor {
  min-width: 0;
  width: 100%;
}

.producer-admin-actions .inline-code-editor select {
  width: 100%;
}

.producer-pending-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.membership-modal-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.membership-modal-grid label:first-child {
  grid-column: 1 / -1;
}

.table-action.primary-lite {
  border-color: rgba(24, 142, 99, 0.3);
  background: #eefaf4;
  color: var(--green-dark);
}

.table-action.danger-lite {
  border-color: rgba(209, 72, 54, 0.25);
  background: #fff4f1;
  color: #b13424;
}

.product-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
}

.product-tree {
  display: grid;
  align-content: start;
  gap: 10px;
}

.tree-card,
.step-card {
  border: 1px solid var(--line);
  background: #fbfcfc;
  border-radius: 8px;
  padding: 14px;
}

.tree-card.is-active,
.step-card.is-focus {
  border-color: var(--green);
  background: var(--green-soft);
}

.tree-card span,
.tree-card strong,
.tree-card small,
.step-card span,
.step-card strong,
.step-card small {
  display: block;
}

.tree-card span,
.step-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.tree-card strong,
.step-card strong {
  margin: 7px 0;
  color: var(--text);
}

.tree-card small,
.step-card small {
  color: var(--muted);
  line-height: 1.5;
}

.product-main {
  min-width: 0;
}

.product-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.management-grid {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  column-gap: 20px;
  row-gap: 12px;
  align-items: start;
}

.form-card {
  grid-row: 1 / span 3;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
  padding: 16px;
}

.management-grid > .table-toolbar,
.management-grid > .metrics-grid,
.management-grid > .data-table,
.management-grid > .empty-table-state,
.management-grid > .full-width-note {
  grid-column: 2;
}

.management-grid > .data-table {
  min-width: 0;
}

.admin-account-layout {
  grid-template-columns: minmax(360px, 420px) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

.admin-account-layout .form-card,
.admin-account-layout .admin-account-list-panel {
  grid-column: auto;
  grid-row: auto;
  min-width: 0;
}

.admin-account-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-self: start;
}

.admin-account-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

.admin-account-form input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 0 14px;
  font-weight: 800;
}

.admin-account-form .primary-button {
  width: fit-content;
  min-width: 180px;
  margin-top: 4px;
}

.admin-account-list-panel {
  overflow: hidden;
}

.admin-account-list-panel .table-scroll {
  width: 100%;
  overflow-x: auto;
}

.admin-account-table {
  min-width: 980px;
}

.admin-account-table td:last-child {
  white-space: nowrap;
}

.production-layout {
  grid-template-columns: 1fr;
  gap: 18px;
}

.production-layout .form-card,
.production-layout > .subsection-header,
.production-layout > .table-toolbar,
.production-layout > .metrics-grid,
.production-layout > .data-table,
.production-layout > .empty-table-state {
  grid-column: 1;
  grid-row: auto;
}

.subsection-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
  margin-top: 8px;
}

.subsection-header h3 {
  margin: 0;
  font-size: 18px;
}

.subsection-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.production-layout .form-card {
  display: grid;
  gap: 18px;
  max-width: none;
  padding: 20px;
}

.production-batch-card {
  align-items: start;
}

.form-card-title {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
}

.form-card-title h3 {
  margin: 0;
}

.form-card-title span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.production-metrics-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 8px 0 0;
}

.production-form-grid {
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  align-items: start;
  gap: 14px 16px;
}

.batch-number-field small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.inline-input-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.inline-input-action input {
  min-width: 0;
}

.form-card-actions {
  display: flex;
  justify-content: flex-start;
  padding-top: 2px;
}

.production-layout .form-card > .primary-button,
.production-layout .form-card .form-card-actions > .primary-button {
  justify-self: start;
}

.production-layout .form-card h3 {
  margin-bottom: 0;
}

.raw-material-layout {
  grid-template-columns: 1fr;
  gap: 18px;
}

.raw-material-layout .form-card,
.raw-material-layout > .table-toolbar,
.raw-material-layout > .data-table,
.raw-material-layout > .empty-table-state {
  grid-column: 1;
  grid-row: auto;
}

.raw-material-form-grid {
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  align-items: start;
}

.raw-material-layout .form-card-actions {
  margin-top: 10px;
  padding-top: 10px;
}

.form-card h3 {
  margin-bottom: 14px;
}

.form-grid.single {
  grid-template-columns: 1fr;
  margin-bottom: 14px;
}

.form-grid-wide {
  grid-column: 1 / -1;
}

.attachment-upload-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.attachment-upload-card {
  display: grid;
  gap: 10px;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfc;
}

.attachment-upload-card strong,
.attachment-upload-card span {
  display: block;
}

.attachment-upload-card strong {
  font-size: 15px;
}

.attachment-upload-card span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}

.attachment-upload-card input[type="file"] {
  min-height: 44px;
}

.batch-ad-upload {
  margin-bottom: 14px;
}

.batch-ad-current .table-actions {
  margin-top: 10px;
}

.mini-status-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mini-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 9px;
  background: #eef2f4;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.mini-status.ok {
  background: #dff4ec;
  color: #0b7a50;
}

.product-explanation-actions {
  max-width: 520px;
}

.explanation-video-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.explanation-video-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfc;
}

.explanation-video-card strong,
.explanation-video-card span {
  display: block;
}

.explanation-video-card strong {
  font-size: 16px;
}

.explanation-video-card span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}

.explanation-video-card input[type="file"] {
  min-height: 42px;
}

.form-card select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--text);
  padding: 0 10px;
}

.search-select {
  position: relative;
}

.search-select input {
  padding-right: 34px;
}

.inline-select {
  min-width: 190px;
}

.inline-select input {
  min-height: 34px;
  padding-top: 7px;
  padding-bottom: 7px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inline-select::after {
  top: 7px;
}

.search-select::after {
  content: "⌄";
  position: absolute;
  top: 10px;
  right: 12px;
  color: var(--muted);
  pointer-events: none;
}

.search-options {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
  max-height: 210px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: 0 14px 34px rgba(34, 47, 51, 0.14);
  padding: 6px;
}

.search-select.is-open .search-options {
  display: grid;
  gap: 4px;
}

.search-options button {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 0 10px;
}

.search-options button.template-option {
  display: grid;
  gap: 2px;
  min-height: 48px;
  padding: 7px 10px;
}

.search-options button.template-option strong,
.search-options button.template-option em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-options button.template-option em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.search-options button.binding-batch-option {
  display: grid;
  gap: 3px;
  min-height: 54px;
  padding: 8px 10px;
}

.search-options button.binding-batch-option strong,
.search-options button.binding-batch-option em {
  display: block;
  line-height: 1.25;
}

.search-options button.binding-batch-option em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.search-options button:hover,
.search-options button.is-selected {
  background: var(--green-soft);
  color: var(--green);
}

.search-options button.binding-batch-option:hover em,
.search-options button.binding-batch-option.is-selected em {
  color: var(--green);
}

.search-options button.is-hidden {
  display: none;
}

.search-options-label {
  padding: 7px 10px 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  background: #f7faf9;
  border-bottom: 1px solid var(--line);
}

.search-options-empty {
  min-height: 34px;
  display: none;
  align-items: center;
  padding: 0 10px;
  color: var(--muted);
  font-size: 13px;
}

.search-options.has-empty .search-options-empty {
  display: flex;
}

.segmented-control {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.segmented-control button {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  padding: 0 14px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.segmented-control button.is-active {
  background: white;
  color: var(--green);
  box-shadow: 0 4px 12px rgba(28, 94, 70, 0.12);
}

.role-card,
.template-row {
  border: 1px solid var(--line);
  background: var(--panel-soft);
  border-radius: 8px;
  text-align: left;
  padding: 16px;
}

.role-card.is-selected,
.template-row.is-active {
  border-color: var(--green);
  background: var(--green-soft);
}

.role-card strong,
.role-card span,
.template-row strong,
.template-row span {
  display: block;
}

.role-card span,
.template-row span {
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.5;
}

.template-row em {
  display: block;
  margin-top: 10px;
  color: var(--green);
  font-style: normal;
  font-size: 13px;
}

.template-workbench {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(460px, 1.1fr);
  gap: 18px;
  align-items: start;
}

.flagship-workbench {
  grid-template-columns: minmax(340px, 0.72fr) minmax(620px, 1.28fr);
}

.template-compliance-banner {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  padding: 18px 20px;
  border: 1px solid #9fd7c3;
  border-left: 6px solid var(--green);
  border-radius: 10px;
  background: linear-gradient(135deg, #ecfbf5, #f8fffc);
  box-shadow: 0 10px 28px rgba(24, 132, 95, 0.08);
}

.template-feature-panel {
  grid-column: 1 / -1;
}

.template-feature-panel .table-toolbar {
  margin-top: 14px;
}

.template-feature-table {
  min-width: 860px;
}

.template-feature-table th:last-child,
.template-feature-table td:last-child {
  width: 220px;
}

.flagship-site-panel {
  grid-column: 1 / -1;
}

.flagship-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.flagship-form-grid label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

.flagship-form-grid .field-wide {
  grid-column: 1 / -1;
}

.flagship-form-grid input,
.flagship-form-grid textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  padding: 10px 12px;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
}

.flagship-form-grid textarea {
  min-height: 92px;
  resize: vertical;
  line-height: 1.55;
}

.flagship-section-toggles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.flagship-section-toggles label {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #d8ebe3;
  border-radius: 10px;
  background: #f4fbf8;
  padding: 0 12px;
  color: var(--ink);
  font-weight: 900;
}

.flagship-section-toggles input {
  width: 18px;
  height: 18px;
}

.flagship-status-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.template-compliance-banner strong {
  color: #0f6d4f;
  font-size: 20px;
  line-height: 1.35;
}

.template-compliance-banner span {
  color: #3f5558;
  line-height: 1.75;
  font-weight: 700;
}

.table-like-template-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.template-list-item {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.table-like-template-list .template-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(0, 1.4fr);
  gap: 8px 16px;
  align-items: center;
  padding: 14px 16px;
}

.table-like-template-list .template-row strong {
  font-size: 17px;
}

.table-like-template-list .template-row span,
.table-like-template-list .template-row em {
  margin-top: 0;
}

.table-like-template-list .template-row em {
  grid-column: 2;
}

.template-style-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: start;
  gap: 4px;
  margin: -2px 0 4px;
  padding: 4px;
  border: 1px solid #cfe4dc;
  border-radius: 9px;
  background: #f7fbfa;
}

.template-style-tabs button {
  min-height: 34px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #516468;
  font-weight: 900;
  padding: 0 16px;
}

.template-style-tabs button.is-active {
  background: white;
  color: var(--green);
  box-shadow: 0 5px 14px rgba(24, 132, 95, 0.14);
}

.template-preview-style-frame {
  --tpl-bg: #ffffff;
  --tpl-main: var(--green);
  --tpl-main-2: #1c9a70;
  --tpl-soft: #f2fbf7;
  --tpl-soft-2: #f8fffc;
  --tpl-line: #dfe7e6;
  --tpl-strong: #172426;
  --tpl-muted: #657477;
  --tpl-shadow: none;
  color: var(--tpl-strong);
}

.template-trace-brand,
.template-trace-footer {
  border: 1px solid var(--tpl-line);
  border-radius: 14px;
  background: linear-gradient(135deg, var(--tpl-soft), var(--tpl-soft-2));
  box-shadow: var(--tpl-shadow);
  text-align: center;
}

.template-trace-brand {
  margin-bottom: 10px;
  padding: 11px 12px;
}

.template-trace-brand span {
  color: var(--tpl-main);
  font-size: 18px;
  font-weight: 1000;
  letter-spacing: 0.04em;
}

.template-trace-footer {
  display: grid;
  gap: 5px;
  margin-top: 12px;
  padding: 12px;
  background: var(--tpl-bg);
  color: var(--tpl-muted);
  font-size: 12px;
}

.template-trace-footer strong {
  color: var(--tpl-main);
  font-size: 14px;
}

.template-trace-footer span {
  font-weight: 800;
}

.template-trace-footer em {
  font-style: normal;
}

.template-preview-style-frame .public-hero {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--tpl-line);
  border-radius: 14px;
  background: linear-gradient(135deg, var(--tpl-main), var(--tpl-main-2));
  box-shadow: var(--tpl-shadow);
}

.template-preview-style-frame .public-hero h2 {
  position: relative;
  z-index: 1;
  color: #fff;
  letter-spacing: 0;
}

.template-preview-style-frame .public-hero p {
  position: relative;
  z-index: 1;
  color: rgba(255, 255, 255, 0.84);
  font-weight: 800;
}

.template-preview-style-frame .template-preview-section {
  border-color: var(--tpl-line);
  border-radius: 12px;
  background: var(--tpl-bg);
  box-shadow: var(--tpl-shadow);
}

.template-preview-style-frame .template-preview-section h3 {
  border-bottom: 1px solid var(--tpl-line);
  background: linear-gradient(90deg, var(--tpl-soft), var(--tpl-soft-2));
  color: var(--tpl-main);
  letter-spacing: 0;
}

.template-preview-style-frame .template-preview-section > div {
  border-bottom-color: color-mix(in srgb, var(--tpl-line) 72%, transparent);
}

.template-preview-style-frame .template-preview-section b,
.template-preview-style-frame .template-flow-item b,
.template-preview-style-frame .record-list b {
  color: var(--tpl-strong);
}

.template-preview-style-frame .template-preview-section span,
.template-preview-style-frame .template-flow-item em,
.template-preview-style-frame .record-list span {
  color: var(--tpl-muted);
}

.template-preview-style-frame .template-preview-subtitle {
  border-left-color: var(--tpl-main);
  color: var(--tpl-main);
}

.template-preview-style-frame .template-flow-route i {
  color: var(--tpl-main);
}

.template-preview-style-frame.style1 {
  --tpl-bg: #ffffff;
  --tpl-main: #136f4f;
  --tpl-main-2: #209766;
  --tpl-soft: #edf9f4;
  --tpl-soft-2: #fbfffd;
  --tpl-line: #bfded1;
  --tpl-shadow: 0 10px 24px rgba(19, 111, 79, 0.08);
}

.template-preview-style-frame.style1 .public-hero::after {
  content: "";
  position: absolute;
  right: -34px;
  top: -46px;
  width: 142px;
  height: 142px;
  border-radius: 50%;
  border: 28px solid rgba(255, 255, 255, 0.1);
}

.template-preview-style-frame.style1 .template-preview-section h3::before {
  content: "✓";
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-right: 8px;
  border-radius: 50%;
  background: #dff4ec;
  color: var(--tpl-main);
  font-size: 12px;
  vertical-align: 1px;
}

.template-preview-style-frame.style2 {
  --tpl-bg: #fffdf8;
  --tpl-main: #6d5018;
  --tpl-main-2: #b3832d;
  --tpl-soft: #fff7df;
  --tpl-soft-2: #fffdf7;
  --tpl-line: #ead6a8;
  --tpl-strong: #2a2419;
  --tpl-muted: #75694f;
  --tpl-shadow: 0 12px 28px rgba(109, 80, 24, 0.09);
}

.template-preview-style-frame.style2 .public-hero {
  background: linear-gradient(135deg, #3d5f3d 0%, #7a5a1e 58%, #b88a31 100%);
}

.template-preview-style-frame.style2 .template-preview-section h3 {
  border-top: 3px solid #c79a3f;
}

.template-preview-style-frame.style2 .template-preview-subtitle {
  border-left-color: #c79a3f;
  color: #7a5a1e;
}

.template-preview-style-frame.style3 {
  --tpl-bg: #ffffff;
  --tpl-main: #1d5f91;
  --tpl-main-2: #23a187;
  --tpl-soft: #eef7ff;
  --tpl-soft-2: #f6fcff;
  --tpl-line: #c6dff0;
  --tpl-strong: #172533;
  --tpl-muted: #5c7080;
  --tpl-shadow: 0 8px 22px rgba(29, 95, 145, 0.08);
}

.template-preview-style-frame.style3 .public-hero {
  background: linear-gradient(135deg, #1d5f91, #238a9e);
}

.template-preview-style-frame.style3 .template-preview-section {
  border-radius: 10px;
}

.template-preview-style-frame.style3 .template-flow-item {
  position: relative;
  padding-left: 14px;
}

.template-preview-style-frame.style3 .template-flow-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 12px;
  width: 3px;
  border-radius: 999px;
  background: var(--tpl-main);
}

.template-preview-style-frame.style4 {
  --tpl-bg: #fbfffd;
  --tpl-main: #083f33;
  --tpl-main-2: #12674e;
  --tpl-soft: #eaf5ef;
  --tpl-soft-2: #f9fffc;
  --tpl-line: #b9d7ca;
  --tpl-strong: #10221e;
  --tpl-muted: #5f746d;
  --tpl-shadow: 0 14px 32px rgba(8, 63, 51, 0.1);
}

.template-preview-style-frame.style4 .public-hero {
  background: linear-gradient(135deg, #062f29, #12674e);
  border-radius: 18px;
}

.template-preview-style-frame.style4 .template-preview-section {
  border-radius: 18px;
}

.template-preview-style-frame.style4 .template-preview-section h3 {
  padding-left: 16px;
  border-bottom: 0;
}

.template-preview-style-frame.style4 .template-preview-section h3::after {
  content: "";
  display: block;
  width: 36px;
  height: 3px;
  margin-top: 7px;
  border-radius: 999px;
  background: var(--tpl-main);
}

.template-preview-style-frame.style5 {
  --tpl-bg: #ffffff;
  --tpl-main: #202b2d;
  --tpl-main-2: #56676b;
  --tpl-soft: #f6f8f8;
  --tpl-soft-2: #ffffff;
  --tpl-line: #d7dfdf;
  --tpl-strong: #182022;
  --tpl-muted: #687579;
  --tpl-shadow: none;
}

.template-preview-style-frame.style5 .public-hero {
  border-radius: 6px;
  background: #ffffff;
  border-top: 5px solid #16865f;
}

.template-preview-style-frame.style5 .public-hero h2 {
  color: var(--tpl-strong);
}

.template-preview-style-frame.style5 .public-hero p {
  color: var(--tpl-muted);
}

.template-preview-style-frame.style5 .template-preview-section {
  border-radius: 6px;
}

.template-preview-style-frame.style5 .template-preview-section h3 {
  background: #fff;
  border-bottom: 1px solid var(--tpl-line);
  color: #16865f;
}

.template-layout {
  display: grid;
  gap: 12px;
}

.template-two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.template-status-ribbon {
  min-height: 36px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--tpl-line);
  border-radius: 999px;
  background: var(--tpl-soft);
  color: var(--tpl-main);
  font-size: 12px;
  font-weight: 900;
}

.template-metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.template-metric {
  min-height: 74px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--tpl-line);
  border-radius: 12px;
  background: var(--tpl-bg);
  box-shadow: var(--tpl-shadow);
}

.template-metric span {
  color: var(--tpl-muted);
  font-size: 12px;
  font-weight: 900;
}

.template-metric strong {
  color: var(--tpl-main);
  font-size: 18px;
  line-height: 1.15;
}

.template-layout-golden .template-metric {
  background: linear-gradient(135deg, #fffdf8, #fff6df);
  border-color: #ead6a8;
}

.template-layout-data .template-metric {
  border-radius: 8px;
  background: #f8fcff;
}

.template-layout-data .template-two-column {
  grid-template-columns: 1fr;
}

.template-layout-brand .template-logistics-section {
  border-left: 5px solid var(--tpl-main);
}

.template-layout-minimal {
  gap: 10px;
}

.template-layout-minimal .template-preview-section,
.template-layout-minimal .template-metric {
  box-shadow: none;
}

@media (max-width: 520px) {
  .template-two-column,
  .template-metric-grid {
    grid-template-columns: 1fr;
  }
}

.template-preview-search {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
}

.template-preview-search label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 900;
}

.template-preview-search input {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0 14px;
  font-size: 15px;
  font-weight: 800;
}

.template-public-preview-shell {
  position: relative;
  width: 100%;
  max-width: 520px;
  min-height: 720px;
  border: 10px solid #162022;
  border-radius: 28px;
  background: #eef3f2;
  overflow: hidden;
  box-shadow: 0 20px 44px rgba(14, 24, 26, 0.18);
}

.template-public-preview {
  width: 100%;
  height: 720px;
  overflow: auto;
  background: white;
  padding: 10px;
}

.template-preview-current {
  display: grid;
  gap: 3px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid #d8ebe3;
  border-radius: 10px;
  background: #f2fbf7;
}

.template-preview-current span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.template-preview-current strong {
  color: var(--green);
  font-size: 17px;
}

.template-preview-current em {
  color: #526467;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.template-preview-empty {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 10px;
  padding: 32px;
  text-align: center;
}

.template-preview-empty strong {
  color: var(--ink);
  font-size: 22px;
}

.template-preview-empty span {
  color: var(--muted);
  line-height: 1.7;
  max-width: 320px;
}

.rule-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.rule-list span {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  background: #f1f5f5;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #445154;
  font-size: 13px;
}

table {
  border-collapse: collapse;
  width: 100%;
}

.table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 14px;
  margin-bottom: 0;
  min-height: 64px;
}

.panel-header .table-toolbar {
  min-width: min(520px, 100%);
  min-height: 0;
}

.table-toolbar strong {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.table-search {
  width: min(580px, 100%);
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.empty-table-state {
  display: none;
  min-height: 96px;
  place-items: center;
  border: 1px dashed #aebfc2;
  border-radius: 8px;
  background: #f8fbfb;
  color: var(--muted);
  margin-top: 12px;
}

.empty-table-state.is-visible {
  display: grid;
}

.empty-panel {
  min-height: 260px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #f7faf9;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: 34px;
  text-align: center;
}

.empty-panel strong {
  font-size: 22px;
  color: var(--text);
}

.empty-panel span {
  max-width: 560px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

th,
td {
  border-bottom: 1px solid #e7eeef;
  padding: 12px 10px;
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  background: #f6f9f9;
}

td span {
  color: var(--muted);
  display: block;
  margin-top: 3px;
  font-size: 12px;
}

.compact-table th,
.compact-table td {
  padding: 10px 8px;
}

.data-table {
  min-width: 860px;
}

.drag-handle {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfc;
  color: var(--muted);
  cursor: grab;
  font-weight: 900;
}

tr.is-dragging {
  opacity: 0.48;
}

.group-row td {
  background: var(--green-soft);
  color: var(--green);
  font-weight: 900;
}

.group-row span {
  margin-left: 10px;
  color: var(--muted);
  font-size: 12px;
}

.sub-panel {
  margin-top: 34px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.sub-panel + .sub-panel {
  margin-top: 42px;
}

.package-stock-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.package-stock-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fbfcfc;
}

.package-stock-list span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.package-stock-list strong {
  color: var(--text);
  font-size: 13px;
}

.stock-adjust-action {
  min-height: 30px;
  padding: 0 9px;
  border-radius: 999px;
  color: var(--green);
  border-color: rgba(24, 142, 99, 0.28);
  background: var(--green-soft);
  font-size: 12px;
  font-weight: 800;
}

.inline-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 280px;
}

.inline-chip-list span {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 9px;
  background: #fbfcfc;
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.count-list span {
  background: var(--green-soft);
  border-color: #cce8dc;
  color: var(--green);
}

.level-table {
  min-width: 0;
}

.template-list {
  display: grid;
  gap: 10px;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.module-grid label {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}

.field-pill {
  min-height: 38px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font-weight: 700;
}

.template-field-panel {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
  padding: 14px;
}

.template-field-panel h3 {
  margin-bottom: 10px;
}

.template-field-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.template-field-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.template-field-form textarea {
  min-height: 88px;
}

.template-field-form .wide-field {
  grid-column: 1 / -1;
}

.template-readiness-panel {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfc;
}

.switch-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.switch-line input {
  width: 18px;
  height: 18px;
}

.readiness-list {
  display: grid;
  gap: 10px;
}

.readiness-card {
  display: grid;
  grid-template-columns: minmax(360px, 1.35fr) minmax(0, 2fr);
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
}

.readiness-card-main {
  display: grid;
  gap: 6px;
}

.readiness-card-main strong {
  font-size: 18px;
  line-height: 1.35;
}

.readiness-card-main span,
.readiness-card-main em {
  color: var(--muted);
  font-style: normal;
  font-size: 13px;
  line-height: 1.5;
}

.readiness-template-editor {
  display: grid;
  gap: 10px;
  margin-top: 8px;
  padding: 12px;
  border: 1px solid #b9dfd1;
  border-radius: 10px;
  background: #f2fbf7;
}

.readiness-template-editor b {
  display: block;
  margin-bottom: 3px;
  color: var(--green);
  font-size: 14px;
}

.readiness-template-editor .inline-template-editor {
  grid-template-columns: minmax(0, 1fr) auto;
}

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

.readiness-action {
  display: grid;
  gap: 6px;
  min-height: 74px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fbfcfc;
  text-align: left;
  cursor: pointer;
}

.readiness-action:hover {
  border-color: rgba(23, 132, 95, 0.45);
  background: #f5fcf9;
}

.readiness-action b {
  color: var(--text);
  font-size: 14px;
}

.readiness-action .tag {
  justify-self: start;
}

.preview-panel {
  display: grid;
  justify-items: center;
}

.preview-panel .panel-header {
  width: 100%;
}

.flagship-workbench .preview-panel {
  justify-items: stretch;
}

.flagship-workbench .template-public-preview-shell {
  max-width: none;
  min-height: 780px;
}

.flagship-integrated-preview-frame {
  display: block;
  width: 100%;
  height: 780px;
  border: 0;
  background: #eef3f2;
}

.phone-frame {
  width: 250px;
  height: 470px;
  border: 10px solid #121b1d;
  border-radius: 28px;
  background: #eef3f3;
  padding: 18px 14px;
}

.phone-top {
  width: 76px;
  height: 5px;
  border-radius: 999px;
  background: #323e41;
  margin: 0 auto 18px;
}

.trace-card-preview {
  background: white;
  border-radius: 8px;
  padding: 16px;
  border: 1px solid var(--line);
}

.trace-card-preview h3 {
  margin: 16px 0 6px;
}

.trace-card-preview p {
  color: var(--muted);
  line-height: 1.5;
}

.mini-template-block {
  display: grid;
  gap: 5px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.mini-template-block:last-child {
  border-bottom: 0;
}

.mini-template-block strong {
  color: var(--green);
}

.mini-template-block span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.mini-timeline {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin: 18px 0;
}

.mini-timeline span {
  display: grid;
  place-items: center;
  min-height: 34px;
  background: var(--green-soft);
  color: var(--green);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
}

.anti-fake,
.safe-note {
  background: var(--gold-soft);
  color: var(--gold);
  border-radius: 8px;
  padding: 12px;
  font-size: 13px;
  line-height: 1.6;
}

.form-grid,
.shipment-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-grid label,
.shipment-grid label,
.scan-board label,
.search-box,
.level-count-grid label,
.form-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.shipment-grid select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--text);
  padding: 0 10px;
}

.level-count-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.level-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.spec-level-name-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.spec-level-name-grid label {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.spec-level-name-grid input[readonly] {
  background: var(--panel-soft);
  color: var(--muted);
}

.spec-level-name-grid input::placeholder {
  color: #9aa8aa;
  opacity: 1;
}

.field-hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  font-weight: 700;
}

.inline-template-editor {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.level-choice {
  min-height: 46px;
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--text);
  padding: 8px 10px;
  cursor: pointer;
}

.level-choice:has(input:checked) {
  border-color: var(--green);
  background: var(--green-soft);
}

.level-choice.is-required {
  border-color: var(--green);
  background: #d5f0e6;
  cursor: default;
}

.level-choice input {
  width: 16px;
  min-height: 16px;
  accent-color: var(--green);
}

.level-choice strong {
  color: var(--text);
}

.level-choice em {
  color: var(--muted);
  font-style: normal;
  font-weight: 700;
  font-size: 12px;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--text);
  outline: 0;
  padding: 10px 11px;
  min-height: 40px;
}

textarea {
  resize: vertical;
  line-height: 1.6;
}

input:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(23, 132, 95, 0.12);
}

.capacity-meter {
  height: 18px;
  border-radius: 999px;
  background: #edf2f3;
  overflow: hidden;
  border: 1px solid var(--line);
}

.capacity-meter div {
  height: 100%;
  width: var(--value);
  background: linear-gradient(90deg, #17845f, #2667b9);
}

.capacity-notes {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.capacity-notes div {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}

.capacity-notes strong {
  font-size: 18px;
  color: var(--green);
}

.capacity-notes span {
  color: var(--muted);
}

.record-list {
  display: grid;
  gap: 10px;
}

.record-list div {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}

.record-list span,
.record-list em {
  color: var(--muted);
  font-style: normal;
  line-height: 1.5;
}

.record-list b {
  color: var(--text);
}

.level-table input[disabled],
.level-table input[readonly] {
  color: var(--muted);
  background: #edf2f3;
}

.scan-board {
  display: grid;
  gap: 12px;
}

.binding-workflow {
  display: grid;
  gap: 18px;
}

.binding-block {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}

.binding-block-title {
  display: grid;
  gap: 4px;
}

.binding-block-title strong {
  color: var(--text);
  font-size: 15px;
}

.binding-block-title span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.binding-context-board {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.binding-package-stock-panel {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid #d7e4e6;
  border-radius: 8px;
  background: #fff;
}

.binding-package-stock-header,
.binding-package-run-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.binding-package-stock-header strong,
.binding-package-run-title strong,
.binding-package-run-row strong,
.binding-package-run-empty strong {
  display: block;
  color: var(--text);
}

.binding-package-stock-header span,
.binding-package-run-title span,
.binding-package-run-row span,
.binding-package-run-row em,
.binding-package-run-empty span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  font-style: normal;
}

.binding-package-levels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.binding-package-level {
  min-height: 64px;
  display: grid;
  gap: 5px;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
  color: var(--text);
  text-align: left;
  padding: 10px 12px;
}

.binding-package-level span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.binding-package-level strong {
  color: var(--green);
  font-size: 18px;
}

.binding-package-level:hover,
.binding-package-level.is-active {
  border-color: var(--green);
  background: var(--green-soft);
}

.binding-package-level.is-empty {
  opacity: 0.55;
  cursor: not-allowed;
}

.binding-package-runs {
  display: grid;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}

.binding-package-run-title,
.binding-package-run-empty {
  padding: 4px 2px;
}

.binding-package-run-row {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}

.binding-package-run-row .table-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.scan-board .binding-panel {
  display: none;
}

.scan-board .binding-panel.is-active {
  display: grid;
}

.binding-range-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.binding-action-row {
  display: flex;
  justify-content: flex-end;
  padding-top: 4px;
}

.binding-action-row .primary-button {
  min-width: 150px;
}

.binding-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.binding-preview-grid div {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}

.binding-preview-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.binding-level-advice {
  display: grid;
  gap: 8px;
  margin: 12px 0;
  padding: 12px 14px;
  border: 1px solid #f1c77b;
  border-radius: 8px;
  background: #fff7e8;
  color: #704900;
}

.binding-level-advice[hidden] {
  display: none;
}

.binding-level-advice > strong {
  color: #8a5600;
  font-size: 15px;
}

.binding-level-advice p {
  margin: 0;
  color: #704900;
  font-size: 14px;
  line-height: 1.55;
}

.binding-level-advice b {
  color: #1b2528;
  font-weight: 900;
}

.binding-print-run-summary {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}

.binding-print-run-summary > strong,
.binding-print-run-summary b,
.binding-print-run-summary p,
.binding-print-run-summary span,
.binding-print-run-summary em {
  display: block;
}

.binding-print-run-summary > strong {
  color: var(--text);
  font-size: 15px;
}

.binding-print-run-summary section {
  display: grid;
  gap: 6px;
}

.binding-print-run-summary b {
  color: var(--muted);
  font-size: 12px;
}

.binding-print-run-summary p {
  margin: 0;
  color: var(--text);
  font-weight: 800;
}

.binding-print-run-groups {
  display: grid;
  gap: 6px;
}

.binding-print-run-groups div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  min-height: 32px;
  padding: 6px 8px;
  border: 1px solid #d7e4e6;
  border-radius: 8px;
  background: #fff;
}

.binding-print-run-groups span {
  color: var(--text);
  font-weight: 800;
}

.binding-print-run-groups strong {
  white-space: nowrap;
  color: var(--green);
}

.binding-print-run-summary em {
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff4df;
  color: #9b5d00;
  font-size: 13px;
  font-style: normal;
  font-weight: 800;
}

.warehouse-metrics {
  margin-bottom: 16px;
}

.warehouse-metrics-compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.warehouse-metrics-compact .metric {
  min-height: 82px;
  padding: 12px 14px;
  display: grid;
  align-content: center;
  gap: 5px;
  border-top-width: 3px;
  box-shadow: none;
}

.warehouse-metrics-compact .metric strong {
  font-size: 24px;
  line-height: 1;
  margin: 0;
}

.warehouse-metrics-compact .metric small {
  margin-top: 0;
  font-size: 12px;
}

.warehouse-metrics-compact .metric span {
  font-weight: 800;
}

.warehouse-create-grid,
.warehouse-action-grid {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
}

.warehouse-create-grid {
  grid-template-columns: minmax(260px, 0.9fr) minmax(420px, 1.35fr) minmax(260px, 0.9fr);
  gap: 18px;
}

.warehouse-action-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.warehouse-inbound-card {
  gap: 16px;
}

.warehouse-inbound-form {
  display: grid;
  gap: 14px;
}

.warehouse-location-picker-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.warehouse-location-picker-grid label {
  display: grid;
  gap: 10px;
  border: 1px solid #d5e4e6;
  border-radius: 8px;
  padding: 16px;
  background: #fbfdfd;
  color: var(--text);
  font-size: 17px;
  font-weight: 900;
}

.warehouse-location-picker-grid .search-select input {
  min-height: 58px;
  border-radius: 8px;
  padding: 0 48px 0 16px;
  font-size: 18px;
  font-weight: 900;
}

.warehouse-location-picker-grid .search-select::after {
  top: 17px;
  right: 18px;
  font-size: 20px;
}

.warehouse-location-picker-grid .search-options {
  max-height: 280px;
  padding: 8px;
}

.warehouse-location-picker-grid .search-options button {
  display: grid;
  gap: 4px;
  min-height: 64px;
  padding: 10px 12px;
  font-size: 16px;
  font-weight: 900;
}

.warehouse-location-picker-grid .search-options button span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.warehouse-entry-tabs {
  display: inline-flex;
  width: fit-content;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f4f8f8;
}

.warehouse-entry-tabs button {
  border: 0;
  border-radius: 7px;
  padding: 9px 14px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
  cursor: pointer;
}

.warehouse-entry-tabs button.is-active {
  background: #dff4e9;
  color: var(--green);
}

.logistics-capability-note {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 4px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid #cfe0e1;
  border-radius: 8px;
  background: #f7fbfa;
}

.logistics-capability-note strong {
  color: var(--green);
  font-size: 14px;
  font-weight: 950;
}

.logistics-capability-note span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.logistics-entry-tabs {
  margin: 6px 0;
}

.logistics-entry-tabs button {
  min-height: 38px;
  padding: 8px 14px;
  font-size: 14px;
}

.logistics-page {
  display: grid;
  gap: 22px;
}

.logistics-page .panel {
  margin-bottom: 0;
}

.logistics-stack {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.logistics-work-panel {
  display: grid;
  gap: 8px;
}

.logistics-action-panel {
  display: grid;
  gap: 16px;
}

.logistics-query-panel {
  margin-top: 18px;
  border-top: 4px solid #dde8e6;
  box-shadow: 0 10px 26px rgba(20, 40, 38, 0.06);
}

.logistics-query-panel .panel-header {
  padding-bottom: 14px;
  border-bottom: 1px solid #e5eeee;
}

.logistics-work-panel .panel-header {
  margin-bottom: 0;
}

.logistics-page .panel-header {
  align-items: center;
}

.logistics-page .panel-header h2 {
  line-height: 1.25;
}

.logistics-page .panel-header .primary-button,
.logistics-page .panel-header .ghost-button {
  flex: 0 0 auto;
  min-height: 46px;
}

.logistics-main-fields,
.logistics-scan-fields,
.logistics-range-fields,
.logistics-work-panel .warehouse-batch-input,
.logistics-action-panel .warehouse-batch-input,
.logistics-agreement-panel .warehouse-batch-input {
  padding: 13px 14px;
  border: 1px solid #bdd9d5;
  border-radius: 8px;
  background: #f3faf7;
}

.logistics-main-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
}

.logistics-main-fields:has([data-outbound-source-field][hidden]) {
  grid-template-columns: minmax(0, 1fr);
}

.logistics-main-fields label,
.logistics-main-fields .form-field,
.logistics-scan-fields label,
.logistics-range-fields label,
.logistics-work-panel .warehouse-batch-input,
.logistics-action-panel .warehouse-batch-input,
.logistics-agreement-panel .warehouse-batch-input,
.logistics-agreement-panel > label {
  gap: 7px;
  color: var(--green);
  font-size: 15px;
  font-weight: 950;
}

.logistics-main-fields input,
.logistics-main-fields select,
.logistics-scan-fields input,
.logistics-range-fields input,
.logistics-work-panel .warehouse-batch-input textarea,
.logistics-action-panel .warehouse-batch-input textarea,
.logistics-agreement-panel .warehouse-batch-input textarea,
.logistics-agreement-panel > label input {
  min-height: 48px;
  border-color: #b7d3cf;
  border-radius: 8px;
  padding: 10px 13px;
  font-size: 17px;
  font-weight: 900;
}

.logistics-work-panel .search-select input {
  padding-right: 44px;
}

.logistics-page .search-select .search-options {
  font-size: 16px;
}

.logistics-scan-fields input[readonly] {
  background: #fff;
  color: var(--green);
  text-align: right;
}

.logistics-work-panel .warehouse-batch-input textarea,
.logistics-agreement-panel .warehouse-batch-input textarea {
  min-height: 160px;
  font-size: 16px;
}

.logistics-work-panel .primary-button {
  min-height: 48px;
  padding-inline: 20px;
  font-size: 17px;
}

.logistics-work-panel > [data-outbound-panel="single"] {
  display: grid;
  gap: 8px;
}

.logistics-work-panel .logistics-main-fields,
.logistics-work-panel .logistics-scan-fields,
.logistics-work-panel .logistics-range-fields {
  gap: 10px;
  padding: 9px 10px;
  align-items: stretch;
}

.logistics-work-panel .shipment-grid.single {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.logistics-work-panel .logistics-main-fields:has([data-outbound-source-field][hidden]) {
  grid-template-columns: minmax(0, 1fr);
}

.logistics-work-panel .logistics-main-fields:has([data-outbound-producer-field]:not([hidden])) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.logistics-work-panel .logistics-main-fields label,
.logistics-work-panel .logistics-main-fields .form-field,
.logistics-work-panel .logistics-scan-fields label,
.logistics-work-panel .logistics-range-fields label {
  display: grid;
  grid-template-rows: 18px 42px;
  align-content: start;
  gap: 5px;
  font-size: 13px;
  line-height: 1.35;
}

.logistics-work-panel .logistics-main-fields input,
.logistics-work-panel .logistics-main-fields select,
.logistics-work-panel .logistics-scan-fields input,
.logistics-work-panel .logistics-range-fields input,
.logistics-work-panel .logistics-main-fields .search-select input {
  min-height: 42px;
  height: 42px;
  padding: 8px 12px;
  font-size: 16px;
  line-height: 1.2;
}

.logistics-work-panel .logistics-main-fields .form-field > span {
  display: block;
  min-height: 18px;
}

.logistics-work-panel .logistics-main-fields .search-select {
  min-height: 42px;
}

.logistics-work-panel .logistics-preview-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.logistics-work-panel .logistics-preview-grid div {
  display: grid;
  align-content: center;
  min-height: 62px;
  padding: 9px 10px;
  background: #f8fbfb;
}

.logistics-work-panel .logistics-preview-grid span {
  font-size: 11px;
}

.logistics-work-panel .logistics-preview-grid strong {
  font-size: 14px;
  line-height: 1.35;
}

.logistics-action-panel .shipment-grid,
.logistics-agreement-panel .stats-filter-grid,
.logistics-filter-grid {
  align-items: end;
}

.logistics-query-panel .logistics-filter-grid {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid #e0e9e7;
  border-radius: 10px;
  background: #f8fbfb;
}

.logistics-query-panel .timeline {
  margin-top: 18px;
}

.logistics-action-panel .shipment-grid label,
.logistics-action-panel .shipment-grid input,
.logistics-action-panel .shipment-grid select,
.logistics-agreement-panel > label {
  min-width: 0;
}

.logistics-agreement-panel > label {
  display: grid;
  margin-top: 12px;
}

.logistics-page .hint {
  margin: 0;
  line-height: 1.7;
}

.warehouse-batch-input {
  display: grid;
  gap: 8px;
}

.warehouse-batch-input textarea {
  min-height: 172px;
  resize: vertical;
  font-family: "SFMono-Regular", Consolas, monospace;
  line-height: 1.65;
}

.warehouse-batch-result {
  display: grid;
  gap: 8px;
  border: 1px solid #cfe9dc;
  border-radius: 8px;
  padding: 12px;
  background: #f4fbf7;
  color: #526366;
  font-weight: 800;
}

.warehouse-batch-result strong {
  color: var(--green);
  font-size: 16px;
}

.warehouse-batch-result details {
  border-top: 1px solid #dcebea;
  padding-top: 8px;
}

.warehouse-batch-result p {
  margin: 4px 0 0;
}

.logistics-agreement-panel {
  margin-top: 18px;
}

.agreement-transfer-list {
  display: grid;
  gap: 12px;
}

.agreement-transfer-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
  padding: 12px;
}

.agreement-transfer-card summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  cursor: pointer;
}

.agreement-transfer-card summary span,
.agreement-transfer-card summary strong,
.agreement-transfer-card summary em,
.agreement-transfer-card summary b {
  display: block;
}

.agreement-transfer-card summary strong {
  color: var(--ink);
  font-size: 17px;
}

.agreement-transfer-card summary em {
  margin-top: 5px;
  color: var(--muted);
  font-style: normal;
  font-weight: 800;
}

.agreement-transfer-card summary b {
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 13px;
}

.agreement-transfer-card summary b.is-pending {
  background: var(--gold-soft);
  color: var(--gold);
}

.agreement-transfer-card summary b.is-ok {
  background: var(--green-soft);
  color: var(--green);
}

.agreement-transfer-meta {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.agreement-transfer-meta div {
  border: 1px solid #e1eaeb;
  border-radius: 8px;
  background: white;
  padding: 9px 10px;
}

.agreement-transfer-meta span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.agreement-transfer-meta strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 14px;
}

.agreement-code-list {
  display: grid;
  gap: 7px;
  max-height: 280px;
  overflow: auto;
  margin: 12px 0;
  border: 1px solid #e1eaeb;
  border-radius: 8px;
  background: white;
  padding: 8px;
}

.agreement-code-list div {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 7px 8px;
  border-bottom: 1px solid #edf2f2;
}

.agreement-code-list div:last-child {
  border-bottom: 0;
}

.agreement-code-list code {
  color: var(--green);
  font-weight: 900;
}

.agreement-code-list span {
  color: var(--muted);
  font-weight: 800;
}

.is-hidden {
  display: none !important;
}

.warehouse-create-grid .panel,
.warehouse-action-grid .panel {
  display: grid;
  gap: 12px;
  align-content: start;
}

.warehouse-create-card {
  min-height: 360px;
  padding: 24px;
}

.warehouse-create-card.is-important {
  border-color: #99d9c2;
  background: #fbfffd;
  box-shadow: 0 18px 38px rgba(23, 132, 95, 0.08);
}

.warehouse-create-grid h3 {
  margin: 0;
  font-size: 24px;
}

.warehouse-create-card label {
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

.warehouse-create-card input,
.warehouse-create-card select {
  min-height: 54px;
  font-size: 16px;
  font-weight: 900;
}

.warehouse-create-card .primary-button {
  min-height: 54px;
  font-size: 18px;
}

.warehouse-zone-pick {
  display: grid;
  gap: 10px;
  border: 2px solid #9edcc6;
  border-radius: 8px;
  padding: 16px;
  background: #eaf9f2;
}

.warehouse-zone-pick span {
  color: var(--green);
  font-size: 16px;
  font-weight: 900;
}

.warehouse-zone-pick select {
  border-color: var(--green);
  background: #ffffff;
}

.warehouse-zone-pick small {
  color: #4f6265;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.55;
}

.warehouse-create-note {
  margin: 0;
  border: 1px solid #d6e9e2;
  border-radius: 8px;
  padding: 12px;
  background: #f5fbf8;
  color: #526366;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.6;
}

.warehouse-overview-primary {
  margin-bottom: 18px;
}

.warehouse-finder-panel {
  border-color: #b8dcca;
  background: #fbfffd;
}

.warehouse-finder-search {
  min-width: min(520px, 100%);
}

.warehouse-overview-result-summary {
  padding: 12px 14px;
  border: 1px solid #d7ece3;
  border-radius: 8px;
  background: #f3fbf7;
  color: #416258;
  font-size: 14px;
  font-weight: 850;
  line-height: 1.55;
}

.warehouse-overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.9fr);
  gap: 18px;
  margin-bottom: 18px;
}

.inline-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin: 2px 6px 2px 0;
  padding: 5px 8px;
  border-radius: 999px;
  background: #edf7f1;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.warehouse-overview-position-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.warehouse-overview-position-list.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.warehouse-overview-position-list button {
  min-height: 118px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfd;
  text-align: left;
  cursor: pointer;
}

.warehouse-overview-position-list button:hover {
  border-color: #9dd7c2;
  background: #f4fbf7;
}

.warehouse-overview-position-list strong,
.warehouse-overview-position-list span,
.warehouse-overview-position-list em,
.warehouse-overview-position-list small {
  display: block;
}

.warehouse-overview-position-list strong {
  color: var(--text);
  font-size: 17px;
}

.warehouse-overview-position-list span {
  margin-top: 4px;
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, monospace;
}

.warehouse-overview-position-list em {
  margin-top: 10px;
  color: var(--green);
  font-style: normal;
  font-weight: 900;
}

.warehouse-overview-position-list small {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.5;
}

.warehouse-overview-detail {
  display: grid;
  gap: 14px;
}

.warehouse-detail-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.warehouse-detail-cards div {
  min-height: 74px;
  display: grid;
  gap: 5px;
  align-content: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}

.warehouse-detail-cards span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.warehouse-detail-cards strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 16px;
}

.warehouse-position-detail-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.warehouse-position-detail-list span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  background: #edf7f1;
  color: var(--green);
  font-size: 13px;
  font-weight: 850;
}

.muted-cell {
  color: var(--muted);
  font-weight: 800;
}

.warehouse-tabs {
  display: flex;
  gap: 8px;
  margin: 12px 0;
  padding: 4px;
  width: fit-content;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf9;
}

.warehouse-tabs button {
  min-width: 78px;
  border: 0;
  border-radius: 6px;
  padding: 9px 14px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
  cursor: pointer;
}

.warehouse-tabs button.is-active {
  background: #dff5ec;
  color: var(--green);
}

.warehouse-actions {
  align-items: center;
  flex-wrap: wrap;
}

.warehouse-actions select {
  min-width: 150px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #fff;
  font-weight: 800;
}

.compact-timeline {
  display: grid;
  gap: 8px;
}

.compact-timeline div {
  display: grid;
  grid-template-columns: 160px 110px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.warehouse-map-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
  margin-bottom: 16px;
}

.warehouse-zone-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0;
}

.warehouse-zone-tabs button {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  background: #fff;
  color: var(--text);
  font-weight: 900;
  cursor: pointer;
}

.warehouse-zone-tabs button.is-active {
  border-color: var(--green);
  background: #dff5ec;
  color: var(--green);
}

.warehouse-zone-tabs span {
  color: var(--muted);
  font-weight: 800;
}

.warehouse-map-settings {
  display: grid;
  grid-template-columns: 110px 110px auto;
  gap: 10px;
  align-items: end;
}

.warehouse-map-settings label,
.warehouse-map-side label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.warehouse-map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
  align-items: start;
}

.warehouse-map-panel,
.warehouse-map-side {
  display: grid;
  gap: 14px;
}

.warehouse-map-header-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  align-items: center;
}

.warehouse-map-controls {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf9;
}

.warehouse-map-controls .ghost-button {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 13px;
}

.warehouse-map-controls span {
  min-width: 48px;
  color: var(--muted);
  font-weight: 900;
  text-align: center;
}

.warehouse-map-canvas {
  --map-rows: 8;
  --map-cols: 12;
  position: relative;
  height: calc(100vh - 116px);
  min-height: 920px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f4f7f7;
  cursor: grab;
}

.warehouse-map-canvas.is-panning {
  cursor: grabbing;
}

.warehouse-map-stage {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: inherit;
  transform-origin: 0 0;
  transition: transform 0.08s ease-out;
  background:
    linear-gradient(to right, rgba(120, 142, 146, 0.18) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(120, 142, 146, 0.18) 1px, transparent 1px),
    #fbfdfc;
  background-size: calc(100% / var(--map-cols)) calc(100% / var(--map-rows));
}

.warehouse-map-stage .empty-state,
.warehouse-map-canvas > .empty-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 900;
}

.warehouse-location-node,
.warehouse-map-block-node {
  position: absolute;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  width: max(14px, min(92px, calc(100% / var(--map-cols) - 6px)));
  height: max(14px, min(52px, calc(100% / var(--map-rows) - 6px)));
  min-width: 0;
  min-height: 0;
  transform: translate(-50%, -50%);
  border: 1px solid #aebcbf;
  border-left-width: 4px;
  border-radius: 4px;
  padding: 3px 5px;
  background: #d9dddf;
  box-shadow: 0 4px 10px rgba(13, 31, 34, 0.08);
  color: var(--text);
  text-align: left;
  cursor: grab;
  touch-action: none;
  user-select: none;
  z-index: 2;
}

.warehouse-location-node strong,
.warehouse-map-block-node strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: clamp(0px, calc((100% - 10px) * 0.36), 11px);
  line-height: 1.1;
}

.warehouse-location-node span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: clamp(0px, calc((100% - 10px) * 0.28), 9px);
  font-weight: 800;
}

.warehouse-location-node.empty {
  border-color: #d5a742;
  background: #fff1bf;
}

.warehouse-location-node.stock {
  border-color: #188a5b;
  background: #fff1bf;
}

.warehouse-location-node.pallet {
  border-color: #1f66b1;
  background: #fff1bf;
}

.warehouse-map-block-node {
  border-color: #4a5052;
  background: #52595c;
  color: #f5f7f7;
  z-index: 1;
}

.warehouse-map-block-node strong {
  color: #f5f7f7;
}

.warehouse-location-node.is-dragging,
.warehouse-map-block-node.is-dragging {
  z-index: 30;
  cursor: grabbing;
  box-shadow: 0 18px 34px rgba(13, 31, 34, 0.18);
}

.warehouse-location-node:hover {
  z-index: 40;
  border-color: var(--green);
  background: #fff6d8;
}

.warehouse-map-block-node:hover {
  z-index: 40;
  border-color: #24282a;
  background: #41474a;
}

.warehouse-location-node.is-query-match {
  z-index: 12;
  border-color: #e05f22;
  background: #ffe39a;
  box-shadow: 0 0 0 3px rgba(224, 95, 34, 0.16), 0 12px 24px rgba(13, 31, 34, 0.16);
}

.warehouse-location-node.is-query-focus {
  animation: warehouse-query-pulse 0.6s ease-in-out 2;
}

@keyframes warehouse-query-pulse {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
  }

  50% {
    transform: translate(-50%, -50%) scale(1.18);
  }
}

.warehouse-location-node:hover::after,
.warehouse-map-block-node:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 10px);
  top: 0;
  width: 260px;
  max-width: 320px;
  white-space: pre-line;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  box-shadow: 0 16px 34px rgba(13, 31, 34, 0.18);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.55;
  pointer-events: none;
}

.warehouse-map-legend {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfb;
}

.warehouse-map-legend span {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
}

.warehouse-map-legend i {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: #fff;
}

.warehouse-map-legend i.stock {
  border-color: #188a5b;
  background: #dff5ec;
}

.warehouse-map-legend i.pallet {
  border-color: #1f66b1;
  background: #dceaff;
}

.warehouse-map-legend i.blocked {
  border-color: #4a5052;
  background: #52595c;
}

.warehouse-map-side-divider {
  height: 1px;
  background: var(--line);
  margin: 2px 0;
}

.warehouse-map-query-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.warehouse-map-query-result {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fffaf0;
}

.warehouse-map-query-result strong {
  font-size: 15px;
}

.warehouse-map-query-result > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.warehouse-map-query-list {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
}

.warehouse-map-query-list button {
  display: grid;
  gap: 3px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  text-align: left;
}

.warehouse-map-query-list button:hover {
  border-color: var(--gold);
  background: #fff7e8;
}

.warehouse-map-query-list b,
.warehouse-map-query-list span,
.warehouse-map-query-list em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.warehouse-map-query-list span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.warehouse-map-query-list em {
  color: var(--gold);
  font-size: 13px;
  font-style: normal;
  font-weight: 900;
}

.warehouse-map-query-list p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.warehouse-map-detail {
  display: grid;
  gap: 8px;
  min-height: 112px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.warehouse-map-detail strong {
  font-size: 16px;
}

.warehouse-map-detail span {
  color: var(--muted);
  font-weight: 800;
  line-height: 1.45;
}

@media (max-width: 1180px) {
  .warehouse-create-grid,
  .warehouse-action-grid,
  .warehouse-location-picker-grid,
  .warehouse-map-toolbar,
  .warehouse-map-layout,
  .warehouse-overview-grid {
    grid-template-columns: 1fr;
  }

  .warehouse-overview-position-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .warehouse-detail-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .logistics-work-panel .logistics-preview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .logistics-main-fields,
  .logistics-scan-fields,
  .logistics-range-fields,
  .logistics-action-panel .shipment-grid,
  .logistics-filter-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .warehouse-map-settings {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .dashboard-code-quota .quota-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard-code-quota .quota-stats {
    grid-template-columns: 1fr;
  }

  .warehouse-overview-position-list,
  .warehouse-overview-position-list.compact,
  .warehouse-detail-cards {
    grid-template-columns: 1fr;
  }

  .agreement-transfer-meta {
    grid-template-columns: 1fr 1fr;
  }

  .logistics-page .panel-header {
    align-items: stretch;
    flex-direction: column;
  }

  .logistics-page .panel-header .primary-button,
  .logistics-page .panel-header .ghost-button,
  .logistics-entry-tabs {
    width: 100%;
  }

  .logistics-entry-tabs {
    display: grid;
    grid-template-columns: 1fr;
  }

  .logistics-main-fields,
  .logistics-scan-fields,
  .logistics-range-fields,
  .logistics-action-panel .shipment-grid,
  .logistics-filter-grid,
  .logistics-work-panel .logistics-preview-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .agreement-code-list div {
    grid-template-columns: 1fr;
  }

  .timeline-pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .timeline-pagination-controls {
    justify-content: flex-start;
  }
}

.drop-zone {
  margin-top: 14px;
  min-height: 88px;
  display: grid;
  place-items: center;
  border: 1px dashed #95a7aa;
  border-radius: 8px;
  color: var(--muted);
  background: #f8fbfb;
}

.tree-map {
  display: grid;
  gap: 8px;
}

.tree-level {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 14px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fbfcfc;
}

.tree-level span {
  min-width: 78px;
  text-align: right;
  color: var(--green);
  font-weight: 800;
}

.search-box input {
  font-weight: 400;
}

.search-result {
  display: none;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
  padding: 14px;
}

.search-result.is-visible {
  display: block;
}

.search-result p {
  color: var(--muted);
  line-height: 1.6;
}

.channel-page {
  display: grid;
  gap: 0;
}

.channel-workspace {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  align-items: start;
}

.channel-create-panel,
.channel-network-panel {
  padding: 24px;
}

.channel-create-header,
.channel-network-header {
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.channel-create-header h2,
.channel-network-header h2 {
  font-size: 26px;
}

.channel-form-section {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfdfc;
}

.channel-create-panel {
  display: grid;
  gap: 0;
}

.section-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e8eff0;
}

.section-title strong {
  font-size: 17px;
}

.section-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: right;
}

.channel-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.channel-form-grid.single {
  grid-template-columns: 1fr;
}

.channel-form-grid.area-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.channel-form-grid label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.channel-form-grid label.required-field::after {
  content: "必填";
  justify-self: start;
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 8px;
  background: #fff1f0;
  color: var(--red);
  font-size: 11px;
  font-weight: 900;
}

.channel-form-grid .field-wide {
  grid-column: auto;
}

.channel-form-grid input,
.channel-form-grid select {
  min-height: 52px;
  border: 1px solid #cfdcde;
  border-radius: 10px;
  background: white;
  color: var(--text);
  padding: 0 14px;
  font-size: 16px;
  font-weight: 750;
}

.channel-form-grid input::placeholder {
  color: #8b9a9d;
  font-weight: 650;
}

.channel-form-grid input:focus,
.channel-form-grid select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(23, 132, 95, 0.12);
  outline: 0;
}

.channel-match-panel {
  margin-top: 18px;
}

.channel-match-panel .search-result {
  margin-top: 0;
  border-radius: 10px;
  padding: 16px;
  background: #f8fbfb;
}

.channel-match-panel .search-result strong {
  font-size: 16px;
}

.channel-match-panel .search-result .primary-button {
  margin-top: 10px;
  min-height: 44px;
}

.channel-create-actions {
  display: flex;
  justify-content: stretch;
  margin-top: 18px;
}

.channel-create-actions .primary-button {
  width: 100%;
  min-height: 56px;
  font-size: 18px;
  border-radius: 10px;
}

.channel-overview-card,
.channel-table-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfdfc;
  padding: 16px;
}

.channel-overview-card {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
  padding: 14px 16px;
}

.channel-overview-card > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.channel-overview-card strong {
  font-size: 18px;
}

.channel-overview-card > div:first-child span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.channel-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 32px;
}

.channel-breadcrumb button,
.channel-breadcrumb span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: white;
  color: var(--text);
  padding: 0 12px;
  font-size: 12px;
  font-weight: 800;
}

.channel-breadcrumb span {
  background: var(--green-soft);
  color: var(--green);
  border-color: rgba(24, 142, 99, 0.25);
}

.channel-table-card {
  display: grid;
  gap: 12px;
}

.channel-table-toolbar {
  min-height: 0;
  margin-bottom: 0;
  align-items: end;
}

.channel-table-toolbar .table-search {
  width: min(680px, 100%);
}

.channel-table-toolbar input {
  min-height: 48px;
  border-radius: 10px;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
}

.table-scroll .data-table {
  margin: 0;
  min-width: 1060px;
}

.table-scroll th,
.table-scroll td {
  padding: 13px 12px;
}

.table-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.channel-list-controls,
.channel-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.channel-list-controls {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
}

.channel-list-controls span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.channel-pagination {
  justify-content: flex-end;
}

.channel-pagination .ghost-button,
.channel-list-controls .ghost-button {
  min-height: 38px;
  border-radius: 9px;
}

.table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 12px 0 2px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfdfc;
}

.table-pagination[hidden] {
  display: none !important;
}

.table-pagination-summary {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.table-pagination-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.table-page-button,
.table-page-size {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.table-page-button {
  min-width: 36px;
  padding: 0 11px;
}

.table-page-button.is-active {
  border-color: rgba(24, 142, 99, 0.35);
  background: var(--green-soft);
  color: var(--green);
}

.table-page-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.table-page-size {
  padding: 0 30px 0 10px;
}

.stats-filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.stats-filter-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.stats-filter-grid select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 0 10px;
}

.scan-heatmap-hero {
  border-top: 5px solid var(--green);
}

.scan-heatmap-filter-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
  margin-top: 18px;
}

.scan-heatmap-filter-grid .form-field {
  gap: 8px;
}

.scan-heatmap-metrics {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.scan-heatmap-panel {
  overflow: hidden;
}

.scan-heatmap-map-wrap {
  position: relative;
  min-height: 620px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #eef4f2;
}

.scan-heatmap-map {
  width: 100%;
  height: 620px;
}

.scan-heatmap-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  color: #516064;
  font-weight: 900;
  background: rgba(247, 250, 249, 0.86);
  z-index: 5;
}

.scan-heatmap-empty[hidden] {
  display: none;
}

.scan-heatmap-legend {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 6;
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid rgba(217, 226, 228, 0.92);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 30px rgba(22, 32, 34, 0.12);
  color: #415155;
  font-size: 14px;
  font-weight: 900;
}

.scan-heatmap-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.scan-heatmap-legend i,
.scan-map-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  display: inline-block;
  background: var(--dot-color, var(--green));
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px rgba(22, 32, 34, 0.12), 0 4px 12px rgba(22, 32, 34, 0.22);
}

.scan-dot-normal {
  --dot-color: #16845f;
}

.scan-dot-suspected {
  --dot-color: #d88818;
}

.scan-dot-confirmed {
  --dot-color: #cf3d2e;
}

.scan-map-info {
  min-width: 240px;
  display: grid;
  gap: 6px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
}

.scan-map-info strong {
  font-size: 16px;
  color: var(--green);
}

.scan-map-info span,
.scan-map-info em {
  font-style: normal;
  color: #56666a;
}

.scan-heatmap-lists {
  align-items: start;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.scan-heatmap-lists > .panel {
  height: 430px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.scan-heatmap-lists > .panel > .panel-header {
  flex: 0 0 auto;
}

.scan-heatmap-table-scroll {
  overflow: auto;
  min-height: 0;
  flex: 1 1 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.scan-heatmap-table-scroll table {
  width: 100%;
  border: 0;
  table-layout: fixed;
}

.scan-region-rank-table {
  min-width: 0;
}

.scan-anomaly-table {
  min-width: 0;
}

.scan-heatmap-table-scroll thead {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f6faf9;
}

.scan-heatmap-table-scroll th,
.scan-heatmap-table-scroll td {
  white-space: normal;
  vertical-align: top;
  word-break: break-word;
  padding: 10px 8px;
  font-size: 13px;
  line-height: 1.35;
}

.scan-region-rank-table th:nth-child(1),
.scan-region-rank-table td:nth-child(1) {
  width: 23%;
}

.scan-region-rank-table th:nth-child(2),
.scan-region-rank-table td:nth-child(2),
.scan-region-rank-table th:nth-child(3),
.scan-region-rank-table td:nth-child(3),
.scan-region-rank-table th:nth-child(4),
.scan-region-rank-table td:nth-child(4),
.scan-region-rank-table th:nth-child(5),
.scan-region-rank-table td:nth-child(5) {
  width: 8%;
  text-align: right;
  white-space: nowrap;
}

.scan-region-rank-table th:nth-child(6),
.scan-region-rank-table td:nth-child(6) {
  width: 13%;
  text-align: right;
  white-space: nowrap;
}

.scan-region-rank-table th:nth-child(7),
.scan-region-rank-table td:nth-child(7) {
  width: 24%;
  white-space: normal;
  word-break: keep-all;
}

.scan-anomaly-table th:nth-child(1),
.scan-anomaly-table td:nth-child(1) {
  width: 14%;
  white-space: nowrap;
}

.scan-anomaly-table th:nth-child(2),
.scan-anomaly-table td:nth-child(2) {
  width: 31%;
}

.scan-anomaly-table th:nth-child(3),
.scan-anomaly-table td:nth-child(3) {
  width: 25%;
}

.scan-anomaly-table th:nth-child(4),
.scan-anomaly-table td:nth-child(4) {
  width: 11%;
  text-align: right;
  white-space: nowrap;
}

.scan-anomaly-table th:nth-child(5),
.scan-anomaly-table td:nth-child(5) {
  width: 19%;
  white-space: normal;
  word-break: keep-all;
}

.scan-heatmap-table-scroll .tag,
.scan-heatmap-table-scroll .status-pill {
  padding: 4px 8px;
  font-size: 12px;
  line-height: 1.2;
}

.scan-heatmap-table-scroll td strong {
  font-size: 13px;
}

.channel-filter-box {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}

.channel-filter-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.channel-filter-header strong,
.channel-filter-header span {
  display: block;
}

.channel-filter-header span:not(.status-pill) {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.cross-region-rank-panel {
  margin: 22px 0 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
}

.cross-region-rank-panel .panel-header {
  margin-bottom: 12px;
}

.cross-region-rank-panel .compact-stat-filter {
  grid-template-columns: minmax(180px, 1fr) minmax(160px, 1fr) minmax(160px, 1fr);
  gap: 12px;
  margin-top: 0;
}

.cross-region-county-rank {
  margin-top: 12px;
  max-height: 330px;
  overflow: auto;
  display: grid;
  gap: 8px;
}

.cross-region-county-rank div {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px 14px;
  padding: 12px 14px;
  border: 1px solid #dce8e6;
  border-radius: 8px;
  background: #fff;
}

.cross-region-county-rank span {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.cross-region-county-rank em {
  color: var(--green);
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .cross-region-rank-panel .compact-stat-filter {
    grid-template-columns: 1fr;
  }
}

.channel-filter-grid {
  display: grid;
  grid-template-columns: 220px minmax(280px, 1fr);
  gap: 12px;
}

.channel-filter-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.channel-filter-grid select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 0 10px;
}

.channel-pick-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.channel-pick-list button {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--text);
  padding: 8px 12px;
  text-align: left;
}

.channel-pick-list button.is-selected {
  border-color: var(--green);
  background: var(--green-soft);
}

.channel-pick-list button.is-hidden {
  display: none;
}

.channel-pick-list span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.selected-channel-box {
  display: grid;
  gap: 8px;
}

.selected-channel-box strong {
  color: var(--muted);
  font-size: 12px;
}

.selected-channel-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 30px;
}

.selected-channel-tags span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.sales-bars,
.rank-list {
  display: grid;
  gap: 11px;
}

.sales-section-panel {
  margin-bottom: 28px;
  border-top: 5px solid var(--green);
}

.sales-section-panel .panel-header {
  align-items: flex-start;
}

.sales-section-panel .panel-subtitle {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.sales-filter-card {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfb;
}

.sales-filter-grid {
  align-items: end;
  gap: 10px;
}

.sales-product-filter {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.sales-product-filter > strong {
  color: var(--muted);
  font-size: 13px;
}

.sales-product-picks {
  min-width: 0;
}

.sales-product-summary-button {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.sales-product-summary-button:hover {
  border-color: var(--green);
  background: var(--green-soft);
}

.sales-product-summary-button span {
  color: var(--muted);
  font-size: 12px;
}

.sales-summary-strip {
  margin: 16px 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.sales-summary-strip span {
  min-height: 58px;
  display: grid;
  align-content: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
}

.sales-summary-strip strong {
  color: var(--ink);
  font-size: 22px;
}

.sales-date-bars,
.sales-product-rank {
  margin-top: 18px;
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.sales-date-bars {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  min-height: 210px;
  overflow-x: auto;
}

.sales-date-bars div {
  min-width: 58px;
  height: 180px;
  display: grid;
  grid-template-rows: 24px 1fr 24px;
  justify-items: center;
  align-items: end;
  gap: 8px;
}

.sales-date-bars div i {
  width: 28px;
  height: var(--value);
  min-height: 8px;
  border-radius: 8px 8px 2px 2px;
}

.sales-date-bars div span,
.sales-date-bars div strong {
  text-align: center;
}

.sales-section-panel .table-scroll {
  max-height: 460px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.sales-section-panel .table-scroll table {
  margin: 0;
}

.sales-percent-bar {
  display: grid;
  grid-template-columns: 1fr 52px;
  align-items: center;
  gap: 10px;
  min-width: 160px;
  color: var(--muted);
  font-weight: 800;
}

.sales-percent-bar.compact {
  min-width: 110px;
  grid-template-columns: 1fr 44px;
}

.sales-product-modal {
  max-width: 760px;
}

.sales-product-modal-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.sales-product-check-list {
  max-height: 430px;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.sales-product-check {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  font-weight: 800;
}

.sales-product-check input {
  width: 18px;
  height: 18px;
}

.sales-percent-bar i {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--green), var(--blue));
  width: var(--value);
  min-width: 6px;
}

.sales-bars div,
.rank-list div {
  display: grid;
  grid-template-columns: 74px 1fr 86px;
  align-items: center;
  gap: 12px;
}

.sales-bars span,
.rank-list span {
  color: var(--muted);
  font-size: 12px;
}

.sales-bars i,
.rank-list i {
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--green), var(--blue));
  width: var(--value);
  min-width: 8px;
}

.sales-bars strong,
.rank-list strong {
  font-size: 13px;
}

.rank-list div {
  grid-template-columns: 1fr 80px 120px;
}

.sales-date-bars div {
  min-width: 58px;
  height: 180px;
  display: grid;
  grid-template-columns: none;
  grid-template-rows: 24px 1fr 24px;
  justify-items: center;
  align-items: end;
  gap: 8px;
}

.sales-date-bars i {
  width: 28px;
  height: var(--value);
  min-height: 8px;
  border-radius: 8px 8px 2px 2px;
}

.sales-product-rank {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  min-height: 230px;
  overflow-x: auto;
}

.sales-product-rank div {
  min-width: 92px;
  height: 198px;
  display: grid;
  grid-template-columns: none;
  grid-template-rows: 28px 1fr 44px;
  justify-items: center;
  align-items: end;
  gap: 8px;
}

.sales-product-rank div i {
  width: 34px;
  height: var(--value);
  min-height: 8px;
  border-radius: 9px 9px 2px 2px;
}

.sales-product-rank div span {
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
}

.sales-product-rank div strong {
  width: 100%;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
  text-align: center;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sales-product-rank .empty-product-rank {
  min-width: 100%;
  height: auto;
  min-height: 120px;
  grid-template-rows: auto auto auto;
  align-content: center;
}

.inventory-ratio {
  display: grid;
  gap: 12px;
}

.inventory-ratio-bar {
  height: 22px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--green-soft);
  overflow: hidden;
}

.inventory-ratio-bar i {
  display: block;
  width: var(--value);
  height: 100%;
  background: var(--gold);
}

.inventory-section-panel {
  margin-top: 24px;
}

.inventory-section-panel .panel-header span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.inventory-level-ratio-bar {
  display: flex;
}

.inventory-level-ratio-bar i {
  width: var(--value);
  min-width: 0;
  flex: 0 0 var(--value);
}

.inventory-level-ratio-bar .segment-1 {
  background: var(--green);
}

.inventory-level-ratio-bar .segment-2 {
  background: var(--blue);
}

.inventory-level-ratio-bar .segment-3 {
  background: var(--gold);
}

.inventory-ratio-legend {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.timeline {
  display: grid;
  gap: 12px;
}

.timeline div {
  min-height: 56px;
  border-bottom: 1px solid #edf1f2;
}

.timeline div.is-agreement-pending {
  border: 1px dashed var(--gold);
  border-radius: 8px;
  padding: 8px 10px;
  margin: 6px 0;
  background: #fffaf0;
}

.timeline time {
  color: var(--muted);
  font-size: 12px;
}

.timeline span {
  color: var(--muted);
}

.timeline .logistics-flow-item {
  display: block;
  min-height: 0;
  padding: 14px 16px;
  border: 1px solid #dbe7e7;
  border-radius: 10px;
  background: #fff;
}

.timeline .logistics-flow-item.is-agreement-pending {
  border: 1px dashed var(--gold);
  background: #fffaf0;
}

.logistics-flow-item time,
.logistics-flow-item b,
.logistics-flow-item span,
.logistics-flow-item small,
.logistics-flow-item em {
  display: block;
}

.logistics-flow-item time {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.logistics-flow-item b {
  margin-bottom: 8px;
}

.logistics-flow-route {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 72px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  color: var(--text) !important;
  font-size: 18px;
  font-weight: 950;
  line-height: 1.4;
}

.logistics-flow-node {
  min-width: 0;
  color: #607174;
  font: inherit;
  line-height: 1.35;
  word-break: break-word;
}

.logistics-flow-node:first-child {
  text-align: right;
}

.logistics-flow-node:last-child {
  text-align: left;
}

.logistics-flow-route i {
  display: block;
  position: relative;
  width: 72px;
  min-width: 72px;
  height: 18px;
  margin: 0;
  color: transparent;
  font-style: normal;
  font-size: 0;
  font-weight: 950;
  line-height: 0;
}

.logistics-flow-route i::before {
  content: "";
  position: absolute;
  left: 0;
  right: 10px;
  top: 50%;
  border-top: 3px solid var(--green);
  transform: translateY(-50%);
}

.logistics-flow-route i::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  width: 0;
  height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 11px solid var(--green);
  transform: translateY(-50%);
}

.logistics-flow-item.is-agreement-pending .logistics-flow-route i::before {
  border-top-style: dashed;
}

.special-code-hero {
  border-top: 5px solid var(--green);
}

.special-code-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.special-code-action-card {
  min-height: 100%;
}

.special-code-action-card .primary-button,
.special-flow-editor .primary-button {
  width: 100%;
  justify-content: center;
  min-height: 52px;
  margin-top: 12px;
}

.special-section-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.special-source-hint {
  grid-column: 1 / -1;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  background: #eff6ff;
  color: #1d4ed8;
  padding: 12px 14px;
  font-weight: 800;
  line-height: 1.6;
}

.special-section-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-soft);
  padding: 18px;
  display: grid;
  gap: 16px;
}

.special-section-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.special-section-card header strong {
  display: block;
  font-size: 18px;
  color: var(--text);
}

.special-section-card header span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.special-section-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.special-section-actions .ghost-button {
  min-width: 112px;
  min-height: 36px;
  padding: 0 12px;
  font-size: 13px;
}

.special-field-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.special-field-item {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 800;
  font-size: 13px;
}

.special-field-item:has(textarea) {
  grid-column: 1 / -1;
}

.special-field-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.special-field-title > span:first-child {
  color: var(--muted);
}

.special-field-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid #b7e4d1;
  border-radius: 999px;
  background: #f0fdf4;
  color: #087a55;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.special-field-toggle input {
  width: 14px;
  height: 14px;
  min-height: 0;
  margin: 0;
}

.special-field-grid input,
.special-field-grid textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  background: #fff;
  font: inherit;
  color: var(--text);
}

.special-field-grid textarea {
  min-height: 116px;
  resize: vertical;
  line-height: 1.55;
}

.special-section-card .ghost-button {
  justify-self: end;
  min-width: 180px;
  min-height: 46px;
}

.special-override-editor {
  border-top: 5px solid #2f8f73;
}

.special-flow-editor {
  margin-top: 18px;
}

.special-flow-layout {
  display: grid;
  gap: 16px;
}

.special-flow-block {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 18px;
  display: grid;
  gap: 14px;
}

.special-flow-settings-block {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.special-flow-block-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.special-flow-block-title strong {
  color: var(--text);
  font-size: 20px;
}

.special-flow-block-title span {
  color: var(--muted);
  font-weight: 700;
}

.special-flow-switch {
  border: 1px solid #a7f3d0;
  border-radius: 14px;
  background: #ffffff;
  padding: 16px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.special-flow-switch input {
  width: 22px;
  height: 22px;
  margin-top: 4px;
}

.special-flow-switch strong,
.special-flow-switch em {
  display: block;
}

.special-flow-switch strong {
  font-size: 18px;
  color: var(--text);
}

.special-flow-switch em {
  margin-top: 4px;
  color: var(--muted);
  font-style: normal;
  line-height: 1.55;
}

.special-flow-mode-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 14px;
}

.special-flow-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.special-flow-form-grid label,
.special-flow-mode-row label,
.special-flow-note-field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 800;
}

.special-flow-form-grid input,
.special-flow-form-grid select,
.special-flow-mode-row select,
.special-flow-note-field textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-weight: 800;
}

.special-flow-note-field textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.55;
}

.special-flow-settings-button {
  min-height: 46px;
  min-width: 180px;
}

.special-flow-add-button {
  justify-self: end;
  min-width: 220px;
  min-height: 52px;
}

.special-flow-editor .rule-list {
  margin-top: 0;
}

.special-flow-list {
  display: grid;
  gap: 12px;
}

.special-flow-list-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-soft);
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 14px;
}

.special-flow-list-item strong,
.special-flow-list-item em,
.special-flow-list-item p {
  display: block;
}

.special-flow-list-item strong {
  margin-top: 8px;
  font-size: 18px;
  color: var(--text);
}

.special-flow-list-item em {
  margin-top: 6px;
  color: var(--muted);
  font-style: normal;
  font-weight: 800;
}

.special-flow-list-item p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.special-flow-list-empty {
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 18px;
  color: var(--muted);
}

.special-flow-editor .rule-list button {
  min-height: 34px;
}

@media (max-width: 980px) {
  .special-code-grid,
  .special-section-grid,
  .special-field-grid,
  .special-flow-form-grid,
  .special-flow-mode-row {
    grid-template-columns: 1fr;
  }

  .special-flow-block-title {
    align-items: flex-start;
    flex-direction: column;
  }
}

.logistics-flow-item small {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.7;
}

.logistics-flow-item em {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  font-style: normal;
  line-height: 1.65;
}

.timeline-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.timeline-pagination[hidden] {
  display: none;
}

.timeline-pagination-summary {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.timeline-pagination-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.timeline-pagination-controls button {
  min-width: 38px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 900;
}

.timeline-pagination-controls button.is-active {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.timeline-pagination-controls button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.timeline-pagination-ellipsis {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font-weight: 900;
}

.flow-tag {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 9px;
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
}

.flow-tag.outbound {
  background: var(--green-soft);
  color: var(--green);
}

.flow-tag.auto {
  background: var(--blue-soft);
  color: var(--blue);
}

.flow-tag.return {
  background: var(--red-soft);
  color: var(--red);
}

.flow-tag.transfer {
  background: var(--gold-soft);
  color: var(--gold);
}

.flow-tag.agreement {
  background: #e6f0ff;
  color: #2365b8;
}

.logistics-record-row {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1.05fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid #dbe7e7;
  border-radius: 10px;
  background: #fff;
}

.logistics-record-main,
.logistics-record-route,
.logistics-record-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logistics-record-main time {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 900;
  color: var(--muted);
}

.logistics-record-main strong,
.logistics-record-main span:last-child,
.logistics-record-route span,
.logistics-record-actions small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logistics-record-main strong {
  max-width: 210px;
  font-size: 15px;
}

.logistics-record-main span:last-child,
.logistics-record-route span,
.logistics-record-actions small {
  color: var(--muted);
  font-weight: 800;
}

.logistics-record-route {
  justify-content: center;
  color: var(--ink);
}

.logistics-record-route i {
  flex: 0 0 28px;
  color: var(--green);
  font-style: normal;
  font-weight: 950;
  text-align: center;
}

.logistics-record-actions {
  justify-content: flex-end;
}

.logistics-record-actions .small {
  min-height: 34px;
  padding: 0 12px;
  white-space: nowrap;
}

.logistics-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.logistics-detail-grid > div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  background: #fbfdfc;
  display: grid;
  gap: 5px;
}

.logistics-detail-grid span,
.logistics-level-row span,
.logistics-level-row em {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  font-style: normal;
}

.logistics-detail-grid strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.logistics-level-list {
  display: grid;
  gap: 8px;
}

.logistics-level-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.logistics-level-row:hover {
  border-color: var(--green);
  background: #f0fdf7;
}

.logistics-code-detail {
  margin-top: 14px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 14px;
  background: #fbfdfc;
}

.compact-code-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  max-height: 320px;
  overflow: auto;
}

.compact-code-list code {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  font-size: 13px;
  font-weight: 850;
}

@media (max-width: 1200px) {
  .logistics-record-row {
    grid-template-columns: 1fr;
  }

  .logistics-record-route {
    justify-content: flex-start;
  }

  .logistics-record-actions {
    justify-content: space-between;
  }
}

.trace-preview-layout {
  grid-template-columns: minmax(0, 0.8fr) minmax(360px, 0.6fr);
}

.public-page {
  max-width: 760px;
}

.public-hero {
  background: #eff8f4;
  border: 1px solid #c8e6da;
  border-radius: 8px;
  padding: 24px;
}

.public-hero h2 {
  margin: 14px 0 8px;
  font-size: 28px;
}

.public-hero p {
  color: var(--muted);
  margin-bottom: 0;
}

.public-info {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.public-info div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfc;
}

.public-info span,
.public-info strong {
  display: block;
}

.public-info span {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}

.public-chain {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 14px;
}

.public-chain p {
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 0;
}

.public-chain i {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 0 8px;
  margin-left: 4px;
  background: var(--green-soft);
  color: var(--green);
  font-style: normal;
  font-size: 12px;
}

.template-preview-hero h2 {
  margin-top: 0;
}

.template-preview-section {
  overflow: hidden;
  margin: 14px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.template-preview-section h3 {
  margin: 0;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--green-soft);
  color: var(--green);
  font-size: 17px;
}

.template-preview-section > div {
  padding: 4px 14px 12px;
}

.template-preview-line {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 9px 0;
  border-bottom: 1px solid #edf2f2;
}

.template-preview-line:last-child {
  border-bottom: 0;
}

.template-preview-line span {
  color: var(--muted);
  font-weight: 800;
}

.template-preview-line strong {
  min-width: 0;
  color: var(--text);
  line-height: 1.55;
  word-break: break-word;
}

.template-material-card {
  padding: 10px 0;
  border-bottom: 1px solid #edf2f2;
}

.template-material-card:last-child {
  border-bottom: 0;
}

.template-material-card > strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

.template-flow-item {
  padding: 10px 0;
  border-bottom: 1px solid #edf2f2;
}

.template-flow-item:last-child {
  border-bottom: 0;
}

.template-flow-item time,
.template-flow-item b,
.template-flow-item span,
.template-flow-item em {
  display: block;
}

.template-flow-item time {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 5px;
}

.template-flow-item b {
  color: var(--text);
  line-height: 1.5;
}

.template-flow-item span {
  margin-top: 4px;
  line-height: 1.55;
}

.template-flow-item em {
  margin-top: 5px;
  color: var(--muted);
  font-style: normal;
  font-size: 13px;
  line-height: 1.55;
}

.template-flow-route {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 48px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  font-weight: 800;
  line-height: 1.4;
}

.template-flow-node {
  min-width: 0;
  font: inherit;
  line-height: 1.35;
  word-break: break-word;
}

.template-flow-node:first-child {
  text-align: right;
}

.template-flow-node:last-child {
  text-align: left;
}

.template-flow-route i {
  display: block;
  position: relative;
  width: 48px;
  min-width: 48px;
  height: 16px;
  margin: 0;
  text-align: center;
  color: transparent;
  font-size: 0;
  line-height: 0;
  font-style: normal;
  font-weight: 900;
}

.template-flow-route i::before {
  content: "";
  position: absolute;
  left: 0;
  right: 8px;
  top: 50%;
  border-top: 2px solid var(--green);
  transform: translateY(-50%);
}

.template-flow-route i::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 9px solid var(--green);
  transform: translateY(-50%);
}

.template-flow-item.is-agreement-pending .template-flow-route i::before {
  border-top-style: dashed;
}

.template-preview-subtitle {
  margin: 12px 0 4px;
  padding: 0 0 0 8px !important;
  border-left: 4px solid var(--green);
  color: #116247;
  font-weight: 900;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 32px;
  background: rgba(15, 24, 25, 0.46);
}

.modal-backdrop.is-open {
  display: grid;
}

.modal-backdrop[hidden] {
  display: none;
}

.confirm-backdrop {
  z-index: 40;
}

.modal-panel {
  width: min(720px, 100%);
  max-height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.22);
}

#codeModal .modal-panel {
  width: min(1080px, 100%);
}

#batchInfoModal .modal-panel {
  width: min(860px, calc(100vw - 64px));
}

#createProducerModal .modal-panel {
  width: min(920px, calc(100vw - 64px));
}

.create-producer-grid {
  align-items: start;
}

#companyDetailModal .modal-panel {
  width: min(920px, calc(100vw - 64px));
}

.company-detail-grid,
.company-detail-files {
  display: grid;
  gap: 12px;
}

.company-detail-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.company-detail-grid > div,
.company-detail-files > div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
  padding: 12px 14px;
}

.company-detail-grid .field-wide {
  grid-column: 1 / -1;
}

.company-detail-grid span,
.company-detail-files span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.company-detail-grid strong,
.company-detail-files strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 16px;
  font-weight: 900;
  line-height: 1.45;
  word-break: break-word;
}

.company-detail-files {
  margin-top: 16px;
}

.company-detail-files h3 {
  margin: 0;
  font-size: 20px;
}

.batch-products-panel {
  width: min(1180px, calc(100vw - 48px));
}

#batchAdModal .modal-panel {
  width: min(820px, calc(100vw - 64px));
}

#productExplanationModal .modal-panel {
  width: min(980px, calc(100vw - 64px));
}

#batchInfoModal .modal-body {
  padding-bottom: 24px;
}

.compact-note {
  margin: 0;
  padding: 12px 14px;
}

.batch-products-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 16px;
}

.batch-products-section {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
  padding: 14px;
}

.subsection-header.compact {
  margin: 0;
}

.subsection-header.compact h3 {
  margin: 0;
  font-size: 20px;
}

.subsection-header.compact p {
  margin: 4px 0 0;
}

.batch-product-level-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.batch-product-level-card {
  min-height: 94px;
  display: grid;
  gap: 6px;
  justify-items: start;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 14px;
  text-align: left;
  cursor: pointer;
}

.batch-product-level-card.is-active {
  border-color: var(--green);
  background: #eefaf4;
  box-shadow: 0 10px 22px rgba(24, 136, 96, 0.12);
}

.batch-product-level-card strong {
  font-size: 20px;
}

.batch-product-level-card span {
  color: var(--muted);
  font-weight: 900;
}

.batch-product-level-card em {
  color: var(--green);
  font-style: normal;
  font-size: 24px;
  font-weight: 1000;
}

.batch-product-position-list {
  max-height: 260px;
  overflow: auto;
  display: grid;
  gap: 8px;
}

.batch-product-position-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  width: 100%;
}

.batch-product-position-item strong,
.batch-product-position-item span,
.batch-product-position-item em {
  display: block;
}

.batch-product-position-item strong {
  font-size: 20px;
}

.batch-product-position-item span {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 800;
}

.batch-product-position-item em {
  margin-top: 6px;
  color: var(--green);
  font-style: normal;
  font-size: 22px;
  font-weight: 1000;
}

.batch-product-position-item.is-active {
  border-color: var(--green);
  background: #eefaf4;
  box-shadow: 0 10px 22px rgba(24, 136, 96, 0.12);
}

.compact-toolbar {
  margin: 0;
  align-items: end;
}

.my-printer-list {
  display: grid;
  gap: 16px;
}

.my-printer-card {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 18px;
}

.my-printer-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.my-printer-card-header h3 {
  margin: 2px 0 8px;
  font-size: 28px;
}

.my-printer-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 900;
}

.my-printer-stats {
  min-width: 110px;
  display: grid;
  justify-items: end;
  gap: 2px;
}

.my-printer-stats strong {
  color: var(--green);
  font-size: 34px;
  line-height: 1;
}

.my-printer-stats span {
  color: var(--muted);
  font-weight: 900;
}

.my-printer-info-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.my-printer-info-grid > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
  padding: 12px;
}

.my-printer-info-grid span,
.my-printer-products > strong {
  display: block;
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

.my-printer-info-grid strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 18px;
  word-break: break-word;
}

.my-printer-products {
  display: grid;
  gap: 8px;
}

.my-printer-products div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.my-printer-products span {
  border: 1px solid #cfe7dc;
  border-radius: 999px;
  background: #edf8f2;
  color: var(--green);
  padding: 7px 11px;
  font-weight: 900;
}

.my-printer-runs {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.my-printer-runs summary {
  cursor: pointer;
  background: #f5f8f8;
  padding: 12px 14px;
  color: var(--text);
  font-size: 18px;
  font-weight: 1000;
}

.my-printer-runs table {
  border: 0;
  border-radius: 0;
}

@media (max-width: 980px) {
  .my-printer-card-header {
    display: grid;
  }

  .my-printer-stats {
    justify-items: start;
  }

  .my-printer-info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .batch-products-layout,
  .batch-product-level-grid {
    grid-template-columns: 1fr;
  }
}

.batch-material-panel {
  width: min(900px, calc(100vw - 64px));
}

.raw-material-info-panel {
  width: min(1080px, calc(100vw - 64px));
}

.raw-material-info-sections {
  display: grid;
  gap: 14px;
}

.info-section-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}

.raw-material-info-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.raw-material-report-upload {
  margin-top: 2px;
}

.batch-material-search {
  max-width: none;
}

.batch-material-choice-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.batch-material-choice {
  min-height: 82px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 4px 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  text-align: left;
}

.batch-material-choice span {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--green);
  font-weight: 900;
}

.batch-material-choice strong,
.batch-material-choice em {
  display: block;
  min-width: 0;
}

.batch-material-choice strong {
  font-size: 15px;
}

.batch-material-choice em {
  grid-column: 2;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.5;
}

.batch-material-choice.is-selected {
  border-color: var(--green);
  background: var(--green-soft);
}

.batch-material-trace-check {
  margin-top: 0;
}

.batch-quality-panel {
  width: min(940px, calc(100vw - 64px));
}

.quality-mode-tabs {
  margin: 12px 0;
}

.quality-indicator-grid {
  display: grid;
  gap: 10px;
}

.quality-indicator-grid.is-disabled {
  opacity: 0.48;
  pointer-events: none;
}

.quality-indicator-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.1fr) minmax(130px, 0.8fr) minmax(130px, 0.8fr) minmax(130px, 0.8fr) auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
}

.quality-indicator-row label {
  min-width: 0;
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 800;
}

.quality-indicator-row input,
.quality-indicator-row select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-weight: 800;
  padding: 0 12px;
}

.trace-quality-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.trace-quality-list div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfdfc;
}

.trace-quality-list span,
.trace-quality-list strong {
  display: block;
}

.trace-quality-list span {
  color: var(--muted);
  font-size: 12px;
}

.trace-quality-list strong {
  margin-top: 4px;
  color: var(--green);
  font-size: 17px;
}

.compact-modal {
  width: min(560px, 100%);
  overflow: visible;
}

.auth-modal {
  width: min(500px, 100%);
}

.compact-modal .modal-body {
  overflow: visible;
}

#stockAdjustModal .compact-modal {
  width: min(680px, calc(100vw - 64px));
  max-height: calc(100vh - 64px);
  overflow: hidden;
}

#stockAdjustModal .modal-body {
  overflow: auto;
  padding-bottom: 18px;
}

#stockAdjustModal .code-modal-summary {
  gap: 5px;
}

#stockAdjustModal .code-modal-summary em {
  display: block;
  color: var(--muted);
  font-size: 14px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.45;
}

.stock-adjust-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 0;
}

.stock-adjust-grid label:nth-child(3),
.stock-adjust-grid label:nth-child(4),
.stock-adjust-grid label:nth-child(8) {
  grid-column: 1 / -1;
}

.compact-modal .search-select {
  z-index: 3;
}

.compact-modal .search-options {
  z-index: 60;
  max-height: 150px;
}

.modal-checkline {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  color: var(--text);
  font-weight: 800;
}

.modal-checkline input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

.material-complete-check {
  width: 100%;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
  box-sizing: border-box;
}

.material-complete-check input[type="checkbox"] {
  width: 22px;
  height: 22px;
  min-height: 22px;
  margin: 2px 0 0;
  padding: 0;
  border-radius: 5px;
  flex: none;
  accent-color: var(--green);
}

.material-complete-check label {
  display: grid;
  gap: 4px;
  min-width: 0;
  margin: 0;
  color: var(--text);
  font-weight: 800;
  line-height: 1.45;
}

.material-complete-check small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.6;
}

.modal-header,
.modal-actions,
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
}

.modal-header {
  border-bottom: 1px solid var(--line);
}

.modal-actions,
.modal-footer {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  background: var(--panel-soft);
}

.modal-footer .ghost-button,
.modal-footer .primary-button {
  min-width: 112px;
  min-height: 44px;
}

.modal-body {
  display: grid;
  gap: 14px;
  overflow: auto;
  padding: 20px 22px 32px;
  scrollbar-width: auto;
  scrollbar-color: #9eaaad #eef3f2;
}

.modal-body::-webkit-scrollbar {
  width: 14px;
  height: 14px;
}

.modal-body::-webkit-scrollbar-track {
  background: #eef3f2;
  border-radius: 999px;
}

.modal-body::-webkit-scrollbar-thumb {
  min-height: 54px;
  border: 3px solid #eef3f2;
  border-radius: 999px;
  background: #9eaaad;
}

.modal-body::-webkit-scrollbar-thumb:hover {
  background: #7c888b;
}

#codeModal .modal-body {
  padding-bottom: 112px;
}

.code-modal-summary {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}

.code-modal-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.code-modal-summary strong {
  font-size: 18px;
}

.modal-note {
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--blue-soft);
  color: #244f88;
  font-size: 13px;
  line-height: 1.6;
}

.code-modal-error {
  padding: 12px 14px;
  border: 1px solid #f0b8b3;
  border-radius: 8px;
  background: #fff3f1;
  color: #b42318;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
}

.code-level-list {
  display: grid;
  gap: 10px;
}

.code-level-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 240px) 148px 170px;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.code-level-row.is-invalid {
  border-color: #f0b8b3;
  background: #fffaf9;
  box-shadow: 0 0 0 2px rgba(180, 35, 24, 0.08);
}

@media (max-width: 760px) {
  .modal-backdrop {
    padding: 12px;
  }

  .production-form-grid,
  .attachment-upload-grid {
    grid-template-columns: 1fr;
  }

  .form-card-title {
    display: grid;
    align-items: start;
  }

  .code-level-row {
    grid-template-columns: 1fr;
  }

  .code-waste-control {
    grid-template-columns: 1fr;
  }

  .code-level-row label {
    max-width: 240px;
  }
}

.code-level-row strong,
.code-level-row span,
.code-level-row em {
  display: block;
}

.code-level-row span {
  color: var(--text);
  font-weight: 800;
}

.code-level-row em {
  margin-top: 3px;
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}

.code-level-digits {
  justify-self: start;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.code-level-row label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.code-level-row input.is-invalid,
.code-waste-control input.is-invalid {
  border-color: #d92d20;
  box-shadow: 0 0 0 3px rgba(217, 45, 32, 0.12);
}

.code-field-error {
  min-height: 16px;
  color: #b42318;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.code-ratio-empty {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.code-ratio-empty em {
  margin: 0;
}

.code-waste-control {
  display: grid;
  grid-template-columns: minmax(180px, 260px) 1fr;
  align-items: end;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}

.code-waste-control label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.code-waste-control span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.confirm-panel {
  width: min(620px, 100%);
}

.confirm-lines {
  display: grid;
  gap: 8px;
}

.confirm-lines div {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
  color: var(--text);
  font-weight: 800;
}

.code-package-panel {
  width: min(760px, 100%);
}

.code-preview-panel {
  width: min(920px, 100%);
}

.code-package-levels {
  display: grid;
  gap: 10px;
}

.code-package-level-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.code-package-level-row strong,
.code-package-level-row span {
  display: block;
}

.code-package-level-row strong {
  color: var(--text);
  font-weight: 900;
}

.code-package-level-row span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.code-preview-modes {
  justify-self: start;
}

.code-preview-textarea {
  min-height: 420px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre;
}

.single-qr-panel {
  width: min(840px, 100%);
}

.qr-package-tabs {
  justify-self: start;
}

.qr-tab-panel {
  display: grid;
  gap: 12px;
}

.qr-range-list {
  display: grid;
  gap: 8px;
}

.qr-range-row {
  display: grid;
  grid-template-columns: 150px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.qr-range-row strong,
.qr-range-row span,
.qr-range-row em {
  display: block;
}

.qr-range-row strong {
  font-weight: 900;
}

.qr-range-row span {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}

.qr-range-row em {
  color: var(--green);
  font-style: normal;
  font-weight: 800;
}

.single-qr-form {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}

.single-qr-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.single-qr-form input {
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--text);
  background: white;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 800;
}

.single-qr-result {
  display: grid;
  grid-template-columns: 340px 1fr;
  align-items: center;
  gap: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.single-qr-canvas {
  width: 340px;
  min-height: 368px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.single-qr-canvas img {
  width: 316px;
  height: auto;
  display: block;
}

.single-qr-meta {
  display: grid;
  gap: 8px;
}

.single-qr-meta strong {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 22px;
}

.single-qr-meta span {
  color: var(--muted);
  word-break: break-all;
}

.single-qr-save-tip {
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--green-soft);
  color: var(--green) !important;
  font-weight: 800;
  line-height: 1.5;
}

.warehouse-qr-panel {
  width: min(780px, 100%);
}

.warehouse-qr-body {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
}

.warehouse-qr-preview {
  display: grid;
  place-items: center;
  width: 360px;
  min-height: 432px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.warehouse-qr-preview img {
  display: block;
  width: 100%;
  height: auto;
}

.warehouse-qr-info {
  display: grid;
  min-width: 0;
  gap: 12px;
}

.warehouse-qr-info div {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}

.warehouse-qr-info span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.warehouse-qr-info strong {
  display: block;
  color: var(--text);
  font-size: 22px;
  font-weight: 900;
  word-break: break-all;
}

.warehouse-qr-info p {
  margin: 0;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--green-soft);
  color: var(--green);
  font-weight: 800;
  line-height: 1.55;
}

.modal-panel.spec-package-image-panel {
  width: min(980px, calc(100vw - 28px));
}

.spec-package-image-body {
  display: grid;
  grid-template-columns: minmax(320px, 1.05fr) minmax(280px, .95fr);
  gap: 20px;
  align-items: stretch;
}

.spec-package-image-preview {
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(135deg, #f5faf8, #eef4f2);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.spec-package-image-preview span {
  color: var(--muted);
  font-size: 18px;
  font-weight: 1000;
}

.spec-package-image-preview img {
  width: 100%;
  height: 100%;
  max-height: 560px;
  object-fit: contain;
  background: #fff;
}

.spec-package-image-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.file-picker {
  display: grid;
  gap: 10px;
  border: 1px dashed #b9cbc8;
  border-radius: 12px;
  padding: 16px;
  background: #fbfdfc;
}

.file-picker span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 1000;
}

.file-picker input {
  width: 100%;
}

@media (max-width: 1240px) {
  .warehouse-qr-body {
    grid-template-columns: 1fr;
  }

  .warehouse-qr-preview {
    justify-self: center;
    width: 100%;
    max-width: 360px;
  }

  .spec-package-image-body {
    grid-template-columns: 1fr;
  }

  .spec-package-image-preview {
    min-height: 280px;
  }
}

.qr-pdf-panel {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}

.qr-tab-panel {
  min-width: 0;
}

.compact-header {
  padding: 0;
  border: 0;
}

.compact-header h3 {
  margin: 0;
  font-size: 20px;
}

.qr-pdf-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 10px;
}

.qr-pdf-controls label,
.qr-custom-range label {
  display: grid;
  min-width: 0;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.qr-pdf-controls select,
.qr-custom-range select,
.qr-custom-range input {
  width: 100%;
  min-width: 0;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: white;
  color: var(--text);
  font-weight: 800;
  text-overflow: ellipsis;
}

.qr-custom-range {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.qr-custom-range > div {
  grid-column: 1 / -1;
  min-width: 0;
}

.qr-custom-range .table-action,
.qr-range-reference-row .table-action {
  min-width: 0;
  white-space: normal;
}

.qr-custom-range .table-action {
  justify-self: start;
}

.qr-custom-range label:nth-of-type(1),
.qr-custom-range label:nth-of-type(2) {
  grid-column: span 2;
}

.qr-custom-range label:nth-of-type(3),
.qr-custom-range label:nth-of-type(4) {
  grid-column: span 2;
}

.qr-custom-range #buildQrPdfRange {
  grid-column: 1 / -1;
}

.qr-custom-range strong,
.qr-custom-range span {
  display: block;
}

.qr-custom-range strong {
  color: var(--text);
  font-weight: 900;
}

.qr-custom-range span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.qr-pdf-segments {
  max-height: 260px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  overflow: auto;
  padding: 2px;
}

.qr-pdf-segments .table-action {
  min-height: 42px;
  justify-content: flex-start;
  text-align: left;
  white-space: normal;
}

.qr-range-reference {
  display: grid;
  gap: 8px;
}

.qr-range-reference-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.qr-range-reference-row > div {
  min-width: 0;
}

.qr-range-reference-row strong,
.qr-range-reference-row span,
.qr-range-reference-row em {
  display: block;
}

.qr-range-reference-row span {
  margin-top: 5px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.qr-range-reference-row em {
  margin-top: 4px;
  color: var(--green);
  font-style: normal;
  font-weight: 800;
}

.qr-pdf-progress {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.qr-pdf-progress div {
  display: grid;
  gap: 6px;
}

.qr-pdf-progress span,
.qr-pdf-progress strong {
  color: var(--muted);
  font-size: 13px;
}

.qr-pdf-progress progress {
  grid-column: 1 / -1;
  width: 100%;
  height: 12px;
  accent-color: var(--green);
}

.qr-pdf-progress .table-action {
  justify-self: end;
  width: auto;
  min-width: 120px;
}

@media (max-width: 1100px) {
  .qr-custom-range {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .qr-custom-range label:nth-of-type(1),
  .qr-custom-range label:nth-of-type(2),
  .qr-custom-range label:nth-of-type(3),
  .qr-custom-range label:nth-of-type(4) {
    grid-column: span 1;
  }
}

@media (max-width: 760px) {
  .qr-range-row,
  .single-qr-form,
  .single-qr-result {
    grid-template-columns: 1fr;
  }

  .qr-pdf-controls,
  .qr-pdf-progress,
  .qr-custom-range,
  .qr-range-reference-row {
    grid-template-columns: 1fr;
  }
}

.material-stockin-list {
  display: grid;
  gap: 10px;
}

#materialModal .modal-panel {
  width: min(980px, calc(100vw - 64px));
}

#materialModal .modal-body {
  overflow-x: hidden;
}

.material-stockin-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.material-stockin-level {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.material-stockin-level strong {
  min-width: 46px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 16px;
}

.material-stockin-level span,
.material-stockin-generated strong {
  color: var(--text);
  font-weight: 800;
}

.material-stockin-generated,
.material-stockin-input {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.material-stockin-input input {
  width: 100%;
  min-width: 0;
}

.material-count-list span {
  display: inline-grid;
  gap: 3px;
  min-width: 220px;
}

.material-count-list small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.material-count-list strong {
  color: var(--text);
  font-size: 12px;
}

@media (max-width: 980px) {
  .material-stockin-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .flagship-form-grid,
  .flagship-section-toggles {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .batch-quality-panel {
    width: min(100%, calc(100vw - 32px));
  }

  .quality-indicator-row {
    grid-template-columns: 1fr;
  }

  .trace-quality-list {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 1320px) {
  .channel-form-grid,
  .channel-form-grid.area-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .certification-action-grid {
    grid-template-columns: 1fr;
  }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(20px);
  min-width: 220px;
  max-width: 420px;
  background: #101719;
  color: white;
  border-radius: 8px;
  padding: 12px 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
  text-align: center;
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.mode-select-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 20px;
  border: 1px solid #bfe2d6;
  border-radius: 10px;
  background: linear-gradient(135deg, #f1fbf6, #ffffff);
  padding: 16px 18px;
}

.mode-select-title div {
  display: grid;
  gap: 5px;
}

.mode-select-title strong {
  color: var(--ink);
  font-size: 22px;
  line-height: 1.25;
}

.mode-select-title span {
  color: var(--muted);
  font-weight: 800;
  line-height: 1.55;
}

.mode-select-title em {
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  padding: 8px 13px;
  font-style: normal;
  font-weight: 950;
}

.mode-select-title.compact {
  margin-top: 0;
  background: #fffaf0;
  border-color: #f0d49a;
}

.mode-select-title.compact strong {
  font-size: 20px;
}

.mode-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.mode-card {
  position: relative;
  min-height: 198px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: #fff;
  padding: 22px 20px 20px;
  text-align: left;
  font-family: inherit;
  color: var(--text);
  cursor: pointer;
  display: grid;
  align-content: start;
  gap: 11px;
  box-shadow: var(--shadow-soft);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease, background 0.16s ease;
}

.mode-card:hover {
  border-color: #72c7a9;
  box-shadow: 0 16px 32px rgba(23, 132, 95, 0.12);
  transform: translateY(-1px);
}

.mode-card i {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 26px;
  height: 26px;
  border: 2px solid #b6c7c5;
  border-radius: 999px;
  background: #fff;
}

.mode-card i::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: inherit;
  background: transparent;
}

.mode-card span {
  color: var(--green);
  font-weight: 900;
  font-size: 15px;
}

.mode-card strong {
  color: var(--ink);
  max-width: calc(100% - 34px);
  font-size: 23px;
  line-height: 1.25;
}

.mode-card em {
  color: var(--muted);
  font-style: normal;
  line-height: 1.7;
  font-weight: 700;
}

.mode-card.is-active {
  border-color: var(--green);
  background: linear-gradient(180deg, #eafaf2, #ffffff);
  box-shadow: 0 18px 36px rgba(23, 132, 95, 0.18);
}

.mode-card.is-active::before {
  content: "当前选择";
  position: absolute;
  right: 54px;
  top: 17px;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 950;
}

.mode-card.is-active i {
  border-color: var(--green);
  background: #fff;
}

.mode-card.is-active i::after {
  background: var(--green);
}

.harsh-warning-panel {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  border: 1px solid #f0d49a;
  border-radius: 12px;
  background: #fffdf7;
  padding: 14px;
}

.harsh-warning-config-grid {
  display: grid;
  gap: 14px;
}

.harsh-warning-block {
  display: grid;
  gap: 12px;
  border: 1px solid #f2dfb9;
  border-radius: 12px;
  background: #fff;
  padding: 14px;
}

.harsh-warning-block-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-end;
  border-bottom: 1px solid #f5ead6;
  padding-bottom: 10px;
}

.harsh-warning-block-head strong {
  color: var(--ink);
  font-size: 20px;
}

.harsh-warning-block-head span {
  color: var(--muted);
  font-weight: 800;
  line-height: 1.5;
}

.warning-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.warning-choice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: #fff;
  padding: 16px;
  cursor: pointer;
}

.warning-choice:has(input:checked) {
  border-color: #c88719;
  background: #fff8e9;
  box-shadow: 0 12px 26px rgba(200, 135, 25, 0.12);
}

.warning-choice input {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: #c88719;
}

.warning-choice span {
  display: grid;
  gap: 6px;
}

.warning-choice strong {
  color: var(--ink);
  font-size: 18px;
}

.warning-choice em {
  color: var(--muted);
  font-style: normal;
  font-weight: 800;
  line-height: 1.55;
}

.warning-custom-textarea {
  width: 100%;
  min-height: 86px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fffdf9;
  color: var(--ink);
  padding: 12px 14px;
  font: inherit;
  font-weight: 800;
  line-height: 1.55;
}

.warning-custom-textarea:focus {
  outline: 2px solid rgba(200, 135, 25, 0.22);
  border-color: #c88719;
}

.settings-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.settings-summary-grid > div {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--soft);
  padding: 16px;
  display: grid;
  gap: 6px;
}

.settings-summary-grid span {
  color: var(--muted);
  font-weight: 800;
}

.settings-summary-grid strong {
  color: var(--ink);
  font-size: 18px;
}

@media (max-width: 1180px) {
  .mode-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mode-card {
    min-height: 0;
  }
}

@media (max-width: 640px) {
  .mode-select-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .mode-card strong {
    font-size: 20px;
  }

  .mode-card-grid,
  .warning-choice-grid {
    grid-template-columns: 1fr;
  }

  .harsh-warning-block-head {
    align-items: flex-start;
    flex-direction: column;
  }
}

.external-service-config {
  display: grid;
  gap: 18px;
}

.external-service-test-result {
  margin: 16px 0 20px;
}

.external-test-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fbfa;
  padding: 14px 16px;
  color: var(--muted);
  font-weight: 850;
}

.external-test-summary strong {
  color: var(--ink);
  font-size: 18px;
  margin-right: 8px;
}

.external-test-summary span {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
}

.external-test-list {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.external-test-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--border);
  border-left-width: 5px;
  border-radius: 8px;
  background: #fff;
  padding: 13px 16px;
}

.external-test-item div {
  display: grid;
  gap: 4px;
}

.external-test-item strong {
  color: var(--ink);
  font-size: 16px;
}

.external-test-item span {
  color: var(--muted);
  line-height: 1.45;
  font-weight: 750;
}

.external-test-item em {
  white-space: nowrap;
  font-style: normal;
  font-weight: 900;
}

.external-test-ok {
  border-left-color: var(--green);
}

.external-test-ok em {
  color: var(--green);
}

.external-test-warn,
.external-test-missing {
  border-left-color: #d99a19;
}

.external-test-warn em,
.external-test-missing em {
  color: #9a6500;
}

.external-test-error {
  border-left-color: #d84a3a;
}

.external-test-error em {
  color: #c9352a;
}

.external-service-group {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 18px;
  display: grid;
  gap: 14px;
}

.external-service-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.external-service-group-title strong {
  color: var(--ink);
  font-size: 20px;
}

.external-service-group-title span {
  color: var(--muted);
  font-weight: 800;
}

.external-service-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.external-service-field {
  display: grid;
  gap: 8px;
}

.external-service-field span {
  color: var(--muted);
  font-weight: 850;
}

.external-service-field input {
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  background: #fff;
}

.external-service-field input:focus {
  outline: 2px solid rgba(23, 132, 95, 0.18);
  border-color: var(--green);
}

.external-service-field em {
  color: var(--muted);
  font-style: normal;
  line-height: 1.55;
  font-weight: 700;
  font-size: 13px;
}

@media (max-width: 1240px) {
  body {
    min-width: 1080px;
  }

  .sidebar {
    width: 232px;
    flex-basis: 232px;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .management-grid {
    grid-template-columns: 1fr;
  }

  .code-hero-panel .code-summary-grid,
  .code-config-grid,
  .code-table-grid {
    grid-template-columns: 1fr;
  }

  .form-card,
  .management-grid > .table-toolbar,
  .management-grid > .metrics-grid,
  .management-grid > .data-table,
  .management-grid > .empty-table-state,
  .management-grid > .full-width-note {
    grid-column: 1;
    grid-row: auto;
  }

  .readiness-card {
    grid-template-columns: 1fr;
  }

  .readiness-status-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .template-workbench {
    grid-template-columns: 1fr;
  }

  .template-preview-search,
  .table-like-template-list .template-row {
    grid-template-columns: 1fr;
  }

  .table-like-template-list .template-row em {
    grid-column: 1;
  }

  .template-public-preview-shell {
    max-width: none;
  }

  .producer-admin-actions {
    width: 100%;
  }

.producer-admin-action-row,
.producer-admin-action-row.membership-row,
.producer-admin-action-row.quota-row {
  grid-template-columns: 1fr;
}
}

.channel-goods-browser {
  display: grid;
  gap: 18px;
}

.goods-browser-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.goods-column {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  background: #fff;
  min-height: 260px;
}

.goods-column h3 {
  margin: 0 0 12px;
  font-size: 20px;
}

.goods-card-list {
  display: grid;
  gap: 10px;
  max-height: 420px;
  overflow: auto;
  padding-right: 4px;
}

.goods-card-list.horizontal {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  max-height: none;
  overflow: visible;
  margin-bottom: 16px;
}

.goods-card-button {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  gap: 6px;
}

.goods-card-button strong {
  font-size: 18px;
}

.goods-card-button span {
  color: var(--muted);
  line-height: 1.45;
}

.goods-card-button.is-active {
  border-color: var(--green);
  background: #ecfdf5;
  box-shadow: 0 0 0 3px rgba(22, 163, 116, 0.12);
}

.goods-code-panel,
.inbound-detail-panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  background: #fbfdfc;
}

.inline-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.compact-search {
  min-width: min(420px, 70vw);
}

.panel-header.compact {
  align-items: center;
}

.channel-stock-detail-groups {
  display: grid;
  gap: 14px;
  margin: 14px 0;
}

.channel-stock-product-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfdfc;
  padding: 14px;
}

.channel-stock-product-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.channel-stock-product-title strong {
  font-size: 18px;
}

.channel-stock-product-title span {
  color: var(--green);
  font-weight: 800;
  white-space: nowrap;
}

.channel-stock-level-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.channel-stock-level-row {
  width: 100%;
  border: 1px solid #d8e3e2;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
}

.channel-stock-level-row span {
  font-weight: 800;
}

.channel-stock-level-row strong {
  color: var(--green);
}

.channel-stock-level-row em {
  color: var(--muted);
  font-style: normal;
  font-size: 14px;
}

.channel-stock-code-list {
  border: 1px dashed #cbdad8;
  border-radius: 12px;
  background: #fff;
  padding: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 220px;
  overflow: auto;
}

.channel-stock-code-list code {
  border-radius: 999px;
  background: #eef7f2;
  color: var(--ink);
  padding: 6px 10px;
  font-size: 13px;
}

@media (max-width: 1100px) {
  .goods-browser-grid {
    grid-template-columns: 1fr;
  }

  .goods-card-list {
    max-height: 280px;
  }
}
