/* Premium visual layer. Business layout and interaction hooks remain unchanged. */
:root {
  --control-empty-surface: #f7fbfe;
  --control-empty-border: #d5e3ed;
  --control-readonly-surface: #eef3f6;
  --control-readonly-border: #d5dfe6;
  --interaction-hover-surface: rgba(233, 245, 255, 0.9);
  --interaction-hover-border: rgba(10, 132, 255, 0.46);
  --interaction-hover-shadow: 0 6px 16px rgba(28, 103, 169, 0.12);
  --interaction-selected-surface: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(241, 249, 255, 0.86));
  --interaction-selected-shadow: 0 6px 14px rgba(37, 74, 112, 0.09), inset 0 1px 0 #fff;
  --interaction-disabled-surface: rgba(231, 239, 246, 0.66);
  --interaction-disabled-text: #91a2b2;
}

.flow-import-dialog {
  width: min(760px, calc(100vw - 32px));
}

.flow-import-preflight-dialog {
  width: min(1400px, calc(100vw - 32px));
  max-height: min(860px, calc(100vh - 28px));
}

.flow-import-setting-grid,
.flow-import-upload-form {
  display: grid;
  gap: 16px;
  padding: 20px 24px;
}

.flow-import-setting-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.flow-import-setting-summary {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.flow-import-setting-summary div {
  padding: 12px 14px;
  border: 1px solid var(--border-color, #d7e3ef);
  border-radius: 14px;
  background: rgba(239, 247, 255, 0.72);
}

.flow-import-setting-summary dt {
  color: var(--muted-text, #66778c);
  font-size: 0.82rem;
}

.flow-import-setting-summary dd {
  margin: 5px 0 0;
  color: var(--heading-color, #17365d);
  font-weight: 700;
}

.flow-import-upload-form {
  align-items: center;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 12px;
  margin: 0 24px 14px;
  padding: 12px 14px;
  background: rgba(247, 251, 254, 0.82);
  border: 1px solid var(--control-empty-border);
  border-radius: 14px;
}

.flow-import-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.flow-import-file-type {
  align-items: center;
  align-self: stretch;
  display: inline-flex;
  justify-content: center;
  min-width: 48px;
  padding: 0 8px;
  border-radius: 10px;
  color: #087f5b;
  background: #e4f6ef;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.flow-import-file-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.flow-import-file-copy strong,
.flow-import-file-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flow-import-file-copy strong {
  color: var(--heading-color, #17365d);
}

.flow-import-file-copy small {
  color: var(--muted-text, #66778c);
}

.flow-import-upload-form .status-chip[data-tone="danger"] {
  color: #b4232b;
  background: #fdebed;
}

.flow-import-upload-form .status-chip[data-tone="warning"] {
  color: #9b5b09;
  background: #fff0dd;
}

.flow-import-upload-form .status-chip[data-tone="success"] {
  color: #087f5b;
  background: #e4f6ef;
}

.flow-import-toolbar {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  min-height: 48px;
  padding: 0 24px 12px;
}

.flow-import-workspace {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(230px, 1fr);
  min-height: 360px;
  max-height: 500px;
  margin: 0 24px;
  border: 1px solid var(--border-color, #d7e3ef);
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.72);
}

.flow-import-draft-wrap {
  max-height: 500px;
  overflow: auto;
}

.flow-import-draft-lines {
  display: grid;
  gap: 8px;
  padding: 8px;
}

.flow-import-draft-lines > .empty-state {
  margin: auto;
}

.flow-import-draft-lines .flow-entry {
  background: #f9fcff;
  padding: 10px;
}

.flow-import-draft-lines .flow-entry-header {
  gap: 8px;
  margin-bottom: 8px;
}

.flow-import-draft-lines .flow-entry-heading {
  gap: 8px;
}

.flow-import-draft-lines .flow-entry-fields {
  gap: 8px;
  grid-template-columns: repeat(6, minmax(145px, 1fr));
}

.flow-import-draft-lines :is(
  .flow-hospital-field,
  .flow-secondary-distributor-field,
  .flow-price-field
) {
  grid-column: span 1;
}

.flow-import-draft-lines :is(
  input,
  select,
  .portal-control-shell,
  :where(.precision-date-trigger)
) {
  min-height: 38px;
}

.flow-import-draft-lines .flow-hospital-info {
  display: none;
}

.flow-import-draft-lines .flow-entry[data-tone="danger"] {
  border-color: rgba(199, 56, 63, 0.52);
  box-shadow: inset 3px 0 0 rgba(199, 56, 63, 0.72);
}

.flow-import-draft-lines .flow-entry[data-tone="warning"] {
  border-color: rgba(169, 111, 18, 0.42);
  box-shadow: inset 3px 0 0 rgba(169, 111, 18, 0.62);
}

.flow-import-draft-lines [data-flow-import-field-tone="danger"] > input,
.flow-import-draft-lines [data-flow-import-field-tone="danger"] > .combobox-field,
.flow-import-draft-lines [data-flow-import-field-tone="danger"] > .precision-date-picker {
  border-radius: var(--radius-control);
  box-shadow: 0 0 0 1px rgba(199, 56, 63, 0.72);
}

.flow-import-draft-lines [data-flow-import-field-tone="warning"] > input,
.flow-import-draft-lines [data-flow-import-field-tone="warning"] > .combobox-field,
.flow-import-draft-lines [data-flow-import-field-tone="warning"] > .precision-date-picker {
  border-radius: var(--radius-control);
  box-shadow: 0 0 0 1px rgba(169, 111, 18, 0.56);
}

.flow-import-field-issue {
  display: block;
  color: #b4232b;
  font-size: 11px;
  line-height: 1.35;
  margin-top: 5px;
}

.flow-import-draft-lines [data-flow-import-field-tone="warning"] .flow-import-field-issue {
  color: #9b5b09;
}

.flow-import-original-product {
  grid-column: 1 / -1;
  margin: -6px 0 0 44px;
  color: #b4232b;
  font-size: 11px;
  overflow-wrap: anywhere;
}

.flow-import-issue-panel {
  min-width: 0;
  overflow: auto;
  padding: 18px;
  border-left: 1px solid var(--border-color, #d7e3ef);
  background: rgba(247, 251, 254, 0.82);
}

.flow-import-issue-panel h3 {
  align-items: baseline;
  display: flex;
  gap: 6px;
  margin: 0 0 12px;
  color: var(--heading-color, #17365d);
  font-size: 16px;
}

.flow-import-issue-list {
  display: grid;
  gap: 8px;
}

.flow-import-issue-item {
  display: grid;
  gap: 5px;
  width: 100%;
  min-height: 0;
  padding: 11px 12px;
  border: 1px solid var(--border-color, #d7e3ef);
  border-radius: 12px;
  color: var(--heading-color, #17365d);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: none;
  text-align: left;
}

.flow-import-issue-item:hover:not(:disabled),
.flow-import-issue-item:focus-visible:not(:disabled),
.flow-import-issue-item.is-active {
  color: var(--heading-color, #17365d);
  border-color: rgba(10, 132, 255, 0.5);
  background: rgba(233, 245, 255, 0.88);
  box-shadow: inset 3px 0 0 rgba(10, 132, 255, 0.72);
}

.flow-import-issue-item strong,
.flow-import-issue-item small {
  overflow-wrap: anywhere;
}

.flow-import-issue-item small {
  color: #b4232b;
  font-size: 12px;
  line-height: 1.4;
}

.flow-import-issue-item[data-tone="warning"] small {
  color: #9b5b09;
}

.flow-import-issue-empty {
  margin: 0;
  padding: 20px 12px;
  color: var(--muted-text, #66778c);
  text-align: center;
}

.flow-import-note {
  margin: 0;
  color: var(--muted-text, #66778c);
}

@media (max-width: 768px) {
  .flow-import-setting-grid,
  .flow-import-upload-form,
  .flow-import-setting-summary {
    grid-template-columns: 1fr;
  }

  .flow-import-preflight-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
  }

  .flow-import-draft-wrap {
    max-height: 390px;
  }

  .flow-import-draft-lines .flow-entry-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .flow-import-draft-lines :is(.precision-date-field, .flow-hospital-field, .flow-secondary-distributor-field) {
    grid-column: 1 / -1;
  }

  .flow-import-upload-form,
  .flow-import-workspace {
    margin-inline: 12px;
  }

  .flow-import-upload-form {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .flow-import-upload-form .secondary-button,
  .flow-import-upload-form .status-chip {
    justify-self: start;
  }

  .flow-import-toolbar {
    padding-inline: 12px;
  }

  .flow-import-workspace {
    grid-template-columns: 1fr;
    max-height: 620px;
  }

  .flow-import-issue-panel {
    max-height: 190px;
    border-top: 1px solid var(--border-color, #d7e3ef);
    border-left: 0;
  }
}

html {
  background: var(--bg);
  scrollbar-gutter: stable;
}

body {
  min-width: 320px;
  background:
    radial-gradient(circle at 84% -8%, rgba(90, 200, 250, 0.22), transparent 32rem),
    radial-gradient(circle at 18% 42%, rgba(10, 132, 255, 0.08), transparent 28rem),
    linear-gradient(145deg, #f8fbff 0, var(--bg) 44%, #f3f7fb 100%);
}

::selection {
  background: rgba(10, 132, 255, 0.18);
}

button {
  background: linear-gradient(135deg, #1590ff, var(--primary-dark));
  border-radius: var(--radius-control);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1;
  min-height: var(--button-height-medium);
  padding-inline: 15px;
  transition: background-color 180ms var(--ease-fluid), border-color 180ms var(--ease-fluid), box-shadow 180ms var(--ease-fluid), color 180ms var(--ease-fluid), transform 180ms var(--ease-fluid);
}

button:hover:not(:disabled) {
  box-shadow: none;
  transform: translateY(-1px);
}

button:active:not(:disabled) {
  box-shadow: none;
  transform: scale(0.98);
}

button:focus-visible {
  outline: 3px solid rgba(0, 113, 227, 0.24);
  outline-offset: 2px;
}

.app-shell {
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100dvh;
}

.sidebar {
  background: linear-gradient(165deg, rgba(250, 253, 255, 0.76), rgba(238, 245, 251, 0.62));
  border-right: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: 10px 0 28px rgba(44, 77, 113, 0.055), inset -1px 0 0 rgba(44, 76, 112, 0.06);
  color: var(--text);
  padding: 22px 18px;
  position: sticky;
  top: 0;
  height: 100dvh;
  overflow-y: auto;
  z-index: 30;
  -webkit-backdrop-filter: blur(28px) saturate(155%);
  backdrop-filter: blur(28px) saturate(155%);
}

.topbar-dock {
  display: contents;
}

.brand {
  margin-bottom: 30px;
}

.brand-logo-frame {
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 20px;
  box-shadow: 0 9px 24px rgba(38, 68, 104, 0.075), inset 0 1px 0 #fff;
  height: 72px;
}

.nav-list {
  gap: 9px;
  padding-block: 3px;
}

.mobile-nav-toggle {
  display: none;
}

.nav-item {
  border: 1px solid transparent;
  border-radius: 14px;
  color: #4f6075;
  font-size: var(--font-body);
  font-weight: 500;
  min-height: 44px;
  padding-inline: 16px;
  position: relative;
  white-space: nowrap;
  width: 100%;
}

.nav-item::before {
  background: transparent;
  border-radius: 999px;
  bottom: 11px;
  content: "";
  left: 7px;
  position: absolute;
  top: 11px;
  transition: background-color 180ms ease, transform 180ms ease;
  width: 3px;
}

.nav-item:hover:not(.active) {
  background: rgba(255, 255, 255, 0.48);
  border-color: rgba(255, 255, 255, 0.58);
  box-shadow: none;
  color: var(--text);
  transform: translateX(3px);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(247, 251, 255, 0.72));
  border-color: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 20px rgba(39, 74, 112, 0.09), inset 0 1px 0 #fff;
  color: var(--primary);
  font-weight: 650;
}

.nav-item.active::before {
  background: var(--primary);
  transform: scaleY(1.08);
}

.nav-count-badge {
  align-items: center;
  background: #fa5151;
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  height: 20px;
  justify-content: center;
  line-height: 1;
  margin-left: auto;
  min-width: 20px;
  padding: 0 5px;
}

.nav-count-badge[hidden] {
  display: none;
}

.sidebar.motion-enter-left .nav-item {
  animation: nav-waterfall-in 520ms cubic-bezier(0.22, 1, 0.36, 1) backwards;
  animation-delay: var(--nav-motion-delay, 0ms);
}

.user-card {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.76), rgba(247, 251, 255, 0.58));
  border: 1px solid rgba(170, 198, 219, 0.58);
  border-radius: 14px;
  box-shadow: 0 8px 20px rgba(38, 68, 104, 0.055), inset 0 1px 0 rgba(255, 255, 255, 0.92);
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 12px 10px 12px 14px;
}

.user-identity {
  align-self: center;
  display: grid;
  gap: 4px;
  min-width: 0;
}

.user-role {
  color: var(--primary);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.2;
}

.user-card strong {
  font-size: 14px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.user-card button {
  align-self: center;
  margin-top: 0;
  min-height: 34px;
  padding-inline: 11px;
  white-space: nowrap;
  width: auto;
}

.main-content {
  --page-gutter: clamp(24px, 2.6vw, 44px);
  margin-inline: auto;
  max-width: 1760px;
  padding: 32px var(--page-gutter) 54px;
  width: 100%;
}

.topbar {
  background: linear-gradient(135deg, rgba(248, 252, 255, 0.78), rgba(235, 243, 250, 0.58));
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-top: 0;
  border-radius: 0 0 24px 24px;
  box-shadow: 0 10px 24px rgba(38, 68, 104, 0.065);
  margin: -32px calc(0px - var(--page-gutter)) 32px;
  min-height: 86px;
  padding: 20px var(--page-gutter);
  position: sticky;
  top: 0;
  z-index: 20;
  -webkit-backdrop-filter: blur(28px) saturate(155%);
  backdrop-filter: blur(28px) saturate(155%);
}

h1,
h2,
h3 {
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: -0.025em;
}

h1 {
  font-size: clamp(25px, 2vw, var(--font-page));
  font-weight: 650;
  line-height: 1.15;
}

h2 {
  font-size: var(--font-section);
  font-weight: 650;
  line-height: 1.3;
}

h3 {
  font-size: 15px;
  font-weight: 650;
  line-height: 1.35;
}

.account-box span {
  color: var(--muted);
  font-size: 13px;
}

.account-box {
  margin-left: auto;
}

.topbar-context {
  display: grid;
  gap: 5px;
  min-width: 0;
  text-align: right;
}

.account-box .topbar-clock {
  color: var(--text);
  font-size: var(--font-label);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.topbar-meta,
.data-freshness,
.pending-summary {
  align-items: center;
  display: flex;
}

.topbar-meta {
  flex-wrap: wrap;
  gap: 7px;
  justify-content: flex-end;
}

.data-freshness {
  gap: 6px;
  white-space: nowrap;
}

.data-freshness i {
  background: #30a46c;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(48, 164, 108, 0.12);
  display: block;
  height: 6px;
  width: 6px;
}

.data-refresh-button {
  background: rgba(255, 255, 255, 0.48);
  border: 1px solid rgba(255, 255, 255, 0.64);
  color: var(--primary-dark);
  flex: 0 0 auto;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  height: 26px;
  min-height: 26px;
  min-width: 52px;
  padding: 4px 9px;
  white-space: nowrap;
  width: auto;
}

.data-refresh-button:disabled {
  cursor: default;
  opacity: 0.72;
}

.data-refresh-button[data-cooldown] {
  min-width: 88px;
}

#refreshPortalDataBtn,
#refreshAccountProfileBtn,
[data-log-refresh] {
  white-space: nowrap;
  word-break: keep-all;
}

.pending-summary {
  gap: 5px;
}

.account-box .pending-chip {
  background: rgba(255, 255, 255, 0.48);
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: 999px;
  color: #515154;
  cursor: default;
  font-size: 12px;
  line-height: 1;
  min-height: 26px;
  padding: 5px 8px;
  white-space: nowrap;
}

.account-box .pending-chip:disabled,
.account-box .pending-chip:disabled:hover {
  background: rgba(255, 255, 255, 0.48);
  color: #515154;
  opacity: 1;
}

.pending-chip strong {
  color: inherit;
  font-variant-numeric: tabular-nums;
  margin-left: 2px;
}

.account-box .pending-chip.has-pending {
  background: #fff4d6;
  border-color: rgba(154, 98, 0, 0.12);
  color: #8a5700;
  cursor: pointer;
}

.account-box .pending-chip.has-pending:hover,
.account-box .pending-chip.has-pending:focus-visible {
  background: #ffe9aa;
  border-color: rgba(154, 98, 0, 0.24);
  box-shadow: 0 0 0 3px rgba(154, 98, 0, 0.1);
}

.account-box .pending-chip.is-unavailable,
.account-box .pending-chip.is-unavailable:disabled:hover {
  background: rgba(185, 28, 28, 0.07);
  color: var(--danger);
}

.metric-grid,
.content-grid {
  gap: 24px;
}

.metric-card,
.panel {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(246, 250, 254, 0.88));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.metric-card {
  min-height: 164px;
  overflow: hidden;
  padding: 26px;
  position: relative;
  transition: border-color 220ms ease, transform 220ms var(--ease-fluid);
}

.metric-card::before {
  background: radial-gradient(circle, rgba(90, 200, 250, 0.2), rgba(10, 132, 255, 0.04) 48%, transparent 70%);
  border-radius: 50%;
  content: "";
  height: 150px;
  pointer-events: none;
  position: absolute;
  right: -56px;
  top: -70px;
  transform: scale(0.92);
  transition: opacity 320ms ease, transform 520ms var(--ease-fluid);
  width: 150px;
}

.metric-card::after {
  background: linear-gradient(90deg, var(--primary), var(--accent), rgba(90, 200, 250, 0.08));
  border-radius: 999px;
  content: "";
  height: 3px;
  left: 26px;
  opacity: 0.72;
  position: absolute;
  right: 26px;
  top: 0;
}

.metric-card:hover {
  border-color: rgba(10, 132, 255, 0.16);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.metric-card:hover::before {
  opacity: 0.9;
  transform: scale(1.02) translate(-2px, 2px);
}

.metric-card span,
.metric-card em {
  font-size: 13px;
  letter-spacing: 0;
}

.metric-card strong {
  color: var(--text);
  display: block;
  font-size: var(--metric-value-font-size, 36px);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  line-height: 1.12;
  margin: 14px 0 10px;
  max-width: 100%;
  min-width: 0;
  white-space: nowrap;
}

.metric-card strong.metric-value-wrap {
  overflow-wrap: anywhere;
  white-space: normal;
}

#flow-collection .flow-collection-metrics {
  gap: 16px;
}

#flow-collection .flow-collection-metrics .metric-card {
  min-height: 108px;
  padding: 18px 20px;
}

#flow-collection .flow-collection-metrics .metric-card::after {
  left: 20px;
  right: 20px;
}

#flow-collection .flow-collection-metrics .metric-card strong {
  font-size: 30px;
  margin: 8px 0 0;
}

@media (min-width: 1101px) and (max-width: 1500px) {
  .metric-grid {
    gap: 16px;
  }

  .metric-card {
    padding-inline: 22px;
  }

  .metric-card::after {
    left: 22px;
    right: 22px;
  }
}

.panel {
  padding: clamp(24px, 2.2vw, 32px);
}

label span,
.form-field > span,
.document-filter-field > span,
.filter-label {
  font-size: var(--font-label);
  font-weight: 500;
  line-height: 1.35;
}

.form-section {
  border-top-color: rgba(44, 76, 112, 0.09);
  margin-top: 26px;
  padding-top: 24px;
}

.form-section h3,
.line-header h3 {
  align-items: center;
  display: flex;
  gap: 9px;
}

.form-section h3::before,
.line-header h3::before {
  background: linear-gradient(180deg, var(--accent), var(--primary));
  border-radius: 999px;
  content: "";
  height: 16px;
  width: 4px;
}

.line-item {
  background: rgba(247, 251, 255, 0.58);
  border-color: rgba(255, 255, 255, 0.82);
  box-shadow: inset 0 0 0 1px rgba(44, 76, 112, 0.055);
  padding: 16px;
}

.line-item .line-no {
  background: linear-gradient(145deg, rgba(10, 132, 255, 0.12), rgba(90, 200, 250, 0.1));
  color: var(--primary-dark);
}

.total-box {
  background: rgba(245, 251, 255, 0.92);
  border: 1px solid rgba(10, 132, 255, 0.2);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(38, 88, 124, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.92);
  color: var(--text);
  overflow: hidden;
  padding: 20px;
  position: relative;
}

.total-box::before {
  content: none;
}

.total-box > span {
  color: var(--muted);
  font-size: var(--font-label);
  font-weight: 600;
}

.total-box strong {
  color: var(--primary-dark);
  letter-spacing: 0;
}

.total-box > button[type="submit"] {
  background: var(--primary);
  box-shadow: 0 7px 16px rgba(10, 132, 255, 0.2);
}

.total-box > button[type="submit"]:hover:not(:disabled),
.total-box > button[type="submit"]:focus-visible:not(:disabled) {
  background: var(--primary-dark);
  box-shadow: 0 9px 20px rgba(10, 103, 204, 0.24);
  transform: translateY(-1px);
}

.total-box > button[type="submit"]:active:not(:disabled) {
  box-shadow: 0 4px 10px rgba(10, 103, 204, 0.18);
  transform: translateY(0);
}

.history-filters {
  gap: 14px;
}

.history-filter-summary {
  background: rgba(241, 247, 252, 0.58);
  border-color: rgba(255, 255, 255, 0.74);
  border-radius: 14px;
  margin-top: 2px;
  padding: 12px 16px;
}

.history-filter-summary strong {
  font-size: var(--font-body);
  font-weight: 700;
}

.danger-button,
.warning-button {
  color: #fff;
}

.danger-button {
  background: #d94e55;
  box-shadow: 0 7px 16px rgba(180, 45, 53, 0.18);
}

.danger-button:hover:not(:disabled),
.danger-button:focus-visible:not(:disabled) {
  background: #c63e46;
  box-shadow: 0 9px 20px rgba(180, 45, 53, 0.24);
  transform: translateY(-1px);
}

.warning-button {
  background: #c98618;
  box-shadow: 0 7px 16px rgba(181, 116, 12, 0.18);
}

.warning-button:hover:not(:disabled),
.warning-button:focus-visible:not(:disabled) {
  background: #b6760f;
  box-shadow: 0 9px 20px rgba(181, 116, 12, 0.24);
  transform: translateY(-1px);
}

/* Button semantics: one visual language for the same business intent.
   Primary commits the current workflow; secondary opens/adds/supports it;
   neutral cancels or clears; danger removes or rejects. */
.primary-button {
  background: #1689e8;
  border-color: #1689e8;
  box-shadow: 0 7px 16px rgba(22, 137, 232, 0.2);
  color: #fff;
}

.primary-button:hover:not(:disabled),
.primary-button:focus-visible:not(:disabled) {
  background: #0b6fc4;
  border-color: #0b6fc4;
  box-shadow: 0 9px 20px rgba(11, 111, 196, 0.24);
  color: #fff;
}

.secondary-button {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(22, 137, 232, 0.38);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  color: #0b6fc4;
}

.secondary-button:hover:not(:disabled),
.secondary-button:focus-visible:not(:disabled) {
  background: #e8f4fe;
  border-color: #1689e8;
  box-shadow: var(--interaction-hover-shadow);
  color: #075fa9;
}

.neutral-button,
.dialog-close-button {
  background: #f3f6f8;
  border: 1px solid #cbd7e1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
  color: #52687c;
}

.neutral-button:hover:not(:disabled),
.neutral-button:focus-visible:not(:disabled),
.dialog-close-button:hover:not(:disabled),
.dialog-close-button:focus-visible:not(:disabled) {
  background: #e8eef3;
  border-color: #aebfcd;
  box-shadow: var(--interaction-hover-shadow);
  color: #344b60;
}

.panel-header,
.line-header,
.action-row {
  margin-bottom: 18px;
}

.schema-status,
.diagnostics-box,
.contract-status-message,
.order-detail-totals {
  border-radius: var(--radius-control);
}

.schema-status {
  background: rgba(255, 255, 255, 0.46);
  border-color: var(--line);
}

.status-chip,
.dashboard-account-count {
  border: 0;
  border-radius: 999px;
  font-weight: 650;
}

.dashboard-account-count,
.compact-button {
  background: rgba(10, 132, 255, 0.09);
  border-color: rgba(10, 132, 255, 0.13);
  color: var(--primary-dark);
}

.link-button {
  font-size: 14px;
  min-height: var(--button-height-small);
}

.compact-button,
.line-item > .remove-line-button {
  border-radius: 9px;
  font-size: 13px;
  min-height: var(--button-height-small);
  padding-inline: 11px;
}

.date-granularity button,
.date-presets button {
  border-radius: 9px;
  font-size: 13px;
  min-height: 30px;
  padding-inline: 10px;
}

.document-tabs {
  background: rgba(241, 247, 252, 0.56);
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
  gap: 6px;
  margin-bottom: 24px;
  padding: 5px;
}

.document-tab {
  background: transparent;
  border-radius: 12px;
  color: var(--muted);
  font-size: var(--font-label);
  min-height: 40px;
  padding: 0 13px;
}

.document-tab:hover:not(.active) {
  background: rgba(255, 255, 255, 0.52);
  box-shadow: none;
  color: var(--primary-dark);
}

.document-tab.active {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(241, 249, 255, 0.82));
  border: 1px solid rgba(255, 255, 255, 0.94);
  box-shadow: 0 6px 14px rgba(37, 74, 112, 0.09), inset 0 1px 0 #fff;
  color: var(--primary-dark);
}

.document-tab small {
  background: rgba(10, 132, 255, 0.08);
  border-color: rgba(10, 132, 255, 0.14);
  color: var(--primary-dark);
}

.portal-clear-button {
  border-radius: 8px;
  font-size: 18px;
  height: 28px;
  min-height: 28px;
  width: 28px;
}

.portal-dropdown-toggle {
  border-radius: 8px;
  height: 30px;
  min-height: 30px;
  width: 30px;
}

.icon-button {
  border-radius: 10px;
  height: 36px;
  min-height: 36px;
  width: 36px;
}

#loginBtn,
#roleLogoutBtn {
  font-size: 14px;
  min-height: 36px;
  padding-inline: 14px;
}

.total-box > button {
  min-height: 44px;
}

.link-button:hover:not(:disabled),
.portal-clear-button:hover:not(:disabled) {
  box-shadow: none;
}

.table-wrap {
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 18px;
  box-shadow: inset 0 0 0 1px rgba(44, 76, 112, 0.045);
  scrollbar-color: rgba(29, 29, 31, 0.18) transparent;
}

table {
  border-collapse: separate;
  border-spacing: 0;
}

th,
td {
  border-bottom-color: var(--line);
  padding: 11px 12px;
}

th {
  background: rgba(229, 239, 248, 0.64);
  color: #52647a;
  font-size: var(--font-caption);
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

td {
  font-size: var(--font-body);
  line-height: 1.5;
}

tbody tr {
  transition: background-color 180ms ease, box-shadow 180ms ease;
}

tbody tr:hover {
  background: rgba(0, 113, 227, 0.035);
}

tbody tr:last-child td {
  border-bottom: 0;
}

.recent-order-row {
  cursor: pointer;
  outline: none;
}

.recent-order-row td {
  transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.recent-order-row:focus-visible td {
  background: rgba(0, 113, 227, 0.07);
  box-shadow: inset 0 2px 0 rgba(0, 113, 227, 0.42), inset 0 -2px 0 rgba(0, 113, 227, 0.42);
}

.recent-order-row:focus-visible td:first-child {
  box-shadow: inset 2px 0 0 rgba(0, 113, 227, 0.42), inset 0 2px 0 rgba(0, 113, 227, 0.42), inset 0 -2px 0 rgba(0, 113, 227, 0.42);
}

.recent-order-row:focus-visible td:last-child {
  box-shadow: inset -2px 0 0 rgba(0, 113, 227, 0.42), inset 0 2px 0 rgba(0, 113, 227, 0.42), inset 0 -2px 0 rgba(0, 113, 227, 0.42);
}

.info-list .dashboard-customer-item,
.info-list .dashboard-scope-item,
.info-list .dashboard-scope-empty,
.dashboard-scope-products li {
  background: rgba(29, 29, 31, 0.025);
  border-color: var(--line);
  border-radius: 12px;
}

.info-list .dashboard-customer-item:hover,
.info-list .dashboard-scope-item:hover {
  background: var(--surface-solid);
  border-color: rgba(0, 113, 227, 0.16);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.055);
}

.dashboard-scope-item dt:first-child span,
.dashboard-scope-products li {
  background: rgba(0, 113, 227, 0.07);
  color: var(--primary-dark);
}

input,
select,
textarea {
  background: rgba(255, 255, 255, 0.68);
  border-color: rgba(61, 91, 126, 0.16);
  border-radius: var(--radius-control);
  box-shadow: inset 0 1px 2px rgba(41, 70, 103, 0.035), 0 1px 0 rgba(255, 255, 255, 0.7);
  font-size: var(--font-body);
  font-weight: 400;
  min-height: 42px;
  padding: 8px 11px;
}

input::placeholder,
textarea::placeholder,
input::-webkit-input-placeholder,
textarea::-webkit-input-placeholder {
  color: #8091a0;
  opacity: 1;
}

input[readonly],
#orderForm input:disabled,
#orderForm select:disabled,
#orderForm textarea:disabled,
#orderForm input[readonly] {
  background: rgba(29, 29, 31, 0.045);
  border-color: rgba(29, 29, 31, 0.08);
  color: var(--muted);
}

.portal-dropdown-menu {
  background: rgba(249, 252, 255, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-color: rgba(255, 255, 255, 0.9);
  border-radius: 16px;
  box-shadow: 0 14px 32px rgba(35, 64, 99, 0.16), inset 0 1px 0 #fff;
  padding: 7px;
  -webkit-backdrop-filter: blur(30px) saturate(165%);
  backdrop-filter: blur(30px) saturate(165%);
}

.combobox-option {
  background: transparent;
  border-radius: 11px;
  font-size: var(--font-label);
  min-height: 34px;
  padding: 6px 8px;
}

.line-item,
.customer-block,
.document-card,
.order-card,
.qualification-card,
.authorization-card {
  border-radius: 16px;
}

.document-panel {
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.document-panel.active {
  animation: document-panel-in 360ms var(--ease-fluid) backwards;
}

.inventory-panel {
  display: none;
}

.inventory-panel.active {
  animation: document-panel-in 360ms var(--ease-fluid) backwards;
  display: block;
}

.inventory-summary {
  margin-top: 0;
}

.table-pagination {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 14px;
  min-height: 34px;
}

.table-pagination label {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex: 0 0 auto;
  font-size: 13px;
  gap: 6px;
  margin-right: 6px;
  white-space: nowrap;
}

.table-pagination .pagination-size-control {
  height: 32px;
  line-height: 1;
}

.table-pagination .pagination-size-control > span {
  align-items: center;
  display: inline-flex;
  height: 32px;
  line-height: 1;
  margin: 0;
}

.table-pagination select {
  align-self: center;
  height: 32px;
  line-height: 1;
  margin: 0;
  min-height: 32px;
  min-width: 68px;
  padding: 4px 26px 4px 8px;
}

.table-pagination .icon-button {
  height: 32px;
  min-height: 32px;
  width: 32px;
}

.table-pagination .pagination-arrow-button {
  display: grid;
  font-size: 0;
  padding: 0;
  place-items: center;
}

.pagination-arrow-button > span {
  display: block;
  height: 12px;
  margin: 0;
  pointer-events: none;
  position: relative;
  width: 12px;
}

.pagination-arrow-button > span::before,
.pagination-arrow-button > span::after {
  background: currentColor;
  border-radius: 1px;
  content: "";
  height: 1.5px;
  position: absolute;
  top: calc(50% - 0.75px);
  width: 7px;
}

.pagination-arrow-button[data-pagination-direction="next"] > span::before,
.pagination-arrow-button[data-pagination-direction="next"] > span::after {
  right: calc(50% - 2.5px);
  transform-origin: right center;
}

.pagination-arrow-button[data-pagination-direction="previous"] > span::before,
.pagination-arrow-button[data-pagination-direction="previous"] > span::after {
  left: calc(50% - 2.5px);
  transform-origin: left center;
}

.pagination-arrow-button > span::before {
  transform: rotate(45deg);
}

.pagination-arrow-button > span::after {
  transform: rotate(-45deg);
}

.table-pagination > span {
  color: var(--muted);
  flex: 0 0 auto;
  font-size: 13px;
  min-width: 82px;
  text-align: center;
}

.pagination-jump-control {
  height: 32px;
  line-height: 1;
  margin-left: 6px;
  margin-right: 0 !important;
}

.pagination-jump-control > span {
  align-items: center;
  display: inline-flex;
  height: 32px;
  line-height: 1;
  margin: 0;
}

.pagination-jump-control input {
  align-self: center;
  height: 32px;
  line-height: 1;
  margin: 0;
  min-height: 32px;
  padding: 4px 6px;
  text-align: center;
  width: 58px;
}

.pagination-jump-button {
  min-height: 32px;
  padding-inline: 11px;
}

.inventory-table {
  min-width: 1280px;
}

.inventory-outbound-table {
  min-width: 1960px;
}

.inventory-stock-table {
  min-width: 1420px;
}

.inventory-outbound-table th:first-child,
.inventory-outbound-table th:nth-child(2),
.inventory-outbound-table td:first-child,
.inventory-outbound-table td:nth-child(2) {
  white-space: nowrap;
}

.inventory-table th:last-child {
  background: rgba(229, 239, 248, 0.96);
  box-shadow: -8px 0 14px rgba(38, 68, 104, 0.055);
  position: sticky;
  right: 0;
  text-align: right;
  z-index: 2;
}

.inventory-table td:last-child {
  background: rgba(250, 252, 255, 0.96);
  box-shadow: -8px 0 14px rgba(38, 68, 104, 0.055);
  position: sticky;
  right: 0;
}

.inventory-table td.empty-state {
  background: transparent;
  box-shadow: none;
  position: static;
}

.inventory-table td.inventory-loading-cell {
  background: transparent;
  box-shadow: none;
  padding: 0;
  position: static;
}

.inventory-quantity {
  color: var(--primary-dark);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  text-align: right;
}

.inventory-negative {
  color: var(--danger) !important;
}

.inventory-placeholder {
  align-content: center;
  display: grid;
  justify-items: center;
  min-height: 320px;
  padding: 48px 20px;
  text-align: center;
}

.inventory-placeholder h2 {
  margin: 16px 0 8px;
}

.inventory-placeholder p {
  color: var(--muted);
  margin: 0;
}

.document-list {
  gap: 18px;
}

.document-filters {
  gap: 14px;
}

.document-card {
  background: rgba(255, 255, 255, 0.58);
  border-color: rgba(255, 255, 255, 0.8);
  box-shadow: 0 8px 22px rgba(38, 68, 104, 0.065), inset 0 1px 0 rgba(255, 255, 255, 0.82);
  contain-intrinsic-size: auto 280px;
  content-visibility: auto;
}

.contract-card-header {
  background: linear-gradient(135deg, rgba(231, 244, 254, 0.72), rgba(247, 251, 255, 0.6));
  border-bottom-color: rgba(44, 76, 112, 0.09);
  min-height: 66px;
  padding: 13px 18px;
}

.document-record-index {
  background: linear-gradient(145deg, rgba(10, 132, 255, 0.14), rgba(90, 200, 250, 0.12));
  border-color: rgba(10, 132, 255, 0.16);
  border-radius: 10px;
  color: var(--primary-dark);
  height: 38px;
  width: 42px;
}

.document-card-heading strong {
  color: var(--text);
  font-weight: 600;
}

.document-card-heading small {
  color: var(--muted);
}

.contract-detail-grid {
  border-color: rgba(44, 76, 112, 0.09);
  border-radius: 14px;
  margin: 18px;
  overflow: hidden;
}

.contract-detail-grid div {
  background: rgba(255, 255, 255, 0.28);
  border-color: rgba(44, 76, 112, 0.09);
  padding: 11px 13px;
}

.contract-detail-grid .document-section-label {
  background: rgba(221, 239, 252, 0.58);
  min-height: 40px;
}

.document-loading {
  align-content: center;
  color: var(--muted);
  display: grid;
  gap: 8px;
  justify-items: center;
  min-height: 220px;
  padding: 28px 16px;
  text-align: center;
}

.document-loading strong {
  color: var(--text);
  font-size: 15px;
}

.document-loading small {
  font-size: 12px;
}

.document-loading-dots {
  align-items: center;
  display: flex;
  gap: 6px;
  height: 18px;
  justify-content: center;
}

.document-loading-dots i {
  animation: document-loading-pulse 900ms ease-in-out infinite;
  background: var(--primary);
  border-radius: 50%;
  display: block;
  height: 8px;
  opacity: 0.32;
  transform: translateY(2px) scale(0.82);
  width: 8px;
}

.document-loading-dots i:nth-child(2) {
  animation-delay: 120ms;
}

.document-loading-dots i:nth-child(3) {
  animation-delay: 240ms;
}

.modal-card,
.order-detail-card {
  background: var(--surface-solid);
  border-color: rgba(255, 255, 255, 0.9);
  border-radius: 22px;
  box-shadow: var(--shadow-raised);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.detail-modal:not([hidden]) {
  animation: detail-backdrop-in 220ms ease-out backwards;
}

.detail-modal:not([hidden]) .detail-dialog,
.pending-login-modal:not([hidden]) .pending-login-dialog {
  animation: detail-card-in 420ms cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

@media (hover: hover) {
  #dashboard .info-list > div:not(.info-list-title) {
    transition: border-color 180ms ease;
  }

  #dashboard .info-list > div:not(.info-list-title) dd {
    transition: color 180ms ease, transform 180ms ease;
  }

  #dashboard .info-list > div:not(.info-list-title):hover {
    border-color: rgba(0, 113, 227, 0.2);
  }

  #dashboard .info-list > div:not(.info-list-title):hover dd {
    color: var(--primary-dark);
    transform: translateX(2px);
  }

  .document-card:hover {
    border-color: rgba(0, 113, 227, 0.16);
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.065);
  }

  .recent-order-row:hover td {
    background: rgba(0, 113, 227, 0.055);
    color: var(--primary-dark);
    transform: translateX(2px);
  }
}

.login-modal {
  background:
    radial-gradient(circle at 18% 24%, rgba(0, 113, 227, 0.15), transparent 26rem),
    radial-gradient(circle at 82% 76%, rgba(255, 255, 255, 0.9), transparent 30rem),
    #f5f5f7;
  isolation: isolate;
}

.login-modal::before,
.login-modal::after {
  border-radius: 50%;
  content: "";
  filter: blur(2px);
  opacity: 0.55;
  pointer-events: none;
  position: fixed;
  z-index: -1;
}

.login-modal::before {
  background: rgba(0, 113, 227, 0.12);
  height: 22rem;
  left: -7rem;
  top: -8rem;
  width: 22rem;
}

.login-modal::after {
  background: rgba(255, 255, 255, 0.86);
  bottom: -10rem;
  height: 30rem;
  right: -8rem;
  width: 30rem;
}

.login-layout {
  gap: clamp(40px, 7vw, 92px);
  grid-template-columns: minmax(0, 500px) minmax(360px, 410px);
  max-width: 1050px;
}

.login-brand-panel {
  flex-direction: column;
  gap: 10px;
}

.login-logo-frame {
  height: 190px;
  max-width: 500px;
}

.login-logo {
  top: -25px;
  width: 590px;
}

.login-company-name {
  color: #315b81;
  font-size: clamp(13px, 1.35vw, 16px);
  font-weight: 600;
  left: 8.4%;
  letter-spacing: 0.04em;
  line-height: 1.6;
  margin: 0;
  max-width: 100%;
  padding-inline: 12px;
  position: relative;
  text-align: center;
}

.login-card {
  background: var(--surface-solid);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 24px;
  box-shadow: var(--shadow-raised);
  gap: 18px;
  padding: 34px;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.login-form-heading {
  border-bottom-color: var(--line);
  padding-bottom: 20px;
}

.login-form-heading h2 {
  color: var(--text);
  font-size: 26px;
  letter-spacing: -0.035em;
}

.login-card label span {
  color: #515154;
  font-weight: 600;
}

.login-card input {
  background: rgba(255, 255, 255, 0.76);
  min-height: 48px;
}

.login-submit {
  border-radius: 999px;
  font-size: 15px;
  min-height: var(--button-height-large);
  padding-inline: 20px;
}

.login-submit:hover:not(:disabled) {
  box-shadow: 0 6px 16px rgba(0, 113, 227, 0.18);
}

@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .sidebar,
  .topbar,
  .metric-card,
  .panel,
  .modal-card,
  .order-detail-card,
  .login-card,
  .portal-dropdown-menu {
    background: var(--surface-solid);
  }
}

@media (max-width: 1100px) {
  .login-layout {
    gap: 36px;
    grid-template-columns: minmax(0, 430px) minmax(350px, 390px);
    max-width: 880px;
  }

  .login-logo-frame {
    height: auto;
    overflow: visible;
  }

  .login-logo {
    height: auto;
    left: auto;
    max-width: 100%;
    position: static;
    top: auto;
    transform: none;
    width: 100%;
  }

  .main-content {
    padding-inline: 22px;
  }

  .topbar {
    margin-inline: -22px;
    padding-inline: 22px;
  }
}

@media (min-width: 761px) and (max-width: 1100px) {
  .topbar {
    column-gap: 16px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
  }

  .topbar h1 {
    font-size: clamp(18px, 2.7vw, 25px);
    white-space: nowrap;
    word-break: keep-all;
  }

  .account-box {
    justify-self: stretch;
    margin-left: 0;
    min-width: 0;
    width: auto;
  }

  .topbar-meta {
    max-width: 100%;
    min-width: 0;
  }

  .pending-summary {
    flex-wrap: wrap;
    justify-content: flex-end;
    min-width: 0;
  }

  #flow-collection .flow-collection-metrics {
    gap: 8px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  #flow-collection .flow-collection-metrics .metric-card {
    min-height: 84px;
    padding: 12px 10px;
  }

  #flow-collection .flow-collection-metrics .metric-card::after {
    left: 10px;
    right: 10px;
  }

  #flow-collection .flow-collection-metrics .metric-card > span {
    font-size: 11px;
    text-align: center;
    white-space: nowrap;
  }

  #flow-collection .flow-collection-metrics .metric-card strong {
    font-size: 26px;
    margin: 6px 0 0;
    text-align: center;
  }

  #dashboard .content-grid.two-columns {
    grid-template-columns: minmax(0, 1fr);
  }

  #dealer-management .dealer-management-toolbar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dealer-management-toolbar > label {
    display: none;
  }

  .dealer-management-toolbar > span {
    grid-column: 1 / -1;
  }

  #dealer-management .dealer-management-toolbar > .portal-control-shell:has(input) {
    grid-column: span 2;
  }

  #dingtalkPeopleModal .dingtalk-people-toolbar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #dingtalkPeopleModal .dingtalk-people-toolbar > label {
    display: none;
  }

  #dingtalkPeopleModal .dingtalk-people-toolbar > span {
    grid-column: 1 / -1;
    margin-left: 0;
    text-align: right;
    white-space: nowrap;
  }

  #system-management :is(
    #openDealerManagementBtn,
    #openDingtalkPeopleModalBtn,
    #openDingtalkRulesModalBtn,
    #openDingtalkExceptionAlertModalBtn
  ) {
    font-size: 12px;
    font-weight: 650;
    padding-inline: 12px;
  }

  #system-management .dingtalk-people-overview strong {
    font-size: 13px;
    font-weight: 650;
    line-height: 1.45;
  }
}

@media (max-width: 760px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    background: rgba(247, 247, 249, 0.94);
    border-bottom: 1px solid var(--line);
    border-right: 0;
    height: auto;
    min-height: auto;
    position: relative;
  }

  .nav-list {
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .nav-list::-webkit-scrollbar {
    display: none;
  }

  .nav-item {
    flex: 0 0 auto;
    min-height: var(--button-height-medium);
    white-space: nowrap;
    width: auto;
  }

  .nav-item:hover:not(.active) {
    transform: translateY(-1px);
  }

  .compact-button,
  .line-item > .remove-line-button {
    min-height: 34px;
  }

  .icon-button {
    height: var(--button-height-medium);
    min-height: var(--button-height-medium);
    width: var(--button-height-medium);
  }

  .user-card {
    margin-top: 14px;
  }

  .main-content {
    padding: 20px 16px 36px;
  }

  .topbar {
    margin: -20px -16px 20px;
    min-height: 70px;
    padding: 14px 16px;
  }

  .account-box {
    background: rgba(255, 255, 255, 0.58);
    border-color: rgba(255, 255, 255, 0.78);
    border-radius: 16px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
    padding: 10px 12px;
  }

  .topbar-context {
    text-align: left;
  }

  .topbar-meta {
    justify-content: flex-start;
  }

  .login-modal {
    padding: 24px 18px 36px;
  }

  .login-layout {
    gap: 22px;
    grid-template-columns: 1fr;
    max-width: 440px;
  }

  .login-company-name {
    left: 0;
  }

  .login-logo-frame {
    height: 108px;
    max-width: 390px;
  }

  .login-logo {
    top: -27px;
    width: 440px;
  }

  .login-card {
    border-radius: 20px;
    padding: 26px;
  }

  .metric-card,
  .panel {
    border-radius: 16px;
  }
}

@media (max-width: 420px) {
  .account-box {
    align-items: center;
  }

  .account-box button {
    align-self: center;
  }

  .login-card {
    padding: 22px;
  }

  .metric-card {
    min-height: 128px;
    padding: 18px;
  }

  .metric-card strong {
    font-size: var(--metric-value-font-size, 30px);
  }

  .pending-login-dialog {
    border-radius: 16px;
    padding: 22px 18px 18px;
    width: calc(100vw - 24px);
  }

  .pending-login-modal {
    bottom: 12px;
    right: 12px;
  }

  .pending-login-close {
    right: 12px;
    top: 12px;
  }

  .pending-login-heading {
    padding-right: 68px;
  }

  .pending-login-heading h2 {
    font-size: 18px;
  }

  .pending-login-heading p {
    display: none;
  }

  .pending-login-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pending-login-actions button {
    width: 100%;
  }
}

.motion-enter-left {
  animation: motion-enter-left 800ms cubic-bezier(0.22, 1, 0.36, 1) var(--motion-delay, 0ms) backwards;
}

#appShell.motion-shell-reveal {
  animation: motion-shell-reveal 860ms cubic-bezier(0.16, 1, 0.3, 1) both;
  transform-origin: center top;
}

body.modal-open #appShell.motion-shell-reveal {
  animation: none;
  filter: none;
  transform: none;
}

#appShell .motion-enter-left {
  animation-name: motion-app-enter-left;
}

.motion-enter-card {
  animation: motion-enter-card 700ms cubic-bezier(0.22, 1, 0.36, 1) var(--motion-delay, 0ms) backwards;
}

.motion-enter-up {
  animation: motion-enter-up 550ms cubic-bezier(0.22, 1, 0.36, 1) var(--motion-delay, 0ms) backwards;
}

.motion-enter-down {
  animation: motion-enter-down 500ms cubic-bezier(0.22, 1, 0.36, 1) var(--motion-delay, 0ms) backwards;
}

#appShell .motion-enter-down {
  animation-name: motion-app-enter-down;
}

.motion-item-enter {
  animation: motion-item-enter 420ms cubic-bezier(0.22, 1, 0.36, 1) var(--motion-delay, 0ms) backwards;
}

.motion-row-enter {
  animation: motion-row-enter 420ms cubic-bezier(0.22, 1, 0.36, 1) var(--motion-delay, 0ms) backwards;
}

.motion-value-pop {
  animation: motion-value-pop 420ms cubic-bezier(0.22, 1, 0.36, 1) var(--motion-delay, 0ms) backwards;
  transform-origin: left center;
}

@keyframes motion-enter-left {
  from {
    opacity: 0;
    transform: translateX(-24px);
  }
}

@keyframes motion-shell-reveal {
  from {
    filter: blur(8px) saturate(0.88);
    opacity: 0.18;
    transform: scale(0.988);
  }
  58% {
    filter: blur(0);
    opacity: 1;
  }
  to {
    filter: none;
    opacity: 1;
    transform: none;
  }
}

@keyframes motion-enter-card {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.98);
  }
}

@keyframes motion-app-enter-left {
  from {
    opacity: 0.55;
    transform: translateX(-10px);
  }
}

@keyframes motion-app-enter-down {
  from {
    opacity: 0.55;
    transform: translateY(-6px);
  }
}

@keyframes motion-enter-up {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
}

@keyframes motion-enter-down {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
}

@keyframes motion-item-enter {
  from {
    opacity: 0.45;
    transform: translateY(8px);
  }
}

@keyframes motion-row-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@keyframes motion-value-pop {
  from {
    opacity: 0.45;
    transform: translateY(4px) scale(0.985);
  }
}

@keyframes nav-waterfall-in {
  from {
    opacity: 0;
    transform: translate(-12px, -10px);
  }
}

@keyframes detail-backdrop-in {
  from {
    opacity: 0;
  }
}

@keyframes detail-card-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }
}

@keyframes document-panel-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

@keyframes document-loading-pulse {
  50% {
    opacity: 1;
    transform: translateY(-2px) scale(1);
  }
}

/* Shared portal field states: empty, editable and read-only remain visually distinct. */
.required-field > span:first-child::after {
  color: var(--danger);
  content: " *";
  font-weight: 700;
}

:is(#appShell, .portal-control-surface) .portal-control-shell {
  background: var(--control-empty-surface);
  border: 1px solid var(--control-empty-border);
  border-radius: var(--radius-control);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
  min-width: 0;
  position: relative;
  transform: translateY(0);
  transform-origin: center;
  transition: background-color 180ms var(--ease-fluid), border-color 180ms var(--ease-fluid), box-shadow 180ms var(--ease-fluid), color 180ms var(--ease-fluid), transform 180ms var(--ease-fluid);
  width: 100%;
}

:is(#appShell, .portal-control-surface) .portal-control-shell > input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]),
:is(#appShell, .portal-control-surface) .portal-control-shell > select,
:is(#appShell, .portal-control-surface) .portal-control-shell > textarea {
  background: transparent;
  border: 0;
  box-shadow: none;
  outline: none !important;
  transform: none !important;
}

/* Internal action buttons keep their own size; page submit-button styles must not stretch them. */
:is(#appShell, .portal-control-surface) :is(.portal-control-shell, .precision-date-picker) > .portal-clear-button {
  min-width: var(--control-clear-width, 28px);
  padding: 0;
  width: var(--control-clear-width, 28px);
}

:is(#appShell, .portal-control-surface) :is(.portal-control-shell, .precision-date-picker) > .portal-dropdown-toggle {
  min-width: var(--control-arrow-width, 30px);
  padding: 0;
  width: var(--control-arrow-width, 30px);
}

#hospitalDevelopmentStatisticsModal {
  --control-actions-space: 39px;
  --control-arrow-space: 22px;
  --control-clear-width: 16px;
  --control-arrow-width: 18px;
}

/* Keep text out of the shared clear/arrow area even when a page compacts input padding. */
:is(#appShell, .portal-control-surface) .portal-control-shell:has(> input.combobox-input),
:is(#appShell, .portal-control-surface) .precision-date-picker {
  padding-inline: 0;
}

:is(#appShell, .portal-control-surface) .portal-control-shell > input.combobox-input,
:is(#appShell, .portal-control-surface) .precision-date-picker > .precision-date-trigger {
  min-width: 0;
  padding-right: var(--control-actions-space, 72px);
  width: 100%;
}

:is(#appShell, .portal-control-surface) .portal-control-shell:not(:has(> .portal-clear-button.is-visible)) > input.combobox-input,
:is(#appShell, .portal-control-surface) .precision-date-picker:not(:has(> .portal-clear-button.is-visible)) > .precision-date-trigger {
  padding-right: var(--control-arrow-space, 36px);
}

:is(#appShell, .portal-control-surface) .portal-control-shell:not(:has(> input:disabled, > select:disabled, > textarea:disabled)):not(:has(> input[readonly], > textarea[readonly])):hover,
body.portal-keyboard-navigation :is(#appShell, .portal-control-surface) .portal-control-shell:not(:has(> input:disabled, > select:disabled, > textarea:disabled)):not(:has(> input[readonly], > textarea[readonly])):focus-within,
:is(#appShell, .portal-control-surface) .combobox-field.portal-dropdown-open .portal-control-shell:not(:has(> .combobox-input:disabled)) {
  background: #fff;
  border-color: var(--interaction-hover-border);
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.1);
  transform: none;
}

:is(#appShell, .portal-control-surface) .portal-control-shell:not(:has(> input:disabled, > select:disabled, > textarea:disabled)):active {
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.1);
  transform: none;
}

:is(#appShell, .portal-control-surface) .portal-control-shell:has(> input:disabled, > select:disabled, > textarea:disabled),
:is(#appShell, .portal-control-surface) .portal-control-shell:has(> input[readonly], > textarea[readonly]) {
  background: var(--control-readonly-surface);
  border-color: var(--control-readonly-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.48);
  transform: none;
}

:is(#appShell, .portal-control-surface) .portal-control-shell:has(> .field-invalid) {
  box-shadow: inset 0 0 0 1px var(--danger);
}

.portal-dropdown-toggle:hover:not(:disabled),
.portal-dropdown-toggle:focus-visible {
  background: rgba(10, 132, 255, 0.09);
  box-shadow: none;
  color: var(--primary-dark);
  outline: none;
  transform: none;
}

.portal-dropdown-toggle:active:not(:disabled) {
  transform: none;
}

.portal-dropdown-option:hover:not(:disabled),
.portal-dropdown-option:focus-visible,
.portal-dropdown-option.active:not(:disabled) {
  background: rgba(10, 132, 255, 0.09);
  border-color: rgba(10, 132, 255, 0.18);
  box-shadow: none;
  color: var(--primary-dark);
  transform: none;
}

.portal-dropdown-option.selected,
.portal-dropdown-option[aria-selected="true"],
.portal-dropdown-option[aria-current="true"] {
  background: rgba(10, 132, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(10, 132, 255, 0.14);
  color: var(--primary-dark);
  font-weight: 650;
}

.portal-dropdown-option:active {
  transform: scale(0.985);
}

.flow-tracking-form {
  margin-inline: auto;
  max-width: 1680px;
}

.flow-reporting-section {
  align-items: end;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(180px, 0.7fr) minmax(360px, 2.3fr);
  margin-bottom: 18px;
  padding-block: 14px;
}

.flow-reporting-heading h3 {
  margin: 0;
}

.flow-reporting-heading p {
  color: var(--muted);
  font-size: 13px;
  margin: 4px 0 0;
}

.flow-reporting-fields {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(180px, 320px));
  justify-content: end;
}

.flow-month-toolbar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.flow-month-toolbar > .form-field {
  align-items: center;
  display: flex;
  flex: 0 1 260px;
  gap: 10px;
  min-width: 0;
}

.flow-month-toolbar > .form-field > span {
  margin: 0;
  white-space: nowrap;
}

.flow-month-toolbar .precision-date-picker {
  flex: 1;
  min-width: 0;
}

.flow-month-toolbar #flowReportingMonthStatus {
  flex: 1 1 300px;
  margin: 0;
}

.flow-stock-workspace {
  border-block: 1px solid var(--line);
  margin-block: 14px 0;
  padding-block: 12px;
}

.flow-stock-toolbar {
  align-items: center;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(180px, 0.7fr) minmax(0, 2.3fr);
}

.flow-stock-heading h3 {
  margin: 0;
}

.flow-stock-heading p {
  color: var(--muted);
  font-size: 13px;
  margin: 4px 0 0;
}

.flow-stock-toolbar-controls {
  align-items: center;
  display: flex;
  gap: 14px;
  justify-content: flex-end;
  min-width: 0;
}

.flow-stock-company {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  min-height: 34px;
  min-width: 0;
}

.flow-stock-company span,
.flow-stock-customer-field > span {
  color: var(--muted);
  font-size: 12px;
}

.flow-stock-company strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
  overflow-wrap: anywhere;
  text-align: right;
}

.flow-stock-customer-field {
  align-items: center;
  display: grid;
  flex: 0 1 340px;
  gap: 8px;
  grid-template-columns: auto minmax(190px, 1fr);
  min-width: 240px;
}

.flow-stock-customer-field > .portal-control-shell {
  min-width: 0;
}

.flow-stock-summary {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex: 0 0 auto;
  gap: 14px;
  white-space: nowrap;
}

.flow-stock-summary strong {
  color: var(--primary-dark);
  font-size: 15px;
  margin-left: 3px;
}

.flow-stock-toggle-button {
  align-items: center;
  display: inline-flex;
  flex: 0 0 auto;
  gap: 8px;
  justify-content: center;
  min-width: 104px;
}

.flow-stock-toggle-icon {
  display: grid;
  height: 14px;
  place-items: center;
  width: 14px;
}

.flow-stock-toggle-icon::before {
  border-bottom: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  content: "";
  height: 6px;
  transform: rotate(45deg);
  transform-origin: 50% 50%;
  transition: transform 240ms var(--ease-fluid);
  width: 6px;
}

.flow-stock-workspace.is-expanded .flow-stock-toggle-icon::before {
  transform: rotate(225deg);
}

.flow-stock-details {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  padding-top: 0;
  transition: grid-template-rows 280ms var(--ease-fluid), opacity 180ms ease, padding-top 280ms var(--ease-fluid), visibility 0s linear 280ms;
  visibility: hidden;
}

.flow-stock-workspace.is-expanded .flow-stock-details {
  grid-template-rows: 1fr;
  opacity: 1;
  padding-top: 12px;
  transition: grid-template-rows 280ms var(--ease-fluid), opacity 220ms ease 40ms, padding-top 280ms var(--ease-fluid), visibility 0s linear 0s;
  visibility: visible;
}

.flow-stock-details-inner {
  min-height: 0;
  overflow: hidden;
}

.flow-stock-table {
  min-width: 860px;
}

.flow-stock-table-wrap {
  max-height: 260px;
}

.flow-stock-pagination {
  margin-top: 8px;
}

.flow-ledger-header {
  align-items: end;
  display: flex;
  justify-content: space-between;
}

.flow-ledger-header p {
  color: var(--muted);
  font-size: 13px;
  margin: 5px 0 0 13px;
}

.system-management-panel {
  margin-inline: auto;
  max-width: 1380px;
}

.system-management-group {
  border-top: 1px solid var(--line);
  display: block;
  padding-block: 24px;
}

.system-group-heading {
  align-items: center;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.system-group-heading h3,
.system-group-heading p {
  margin: 0;
}

.system-group-heading p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 5px;
}

.system-management-heading p,
.system-setting-row p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  margin: 6px 0 0;
}

.system-setting-list {
  border-top: 1px solid var(--line);
}

.system-management-card-grid,
.system-config-domain-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.system-management-entry-card {
  background: rgba(247, 251, 255, 0.7);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
}

.system-management-entry-card .system-setting-content {
  min-width: 0;
}

.system-management-entry-card .secondary-button {
  align-self: flex-start;
  margin-top: auto;
}

.system-rule-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding-block: 20px;
}

.system-config-field-grid.flow-date-limit-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.flow-date-limit-value-slot {
  min-width: 0;
}

.system-rule-field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.system-rule-field > span {
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 650;
}

.system-rule-field small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.system-form-status {
  color: var(--primary-dark);
  display: block;
  font-size: 13px;
  font-weight: 650;
  min-height: 20px;
}

.system-save-behavior {
  background: #edf6fd;
  border: 1px solid rgba(10, 132, 255, 0.14);
  border-radius: 6px;
  color: var(--primary-dark);
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 650;
  padding: 7px 10px;
}

.system-config-overview-grid {
  display: grid;
  gap: 20px;
}

.system-config-domain {
  display: grid;
  gap: 12px;
}

.system-config-section-label {
  align-items: center;
  border-top: 1px solid var(--line);
  color: var(--text);
  display: flex;
  gap: 10px;
  grid-column: 1 / -1;
  padding-top: 18px;
}

.system-config-domain:first-child .system-config-section-label {
  border-top: 0;
  padding-top: 0;
}

.system-config-section-label > span {
  align-items: center;
  background: #edf6fd;
  border: 1px solid rgba(10, 132, 255, 0.16);
  border-radius: 999px;
  color: var(--primary-dark);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 750;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.system-config-section-label > div {
  display: grid;
  gap: 2px;
}

.system-config-section-label strong {
  font-size: 14px;
}

.system-config-section-label small {
  color: var(--muted);
  font-size: 12px;
}

.system-config-summary {
  background: rgba(247, 251, 255, 0.7);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 14px;
}

.system-config-domain-grid > .system-config-summary:only-child {
  grid-column: 1 / -1;
}

.system-config-summary-heading {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.system-config-summary-heading > span {
  color: var(--text);
  font-size: 15px;
  font-weight: 750;
}

.system-config-summary-heading > strong {
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 700;
}

.system-config-summary dl {
  display: grid;
  gap: 0;
  margin: 10px 0 12px;
}

.system-config-summary dl > div {
  align-items: start;
  border-top: 1px solid rgba(183, 208, 224, 0.56);
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(80px, 0.8fr) minmax(0, 1.2fr);
  padding: 6px 0;
}

.system-config-summary dt,
.system-config-summary dd {
  font-size: 12px;
  line-height: 1.5;
  margin: 0;
}

.system-config-summary dt { color: var(--muted); }
.system-config-summary dd {
  color: var(--text-soft);
  overflow-wrap: anywhere;
  text-align: right;
}

.system-config-summary .secondary-button {
  align-self: flex-start;
  margin-top: auto;
}

.system-config-summary-limits {
  gap: 0 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.flow-settings-overview-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.approval-workspace { min-height: 560px; }
.approval-header { align-items: center; }
.approval-header p { margin: 4px 0 0; color: var(--muted); }
.approval-business-tabs, .approval-view-tabs { display: flex; gap: 8px; }
.approval-business-tabs { padding: 6px; margin-bottom: 18px; border-radius: 12px; background: #eef5fb; }
.approval-business-tabs button, .approval-view-tabs button { border: 0; border-radius: 9px; padding: 10px 18px; color: #587086; background: transparent; font: inherit; cursor: pointer; }
.approval-business-tabs button { align-items: center; display: flex; flex: 1; gap: 7px; justify-content: center; }
.approval-business-tabs button.active, .approval-view-tabs button.active { color: var(--primary); background: #fff; box-shadow: 0 4px 14px rgba(34, 105, 160, .1); font-weight: 700; }
.approval-business-tabs button:disabled { cursor: not-allowed; opacity: .62; }
.approval-business-tabs small { margin-left: 6px; font-size: 11px; }
.approval-tab-badge {
  align-items: center;
  background: #fa5151;
  border-radius: 999px;
  box-shadow: 0 0 0 2px #eef5fb;
  color: #fff;
  display: inline-flex;
  font-size: 10px;
  font-weight: 700;
  height: 18px;
  justify-content: center;
  line-height: 1;
  min-width: 18px;
  padding: 0 4px;
}
.approval-business-tabs button.active .approval-tab-badge,
.approval-view-tabs button.active .approval-tab-badge { box-shadow: 0 0 0 2px #fff; }
.approval-tab-badge[hidden] { display: none; }
.approval-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.approval-search { display: grid; grid-template-columns: minmax(180px, 240px) auto auto; align-items: center; gap: 8px; }
.approval-search input { min-width: 0; width: 100%; }
.approval-search button { min-width: 58px; white-space: nowrap; }
.approval-table-wrap { min-height: 320px; }
.approval-document-link {
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: var(--primary);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 700;
  line-height: 1.35;
  margin: -5px -8px;
  min-height: 0;
  padding: 5px 8px;
  position: relative;
  text-align: left;
  transition: color 220ms ease, background-color 220ms ease, box-shadow 220ms ease, transform 220ms ease;
}

.approval-document-link::after {
  background: linear-gradient(90deg, rgba(10, 132, 255, .2), var(--primary), rgba(10, 132, 255, .2));
  border-radius: 999px;
  bottom: 2px;
  content: "";
  height: 1px;
  left: 8px;
  opacity: .45;
  position: absolute;
  right: 8px;
  transform: scaleX(.18);
  transform-origin: left center;
  transition: opacity 240ms ease, transform 320ms cubic-bezier(.22, 1, .36, 1);
}

button.approval-document-link:hover:not(:disabled),
button.approval-document-link:focus-visible {
  background: rgba(10, 132, 255, .055);
  box-shadow: 0 5px 14px rgba(30, 100, 165, .09);
  color: #006bc7;
  transform: translateY(-1px);
}

button.approval-document-link:hover:not(:disabled)::after,
button.approval-document-link:focus-visible::after {
  opacity: .9;
  transform: scaleX(1);
}

button.approval-document-link:active:not(:disabled) {
  background: rgba(10, 132, 255, .09);
  box-shadow: 0 2px 7px rgba(30, 100, 165, .08);
  transform: translateY(0) scale(.99);
}

@media (prefers-reduced-motion: reduce) {
  .login-modal .motion-enter-left,
  .login-modal .motion-enter-card {
    animation: none;
  }

  .approval-document-link,
  .approval-document-link::after {
    transition-duration: 0.01ms;
  }
}

.approval-status-pill { display: inline-flex; white-space: nowrap; padding: 3px 8px; border-radius: 999px; color: #176ca5; background: #e9f5fd; font-size: 12px; font-weight: 700; }
.approval-status-pill.is-complete { color: #087f5b; background: #e4f6ef; }
.approval-status-pill.is-processing { color: #a46d00; background: #fff4d6; }
.approval-status-pill.is-rejected { color: #c7383f; background: #fdebed; }
.approval-status-pill.is-not-approved { color: #a96f12; background: #fff1d6; }
.approval-status-pill.is-issue { color: #9b5b09; background: #fff0dd; }
.approval-issue-text { display: block; max-width: 20rem; margin-top: 0.35rem; color: #b45309; line-height: 1.45; white-space: normal; }
.approval-detail-modal { background: rgba(27, 51, 70, .42); }
.approval-detail-dialog { width: min(1500px, 100%); max-height: calc(100vh - 48px); overflow: auto; background: var(--surface-solid); }
.approval-detail-header { min-height: 78px; }
.approval-detail-body { padding: 0; }
.approval-document-heading { align-items: center; display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr) auto auto; margin: 2px 0 12px; }
.approval-document-heading div { align-items: baseline; display: flex; gap: 10px; min-width: 0; }
.approval-document-heading div span, .approval-document-heading small { color: var(--muted); font-size: 12px; }
.approval-document-heading strong { color: var(--text); font-size: 15px; overflow-wrap: anywhere; }
.approval-detail-meta { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 12px; }
.approval-progress { align-items: center; display: flex; gap: 8px; justify-content: center; margin: 12px auto 0; max-width: 100%; overflow-x: auto; padding: 6px 10px; }
.approval-progress-step { align-items: center; background: transparent; display: flex; flex: 0 1 240px; justify-content: center; min-height: 38px; min-width: 160px; padding: 3px 8px; }
.approval-progress-content { min-width: 0; text-align: center; width: 100%; }
.approval-progress-label { color: #617c8e; display: block; font-size: 11px; margin-bottom: 2px; }
.approval-progress-approvers { align-items: center; display: flex; flex-wrap: wrap; gap: 4px 8px; justify-content: center; min-width: 0; }
.approval-progress-approver { align-items: center; color: var(--text); display: inline-flex; flex: 0 1 auto; font-size: 11px; gap: 3px; min-width: 0; }
.approval-progress-approver i { align-items: center; display: inline-flex; flex: 0 0 12px; font-style: normal; height: 12px; justify-content: center; }
.approval-progress-approver i img { display: block; height: 12px; width: 12px; }
.approval-progress-approver em { font-style: normal; overflow-wrap: anywhere; }
.approval-progress-approver.is-complete i { color: #0f9f74; }
.approval-progress-approver.is-rejected i { color: #dc3f45; }
.approval-progress-approver.is-processing i { color: #d99a16; }
.approval-progress-approver.is-upcoming i, .approval-progress-approver.is-ended i { color: #91a4b3; }
.approval-progress-arrow { color: #7890a1; flex: 0 0 32px; height: 16px; position: relative; width: 32px; }
.approval-progress-arrow::before { border-top: 1px solid currentColor; content: ""; left: 0; position: absolute; right: 7px; top: 8px; }
.approval-progress-arrow::after { border-right: 1px solid currentColor; border-top: 1px solid currentColor; content: ""; height: 7px; position: absolute; right: 1px; top: 4px; transform: rotate(45deg); width: 7px; }
.approval-detail-table-wrap { background: #fff; border: 1px solid #afcbdc; max-height: 320px; overflow: auto; }
.approval-detail-table { min-width: 1380px; }
.approval-detail-table thead { position: sticky; top: 0; z-index: 1; }
.approval-detail-table td:nth-child(1), .approval-detail-table td:nth-child(7), .approval-detail-table td:nth-child(12) { text-align: center; }
.approval-col-index { width: 52px; } .approval-col-date { width: 104px; } .approval-col-dealer { width: 150px; }
.approval-col-manufacturer { width: 170px; } .approval-col-code { width: 112px; } .approval-col-product { width: 170px; }
.approval-col-quantity { width: 84px; } .approval-col-hospital { width: 180px; } .approval-col-sales-type { width: 90px; }
.approval-col-manager { width: 100px; } .approval-col-secondary { width: 150px; } .approval-col-money { width: 104px; }
.approval-order-col-index { width: 48px; }
.approval-order-col-product { width: 170px; }
.approval-order-col-code { width: 120px; }
.approval-order-col-specialty, .approval-order-col-department { width: 112px; }
.approval-order-col-model, .approval-order-col-specification { width: 96px; }
.approval-order-col-money { width: 112px; }
.approval-order-col-quantity { width: 88px; }
.approval-order-col-remark { width: 180px; }
.approval-detail-totals { margin-top: 14px; }
.approval-detail-actions {
  align-items: flex-end;
  background: var(--surface-solid);
  border-top: 1px solid #dbe7f0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 14px;
  padding-top: 14px;
}
.approval-detail-actions > .history-download-status { margin-right: auto; }
.approval-detail-actions > button {
  flex: 0 0 auto;
  white-space: nowrap;
}
.flow-history-panel { margin-inline: auto; max-width: 1680px; }
.flow-collection-panel { margin-inline: auto; max-width: 1680px; }
.flow-collection-toolbar { align-items: end; display: grid; grid-template-columns: repeat(4, minmax(170px, 1fr)) auto; }
.flow-collection-toolbar label { align-self: stretch; display: grid; gap: 6px; grid-template-rows: auto minmax(42px, auto); }
.flow-collection-toolbar label > span { color: var(--muted); font-size: 12px; font-weight: 700; }
.flow-collection-toolbar .precision-date-picker,
.flow-collection-toolbar .portal-control-shell { align-self: end; min-height: 42px; }
.flow-collection-anomalies { align-items: center; background: #fff6e5; border: 1px solid #e8c578; border-radius: 10px; color: #7d5511; display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 0 0 14px; padding: 10px 12px; }
.flow-collection-anomalies[hidden] { display: none; }
.flow-collection-anomalies span { font-size: 13px; }
.flow-collection-anomalies details { flex-basis: 100%; min-width: 0; overflow-wrap: anywhere; }
.flow-collection-table { min-width: 960px; table-layout: fixed; }
.flow-collection-table th:first-child { width: 18%; }
.flow-collection-table th:nth-child(2) { width: 17%; }
.flow-collection-table th:nth-child(3) { width: 9%; }
.flow-collection-table th:nth-child(4),
.flow-collection-table th:nth-child(5) { width: 9%; }
.flow-collection-table th:nth-child(6) { width: 10%; }
.flow-collection-table th:nth-child(7) { width: 8%; }
.flow-collection-table th:last-child { width: 20%; }
.flow-collection-table th,
.flow-collection-table td { padding-block: 10px; vertical-align: middle; }
.flow-collection-panel .inventory-table td small,
.flow-collection-muted,
.flow-collection-latest-time,
.flow-collection-account-status { color: var(--muted); font-size: 12px; line-height: 1.45; }
.flow-collection-panel .inventory-table td small { display: block; margin-top: 3px; white-space: nowrap; }
.flow-collection-manager-list { display: flex; flex-wrap: wrap; gap: 5px; }
.flow-collection-manager-pill { align-items: center; background: #eef4f8; border: 1px solid #d8e5ed; border-radius: 999px; color: var(--muted); display: inline-flex; font-size: 12px; font-weight: 650; line-height: 1.2; max-width: 100%; padding: 3px 8px; }
.flow-collection-status.approval-status-pill { font-size: 11px; line-height: 1.2; padding: 2px 7px; }
.flow-collection-status.is-neutral { background: #edf2f6; color: #698093; }
.flow-collection-document-actions { display: grid; gap: 4px 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); min-width: 0; width: 100%; }
.flow-collection-document-actions .compact-button,
.approval-row-view-button { white-space: nowrap; }
.flow-collection-document-actions .compact-button { background: transparent; border: 0; border-radius: 0; box-shadow: none; color: var(--primary-dark); font-size: 10px; max-width: 100%; min-height: 22px; overflow: hidden; padding: 2px 0; text-align: left; text-overflow: ellipsis; width: 100%; }
.flow-collection-document-actions .compact-button:hover:not(:disabled) { background: transparent; box-shadow: none; color: var(--primary); text-decoration: underline; }
.flow-history-header p { color: var(--muted); margin: 4px 0 0; }
.flow-history-toolbar { justify-content: flex-end; }
.flow-history-toolbar .contract-status-message { margin-right: auto; }
.flow-history-table { min-width: 1180px; }
.flow-history-table th:nth-child(n+6), .flow-history-table td:nth-child(n+6) { text-align: center; }
.flow-history-status { align-items: center; display: inline-flex; font-weight: 700; gap: 5px; white-space: nowrap; }
.flow-history-status img { display: block; height: 18px; width: 18px; }
.flow-history-status.is-complete { color: #0f8f69; }
.flow-history-status.is-processing { color: #c18713; }
.flow-history-status.is-not-approved { color: #b7791f; }
.approval-detail-modal.is-dealer-history .approval-document-heading { grid-template-columns: minmax(0, 1fr) auto; }
.flow-approval-master-choice { margin-bottom: 12px; }
.flow-approval-toggle-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 12px;
}
.flow-approval-toggle-grid .flow-approval-master-choice { margin-bottom: 0; }
@media (max-width: 760px) {
  .flow-approval-toggle-grid { grid-template-columns: 1fr; }
}
.flow-approval-stage-grid { align-items: stretch; }
.flow-approval-stage-card { display: grid; gap: 10px; padding: 14px; border: 1px solid #d7e5f0; border-radius: 12px; background: #fff; }
.flow-approval-stage-card > label { display: flex; gap: 10px; align-items: flex-start; }
.flow-approval-stage-card strong, .flow-approval-stage-card small { display: block; }
.flow-approval-stage-card small { margin-top: 4px; color: var(--muted); }

@media (max-width: 900px) {
  .approval-toolbar { align-items: stretch; flex-direction: column; }
  .flow-collection-toolbar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow-collection-toolbar label:last-of-type { grid-column: 1 / -1; }
  .approval-search input { width: 100%; }
  .approval-detail-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .approval-progress { align-items: center; flex-direction: column; gap: 2px; overflow-x: visible; }
  .approval-progress-step { flex: 0 0 auto; min-height: 38px; width: min(100%, 320px); }
  .approval-progress-arrow { flex: 0 0 28px; transform: rotate(90deg); width: 28px; }
}

@media (max-width: 1280px) {
  .flow-collection-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow-collection-toolbar > button { justify-self: stretch; }
}

/* Date fields and selected navigation retain the same interaction language as portal controls. */
:is(#appShell, #portalSettingsModal) .precision-date-trigger:hover:not(:disabled),
body.portal-keyboard-navigation :is(#appShell, #portalSettingsModal) .precision-date-trigger:focus-visible,
:is(#appShell, #portalSettingsModal) .precision-date-picker.portal-dropdown-open .precision-date-trigger {
  background: #fff;
  border-color: var(--interaction-hover-border);
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.1);
  color: var(--text);
  transform: none;
}

:is(#appShell, #portalSettingsModal) .precision-date-trigger:active:not(:disabled) {
  background: #fff;
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.1);
  color: var(--text);
  transform: none;
}

/* The authorization dialog is rendered outside #appShell. Keep its date
   controls on the same white-surface interaction contract as the order form. */
#authorizationCreateDialog .precision-date-trigger,
#authorizationCreateDialog .precision-date-trigger:hover:not(:disabled),
body.portal-keyboard-navigation #authorizationCreateDialog .precision-date-trigger:focus-visible,
#authorizationCreateDialog .precision-date-picker.portal-dropdown-open .precision-date-trigger,
#authorizationCreateDialog .precision-date-trigger:active:not(:disabled) {
  background: #fff;
  color: var(--text);
}

#authorizationCreateDialog .precision-date-trigger:hover:not(:disabled),
body.portal-keyboard-navigation #authorizationCreateDialog .precision-date-trigger:focus-visible,
#authorizationCreateDialog .precision-date-picker.portal-dropdown-open .precision-date-trigger {
  border-color: rgba(10, 132, 255, 0.34);
  box-shadow: 0 5px 14px rgba(10, 132, 255, 0.16);
  transform: translateY(-2px);
}

#authorizationCreateDialog .precision-date-trigger:active:not(:disabled) {
  box-shadow: none;
  transform: scale(0.98);
}

.nav-item.active:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(239, 248, 255, 0.88));
  border-color: rgba(10, 132, 255, 0.2);
  box-shadow: 0 8px 20px rgba(39, 74, 112, 0.11), inset 0 1px 0 #fff;
  color: var(--primary-dark);
  transform: none;
}

.system-config-summary-limits > div {
  display: block !important;
  padding-right: 18px !important;
}

.system-config-summary-limits dd {
  margin-top: 4px;
  text-align: left;
}

.system-config-dialog,
.fixed-options-dialog {
  background: var(--surface-solid);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 48px);
  overflow: hidden;
  width: min(1080px, 100%);
}

.system-config-dialog > form {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.system-config-modal-body,
.fixed-options-dialog > .fixed-options-editor {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

.system-config-modal-body {
  margin-inline: -4px;
  padding-inline: 4px;
}

.system-config-panel {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding-top: 18px;
}

.system-config-panel[hidden] { display: none; }

.system-config-panel > :not(.system-modal-setting-row) {
  grid-column: 1 / -1;
}

.system-config-panel-heading h3,
.system-config-panel-heading p {
  margin: 0;
}

.system-config-panel-heading p,
.system-modal-setting-row p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  margin-top: 5px;
}

.system-config-subheading {
  border-left: 3px solid var(--primary);
  color: var(--text);
  font-size: 14px;
  margin: 24px 0 4px;
  padding-left: 10px;
}

.system-modal-setting-row {
  align-items: start;
  background: color-mix(in srgb, var(--surface-muted) 58%, var(--surface-solid));
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) auto;
  margin: 0;
  padding: 14px;
}

.system-config-subheading + .system-modal-setting-row:not(:has(+ .system-modal-setting-row)) {
  grid-column: 1 / -1;
}

.system-modal-setting-row > div > strong {
  color: var(--text);
  font-size: 14px;
}

.system-config-field-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.system-config-field-grid > :only-child {
  grid-column: 1 / -1;
}

.system-config-panel .system-rule-field > input[type="number"] {
  width: min(100%, 220px);
}

.system-config-panel .system-rule-field > :is(select, .portal-control-shell) {
  width: min(100%, 360px);
}

.system-config-panel .system-rule-field > .precision-date-picker {
  width: min(100%, 260px);
}

.system-role-access-fieldset {
  border: 1px solid var(--line);
  border-radius: 14px;
  margin: 18px 0 0;
  min-width: 0;
  padding: 14px;
}

.system-role-access-fieldset legend {
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  padding-inline: 6px;
}

.system-role-access-fieldset > p {
  color: var(--muted);
  font-size: 12px;
  margin: 0 0 12px;
}

.system-role-access-choice {
  align-items: flex-start;
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  gap: 9px;
  min-height: 82px;
  padding: 12px;
}

.system-role-access-choice input,
.flow-approval-stage-card > label > input[type="checkbox"] {
  flex: 0 0 18px;
  height: 18px;
  margin: 1px 0 0;
  width: 18px;
}

.system-role-access-choice span,
.system-role-access-choice small {
  display: block;
}

.role-feature-matrix {
  border: 1px solid var(--line);
  border-radius: 16px;
  margin-top: 18px;
  min-width: 760px;
  overflow: hidden;
}

.role-feature-matrix-head,
.role-feature-matrix-row {
  align-items: center;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(280px, 1fr) repeat(3, minmax(130px, 0.52fr));
  padding: 12px 16px;
}

.role-feature-matrix-head {
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.role-feature-matrix-head > span { text-align: left; }

.role-feature-matrix-row {
  border-top: 1px solid var(--line);
}

.role-feature-matrix-row.is-child {
  background: color-mix(in srgb, var(--surface-muted) 46%, transparent);
}

.role-feature-matrix-row.is-child > span {
  padding-left: 22px;
  position: relative;
}

.role-feature-matrix-row.is-child > span::before {
  color: var(--muted);
  content: "↳";
  left: 2px;
  position: absolute;
  top: 1px;
}

.role-feature-matrix-row > span strong,
.role-feature-matrix-row > span small {
  display: block;
}

.role-feature-matrix-row > span strong { font-size: 14px; }

.role-feature-matrix-row > span small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  margin-top: 3px;
}

.role-feature-switch {
  justify-self: center;
}

.role-feature-switch.is-parent-disabled {
  opacity: 0.58;
}

@media (max-width: 980px) {
  .role-feature-matrix {
    min-width: 0;
  }

  .role-feature-matrix-head,
  .role-feature-matrix-row {
    gap: 6px;
    grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr));
    padding: 10px 6px;
  }
}

.system-role-access-choice strong {
  color: var(--text);
  font-size: 13px;
}

.system-role-access-choice small {
  color: var(--muted);
  line-height: 1.5;
  margin-top: 5px;
}

.system-config-dialog-footer {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  flex: 0 0 auto;
  gap: 16px;
  justify-content: space-between;
  margin-top: 18px;
  padding-top: 14px;
}

.system-config-dialog-footer .system-form-status { margin: 0; }

.system-config-footer-actions {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: 10px;
}

.fixed-options-dialog {
  height: min(800px, calc(100vh - 48px));
  width: min(1260px, 100%);
}

.fixed-options-dialog > .fixed-options-editor {
  padding-right: 4px;
}

.system-switch-save-note {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  grid-column: 1 / -1;
  line-height: 1.3;
  text-align: right;
}

.dingtalk-management-stack {
  border-top: 1px solid var(--line);
}

.dingtalk-admin-section {
  border-bottom: 1px solid var(--line);
  padding-block: 20px;
}

.dingtalk-section-heading,
.dingtalk-heading-actions,
.dingtalk-people-toolbar {
  align-items: center;
  display: flex;
}

.dingtalk-section-heading {
  gap: 20px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.dingtalk-section-heading h4,
.dingtalk-section-heading p {
  margin: 0;
}

.dingtalk-section-heading h4 {
  font-size: 15px;
}

.dingtalk-section-heading p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  margin-top: 4px;
}

.dingtalk-heading-actions {
  flex: 0 0 auto;
  gap: 8px;
}

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

.dingtalk-config-grid > label,
.dingtalk-rule-condition {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.dingtalk-config-grid > label > span,
.dingtalk-rule-condition > span {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 650;
}

.dingtalk-people-toolbar {
  gap: 10px;
  margin-bottom: 12px;
}

.dingtalk-people-toolbar label {
  color: var(--text-soft);
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 650;
}

.dingtalk-people-toolbar input {
  max-width: 420px;
}

.dingtalk-people-toolbar > span {
  color: var(--muted);
  font-size: 12px;
  margin-left: auto;
}

.dingtalk-people-overview {
  align-items: center;
  color: var(--text-soft);
  display: flex;
  gap: 10px;
  min-height: 34px;
}

.dingtalk-people-overview > span,
.dingtalk-people-overview small {
  font-size: 12px;
}

.dingtalk-people-overview strong {
  color: var(--primary-dark);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.dingtalk-people-overview small {
  color: var(--muted);
}

.dingtalk-rules-overview {
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.dingtalk-rules-overview-item {
  align-items: center;
  background: rgba(248, 251, 254, 0.82);
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(100px, 150px) minmax(0, 1fr);
  min-height: 42px;
  padding: 9px 12px;
}

.dingtalk-rules-overview-item + .dingtalk-rules-overview-item {
  border-top: 1px solid var(--line);
}

.dingtalk-rules-overview-item strong {
  color: var(--text);
  font-size: 13px;
}

.dingtalk-rules-overview-item span {
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.dingtalk-people-table-wrap {
  border: 1px solid var(--line);
  max-height: 440px;
  overflow: auto;
}

.dingtalk-people-table {
  min-width: 980px;
  table-layout: fixed;
  width: 100%;
}

.dingtalk-people-table th {
  background: #edf5fb;
  position: sticky;
  top: 0;
  z-index: 2;
}

.dingtalk-people-table th:first-child { width: 29%; }
.dingtalk-people-table th:nth-child(2) { width: 18%; }
.dingtalk-people-table th:nth-child(3) { width: 31%; }
.dingtalk-people-table th:nth-child(4) { width: 150px; }
.dingtalk-people-table th:last-child { width: 52px; }

.dingtalk-people-table td {
  padding: 8px;
  vertical-align: middle;
}

.dingtalk-people-table textarea {
  min-height: 56px;
  resize: vertical;
}

.dingtalk-person-remove {
  align-items: center;
  display: inline-flex;
  height: 32px;
  justify-content: center;
  min-width: 32px;
  padding: 0;
  width: 32px;
}

.dingtalk-people-table tr.is-push-disabled td {
  background: #f7fafc;
}

.dingtalk-person-enabled-cell {
  white-space: nowrap;
}

.dingtalk-person-enabled-switch {
  gap: 8px;
}

.dingtalk-person-enabled-switch > strong {
  font-size: 12px;
}

.dingtalk-people-table tr.is-push-disabled .dingtalk-person-enabled-switch > strong {
  color: var(--muted);
}

.dingtalk-people-dialog {
  background: var(--surface-solid);
  display: flex;
  flex-direction: column;
  height: min(760px, calc(100vh - 48px));
  overflow: hidden;
  width: min(1180px, 100%);
}

.dingtalk-people-dialog .dingtalk-people-toolbar {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: auto minmax(150px, 190px) auto minmax(170px, 210px) auto minmax(220px, 1fr) auto;
}

.dingtalk-people-dialog .dingtalk-people-toolbar input,
.dingtalk-people-dialog .dingtalk-people-toolbar select,
.dingtalk-people-dialog .dingtalk-people-toolbar .portal-control-shell {
  max-width: none;
  min-width: 0;
}

.dingtalk-people-dialog .dingtalk-people-table-wrap {
  background: var(--surface-solid);
  flex: 1;
  max-height: none;
  min-height: 280px;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.dingtalk-people-dialog .dingtalk-people-table th {
  background: #edf5fb;
  background-clip: padding-box;
  box-shadow: inset 0 -1px 0 var(--line);
}

.dingtalk-people-dialog .dingtalk-people-table {
  min-width: 1120px;
}

.dingtalk-people-dialog .dingtalk-people-table th:first-child { width: 18%; }
.dingtalk-people-dialog .dingtalk-people-table th:nth-child(2) { width: 14%; }
.dingtalk-people-dialog .dingtalk-people-table th:nth-child(3) { width: 10%; }
.dingtalk-people-dialog .dingtalk-people-table th:nth-child(4) { width: 24%; }
.dingtalk-people-dialog .dingtalk-people-table th:nth-child(5) { width: 14%; }
.dingtalk-people-dialog .dingtalk-people-table th:nth-child(6) { width: 12%; }
.dingtalk-people-dialog .dingtalk-people-table th:last-child { width: 86px; }

.sales-handover-dialog .dingtalk-people-table {
  min-width: 1080px;
}

.sales-handover-dialog-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
  scrollbar-gutter: stable;
}

.sales-handover-dialog .dingtalk-people-table-wrap {
  flex: 0 0 auto;
  max-height: min(40dvh, 360px);
  min-height: 0;
  overflow: auto;
}

.sales-handover-dialog .dingtalk-people-table th:first-child { width: 118px; }
.sales-handover-dialog .dingtalk-people-table th:nth-child(2) { width: 132px; }
.sales-handover-dialog .dingtalk-people-table th:nth-child(3) { width: 300px; }
.sales-handover-dialog .dingtalk-people-table th:nth-child(4) { width: 330px; }
.sales-handover-dialog .dingtalk-people-table th:last-child { width: 112px; }

.sales-handover-successor-field {
  display: block;
  min-width: 0;
}

.sales-handover-successor-field > span {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.sales-handover-scope {
  display: grid;
  gap: 5px;
}

.sales-handover-scope-row {
  align-items: baseline;
  display: grid;
  gap: 8px;
  grid-template-columns: 34px minmax(0, 1fr);
}

.sales-handover-scope-row small {
  color: var(--muted);
  font-size: 11px;
}

.sales-handover-scope-row strong {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.sales-handover-scope-empty {
  color: var(--muted);
  font-size: 12px;
}

.sales-handover-records {
  padding-bottom: 8px;
}

.sales-handover-record {
  border-bottom: 1px solid var(--line);
}

.sales-handover-record > summary {
  align-items: center;
  cursor: pointer;
  display: grid;
  gap: 16px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  list-style: none;
  padding-block: 14px;
}

.sales-handover-record > summary::-webkit-details-marker {
  display: none;
}

.sales-handover-record > summary::before {
  border-bottom: 1.5px solid var(--primary);
  border-right: 1.5px solid var(--primary);
  content: "";
  height: 7px;
  transform: rotate(45deg);
  transform-origin: 50% 50%;
  transition: transform 180ms var(--ease-fluid);
  width: 7px;
}

.sales-handover-record[open] > summary::before {
  transform: rotate(225deg);
}

.sales-handover-record-summary-copy {
  display: inline-grid;
  gap: 4px;
  min-width: 0;
}

.sales-handover-record-summary-copy strong,
.sales-handover-record-summary-copy small,
.sales-handover-record-details p {
  overflow-wrap: anywhere;
}

.sales-handover-record-summary-copy strong,
.sales-handover-record-summary-copy small {
  -webkit-box-orient: vertical;
  display: -webkit-box;
  overflow: hidden;
}

.sales-handover-record-summary-copy strong {
  -webkit-line-clamp: 1;
}

.sales-handover-record-summary-copy small {
  -webkit-line-clamp: 2;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.sales-handover-record-details {
  background: rgba(237, 245, 251, 0.58);
  border-radius: 10px;
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
  padding: 12px 14px;
}

.sales-handover-record-details p {
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.55;
  margin: 0;
}

.sales-handover-record-details p > strong {
  color: var(--muted);
  display: inline-block;
  margin-right: 10px;
}

.sales-handover-record-details .system-setting-status {
  margin-top: 2px;
}

.sales-handover-record-pagination {
  padding-bottom: 2px;
}

.management-person-name,
.dingtalk-people-table td > small {
  display: block;
}

.dingtalk-people-table td > .management-person-binding {
  color: var(--muted);
  font-weight: 700;
}

.dingtalk-people-table td > .management-person-binding.is-explicit {
  color: #18795c;
}

.dingtalk-people-table td > .management-person-binding.is-warning {
  color: #a26b00;
}

.dingtalk-people-table tr.is-binding-missing td {
  background: rgba(255, 194, 71, 0.07);
}

.management-person-name {
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}

.dingtalk-people-table td > small {
  color: var(--muted);
  font-size: 11px;
  margin-top: 3px;
  overflow-wrap: anywhere;
}

.management-person-alias-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.management-person-alias-list span,
.management-person-alias-empty {
  background: #edf6ff;
  border: 1px solid #cfe4f7;
  border-radius: 999px;
  color: var(--primary-dark);
  display: inline-flex;
  font-size: 11px;
  line-height: 1.35;
  max-width: 100%;
  overflow-wrap: anywhere;
  padding: 3px 7px;
  white-space: normal;
}

.management-person-alias-list .is-more {
  background: #f1f5f8;
  border-color: #dce5ec;
  color: var(--muted);
  white-space: nowrap;
}

.management-person-alias-empty {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
  padding-inline: 0;
}

.management-person-source,
.management-person-status {
  border-radius: 999px;
  display: inline-flex;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  white-space: nowrap;
}

.management-person-source {
  background: #e9f5ff;
  color: #2474b5;
}

.management-person-source.is-account-only,
.management-person-source.is-dingtalk-only {
  background: #fff6dc;
  color: #916c0b;
}

.management-person-status {
  background: #e8f7f1;
  color: #18795c;
}

.management-person-status.is-disabled {
  background: #edf1f4;
  color: var(--muted);
}

.flow-approval-stage-card.is-disabled {
  opacity: .56;
}

.flow-approval-stage-card.is-disabled input {
  cursor: not-allowed;
}

.management-person-capabilities {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.management-person-capabilities span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  border: 1px solid #cfe2f5;
  border-radius: 999px;
  color: #1666a8;
  background: #f1f8ff;
  font-size: 12px;
  font-weight: 700;
}

.management-person-capabilities .is-approval {
  color: #217a5b;
  border-color: #c8e8dc;
  background: #f0faf6;
}

.management-person-capabilities .is-login {
  color: #5c55a7;
  border-color: #ddd9f5;
  background: #f7f5ff;
}

.management-capability-bulk {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 12px;
}

.management-capability-bulk > button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 58px;
  padding: 10px 14px;
  border: 1px solid #d7e4ef;
  border-radius: 12px;
  color: #40546a;
  background: #f7fafc;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.management-capability-bulk > button:hover:not(:disabled) {
  background: #edf6fd;
  border-color: #9ec9ed;
  box-shadow: 0 7px 18px rgba(24, 108, 180, 0.09);
  color: #40546a;
  transform: none;
}

.management-capability-bulk > button > span {
  display: grid;
  gap: 2px;
}

.management-capability-bulk strong {
  color: #17324d;
  font-size: 13px;
}

.management-capability-bulk small {
  color: #73859a;
  font-size: 12px;
}

.management-bulk-track {
  position: relative;
  flex: 0 0 auto;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #c7d0da;
  transition: background-color 160ms ease;
}

.management-bulk-track > i {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(24, 50, 77, 0.22);
  transition: transform 160ms ease;
}

.management-capability-bulk > button.is-enabled,
.management-capability-bulk > button.is-mixed {
  border-color: #b7d9f4;
  background: #f2f8fd;
}

.management-capability-bulk > button.is-enabled .management-bulk-track,
.management-capability-bulk > button.is-mixed .management-bulk-track {
  background: #1684e8;
}

.management-capability-bulk > button.is-enabled .management-bulk-track > i,
.management-capability-bulk > button.is-mixed .management-bulk-track > i {
  transform: translateX(18px);
}

.management-capability-bulk > button.is-mixed .management-bulk-track > i::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 8px;
  width: 8px;
  height: 2px;
  border-radius: 2px;
  background: #1684e8;
}

.management-capability-bulk > button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.management-person-detail-modal {
  background: rgba(30, 57, 78, 0.28);
  z-index: 190;
}

.management-person-detail-dialog {
  background: var(--surface-solid);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 64px);
  overflow: hidden;
  width: min(940px, 100%);
}

.personnel-access-dialog {
  width: min(460px, calc(100vw - 32px));
  background: #f7fbff;
}

#personnelAccessModal {
  /* Verification can open above an existing mobile settings dialog (220). */
  z-index: 230;
}

.personnel-access-form {
  display: grid;
  gap: 16px;
  padding: 20px 24px 24px;
}

.personnel-access-form > label,
.user-information-editor-grid > label {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.user-information-editor-grid > label {
  align-content: start;
  grid-template-rows: minmax(18px, auto) 42px auto;
}

.user-information-editor-grid > label > span:first-child {
  align-self: end;
  margin-bottom: 0;
}

.user-information-editor-grid > label > .portal-control-shell {
  align-self: stretch;
  min-height: 42px;
  padding: 0;
}

.personnel-access-form input,
.user-information-editor-grid input {
  min-height: 40px;
  border: 1px solid #cbdceb;
  border-radius: 10px;
  background: #fff;
  padding: 0 12px;
  color: #142d45;
}

.user-information-accounts-dialog {
  display: flex;
  flex-direction: column;
  width: min(1240px, calc(100vw - 42px));
  max-height: min(840px, calc(100vh - 42px));
  background: #f7fbff;
  overflow: hidden;
}

.user-information-accounts-dialog .dingtalk-people-toolbar {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: auto minmax(170px, 240px) auto minmax(220px, 1fr) auto;
}

.user-information-accounts-dialog .dingtalk-people-toolbar input,
.user-information-accounts-dialog .dingtalk-people-toolbar select,
.user-information-accounts-dialog .dingtalk-people-toolbar .portal-control-shell {
  max-width: none;
  min-width: 0;
  width: 100%;
}

.user-information-accounts-dialog .dingtalk-people-toolbar > span {
  margin-left: 0;
  white-space: nowrap;
}

.user-information-accounts-dialog .dingtalk-people-table-wrap {
  background: var(--surface-solid);
  flex: 1 1 auto;
  max-height: none;
  min-height: 280px;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.user-information-accounts-dialog .dingtalk-people-table {
  min-width: 940px;
}

.user-information-accounts-dialog .dingtalk-people-table th:first-child { width: 14%; }
.user-information-accounts-dialog .dingtalk-people-table th:nth-child(2) { width: 10%; }
.user-information-accounts-dialog .dingtalk-people-table th:nth-child(3) { width: 18%; }
.user-information-accounts-dialog .dingtalk-people-table th:nth-child(4) { width: 22%; }
.user-information-accounts-dialog .dingtalk-people-table th:nth-child(5) { width: 12%; }
.user-information-accounts-dialog .dingtalk-people-table th:nth-child(6) { width: 96px; }
.user-information-accounts-dialog .dingtalk-people-table th:last-child { width: 118px; }

.user-information-accounts-dialog .dingtalk-people-table td:first-child,
.user-information-accounts-dialog .dingtalk-people-table td:nth-child(4) {
  overflow-wrap: anywhere;
}

.user-information-accounts-dialog .dingtalk-people-table td:last-child .system-log-dialog-actions {
  gap: 8px;
  justify-content: flex-end;
}

.user-information-accounts-dialog .dingtalk-people-table td:last-child button {
  min-width: 48px;
  padding-inline: 10px;
}

.user-information-accounts-dialog .dingtalk-people-table th:nth-child(6),
.user-information-accounts-dialog .dingtalk-people-table td:nth-child(6),
.user-information-accounts-dialog .dingtalk-people-table th:last-child,
.user-information-accounts-dialog .dingtalk-people-table td:last-child {
  white-space: nowrap;
}

.user-information-editor-dialog {
  width: min(920px, calc(100vw - 42px));
  background: #f7fbff;
}

.dealer-management-panel {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 116px);
  min-height: min(720px, calc(100vh - 116px));
  overflow: hidden;
}

.dealer-management-header {
  flex: 0 0 auto;
}

#addDealerAccountBtn {
  flex: 0 0 auto;
  white-space: nowrap;
  word-break: keep-all;
}

#system-management :is(
  #openDealerManagementBtn,
  #openDingtalkPeopleModalBtn,
  #openDingtalkRulesModalBtn,
  #openDingtalkExceptionAlertModalBtn
) {
  flex: 0 0 auto;
  white-space: nowrap;
  word-break: keep-all;
}

.dealer-management-toolbar {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: auto minmax(240px, 1fr) auto minmax(180px, 240px) auto;
  padding: 0 0 16px;
}

.dealer-management-toolbar input,
.dealer-management-toolbar select,
.dealer-management-toolbar .portal-control-shell {
  max-width: none;
  min-width: 0;
  width: 100%;
}

.dealer-account-table-wrap {
  flex: 1 1 auto;
  max-height: none;
  min-height: 320px;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.dealer-account-table {
  min-width: 1180px;
}

.dealer-account-table th:first-child { width: 13%; }
.dealer-account-table th:nth-child(2) { width: 10%; }
.dealer-account-table th:nth-child(3) { width: 13%; }
.dealer-account-table th:nth-child(4) { width: 18%; }
.dealer-account-table th:nth-child(5) { width: 12%; }
.dealer-account-table th:nth-child(6) { width: 16%; }
.dealer-account-table th:nth-child(7) { width: 112px; }
.dealer-account-table th:last-child { width: 190px; }

.dealer-account-table td small {
  color: var(--muted);
  display: block;
  margin-top: 4px;
}

.dealer-account-table td:nth-child(4),
.dealer-account-table td:nth-child(6) {
  overflow-wrap: anywhere;
}

.dealer-qualification-reminder {
  color: #b91c1c;
  font-weight: 650;
}

.dealer-account-table td:last-child .system-log-dialog-actions {
  flex-wrap: nowrap;
  gap: 6px;
}

.dealer-account-table td:last-child button {
  min-width: 48px;
  padding-inline: 9px;
}

.dealer-table-login-switch {
  min-width: 102px;
}

.dealer-login-setting {
  grid-column: 1 / -1;
}

.dealer-account-editor-dialog {
  width: min(920px, calc(100vw - 42px));
}

.user-information-editor-form {
  padding: 18px 24px 22px;
}

.user-information-editor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
}

.user-information-editor-grid label[hidden] {
  display: none;
}

.user-information-editor-grid small {
  color: #6f8395;
  line-height: 1.4;
}

.user-information-editor-grid .user-information-field-error,
.user-information-editor-form .system-form-status.is-error {
  color: var(--danger);
}

.user-information-editor-grid .user-information-field-error[hidden] {
  display: none;
}

.danger-outline-button {
  color: #c33d47;
  border-color: #efc2c6;
}

@media (max-width: 720px) {
  .user-information-accounts-dialog .dingtalk-people-toolbar {
    grid-template-columns: 1fr;
  }

  .user-information-editor-grid { gap: 10px; }

  .user-information-editor-form { padding: 12px 0; }

  .dealer-management-toolbar { grid-template-columns: 1fr; }
}

.management-person-detail-content {
  flex: 1;
  overflow: auto;
  padding-right: 4px;
}

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

.management-person-edit-field,
.management-person-enabled-detail,
.management-person-readonly {
  background: #f8fbfd;
  border: 1px solid var(--line);
  border-radius: 6px;
  box-sizing: border-box;
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 12px;
}

.management-person-edit-field > span,
.management-person-enabled-detail > span,
.management-person-readonly > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.management-person-readonly strong {
  color: var(--text);
  font-size: 13px;
  min-height: 20px;
  overflow-wrap: anywhere;
}

.management-person-edit-field small,
.management-person-enabled-detail small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.management-person-edit-field small.is-warning {
  color: #a16207;
  font-weight: 650;
}

.management-person-edit-field textarea {
  min-height: 88px;
  resize: vertical;
}

.management-person-scope {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
}

.management-person-scope header h3,
.management-person-scope header p {
  margin: 0;
}

.management-person-scope header h3 {
  font-size: 14px;
}

.management-person-scope header p,
.management-person-scope label {
  color: var(--muted);
  font-size: 11px;
}

.management-person-scope > div {
  display: grid;
  gap: 6px;
}

.management-person-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.management-person-chips span {
  background: #edf6fd;
  border: 1px solid #cfe5f5;
  border-radius: 999px;
  color: #276c9f;
  font-size: 11px;
  padding: 5px 9px;
}

.management-person-chips em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.dingtalk-people-dialog .dingtalk-people-table input,
.dingtalk-people-dialog .dingtalk-people-table textarea,
.dingtalk-people-dialog .dingtalk-people-table .portal-control-shell {
  box-sizing: border-box;
  min-width: 0;
  width: 100%;
}

.dingtalk-people-dialog-footer {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: 16px;
  justify-content: space-between;
  min-height: 58px;
  padding-top: 14px;
}

.dingtalk-people-dialog-footer .system-form-status {
  margin: 0;
}

.dingtalk-rules-dialog {
  background: var(--surface-solid);
  display: flex;
  flex-direction: column;
  height: auto;
  max-height: calc(100vh - 32px);
  overflow: auto;
  width: min(1640px, calc(100vw - 32px));
}

.dingtalk-rules-dialog > .dingtalk-rule-editor {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-height: 0;
  overflow: visible;
  overscroll-behavior: contain;
  padding-right: 0;
}

.dingtalk-rules-dialog .dingtalk-business-rule {
  align-self: start;
}

.dingtalk-rules-dialog .dingtalk-mode-row {
  grid-template-columns: 1fr;
}

.dingtalk-rules-dialog .dingtalk-value-rule {
  align-items: start;
  grid-template-columns: minmax(0, 1fr) 34px;
}

.dingtalk-rules-dialog .dingtalk-value-rule .dingtalk-rule-condition {
  grid-column: 1;
}

.dingtalk-rules-dialog .dingtalk-value-rule .dingtalk-person-remove {
  grid-column: 2;
  grid-row: 1;
}

.dingtalk-recipient-picker-modal {
  z-index: 70;
}

.dingtalk-exception-alert-dialog {
  background: var(--surface-solid);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 64px);
  overflow: hidden;
  width: min(620px, 100%);
}

.dingtalk-exception-alert-body {
  display: grid;
  gap: 18px;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 20px 24px;
}

.dingtalk-exception-alert-body .system-setting-input {
  display: grid;
  gap: 8px;
}

.dingtalk-recipient-picker-dialog {
  background: var(--surface-solid);
  display: flex;
  flex-direction: column;
  height: auto;
  max-height: calc(100vh - 48px);
  overflow: hidden;
  width: min(920px, 100%);
}

.dingtalk-recipient-picker-toolbar {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: auto minmax(220px, 1fr) auto;
  margin-bottom: 14px;
}

.dingtalk-recipient-picker-toolbar label {
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 650;
}

.dingtalk-recipient-picker-toolbar > span {
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 650;
}

.dingtalk-recipient-list {
  background: #f8fbfe;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: grid;
  flex: 0 1 auto;
  gap: 1px;
  max-height: calc(100vh - 270px);
  min-height: 104px;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 6px;
  transition: height 180ms ease;
}

.dingtalk-recipient-list-head {
  align-items: center;
  background: #edf5fb;
  color: var(--text-soft);
  display: grid;
  font-size: 11px;
  font-weight: 700;
  gap: 12px;
  grid-template-columns: 22px minmax(110px, .8fr) minmax(180px, 1.4fr) minmax(180px, 1fr);
  min-height: 34px;
  padding: 6px 10px;
  position: sticky;
  top: 0;
  z-index: 2;
}

.dingtalk-recipient-option {
  align-items: center;
  background: var(--surface-solid);
  border: 1px solid transparent;
  border-radius: 5px;
  cursor: pointer;
  display: grid;
  gap: 12px;
  grid-template-columns: 22px minmax(110px, .8fr) minmax(180px, 1.4fr) minmax(180px, 1fr);
  min-height: 52px;
  padding: 7px 10px;
  transition: background-color 150ms ease, box-shadow 150ms ease;
}

.dingtalk-recipient-option:hover {
  background: #f2f8fd;
  box-shadow: 0 5px 14px rgba(22, 119, 206, 0.08);
}

.dingtalk-recipient-option:has(input:checked) {
  background: #edf7ff;
  box-shadow: inset 3px 0 0 var(--primary);
}

.dingtalk-recipient-option input {
  height: 18px;
  margin: 0;
  width: 18px;
}

.dingtalk-recipient-empty {
  color: var(--muted);
  margin: 0;
  padding: 24px 12px;
  text-align: center;
}

.dingtalk-recipient-dingtalk-name {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.45;
  min-width: 0;
  overflow-wrap: anywhere;
}

.dingtalk-recipient-website-names,
.dingtalk-recipient-userid {
  color: var(--muted);
  font-family: inherit;
  font-size: 12px;
  line-height: 1.45;
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal;
}

.dingtalk-recipient-picker-footer {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding-top: 14px;
}

.dingtalk-recipient-picker-footer > div {
  display: flex;
  gap: 8px;
}

.dingtalk-rule-editor {
  display: grid;
  gap: 12px;
}

.dingtalk-business-rule {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.dingtalk-business-rule > header {
  align-items: center;
  background: #f3f8fc;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 12px 14px;
}

.dingtalk-business-rule > header h5,
.dingtalk-business-rule > header p {
  margin: 0;
}

.dingtalk-business-rule > header h5 {
  font-size: 14px;
}

.dingtalk-business-rule > header p {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.dingtalk-mode-row {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 14px;
  grid-template-columns: 180px minmax(0, 1fr);
  padding: 14px;
}

.dingtalk-mode-toggle {
  align-items: flex-start;
  display: flex;
  gap: 9px;
}

.dingtalk-mode-toggle input {
  flex: 0 0 auto;
  height: 18px;
  margin: 1px 0 0;
  width: 18px;
}

.dingtalk-mode-toggle strong,
.dingtalk-mode-toggle small {
  display: block;
}

.dingtalk-mode-toggle strong {
  font-size: 13px;
}

.dingtalk-mode-toggle small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  margin-top: 3px;
}

.dingtalk-mode-content {
  min-width: 0;
}

.dingtalk-value-rules {
  display: grid;
  gap: 10px;
}

.dingtalk-value-rule {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(130px, .8fr) minmax(150px, 1fr) minmax(280px, 1.6fr) 34px;
}

.dingtalk-recipient-field {
  align-items: center;
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: 6px;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 44px;
  padding: 5px 6px 5px 11px;
}

.dingtalk-recipient-field .secondary-button {
  min-height: 32px;
  padding: 5px 11px;
}

.dingtalk-recipient-summary {
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
  min-width: 0;
  overflow-wrap: anywhere;
}

.dingtalk-recipient-summary.is-empty {
  color: var(--muted);
}

.dingtalk-rule-empty {
  color: var(--muted);
  font-size: 12px;
  margin: 0 0 10px;
}

.dingtalk-add-rule {
  margin-top: 10px;
}

@media (max-width: 1380px) {
  .dingtalk-rules-dialog > .dingtalk-rule-editor {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .management-capability-bulk {
    grid-template-columns: 1fr;
  }

  .dingtalk-rules-dialog > .dingtalk-rule-editor {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .dingtalk-section-heading,
  .dingtalk-people-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .dingtalk-heading-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .dingtalk-config-grid,
  .dingtalk-mode-row,
  .dingtalk-value-rule {
    grid-template-columns: 1fr;
  }

  .dingtalk-people-toolbar input {
    max-width: none;
  }

  .dingtalk-people-toolbar > span {
    margin-left: 0;
  }

  .dingtalk-people-overview {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .dingtalk-people-dialog {
    height: calc(100vh - 24px);
  }

  .dingtalk-people-dialog .system-log-dialog-header,
  .dingtalk-people-dialog .system-log-dialog-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .sales-handover-dialog .system-log-dialog-actions,
  .dingtalk-rules-dialog .system-log-dialog-actions {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dingtalk-people-dialog .dingtalk-people-toolbar {
    grid-template-columns: 1fr;
  }

  .dingtalk-rules-overview-item,
  .dingtalk-recipient-picker-toolbar {
    grid-template-columns: 1fr;
  }

  .dingtalk-rules-dialog {
    height: auto;
    max-height: calc(100vh - 24px);
    width: calc(100vw - 24px);
  }

  .dingtalk-recipient-picker-dialog {
    height: auto;
    max-height: calc(100vh - 24px);
  }

  .dingtalk-rules-dialog .system-log-dialog-header {
    align-items: stretch;
    flex-direction: column;
  }

  :is(.dingtalk-recipient-picker-dialog, .dingtalk-exception-alert-dialog, .personnel-access-dialog) .system-log-dialog-header {
    align-items: flex-start;
    flex-wrap: nowrap;
  }

  :is(.dingtalk-recipient-picker-dialog, .dingtalk-exception-alert-dialog, .personnel-access-dialog) .system-log-dialog-header > :first-child {
    flex: 1;
    min-width: 0;
  }

  .dingtalk-recipient-list-head {
    display: none;
  }

  .dingtalk-recipient-option {
    align-items: start;
    grid-template-columns: 22px minmax(0, 1fr);
  }

  .dingtalk-recipient-option > :not(input) {
    grid-column: 2;
  }

  .dingtalk-recipient-dingtalk-name::before,
  .dingtalk-recipient-website-names::before,
  .dingtalk-recipient-userid::before {
    color: var(--muted);
    display: block;
    font-size: 10px;
    font-weight: 600;
  }

  .dingtalk-recipient-dingtalk-name::before { content: "钉钉姓名"; }
  .dingtalk-recipient-website-names::before { content: "网站姓名 / 别名"; }
  .dingtalk-recipient-userid::before { content: "UserID"; }
}

.fixed-options-editor {
  border-top: 1px solid var(--line);
}

.fixed-option-row {
  align-items: start;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(150px, 0.7fr) minmax(260px, 1.8fr) minmax(150px, 0.8fr) auto;
  padding-block: 16px;
}

.fixed-option-row label {
  display: grid;
  gap: 6px;
}

.fixed-option-row label > span {
  color: var(--muted);
  font-size: 12px;
}

.fixed-option-row textarea {
  min-height: 88px;
  resize: vertical;
}

.fixed-option-manual {
  align-items: center;
  display: flex !important;
  gap: 8px !important;
  min-height: 42px;
  padding-top: 23px;
  white-space: nowrap;
}

.fixed-option-manual input {
  height: 18px;
  width: 18px;
}

.fixed-option-dependency {
  border: 0;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 8px;
  grid-column: 1 / -1;
  margin: 2px 0 0;
  min-width: 0;
  padding: 14px 0 0;
}

.fixed-option-dependency legend {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  padding: 0;
}

.fixed-option-dependency > p {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
}

.fixed-option-dependency-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}

.fixed-option-row .fixed-option-dependency-choice {
  align-items: center;
  color: var(--text);
  display: inline-flex;
  flex: 0 0 auto;
  gap: 7px;
  min-height: 30px;
}

.fixed-option-dependency-choice input {
  height: 18px;
  margin: 0;
  width: 18px;
}

.fixed-option-row .fixed-option-dependency-choice > span {
  color: inherit;
  font-size: 13px;
}

.system-log-table-wrap {
  background: var(--surface-solid);
  border: 1px solid var(--line);
  flex: 1;
  min-height: 260px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.system-log-dialog {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 48px);
  overflow: hidden;
  width: min(1280px, 100%);
}

.system-log-dialog-header {
  align-items: flex-start;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  margin-bottom: 16px;
}

.system-log-dialog-header h2,
.system-log-dialog-header p {
  margin: 0;
}

.system-log-dialog-header h2 {
  font-size: 22px;
}

.system-log-dialog-header p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 6px;
}

.system-log-dialog-actions {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: 10px;
}

.system-log-toolbar {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: auto minmax(240px, 1fr) auto auto;
  margin-bottom: 14px;
}

.system-log-toolbar > label {
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 650;
}

.system-log-toolbar .portal-control-shell {
  min-width: 0;
}

.system-log-table {
  min-width: 920px;
  table-layout: fixed;
  width: 100%;
}

.system-log-table th {
  background: #edf5fb;
  background-clip: padding-box;
  box-shadow: inset 0 -1px 0 var(--line);
  position: sticky;
  top: 0;
  z-index: 2;
}

.system-log-table td {
  line-height: 1.5;
  overflow-wrap: anywhere;
  vertical-align: top;
  white-space: normal;
}

.system-log-time { width: 190px; }
.system-log-account { width: 100px; }
.system-log-client { width: 116px; }
.system-log-action { width: 150px; }
.system-log-summary { width: auto; }
.system-log-result { width: 70px; }

.system-log-footer {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: flex-end;
  min-height: 42px;
  padding-top: 12px;
}

.system-log-footer span {
  color: var(--muted);
  font-size: 13px;
}

.runtime-log-list {
  background: var(--surface-solid);
  border: 1px solid var(--line);
  flex: 1;
  min-height: 280px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.runtime-log-entry {
  background: var(--surface-solid);
  border-bottom: 1px solid var(--line);
  padding: 15px 16px;
}

.runtime-log-entry:last-child {
  border-bottom: 0;
}

.runtime-log-entry > header {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.runtime-log-entry-title,
.runtime-log-entry-state {
  align-items: center;
  display: flex;
  gap: 9px;
  min-width: 0;
}

.runtime-log-entry-title strong {
  overflow-wrap: anywhere;
}

.runtime-log-entry-state {
  flex: 0 0 auto;
}

.runtime-log-entry-state time {
  color: var(--muted);
  font-size: 12px;
}

.runtime-log-category {
  background: #e5f3fb;
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 7px;
  white-space: nowrap;
}

.runtime-log-context {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 10px;
}

.runtime-log-context span {
  color: var(--text-soft);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.runtime-log-context b,
.runtime-log-details b {
  color: var(--muted);
  font-size: 11px;
  margin-right: 6px;
}

.runtime-log-summary-text {
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.65;
  margin: 10px 0 0;
  overflow-wrap: anywhere;
}

.runtime-log-sql-block,
.runtime-log-parameter-block {
  margin-top: 12px;
}

.runtime-log-sql-block > span,
.runtime-log-parameter-block > span {
  color: var(--muted);
  display: block;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 6px;
}

.runtime-log-sql-block pre,
.runtime-log-parameter-block pre,
.runtime-log-details pre {
  background: #f3f7fa;
  border: 1px solid #dbe7ef;
  color: #21364a;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  line-height: 1.6;
  margin: 0;
  max-height: 240px;
  overflow: auto;
  padding: 10px 12px;
  tab-size: 2;
  white-space: pre-wrap;
  word-break: break-word;
}

.runtime-log-parameter-table-wrap {
  border: 1px solid #dbe7ef;
  max-height: 240px;
  overflow: auto;
}

.runtime-log-parameter-table {
  background: #fff;
  border-collapse: collapse;
  font-size: 12px;
  min-width: 560px;
  table-layout: fixed;
  width: 100%;
}

.runtime-log-parameter-table th,
.runtime-log-parameter-table td {
  border-bottom: 1px solid #e2ebf2;
  border-right: 1px solid #e2ebf2;
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
  word-break: break-word;
}

.runtime-log-parameter-table th {
  background: #f3f7fa;
  color: var(--muted);
  font-weight: 700;
  position: sticky;
  top: 0;
}

.runtime-log-parameter-table th:first-child,
.runtime-log-parameter-table td:first-child {
  text-align: center;
  width: 58px;
}

.runtime-log-parameter-table th:nth-child(2),
.runtime-log-parameter-table td:nth-child(2),
.runtime-log-parameter-table th:nth-child(3),
.runtime-log-parameter-table td:nth-child(3) {
  width: 22%;
}

.runtime-log-query-id {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.runtime-log-query-id small {
  color: var(--muted);
}

.runtime-log-details {
  margin-top: 10px;
}

.runtime-log-details summary {
  color: var(--primary-dark);
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
}

.runtime-log-details > div,
.runtime-log-details > p {
  margin: 10px 0 0;
}

@media (max-width: 760px) {
  .system-log-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .system-log-toolbar > label,
  .system-log-toolbar .portal-control-shell {
    grid-column: 1 / -1;
  }

  .runtime-log-entry > header,
  .runtime-log-entry-state {
    align-items: flex-start;
    flex-direction: column;
  }

  .system-log-footer {
    align-items: stretch;
    flex-direction: column;
  }
}

.system-setting-row {
  align-items: start;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding-block: 20px;
}

.system-setting-row h3 {
  margin: 0;
}

.system-setting-status {
  color: var(--primary-dark);
  display: block;
  font-size: 13px;
  font-weight: 650;
  margin-top: 10px;
  overflow-wrap: anywhere;
}

.system-setting-row .secondary-button {
  min-width: 116px;
}

.system-switch {
  align-items: center;
  align-self: start;
  cursor: pointer;
  display: inline-grid;
  gap: 10px;
  grid-template-columns: 40px auto;
  min-height: 22px;
  position: relative;
  user-select: none;
}

.system-switch > input {
  height: 1px;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  width: 1px;
}

.system-switch-track {
  background: #c8d5df;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(62, 86, 108, 0.08);
  display: block;
  height: 22px;
  position: relative;
  transition: background-color 220ms ease, box-shadow 220ms ease, transform 220ms var(--ease-fluid);
  width: 40px;
}

.system-switch-track > span {
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 7px rgba(36, 60, 84, 0.2);
  display: block;
  height: 20px;
  left: 1px;
  position: absolute;
  top: 50%;
  transform: translate(0, -50%);
  transition: transform 240ms var(--ease-fluid), box-shadow 220ms ease;
  width: 20px;
}

.system-switch > input:checked + .system-switch-track {
  background: var(--primary);
  box-shadow: 0 5px 14px rgba(10, 132, 255, 0.2);
}

.system-switch > input:checked + .system-switch-track > span {
  transform: translate(18px, -50%);
}

.system-switch:hover .system-switch-track {
  box-shadow: 0 5px 14px rgba(10, 132, 255, 0.16);
  transform: translateY(-1px);
}

.system-switch > input:focus-visible + .system-switch-track {
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.18);
}

.system-switch > input:disabled ~ * {
  cursor: not-allowed;
  opacity: 0.55;
}

.system-switch > strong {
  align-items: center;
  color: var(--primary-dark);
  display: flex;
  font-size: 13px;
  height: 22px;
  line-height: 1;
  min-width: 42px;
  transform: translateY(-2px);
}

.flow-ledger-list {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.flow-ledger-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.flow-batch-entry-modal {
  padding: 20px;
}

.flow-batch-entry-dialog {
  background: var(--surface-solid);
  box-sizing: border-box;
  max-height: calc(100vh - 40px);
  padding: 0;
  width: min(1320px, calc(100vw - 40px));
}

.flow-batch-entry-dialog > form {
  display: flex;
  flex-direction: column;
  min-height: min(760px, calc(100vh - 42px));
}

.flow-batch-entry-header {
  border-bottom: 1px solid var(--line);
  min-height: auto;
  padding: 20px 24px 16px;
}

.flow-batch-entry-header h2 {
  margin: 3px 0 4px;
}

.flow-batch-entry-header p {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.flow-batch-entry-header .dialog-close-button {
  right: 24px;
  top: 20px;
}

.flow-batch-common-fields {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  padding: 18px 24px;
}

.flow-batch-common-fields > label,
.flow-batch-common-fields > .form-field {
  min-width: 0;
}

#flowBatchDealerInput[data-flow-batch-locked="true"] {
  background: var(--field-disabled-bg, #f3f7fa);
  color: var(--text-soft);
  cursor: default;
}

.flow-batch-workspace {
  border-top: 1px solid var(--line);
  display: grid;
  flex: 1 1 auto;
  grid-template-columns: minmax(330px, 0.38fr) minmax(0, 1fr);
  min-height: 0;
}

.flow-batch-hospital-panel {
  background: rgba(244, 249, 253, 0.72);
  border-right: 1px solid var(--line);
  min-width: 0;
  padding: 16px;
}

.flow-batch-panel-heading {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 12px;
}

.flow-batch-panel-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.flow-batch-panel-heading h3,
.flow-batch-product-toolbar h3 {
  margin: 0;
}

.flow-batch-panel-heading p,
.flow-batch-product-toolbar p {
  color: var(--muted);
  font-size: 12px;
  margin: 4px 0 0;
}

.flow-batch-hospital-groups {
  display: grid;
  gap: 10px;
  max-height: 560px;
  overflow: auto;
  padding: 3px;
}

.flow-batch-hospital-group {
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.flow-batch-hospital-group.is-active {
  border-color: rgba(10, 132, 255, 0.52);
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.1);
}

.flow-batch-hospital-group > header {
  align-items: end;
  display: grid;
  gap: 6px;
  grid-template-columns: minmax(94px, 1fr) minmax(118px, 132px) 56px;
}

.flow-batch-group-select {
  align-items: center;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text);
  display: flex;
  justify-content: flex-start;
  min-width: 0;
  min-height: 36px;
  padding: 0 8px;
  text-align: left;
  transform: none;
  width: 100%;
}

.flow-batch-group-select:hover:not(:disabled),
.flow-batch-group-select:focus-visible:not(:disabled) {
  background: rgba(10, 132, 255, 0.1);
  border-color: rgba(10, 132, 255, 0.18);
  box-shadow: none;
  color: var(--text);
  transform: none;
}

.flow-batch-group-select:active:not(:disabled) {
  background: rgba(10, 132, 255, 0.14);
  color: var(--text);
  transform: none;
}

.flow-batch-group-select strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flow-batch-header-sales-type {
  min-width: 0;
}

.flow-batch-header-sales-type > span {
  font-size: 12px;
  margin-bottom: 4px;
}

.flow-batch-header-sales-type input {
  min-height: 36px;
  padding-block: 5px;
}

.flow-batch-remove-group {
  align-self: end;
  grid-column: 3;
  min-height: 36px;
  min-width: 56px;
  padding-inline: 8px;
  position: static;
  width: 56px;
}

.flow-batch-group-fields {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 12px;
}

.flow-batch-group-fields > label {
  min-width: 0;
}

.flow-batch-hospital-field,
.flow-batch-distributor-field {
  grid-column: 1 / -1;
}

.flow-batch-scrap-note {
  background: rgba(201, 134, 24, 0.09);
  border: 1px solid rgba(201, 134, 24, 0.22);
  border-radius: 10px;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.6;
  margin-top: 12px;
  padding: 10px 12px;
}

.flow-batch-product-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.flow-batch-product-toolbar {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(240px, 1fr) minmax(320px, 0.9fr) auto;
  padding: 16px 24px 12px;
}

.flow-batch-search {
  min-width: 0;
}

.flow-batch-toolbar-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.flow-batch-table-wrap {
  border: 1px solid var(--line);
  flex: 1 1 auto;
  margin: 0 24px;
  max-height: 440px;
  overflow: auto;
}

.flow-batch-table {
  min-width: 1420px;
  table-layout: fixed;
}

.flow-batch-table th {
  background: #edf5fb;
  position: sticky;
  text-align: center;
  top: 0;
  z-index: 2;
}

.flow-batch-table th:first-child {
  width: 64px;
}

.flow-batch-table th:nth-child(2) {
  width: 190px;
}

.flow-batch-table th:nth-child(3) {
  width: 130px;
}

.flow-batch-table th:nth-child(4) {
  width: 230px;
}

.flow-batch-table th:nth-child(7) {
  width: 110px;
}

.flow-batch-table th:nth-child(8) {
  width: 150px;
}

.flow-batch-table th:nth-child(9) {
  width: 120px;
}

.flow-batch-table th:last-child {
  width: 160px;
}

.flow-batch-table td {
  text-align: center;
  vertical-align: middle;
}

.flow-batch-table tr.is-selected td {
  background: rgba(10, 132, 255, 0.075);
}

.flow-batch-table :is(.flow-batch-select-cell, .flow-batch-quantity-cell, .flow-batch-price-cell) {
  background: var(--surface-solid);
  position: sticky;
  z-index: 3;
}

.flow-batch-table th:is(.flow-batch-select-cell, .flow-batch-quantity-cell, .flow-batch-price-cell) {
  background: #edf5fb;
  z-index: 4;
}

.flow-batch-table tr.is-selected :is(.flow-batch-select-cell, .flow-batch-quantity-cell, .flow-batch-price-cell) {
  background: #f3f9ff;
}

.flow-batch-select-cell {
  box-shadow: 1px 0 0 var(--line);
  left: 0;
  text-align: center;
}

.flow-batch-quantity-cell {
  box-shadow: -1px 0 0 var(--line);
  right: 160px;
}

.flow-batch-price-cell {
  right: 0;
}

.flow-batch-select-cell input {
  accent-color: var(--primary);
  height: 18px;
  min-height: 18px;
  width: 18px;
}

.flow-batch-inline-input {
  min-height: 36px;
  min-width: 0;
  padding: 7px 9px;
  text-align: center;
  width: 100%;
}

.flow-batch-entry-footer {
  align-items: center;
  background: var(--surface-solid);
  border-top: 1px solid var(--line);
  display: flex;
  gap: 20px;
  justify-content: space-between;
  margin-top: 16px;
  padding: 14px 24px 18px;
}

.flow-batch-selection-summary {
  display: grid;
  gap: 3px;
}

.flow-batch-selection-summary strong {
  color: var(--text);
  font-size: 14px;
}

.flow-batch-selection-summary small {
  color: var(--muted);
}

.flow-batch-entry-actions {
  display: flex;
  gap: 10px;
}

.flow-entry {
  min-width: 0;
  background: rgba(247, 251, 255, 0.64);
  border: 1px solid rgba(44, 76, 112, 0.1);
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
  padding: 16px;
}

#flowReportingMonthStatus,
[data-flow-stock-hint] {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
  margin: 8px 0;
  overflow-wrap: anywhere;
}

[data-flow-stock-timeline] {
  margin: 12px 0;
  min-width: 0;
}

[data-flow-stock-timeline] summary {
  color: var(--primary);
  cursor: pointer;
  font-size: 12px;
}

[data-flow-stock-days] {
  margin-top: 8px;
  max-height: 260px;
}

[data-flow-stock-days] table {
  min-width: 420px;
}

.flow-entry-header {
  align-items: start;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.flow-entry-heading {
  align-items: center;
  display: grid;
  flex: 1;
  gap: 14px;
  grid-template-columns: auto minmax(0, 1fr);
  min-width: 0;
}

.flow-entry-title {
  align-items: center;
  color: var(--text);
  display: flex;
  gap: 9px;
  white-space: nowrap;
}

.flow-entry-title .line-no {
  align-items: center;
  background: linear-gradient(145deg, rgba(10, 132, 255, 0.12), rgba(90, 200, 250, 0.1));
  border-radius: 6px;
  color: var(--primary-dark);
  display: flex;
  font-size: 13px;
  font-weight: 700;
  height: 30px;
  justify-content: center;
  width: 30px;
}

.flow-entry-product-summary {
  background: rgba(235, 244, 251, 0.72);
  border: 1px solid rgba(44, 76, 112, 0.1);
  border-radius: 8px;
  display: grid;
  grid-template-columns: minmax(150px, 1.5fr) repeat(2, minmax(90px, 0.8fr)) minmax(90px, 0.65fr);
  min-width: 0;
  overflow: hidden;
}

.flow-entry-product-summary > div {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 7px 10px;
}

.flow-entry-product-summary > div + div {
  border-left: 1px solid rgba(44, 76, 112, 0.1);
}

.flow-entry-product-summary span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.flow-entry-product-summary output {
  color: var(--text);
  display: block;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.45;
  min-height: 19px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flow-entry-product-summary output:empty::before {
  color: var(--interaction-disabled-text);
  content: "-";
  font-weight: 500;
}

.flow-entry-stock-summary output {
  color: var(--primary-dark);
}

.flow-entry-stock-summary output:empty::before {
  content: "待计算";
}

.flow-entry-header .remove-line-button {
  background: #e7f2fb;
  border: 1px solid #b8d5ea;
  color: #24658f;
  min-height: 32px;
  min-width: 60px;
  padding: 0 10px;
}

.flow-entry-header .remove-line-button:hover {
  background: #d5eafa;
  color: #174f75;
}

.flow-entry-fields {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  min-width: 0;
}

.flow-entry-fields > label,
.flow-entry-fields > .form-field {
  min-width: 0;
}

.flow-hospital-field {
  grid-column: span 2;
}

.flow-secondary-distributor-field {
  grid-column: span 2;
}

@media (min-width: 1101px) {
  .flow-price-field {
    grid-column: span 2;
  }
}

.flow-hospital-info {
  align-items: start;
  border-left: 3px solid rgba(10, 132, 255, 0.45);
  display: grid;
  gap: 10px 18px;
  grid-column: 1 / -1;
  grid-template-columns: minmax(90px, 0.65fr) minmax(110px, 0.75fr) minmax(220px, 2fr);
  min-height: 42px;
  padding: 5px 0 5px 13px;
}

.flow-hospital-info[hidden] {
  display: none;
}

.flow-hospital-info span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-bottom: 4px;
}

.flow-hospital-info strong {
  color: var(--text);
  display: block;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.flow-tracking-footer {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: space-between;
  margin-top: 18px;
  padding-top: 18px;
}

.flow-tracking-totals {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
}

.flow-tracking-totals > span {
  white-space: nowrap;
}

.flow-tracking-totals strong {
  color: var(--primary-dark);
  font-size: 18px;
  margin-left: 5px;
}

.flow-generate-button {
  min-width: 150px;
}

.flow-tracking-submit-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  margin-left: auto;
  max-width: 100%;
}

.flow-tracking-submit-actions > button {
  flex-shrink: 0;
  white-space: nowrap;
}

.flow-generate-button:disabled {
  background: rgba(101, 117, 138, 0.24);
  color: rgba(19, 34, 56, 0.5);
  cursor: not-allowed;
}

.hospital-application-form {
  margin-inline: auto;
  max-width: 1680px;
}

.hospital-application-header p {
  color: var(--muted);
  font-size: 13px;
  margin: 5px 0 0;
}

.hospital-application-ledger-header {
  border-block: 1px solid var(--line);
  margin-top: 14px;
  padding-block: 12px;
}

.hospital-application-summary {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 13px;
  flex-wrap: wrap;
  gap: 18px;
}

.hospital-application-summary strong {
  color: var(--primary-dark);
  font-size: 17px;
  margin-inline: 4px;
}

.hospital-application-list {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.hospital-application-item {
  background: rgba(247, 251, 255, 0.64);
  border: 1px solid rgba(44, 76, 112, 0.1);
  border-radius: 8px;
  padding: 16px;
}

.hospital-application-item-header,
.hospital-application-item-header > div {
  align-items: center;
  display: flex;
}

.hospital-application-item-header {
  justify-content: space-between;
  margin-bottom: 14px;
}

.hospital-application-item-header > div {
  gap: 9px;
}

.hospital-application-item-header .line-no {
  align-items: center;
  background: rgba(10, 132, 255, 0.1);
  border-radius: 6px;
  color: var(--primary-dark);
  display: flex;
  font-size: 13px;
  font-weight: 700;
  height: 30px;
  justify-content: center;
  width: 30px;
}

.hospital-application-item-header .remove-line-button {
  background: #e7f2fb;
  border: 1px solid #b8d5ea;
  color: #24658f;
  min-height: 32px;
  min-width: 60px;
  padding: 0 10px;
}

.hospital-application-item-header .remove-line-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.hospital-application-fields {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
}

.hospital-application-fields > label {
  min-width: 0;
}

.hospital-name-field,
.hospital-address-field {
  grid-column: span 2;
}

.hospital-application-footer {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-top: 18px;
  padding-top: 18px;
}

#hospitalApplicationStatus {
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 650;
}

#generateHospitalApplicationBtn {
  min-width: 150px;
}

@media (min-width: 1101px) {
  #orderForm .order-info-grid,
  #orderForm .enterprise-info-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .document-filters > .precision-date-field {
    grid-column: span 2;
  }

  .system-config-overview-grid {
    grid-template-columns: 1fr;
  }

  .history-filters,
  .history-filters.without-customer-filter,
  .document-filters,
  #hospital-development .hospital-development-filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #document-approval .approval-business-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #document-approval .approval-business-tabs button {
    min-width: 0;
    padding-inline: 8px;
    white-space: nowrap;
  }

  .hospital-application-fields {
    grid-template-columns: repeat(2, minmax(170px, 1fr));
  }

  .flow-reporting-section {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .flow-reporting-fields {
    justify-content: stretch;
  }

  .flow-stock-toolbar {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .flow-stock-toolbar-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    justify-content: flex-start;
    width: 100%;
  }

  .flow-stock-company,
  .flow-stock-customer-field {
    grid-column: 1 / -1;
  }

  .flow-ledger-header {
    flex-wrap: wrap;
    gap: 12px;
  }

  #exportFlowInventoryBtn {
    white-space: nowrap;
    word-break: keep-all;
  }

  .flow-entry-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .flow-entry-heading {
    align-items: stretch;
    grid-template-columns: minmax(0, 1fr);
  }

  .flow-entry-product-summary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .hospital-development-overview {
    gap: 7px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-block: 10px;
  }

  .hospital-development-overview article {
    align-content: center;
    display: grid;
    gap: 4px;
    justify-items: center;
    min-height: 64px;
    padding: 7px 4px;
    text-align: center;
  }

  .hospital-development-overview-icon {
    flex-basis: 26px;
    height: 26px;
    width: 26px;
  }

  .hospital-development-overview-icon img {
    height: 16px;
    width: 16px;
  }

  .hospital-development-overview article > div {
    gap: 2px;
  }

  .hospital-development-overview article > div > span {
    font-size: 10px;
  }

  .hospital-development-overview strong {
    font-size: 19px;
  }

  .flow-hospital-field,
  .flow-hospital-info,
  .flow-secondary-distributor-field {
    grid-column: span 2;
  }
}

@media (max-width: 760px) {
  .hospital-application-fields {
    grid-template-columns: 1fr;
  }

  .hospital-name-field,
  .hospital-address-field {
    grid-column: auto;
  }

  .hospital-application-footer {
    flex-wrap: wrap;
  }

  #generateHospitalApplicationBtn {
    margin-left: auto;
  }
}

@media (max-width: 760px) {
  .flow-reporting-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .system-setting-row {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .system-group-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .system-rule-grid,
  .fixed-option-row {
    grid-template-columns: 1fr;
  }

  .system-config-overview-grid,
  .system-config-field-grid,
  .system-config-summary-limits {
    grid-template-columns: 1fr;
  }

  .system-management-card-grid,
  .system-config-domain-grid,
  .system-config-panel {
    grid-template-columns: minmax(0, 1fr);
  }

  .system-config-field-grid.flow-date-limit-grid {
    grid-template-columns: 1fr;
  }

  .system-modal-setting-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .system-config-panel .system-rule-field > :is(
    input[type="number"],
    select,
    .portal-control-shell,
    .precision-date-picker
  ) {
    width: 100%;
  }

  .system-config-dialog-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .system-config-footer-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .system-config-footer-actions > button {
    width: 100%;
  }

  :is(.system-config-dialog, .fixed-options-dialog, .dingtalk-oa-field-mapping-dialog) .system-log-dialog-header {
    align-items: flex-start;
    flex-wrap: nowrap;
  }

  :is(.system-config-dialog, .fixed-options-dialog, .dingtalk-oa-field-mapping-dialog) .system-log-dialog-header > :first-child {
    flex: 1;
    min-width: 0;
  }

  .dingtalk-oa-mapping-footer > div {
    display: flex;
    gap: 8px;
    margin-left: auto;
  }

  .role-feature-matrix-row > span {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .role-feature-matrix-row > span strong {
    font-size: 11px;
  }

  .role-feature-matrix-row.is-child > span {
    padding-left: 12px;
  }

  .role-feature-switch {
    gap: 3px;
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    min-height: 40px;
  }

  .role-feature-switch > strong {
    font-size: 10px;
    height: auto;
    line-height: 1.3;
    min-width: 0;
    text-align: center;
    transform: none;
  }

  :is(.system-config-dialog, .fixed-options-dialog) .system-log-dialog-actions {
    flex: 0 0 auto;
    width: auto;
  }

  .fixed-option-manual {
    padding-top: 0;
  }

  .system-setting-row .secondary-button {
    width: 100%;
  }

  .flow-stock-toolbar-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .flow-stock-company,
  .flow-stock-customer-field {
    align-items: flex-start;
    gap: 4px;
    grid-column: 1 / -1;
  }

  .flow-stock-company {
    flex-direction: column;
  }

  .flow-stock-company strong {
    text-align: left;
  }

  .flow-stock-customer-field {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .flow-stock-summary {
    justify-content: flex-start;
  }

  .flow-ledger-header {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .flow-ledger-header .secondary-button {
    width: 100%;
  }

  .hospital-application-ledger-header {
    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }

  .hospital-application-ledger-header .secondary-button {
    margin-left: auto;
    width: auto;
  }

  .flow-entry-fields,
  .flow-hospital-info {
    grid-template-columns: 1fr;
  }

  .flow-entry-header {
    gap: 10px;
  }

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

  .flow-entry-product-summary > div:nth-child(odd) {
    border-left: 0;
  }

  .flow-entry-product-summary > div:nth-child(n + 3) {
    border-top: 1px solid rgba(44, 76, 112, 0.1);
  }

  .flow-hospital-field,
  .flow-hospital-info,
  .flow-quantity-field,
  .flow-secondary-distributor-field {
    grid-column: span 1;
  }

  .flow-tracking-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .flow-generate-button {
    width: 100%;
  }

  .flow-tracking-submit-actions {
    align-items: stretch;
    flex-direction: row;
    width: 100%;
  }

  .flow-tracking-submit-actions > button {
    flex: 1 1 0;
    min-width: 0;
    padding-inline: 8px;
    width: auto;
  }

  .flow-tracking-submit-actions > .flow-generate-button {
    flex-basis: 100%;
  }
}

/* Unified action, tab and pagination interaction states. */
button:disabled {
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.56;
  transform: none;
}

/* One interaction language for all actionable controls.  Semantic colors stay
   distinct, while hover, focus, press and disabled feedback remain consistent. */
.data-refresh-button,
.dialog-close-button,
.hospital-development-project-year-button,
.hospital-development-project-year-more,
.hospital-development-detail-toggle {
  transition: background-color 180ms var(--ease-fluid), border-color 180ms var(--ease-fluid), box-shadow 180ms var(--ease-fluid), color 180ms var(--ease-fluid), transform 180ms var(--ease-fluid);
}

.data-refresh-button:hover:not(:disabled),
.data-refresh-button:focus-visible:not(:disabled),
.dialog-close-button:hover:not(:disabled),
.dialog-close-button:focus-visible:not(:disabled),
.hospital-development-project-year-button:hover:not(:disabled),
.hospital-development-project-year-button:focus-visible:not(:disabled),
.hospital-development-project-year-more:hover:not(:disabled),
.hospital-development-project-year-more:focus-visible:not(:disabled),
.hospital-development-detail-toggle:hover:not(:disabled),
.hospital-development-detail-toggle:focus-visible:not(:disabled) {
  box-shadow: var(--interaction-hover-shadow);
  transform: translateY(-1px);
}

.data-refresh-button:active:not(:disabled),
.dialog-close-button:active:not(:disabled),
.hospital-development-project-year-button:active:not(:disabled),
.hospital-development-project-year-more:active:not(:disabled),
.hospital-development-detail-toggle:active:not(:disabled) {
  box-shadow: none;
  transform: scale(0.98);
}

.data-refresh-button:disabled {
  cursor: not-allowed;
}

.hospital-development-project-year-button.is-active:hover:not(:disabled),
.hospital-development-project-year-button[aria-current="true"]:hover:not(:disabled) {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* Disabled absolute controls still need their positioning transform. */
.portal-dropdown-toggle:disabled,
.portal-clear-button:disabled {
  transform: none;
}

.compact-button:not(.primary-button):not(.secondary-button):not(.neutral-button):not(.danger-button):not(.warning-button):hover:not(:disabled),
.icon-button:hover:not(:disabled),
.line-item > .remove-line-button:hover:not(:disabled),
.flow-entry-header .remove-line-button:hover:not(:disabled),
.hospital-application-item-header .remove-line-button:hover:not(:disabled) {
  background: var(--interaction-hover-surface);
  border-color: var(--interaction-hover-border);
  box-shadow: var(--interaction-hover-shadow);
  color: var(--primary-dark);
  transform: translateY(-1px);
}

.compact-button:not(.primary-button):not(.secondary-button):not(.neutral-button):not(.danger-button):not(.warning-button):active:not(:disabled),
.icon-button:active:not(:disabled),
.line-item > .remove-line-button:active:not(:disabled),
.flow-entry-header .remove-line-button:active:not(:disabled),
.hospital-application-item-header .remove-line-button:active:not(:disabled) {
  box-shadow: none;
  transform: scale(0.98);
}

.link-button:hover:not(:disabled),
.link-button:active:not(:disabled) {
  background: transparent;
  box-shadow: none;
  color: var(--primary-dark);
  transform: none;
}

.document-tabs,
.approval-business-tabs,
.hospital-development-statistics-tabs {
  background: rgba(241, 247, 252, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
  gap: 6px;
  padding: 5px;
}

.document-tab,
.approval-business-tabs button,
.approval-view-tabs button,
.hospital-development-statistics-tabs button,
.date-granularity button,
.date-presets button,
.admin-tabs .tab {
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  transition: background-color 180ms var(--ease-fluid), border-color 180ms var(--ease-fluid), box-shadow 180ms var(--ease-fluid), color 180ms var(--ease-fluid), transform 180ms var(--ease-fluid);
}

.document-tab:hover:not(.active):not(:disabled),
.approval-business-tabs button:hover:not(.active):not(:disabled),
.approval-view-tabs button:hover:not(.active):not(:disabled),
.hospital-development-statistics-tabs button:hover:not(.active):not(:disabled),
.date-granularity button:hover:not(.active):not(:disabled),
.date-presets button:hover:not(.active):not(:disabled),
.admin-tabs .tab:hover:not(.active):not(:disabled) {
  background: var(--interaction-hover-surface);
  border-color: rgba(10, 132, 255, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88);
  color: var(--primary-dark);
  transform: none;
}

.document-tab.active,
.document-tab[aria-selected="true"],
.approval-business-tabs button.active,
.approval-business-tabs button[aria-selected="true"],
.approval-view-tabs button.active,
.approval-view-tabs button[aria-selected="true"],
.hospital-development-statistics-tabs button.active,
.hospital-development-statistics-tabs button[aria-selected="true"],
.date-granularity button.active,
.date-presets button.active,
.admin-tabs .tab.active {
  background: var(--interaction-selected-surface);
  border-color: rgba(255, 255, 255, 0.94);
  box-shadow: var(--interaction-selected-shadow);
  color: var(--primary-dark);
  font-weight: 700;
  transform: none;
}

.document-tab.active:hover:not(:disabled),
.document-tab[aria-selected="true"]:hover:not(:disabled),
.approval-business-tabs button.active:hover:not(:disabled),
.approval-business-tabs button[aria-selected="true"]:hover:not(:disabled),
.approval-view-tabs button.active:hover:not(:disabled),
.approval-view-tabs button[aria-selected="true"]:hover:not(:disabled),
.hospital-development-statistics-tabs button.active:hover:not(:disabled),
.hospital-development-statistics-tabs button[aria-selected="true"]:hover:not(:disabled),
.date-granularity button.active:hover:not(:disabled),
.date-presets button.active:hover:not(:disabled),
.admin-tabs .tab.active:hover:not(:disabled) {
  background: var(--interaction-selected-surface);
  border-color: rgba(10, 132, 255, 0.2);
  box-shadow: 0 7px 17px rgba(37, 74, 112, 0.12), inset 0 1px 0 #fff;
  color: var(--primary-dark);
  transform: none;
}

.document-tab:active:not(:disabled),
.approval-business-tabs button:active:not(:disabled),
.approval-view-tabs button:active:not(:disabled),
.hospital-development-statistics-tabs button:active:not(:disabled),
.date-granularity button:active:not(:disabled),
.date-presets button:active:not(:disabled),
.admin-tabs .tab:active:not(:disabled) {
  box-shadow: inset 0 1px 4px rgba(33, 80, 120, 0.11);
  transform: scale(0.985);
}

.document-tab:disabled,
.approval-business-tabs button:disabled,
.approval-view-tabs button:disabled,
.hospital-development-statistics-tabs button:disabled,
.date-granularity button:disabled,
.date-presets button:disabled,
.admin-tabs .tab:disabled {
  background: var(--interaction-disabled-surface);
  border-color: transparent;
  color: var(--interaction-disabled-text);
  opacity: 0.72;
  transform: none;
}

/* Generated line-item and account deletion controls share the same danger
   treatment as the hospital-development "删除项目" action.  This comes after
   their layout-specific rules so those rules cannot turn them back to blue. */
.remove-line-button.danger-button,
.danger-outline-button.danger-button,
.compact-button.danger-button {
  background: #d94e55;
  border-color: #d94e55;
  box-shadow: 0 7px 16px rgba(180, 45, 53, 0.18);
  color: #fff;
}

.remove-line-button.danger-button:hover:not(:disabled),
.remove-line-button.danger-button:focus-visible:not(:disabled),
.danger-outline-button.danger-button:hover:not(:disabled),
.danger-outline-button.danger-button:focus-visible:not(:disabled),
.compact-button.danger-button:hover:not(:disabled),
.compact-button.danger-button:focus-visible:not(:disabled) {
  background: #c63e46;
  border-color: #c63e46;
  box-shadow: 0 9px 20px rgba(180, 45, 53, 0.24);
  color: #fff;
}

/* Action-button geometry is independent from color semantics.  Keep normal
   page actions identical; use the smaller scale only when an action lives in
   a line item, table row, or pagination control.  Tabs and icon controls are
   deliberately outside this group because they are selection/navigation UI. */
button:is(.primary-button, .secondary-button, .neutral-button, .danger-button, .warning-button, .dialog-close-button) {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  font-size: 14px;
  font-weight: 700;
  justify-content: center;
  letter-spacing: -0.01em;
  line-height: 1;
  min-height: var(--button-height-medium);
  padding-inline: 16px;
  transition: background-color 180ms var(--ease-fluid), border-color 180ms var(--ease-fluid), box-shadow 180ms var(--ease-fluid), color 180ms var(--ease-fluid), transform 180ms var(--ease-fluid);
}

.compact-button,
.remove-line-button.danger-button,
.danger-outline-button.danger-button {
  border-radius: 8px;
  font-size: 13px;
  min-height: var(--button-height-small);
  padding-inline: 12px;
}

.hospital-development-row-actions > button {
  border-radius: 8px;
  line-height: 1;
}

.document-tab small,
.hospital-development-statistics-tabs small {
  background: rgba(10, 132, 255, 0.08);
  border: 1px solid rgba(10, 132, 255, 0.14);
  color: var(--primary-dark);
}

.document-tab:hover:not(:disabled) small,
.document-tab.active small,
.document-tab[aria-selected="true"] small {
  background: rgba(10, 132, 255, 0.11);
  border-color: rgba(10, 132, 255, 0.2);
  color: var(--primary-dark);
}

.table-pagination .pagination-arrow-button,
.table-pagination .pagination-jump-button {
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(10, 132, 255, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
  color: var(--primary-dark);
  transform: none;
}

.table-pagination .pagination-arrow-button:hover:not(:disabled),
.table-pagination .pagination-jump-button:hover:not(:disabled) {
  background: var(--interaction-hover-surface);
  border-color: var(--interaction-hover-border);
  box-shadow: var(--interaction-hover-shadow);
  color: var(--primary-dark);
  transform: translateY(-1px);
}

.table-pagination .pagination-arrow-button:active:not(:disabled),
.table-pagination .pagination-jump-button:active:not(:disabled) {
  box-shadow: none;
  transform: scale(0.96);
}

.table-pagination .pagination-arrow-button:disabled,
.table-pagination .pagination-jump-button:disabled {
  background: var(--interaction-disabled-surface);
  border-color: transparent;
  color: var(--interaction-disabled-text);
  opacity: 0.72;
  transform: none;
}

/* Mobile workspace: compact navigation and denser task-oriented layouts. */
@media (max-width: 760px) {
  body {
    overflow-x: hidden;
  }

  .app-shell {
    align-content: start;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .sidebar {
    align-items: center;
    display: grid;
    gap: 8px 10px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 10px 12px;
    position: sticky;
    top: 0;
    z-index: 80;
  }

  .brand {
    justify-items: start;
    margin: 0;
    min-width: 0;
  }

  .brand-logo-frame {
    height: 44px;
    max-width: 142px;
  }

  .brand-logo {
    top: -6px;
    width: 158px;
  }

  .mobile-nav-toggle {
    align-items: center;
    background: rgba(255, 255, 255, 0.76);
    border: 1px solid rgba(10, 132, 255, 0.18);
    color: var(--text);
    display: flex;
    gap: 10px;
    justify-content: space-between;
    min-height: 44px;
    padding: 7px 12px;
  }

  .mobile-nav-toggle:hover:not(:disabled),
  .mobile-nav-toggle:focus-visible {
    background: #fff;
    border-color: rgba(10, 132, 255, 0.34);
    color: var(--text);
    transform: none;
  }

  .mobile-nav-current {
    color: var(--muted);
    display: grid;
    font-size: 10px;
    gap: 2px;
    line-height: 1.15;
    text-align: left;
  }

  .mobile-nav-current strong {
    color: var(--primary-dark);
    font-size: 13px;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-nav-toggle-icon {
    display: grid;
    gap: 3px;
    width: 16px;
  }

  .mobile-nav-toggle-icon i {
    background: currentColor;
    border-radius: 999px;
    display: block;
    height: 2px;
    transition: transform 180ms var(--ease-fluid), opacity 180ms ease;
    width: 16px;
  }

  .mobile-nav-toggle[aria-expanded="true"] .mobile-nav-toggle-icon i:first-child {
    transform: translateY(5px) rotate(45deg);
  }

  .mobile-nav-toggle[aria-expanded="true"] .mobile-nav-toggle-icon i:nth-child(2) {
    opacity: 0;
  }

  .mobile-nav-toggle[aria-expanded="true"] .mobile-nav-toggle-icon i:last-child {
    transform: translateY(-5px) rotate(-45deg);
  }

  .nav-list,
  .user-card {
    display: none;
    grid-column: 1 / -1;
  }

  .sidebar.mobile-nav-open .nav-list {
    animation: mobile-nav-panel-in 180ms var(--ease-fluid) both;
    background: rgba(246, 250, 254, 0.96);
    border: 1px solid rgba(161, 191, 215, 0.4);
    border-radius: 18px;
    box-shadow: 0 14px 28px rgba(39, 74, 112, 0.12), inset 0 1px 0 #fff;
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-height: min(58dvh, 430px);
    overflow-y: auto;
    padding: 10px;
    width: 100%;
  }

  .sidebar.mobile-nav-open .user-card {
    display: grid;
    margin-top: 2px;
    width: 100%;
  }

  .nav-item {
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(181, 204, 222, 0.48);
    border-radius: 12px;
    color: #445a6d;
    font-size: 13px;
    font-weight: 600;
    justify-content: center;
    line-height: 1.25;
    min-height: 52px;
    padding: 12px 6px 8px;
    position: relative;
    text-align: center;
    white-space: normal;
    width: 100%;
  }

  .nav-item::before {
    display: none;
  }

  .nav-item:hover:not(.active) {
    background: rgba(237, 247, 255, 0.96);
    border-color: rgba(10, 132, 255, 0.24);
    color: var(--primary-dark);
    transform: none;
  }

  .nav-item.active,
  .nav-item.active:hover:not(:disabled) {
    background: linear-gradient(145deg, #fff, #eaf5ff);
    border-color: rgba(10, 132, 255, 0.38);
    box-shadow: 0 6px 14px rgba(37, 111, 174, 0.12), inset 0 1px 0 #fff;
    color: var(--primary-dark);
    transform: none;
  }

  .nav-item > span:first-child:not(.nav-count-badge) {
    min-width: 0;
    text-align: center;
  }

  .nav-count-badge {
    font-size: 10px;
    height: 18px;
    margin: 0;
    min-width: 18px;
    padding-inline: 5px;
    position: absolute;
    right: 6px;
    top: -6px;
    z-index: 1;
  }

  .sidebar.mobile-nav-open .account-profile-nav {
    grid-column: 1 / -1;
    margin-top: 2px;
  }

  .sidebar.motion-enter-left .nav-item {
    animation: none;
  }

  .main-content {
    padding: 14px 12px calc(32px + env(safe-area-inset-bottom));
  }

  .topbar {
    gap: 7px;
    margin: -14px -12px 14px;
    min-height: 0;
    padding: 10px 12px;
    top: 64px;
  }

  .topbar h1 {
    border: 0;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    white-space: nowrap;
    width: 1px;
  }

  .account-box {
    border-radius: 12px;
    padding: 7px 9px;
    width: 100%;
  }

  .topbar-clock {
    display: none;
  }

  .topbar-meta {
    gap: 5px;
  }

  .pending-summary {
    flex-wrap: nowrap;
    justify-content: flex-start;
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .pending-summary::-webkit-scrollbar {
    display: none;
  }

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

  .metric-card {
    min-height: 118px;
    padding: 14px;
  }

  .metric-card strong {
    font-size: var(--metric-value-font-size, 22px);
  }

  .panel {
    padding: 14px 12px;
  }

  .form-grid,
  .line-fields,
  .history-filters,
  .history-filters.without-customer-filter,
  .document-filters,
  .hospital-application-fields,
  .flow-entry-fields {
    gap: 11px 9px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-grid > .wide,
  .form-grid > label:has(textarea),
  .order-info-grid > label:has([name="buyerCompany"]),
  .order-info-grid > label:has([name="address"]),
  .line-fields > label:has([data-field="name"]),
  .line-fields > label:has([data-field="remark"]),
  .history-date-filter,
  .filter-reset-action,
  .document-filter-actions,
  .hospital-name-field,
  .hospital-address-field,
  .flow-hospital-field,
  .flow-secondary-distributor-field,
  .flow-hospital-info {
    grid-column: 1 / -1;
  }

  .line-item {
    gap: 10px 8px;
    grid-template-columns: 30px minmax(0, 1fr);
    padding: 12px 10px;
  }

  .flow-entry {
    padding: 12px 10px;
  }

  input,
  select,
  textarea,
  .portal-control-shell {
    min-height: 44px;
  }

  .precision-date-trigger {
    min-height: 44px;
  }

  .order-header-actions,
  .panel-header > .order-header-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .order-submit-status {
    grid-column: 1 / -1;
  }

  .order-header-actions button {
    width: 100%;
  }

  .approval-business-tabs:not(.module-view-tabs),
  .approval-view-tabs,
  .document-tabs,
  .hospital-development-statistics-tabs {
    display: flex;
    max-width: 100%;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .approval-business-tabs:not(.module-view-tabs)::-webkit-scrollbar,
  .approval-view-tabs::-webkit-scrollbar,
  .document-tabs::-webkit-scrollbar,
  .hospital-development-statistics-tabs::-webkit-scrollbar {
    display: none;
  }

  .approval-business-tabs:not(.module-view-tabs) button,
  .approval-view-tabs button,
  .document-tab,
  .hospital-development-statistics-tabs button {
    flex: 0 0 auto;
    min-height: 42px;
    scroll-snap-align: start;
    white-space: nowrap;
  }

  .module-view-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .module-view-tabs button {
    min-width: 0;
    padding-inline: 8px;
  }

  .approval-search {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .approval-search input,
  .approval-search .portal-control-shell {
    grid-column: 1 / -1;
  }

  .approval-search button {
    width: 100%;
  }

  .table-wrap {
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    position: relative;
  }

  .table-wrap::before,
  .dingtalk-people-table-wrap::before,
  .table-scroll::before {
    background: rgba(232, 244, 252, 0.96);
    color: #4f6d83;
    content: "左右滑动查看完整内容";
    display: block;
    font-size: 11px;
    left: 0;
    letter-spacing: 0.02em;
    padding: 7px 10px;
    position: sticky;
    text-align: left;
    width: max-content;
    z-index: 5;
  }

  .table-pagination {
    display: flex;
    gap: 8px 6px;
  }

  .table-pagination .pagination-size-control {
    margin: 0;
  }

  .table-pagination .pagination-size-control select {
    min-height: 40px;
    min-width: 60px;
    width: 60px;
  }

  .table-pagination > span {
    flex: 1 0 72px;
    min-width: 0;
    text-align: center;
  }

  .table-pagination .pagination-jump-control {
    margin: 0 0 0 auto;
  }

  .table-pagination .pagination-jump-button {
    flex: 0 0 auto;
    min-height: 40px;
  }

  .table-pagination .pagination-arrow-button {
    height: 40px;
    min-height: 40px;
    width: 40px;
  }

  .table-pagination[data-single-page="true"] .pagination-jump-control,
  .table-pagination[data-single-page="true"] .pagination-jump-button {
    display: none;
  }

  .document-card .contract-card-header {
    flex-wrap: wrap;
    gap: 8px 12px;
    padding: 10px 12px;
  }

  .document-card .document-card-heading {
    flex: 1 1 160px;
  }

  .document-card .document-card-heading strong {
    white-space: nowrap;
  }

  .document-card .authorization-badges {
    flex: 0 1 auto;
    margin-left: auto;
  }

  .document-card .contract-detail-grid {
    --document-label-width: clamp(72px, 15vw, 100px);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 12px;
  }

  .document-card .contract-detail-grid > div:not(.document-section-label) {
    align-items: start;
    display: grid;
    gap: 8px;
    grid-template-columns: var(--document-label-width) minmax(0, 1fr);
    padding: 8px 10px;
  }

  .document-card .contract-detail-grid > div.document-wide-field {
    grid-column: 1 / -1;
    grid-template-columns: var(--document-label-width) minmax(0, 1fr);
  }

  .document-card .contract-detail-grid dd {
    margin: 0;
    min-width: 0;
  }

  #hospital-development .history-title-block {
    align-items: stretch;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  #hospital-development .hospital-development-header-actions {
    display: grid;
    grid-column: 1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  #hospital-development .hospital-development-filters {
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 12px;
  }

  #hospital-development .hospital-development-search-field,
  #hospital-development .document-filter-actions {
    grid-column: 1 / -1;
  }

  .hospital-development-overview {
    display: flex;
    gap: 9px;
    margin: 13px 0 12px;
    overflow-x: auto;
    padding-bottom: 3px;
    scroll-snap-type: x proximity;
  }

  .hospital-development-overview article {
    flex: 0 0 128px;
    min-height: 72px;
    scroll-snap-align: start;
  }

  #hospital-development .hospital-development-summary {
    display: flex;
    align-items: baseline;
    gap: 4px 8px;
    padding: 0 2px;
  }

  .hospital-development-year-control {
    grid-column: 1 / -1;
    width: 100%;
  }

  .hospital-development-year-control select {
    flex: 1 1 auto;
    min-width: 0;
  }

  .hospital-development-summary > span {
    font-size: 11px;
    line-height: 1.5;
  }

  .hospital-development-summary > span:first-child {
    flex: 1 1 0;
    min-width: 0;
  }

  .hospital-development-summary > span:nth-child(2) {
    white-space: nowrap;
  }

  .hospital-development-summary > span > strong {
    font-size: inherit;
    font-weight: 600;
    margin-left: 0;
  }

  #hospital-development .hospital-development-table-wrap {
    border: 0;
    overflow: visible;
  }

  #hospital-development .hospital-development-table-wrap::before {
    display: none;
  }

  #hospital-development .hospital-development-table {
    display: block;
    min-width: 0;
    width: 100%;
  }

  #hospital-development .hospital-development-table thead {
    display: none;
  }

  #hospital-development .hospital-development-table tbody {
    display: grid;
    gap: 12px;
  }

  #hospital-development .hospital-development-record-row {
    display: block;
    min-width: 0;
    padding: 0;
  }

  #hospital-development .hospital-development-record-row > td {
    display: block;
    min-width: 0;
    padding: 0;
    width: 100%;
  }

  #hospital-development .hospital-development-project-card {
    border: 1px solid rgba(153, 190, 216, 0.74);
    border-radius: 14px;
    box-shadow: 0 5px 14px rgba(55, 91, 119, 0.08);
    overflow: hidden;
    width: 100%;
  }

  #hospital-development .hospital-development-project-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #hospital-development .hospital-development-project-summary > div {
    border-bottom: 1px solid #edf2f6;
    border-right: 0;
    padding: 11px 12px;
  }

  #hospital-development .hospital-development-project-summary > div::before {
    color: #73889a;
    content: attr(data-label);
    font-size: 10px;
    font-weight: 700;
  }

  #hospital-development .hospital-development-project-identity,
  #hospital-development .hospital-development-project-years-cell {
    grid-column: 1 / -1;
  }

  #hospital-development .hospital-development-project-identity {
    background: #f3f9fd;
  }

  #hospital-development .hospital-development-project-identity::before {
    grid-column: 1 / -1;
  }

  #hospital-development .hospital-development-project-identity > div > :is(strong, span, small) {
    overflow: visible;
    overflow-wrap: anywhere;
    text-overflow: clip;
    white-space: normal;
  }

  #hospital-development .hospital-development-project-detail-footer {
    align-items: stretch;
    grid-template-columns: minmax(0, 1fr);
  }

  #hospital-development .hospital-development-project-detail-footer .hospital-development-row-actions {
    display: flex;
    justify-content: flex-start;
    width: 100%;
  }

  #hospital-development .hospital-development-row-actions button {
    min-height: 28px;
    width: auto;
  }

  #hospital-development .hospital-development-action-note {
    grid-column: 1 / -1;
  }

  #hospital-development .hospital-development-project-detail {
    min-width: 0;
    padding: 14px 12px;
  }

  #hospital-development .hospital-development-timeline {
    grid-template-columns: repeat(12, 78px);
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overscroll-behavior-x: contain;
  }

  #hospital-development .hospital-development-project-meta {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #hospital-development .hospital-development-project-meta-wide {
    grid-column: 1 / -1;
  }

  #hospital-development .hospital-development-project-year-buttons {
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .hospital-development-editor-nav {
    display: flex;
    gap: 0;
    margin: 8px 0 0;
    overflow-x: auto;
    padding: 0 4px;
    scrollbar-width: none;
    top: 0;
  }

  .hospital-development-editor-nav::-webkit-scrollbar {
    display: none;
  }

  .hospital-development-editor-nav button {
    flex: 0 0 auto;
    font-size: 10px;
    gap: 5px;
    min-height: 38px;
    min-width: 106px;
    padding: 4px 5px;
  }

  .hospital-development-editor-nav button > span {
    flex-basis: 18px;
    font-size: 9px;
    height: 18px;
  }

  .hospital-development-editor-layout {
    grid-template-columns: minmax(0, 1fr);
    margin-top: 8px;
  }

  .hospital-development-editor-card .hospital-development-editor-grid,
  .hospital-development-editor-card[data-editor-section="ownership"] .hospital-development-editor-grid {
    column-gap: 8px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 8px;
  }

  .hospital-development-editor-card[data-editor-section="customer"] .hospital-development-editor-grid,
  .hospital-development-editor-card .hospital-development-stage-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-dialog.hospital-development-editor-dialog {
    border-radius: 20px 20px 0 0;
    padding: 0 10px max(10px, env(safe-area-inset-bottom));
  }

  .hospital-development-editor-header {
    gap: 8px;
    margin: 0 -10px;
    padding: 10px;
  }

  .hospital-development-editor-header h2 {
    font-size: 17px;
    margin: 2px 0;
  }

  .hospital-development-editor-header p,
  .hospital-development-editor-header .admin-confirm-eyebrow {
    font-size: 9px;
    line-height: 1.3;
  }

  .hospital-development-editor-header .dialog-close-button {
    font-size: 11px;
    min-height: 34px;
    padding-inline: 10px;
  }

  .hospital-development-editor-card {
    padding: 10px 8px 11px !important;
    scroll-margin-top: 48px;
  }

  .hospital-development-section-heading {
    gap: 6px;
    margin-bottom: 8px;
    padding-left: 8px;
  }

  .hospital-development-section-heading::before {
    width: 2px;
  }

  .hospital-development-section-heading > span {
    flex-basis: 20px;
    font-size: 9px;
    height: 20px;
  }

  .hospital-development-section-heading h3 {
    font-size: 12px;
    margin: 0 0 2px;
  }

  .hospital-development-section-heading p {
    font-size: 9px;
    line-height: 1.3;
  }

  .hospital-development-editor-card .hospital-development-editor-grid > label {
    gap: 3px;
  }

  .hospital-development-editor-card .hospital-development-editor-grid > label > span,
  .hospital-development-month-editor label > span {
    font-size: 9px;
    line-height: 1.2;
  }

  .hospital-development-editor-card :is(label small, .form-hint) {
    font-size: 8px;
    line-height: 1.25;
  }

  .hospital-development-editor-dialog :is(
    .hospital-development-editor-grid,
    .hospital-development-month-editor
  ) :is(input:not([type="hidden"]), select, .portal-control-shell, .precision-date-picker, :where(.precision-date-trigger)) {
    font-size: 10px;
    height: 34px;
    min-height: 34px;
    padding-inline: 6px;
  }

  .hospital-development-editor-dialog {
    --control-actions-space: 60px;
    --control-arrow-space: 32px;
    --control-clear-width: 24px;
    --control-arrow-width: 24px;
  }

  .hospital-development-editor-dialog .portal-dropdown-toggle,
  .hospital-development-editor-dialog .portal-clear-button {
    height: 24px;
    min-height: 24px;
    min-width: 24px;
    padding: 0;
    width: 24px;
  }

  .hospital-development-editor-dialog .portal-dropdown-toggle { right: 3px; }
  .hospital-development-editor-dialog .portal-clear-button { right: 30px; }

  .hospital-development-month-editor {
    gap: 6px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hospital-development-future-month {
    font-size: 9px;
    min-height: 34px;
    padding-inline: 6px;
  }

  .hospital-development-system-info .admin-confirm-details {
    gap: 6px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 6px;
  }

  .hospital-development-system-info .admin-confirm-details > div {
    gap: 2px;
    padding: 6px;
  }

  .hospital-development-system-info .admin-confirm-details dt {
    font-size: 9px;
  }

  .hospital-development-system-info .admin-confirm-details dd {
    font-size: 10px;
  }

  .hospital-development-editor-actions {
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 8px;
    padding-top: 8px;
  }

  .hospital-development-editor-actions > button {
    min-height: 36px;
    width: 100%;
  }

  .hospital-development-statistics-dialog {
    padding: 14px 14px max(16px, env(safe-area-inset-bottom));
  }

  .hospital-development-statistics-header {
    gap: 12px;
    padding-right: 0;
  }

  .hospital-development-statistics-header > div:first-child {
    min-width: 0;
  }

  .hospital-development-statistics-header h2 {
    font-size: 21px;
    margin: 2px 0 4px;
  }

  .hospital-development-statistics-header p {
    font-size: 12px;
    line-height: 1.55;
  }

  .hospital-development-statistics-controls {
    gap: 8px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hospital-development-statistics-controls label,
  .hospital-development-statistics-controls .portal-control-shell {
    min-width: 0;
    width: 100%;
  }

  #hospitalDevelopmentStatisticsModal .hospital-development-statistics-controls label span,
  #hospitalDevelopmentStatisticsModal .hospital-development-statistics-card-controls label span {
    font-size: 11px;
  }

  #hospitalDevelopmentStatisticsModal {
    --control-actions-space: 52px;
    --control-arrow-space: 29px;
    --control-clear-width: 20px;
    --control-arrow-width: 24px;
  }

  #hospitalDevelopmentStatisticsModal .portal-control-shell,
  #hospitalDevelopmentStatisticsModal .portal-control-shell > .combobox-input {
    min-height: 34px;
  }

  #hospitalDevelopmentStatisticsModal .portal-control-shell {
    padding: 0;
  }

  #hospitalDevelopmentStatisticsModal .portal-control-shell > .combobox-input {
    font-size: 12px;
    padding-block: 5px;
    padding-left: 8px;
  }

  #hospitalDevelopmentStatisticsModal .hospital-development-statistics-card-controls .portal-control-shell {
    min-width: 0;
    width: 100%;
  }

  #hospitalDevelopmentStatisticsModal .hospital-development-statistics-card-controls-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #hospitalDevelopmentStatisticsModal .combobox-toggle {
    height: 24px;
    min-height: 24px;
    min-width: 24px;
    right: 3px;
    width: 24px;
  }

  #hospitalDevelopmentStatisticsModal .combobox-clear-button {
    height: 24px;
    min-height: 24px;
    min-width: 20px;
    right: 28px;
    width: 20px;
  }

  .hospital-development-statistics-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }

  .hospital-development-statistics-tabs button {
    min-width: 0;
  }

  .hospital-development-statistics-kpis {
    gap: 8px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hospital-development-statistics-kpis article {
    min-height: 82px;
    padding: 10px 11px;
  }

  .hospital-development-statistics-kpis strong {
    font-size: 21px;
  }

  .hospital-development-statistics-card {
    min-height: 0;
    padding: 11px;
  }

  .hospital-development-statistics-card > header {
    gap: 8px;
    margin-bottom: 10px;
  }

  .hospital-development-statistics-card-title {
    position: relative;
  }

  #hospitalDevelopmentStatisticsModal .hospital-development-statistics-help {
    font-size: 11px;
    height: 24px;
    min-height: 24px;
    min-width: 24px;
    padding: 0;
    position: static;
    transform: none;
    width: 24px;
  }

  .hospital-development-statistics-help::before {
    display: none;
  }

  .hospital-development-statistics-help::after {
    max-width: min(300px, calc(100vw - 80px));
  }

  .hospital-development-statistics-card-controls-row label:first-child {
    grid-column: auto;
  }

  .hospital-development-statistics-filter-summary {
    align-items: stretch;
    display: grid;
    gap: 8px;
  }

  .hospital-development-statistics-filter-summary > div {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hospital-development-donut-wrap {
    gap: 10px;
    grid-template-columns: 96px minmax(0, 1fr);
    justify-items: stretch;
    margin-top: 8px;
  }

  .hospital-development-donut,
  .hospital-development-donut > span {
    height: 96px;
    width: 96px;
  }

  .hospital-development-donut > span {
    height: 60px;
    width: 60px;
  }

  #hospitalDevelopmentStatisticsDetailsPanel .table-wrap {
    overflow: visible;
  }

  #hospitalDevelopmentStatisticsDetailsPanel .table-wrap::before {
    display: none;
  }

  #hospitalDevelopmentStatisticsDetailsPanel table {
    display: block;
    min-width: 0;
  }

  #hospitalDevelopmentStatisticsDetailsPanel thead {
    display: none;
  }

  #hospitalDevelopmentStatisticsDetailsPanel tbody {
    display: grid;
    gap: 10px;
  }

  #hospitalDevelopmentStatisticsDetailsPanel .hospital-development-statistics-record-row {
    background: #fff;
    border: 1px solid rgba(153, 190, 216, 0.74);
    border-radius: 12px;
    display: grid;
    gap: 0 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: hidden;
    padding: 5px 11px 10px;
  }

  #hospitalDevelopmentStatisticsDetailsPanel .hospital-development-statistics-record-row > td {
    border: 0;
    border-bottom: 1px solid rgba(203, 221, 233, 0.72);
    display: grid;
    gap: 3px;
    min-width: 0;
    padding: 8px 0;
    white-space: normal;
  }

  #hospitalDevelopmentStatisticsDetailsPanel .hospital-development-statistics-record-row > td::before {
    color: #6a8293;
    content: attr(data-label);
    font-size: 11px;
    font-weight: 650;
  }

  #hospitalDevelopmentStatisticsDetailsPanel .hospital-development-statistics-record-row > td:nth-child(2),
  #hospitalDevelopmentStatisticsDetailsPanel .hospital-development-statistics-record-row > td:nth-child(3),
  #hospitalDevelopmentStatisticsDetailsPanel .hospital-development-statistics-record-row > td:nth-child(6),
  #hospitalDevelopmentStatisticsDetailsPanel .hospital-development-statistics-record-row > td:last-child {
    grid-column: 1 / -1;
  }

  #hospitalDevelopmentStatisticsDetailsPanel .hospital-development-statistics-record-row > td:last-child {
    border-bottom: 0;
  }

  #hospitalDevelopmentStatisticsDetailsPanel .hospital-development-statistics-record-row > td:last-child button {
    min-height: 40px;
    width: 100%;
  }

  .detail-modal {
    align-items: flex-end;
    padding: 0;
  }

  .detail-modal:not(.pending-login-modal) {
    z-index: 220;
  }

  .detail-dialog,
  .modal-card,
  .order-detail-card {
    border-radius: 20px 20px 0 0;
    max-height: calc(100dvh - 10px);
    max-width: none !important;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    width: 100% !important;
  }

  .detail-dialog-header,
  .system-log-dialog-header {
    gap: 10px;
  }

  /* Business details become readable record cards on phones; desktop tables stay unchanged. */
  :is(#orderDetailModal, #submittedOrderHistoryDetailModal, #flowApprovalDetailModal) .order-detail-meta {
    border-radius: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 12px;
    overflow: hidden;
  }

  :is(#orderDetailModal, #submittedOrderHistoryDetailModal, #flowApprovalDetailModal) .order-detail-meta > div {
    display: block;
    min-height: 48px;
  }

  #flowApprovalSummary > div:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  :is(#orderDetailModal, #submittedOrderHistoryDetailModal, #flowApprovalDetailModal) .order-detail-meta dt,
  :is(#orderDetailModal, #submittedOrderHistoryDetailModal, #flowApprovalDetailModal) .order-detail-meta dd {
    min-height: 23px;
    padding: 5px 7px;
  }

  :is(#orderDetailModal, #submittedOrderHistoryDetailModal, #flowApprovalDetailModal) .order-detail-table-wrap,
  #flowApprovalDetailModal .approval-detail-table-wrap {
    background: transparent;
    border: 0;
    max-height: none;
    overflow: visible;
  }

  :is(#orderDetailModal, #submittedOrderHistoryDetailModal, #flowApprovalDetailModal) .order-detail-table-wrap::before,
  #flowApprovalDetailModal .approval-detail-table-wrap::before {
    display: none;
  }

  :is(#orderDetailModal, #submittedOrderHistoryDetailModal, #flowApprovalDetailModal) .shipment-detail-table {
    display: block;
    min-width: 0;
    table-layout: auto;
  }

  :is(#orderDetailModal, #submittedOrderHistoryDetailModal, #flowApprovalDetailModal) .shipment-detail-table colgroup,
  :is(#orderDetailModal, #submittedOrderHistoryDetailModal, #flowApprovalDetailModal) .shipment-detail-table thead {
    display: none;
  }

  :is(#orderDetailModal, #submittedOrderHistoryDetailModal, #flowApprovalDetailModal) .shipment-detail-table tbody {
    display: grid;
    gap: 8px;
  }

  :is(#orderDetailModal, #submittedOrderHistoryDetailModal, #flowApprovalDetailModal) .shipment-detail-table tbody tr[data-item-index] {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(153, 190, 216, 0.72);
    border-radius: 14px;
    box-shadow: 0 5px 14px rgba(55, 91, 119, 0.08);
    display: grid;
    gap: 0 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: hidden;
    padding: 0 9px 6px;
  }

  :is(#orderDetailModal, #submittedOrderHistoryDetailModal, #flowApprovalDetailModal) .shipment-detail-table tbody tr[data-item-index]::before {
    background: #eaf5fc;
    border-bottom: 1px solid rgba(175, 203, 220, 0.8);
    color: #315d7b;
    content: "明细 " attr(data-item-index);
    font-size: 13px;
    font-weight: 750;
    grid-column: 1 / -1;
    margin: 0 -9px;
    padding: 7px 9px;
  }

  :is(#orderDetailModal, #submittedOrderHistoryDetailModal, #flowApprovalDetailModal) .shipment-detail-table tbody tr[data-item-index] > td {
    background: transparent;
    border: 0;
    border-bottom: 1px solid rgba(203, 221, 233, 0.72);
    color: #28485e;
    display: grid;
    font-size: 11px;
    gap: 3px;
    min-width: 0;
    padding: 6px 0 5px;
    text-align: left;
  }

  :is(#orderDetailModal, #submittedOrderHistoryDetailModal, #flowApprovalDetailModal) .shipment-detail-table tbody tr[data-item-index] > td::before {
    color: #6a8293;
    content: attr(data-label);
    font-size: 11px;
    font-weight: 650;
    line-height: 1.25;
  }

  :is(#orderDetailModal, #submittedOrderHistoryDetailModal) .shipment-detail-table tbody tr[data-item-index] > td:first-child,
  #flowApprovalDetailModal .shipment-detail-table tbody tr[data-item-index] > td[data-label="序号"] {
    display: none;
  }

  #flowApprovalDetailModal .shipment-detail-table tbody tr[data-item-index] > td:is(
    [data-label="经销商"], [data-label="生产企业"], [data-label="产品名称"],
    [data-label="医院名称"], [data-label="医院等级"], [data-label="地址"], [data-label="备注"],
    [data-label="授权医院（医院库）"], [data-label="授权医院（实际名称）"],
    [data-label="字段"], [data-label="变化"]
  ) {
    grid-column: 1 / -1;
  }

  #flowApprovalDetailModal .shipment-detail-table:has(.approval-col-date) tr[data-item-index] > td:nth-child(2) {
    grid-column: 1;
    grid-row: 2;
  }

  #flowApprovalDetailModal .shipment-detail-table:has(.approval-col-date) tr[data-item-index] > td:nth-child(5) {
    grid-column: 2;
    grid-row: 2;
  }

  #flowApprovalDetailModal .shipment-detail-table:has(.approval-col-date) tr[data-item-index] > td:nth-child(3) {
    grid-column: 1 / -1;
    grid-row: 3;
  }

  #orderDetailModal .shipment-detail-table tbody tr[data-item-index] > td:nth-child(2),
  #orderDetailModal .shipment-detail-table tbody tr[data-item-index] > td:nth-child(4),
  #submittedOrderHistoryDetailModal .shipment-detail-table tbody tr[data-item-index] > td:nth-child(2),
  #submittedOrderHistoryDetailModal .shipment-detail-table tbody tr[data-item-index] > td:nth-child(4),
  #submittedOrderHistoryDetailModal .shipment-detail-table tbody tr[data-item-index] > td:nth-child(12) {
    grid-column: 1 / -1;
  }

  :is(#orderDetailModal, #submittedOrderHistoryDetailModal) .shipment-detail-table tbody tr[data-item-index] > td:last-child,
  #orderDetailModal .shipment-detail-table tbody tr[data-item-index] > td:nth-last-child(2) {
    border-bottom: 0;
  }

  :is(#orderDetailModal, #submittedOrderHistoryDetailModal, #flowApprovalDetailModal) .shipment-detail-table tbody tr:not([data-item-index]) {
    display: block;
  }

  :is(#orderDetailModal, #submittedOrderHistoryDetailModal, #flowApprovalDetailModal) .shipment-detail-table tbody tr:not([data-item-index]) > td[colspan] {
    border: 1px dashed rgba(153, 190, 216, 0.8);
    border-radius: 12px;
    display: block;
    min-height: 72px;
    padding: 24px 12px;
    text-align: center;
  }

  :is(#orderDetailModal, #submittedOrderHistoryDetailModal, #flowApprovalDetailModal) .order-detail-totals {
    border-radius: 14px;
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    margin-top: 12px;
    overflow: hidden;
    overflow-x: auto;
    padding: 0 8px;
  }

  :is(#orderDetailModal, #submittedOrderHistoryDetailModal, #flowApprovalDetailModal) .order-detail-totals span {
    border-bottom: 0;
    border-left: 1px solid rgba(196, 220, 233, 0.9);
    flex: 1 0 72px;
    flex-direction: column;
    gap: 2px;
    justify-content: center;
    min-height: 58px;
    padding: 7px 8px;
    text-align: center;
    white-space: nowrap;
  }

  :is(#orderDetailModal, #submittedOrderHistoryDetailModal, #flowApprovalDetailModal) .order-detail-totals .order-detail-total-label {
    border-left: 0;
    flex: 0 0 auto;
    font-size: 13px;
    min-height: 58px;
    padding: 0 9px 0 2px;
  }

  :is(#orderDetailModal, #submittedOrderHistoryDetailModal, #flowApprovalDetailModal) .order-detail-totals strong,
  :is(#orderDetailModal, #submittedOrderHistoryDetailModal, #flowApprovalDetailModal) .order-detail-totals .order-detail-grand-total strong {
    font-size: 14px;
  }

  #flowApprovalDetailModal .approval-progress {
    align-items: center;
    flex-direction: row;
    gap: 4px;
    justify-content: flex-start;
    overflow-x: auto;
    padding: 7px 2px 9px;
    scroll-snap-type: x proximity;
  }

  #flowApprovalDetailModal .approval-progress-step {
    flex: 0 0 168px;
    min-width: 168px;
    scroll-snap-align: start;
    width: 168px;
  }

  #flowApprovalDetailModal .approval-progress-approvers {
    flex-wrap: nowrap;
    overflow: hidden;
  }

  #flowApprovalDetailModal .approval-progress-approver {
    max-width: 154px;
  }

  #flowApprovalDetailModal .approval-progress-approver em {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #flowApprovalDetailModal .approval-progress-arrow {
    flex: 0 0 24px;
    transform: none;
    width: 24px;
  }

  #submittedOrderHistoryDetailModal .submitted-order-history-actions {
    gap: 10px;
    margin-top: 12px;
    padding-top: 12px;
  }

  #submittedOrderHistoryDetailModal .history-download-status {
    flex: none;
    min-height: 0;
    padding: 10px 12px;
    width: 100%;
  }

  #submittedOrderHistoryDetailModal .submitted-order-history-actions > div {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  #submittedOrderHistoryDetailModal .submitted-order-history-actions button {
    min-height: 44px;
    width: 100%;
  }

  #submittedOrderHistoryDetailModal .submitted-order-history-actions .primary-button {
    grid-column: 1 / -1;
  }
}

@keyframes mobile-nav-panel-in {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.99);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 479px) {
  .document-card .contract-detail-grid > div:not(.document-section-label):not(.document-wide-field) {
    gap: 4px;
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 359px) {
  .sidebar.mobile-nav-open .nav-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-grid,
  .form-grid,
  .line-fields,
  .history-filters,
  .history-filters.without-customer-filter,
  .document-filters,
  .hospital-application-fields,
  .flow-entry-fields {
    grid-template-columns: minmax(0, 1fr);
  }

  .form-grid > *,
  .line-fields > *,
  .history-filters > *,
  .document-filters > *,
  .hospital-application-fields > *,
  .flow-entry-fields > * {
    grid-column: 1;
  }
}

/* Phone-only density pass: keep common actions in reach without changing desktop layout. */
@media (max-width: 760px) {
  .login-modal {
    align-items: start;
    padding: 18px 16px max(18px, env(safe-area-inset-bottom));
  }

  .login-layout {
    gap: 12px;
    grid-template-columns: minmax(0, 1fr);
    max-width: 440px;
  }

  .login-brand-panel {
    gap: 4px;
    min-height: 96px;
  }

  .login-logo-frame {
    height: 96px;
    max-width: 300px;
    overflow: visible;
  }

  .login-logo {
    height: 100%;
    left: auto;
    max-width: 100%;
    object-fit: contain;
    position: static;
    top: auto;
    transform: none;
    width: 100%;
  }

  .login-modal .login-company-name {
    font-size: 12px;
    letter-spacing: 0.02em;
    line-height: 1.5;
    padding-inline: 0;
  }

  .login-card {
    gap: 12px;
    padding: 20px;
  }

  .login-form-heading {
    padding-bottom: 12px;
  }

  .login-form-heading h2 {
    font-size: 21px;
  }

  .flow-collection-toolbar > button,
  .flow-history-toolbar > button,
  .approval-toolbar > button {
    min-width: 0;
  }

  .flow-collection-toolbar > button {
    grid-column: span 1;
    width: 100%;
  }

  .system-log-dialog-header,
  .dingtalk-people-dialog-footer {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .system-log-dialog-header > :first-child,
  .dingtalk-people-dialog-footer .system-form-status {
    min-width: 0;
  }

  .system-log-dialog-actions,
  .dingtalk-people-dialog-footer > :last-child {
    flex-wrap: wrap;
  }

  .system-log-dialog-actions > button,
  .dingtalk-people-dialog-footer > button {
    min-height: 40px;
  }
}

@media (max-width: 359px) {
  .login-modal {
    padding-inline: 12px;
  }

  .login-card {
    padding: 18px 16px;
  }

}

/* Mobile data density and modal reachability. All rules stay below the phone breakpoint. */
@media (max-width: 760px) {
  .metric-grid {
    gap: 6px;
    margin-bottom: 12px;
  }

  .metric-card {
    min-height: 76px;
    padding: 8px 9px;
  }

  .metric-card > span,
  .metric-card > em {
    font-size: 9px;
    line-height: 1.25;
  }

  .metric-card strong {
    font-size: var(--metric-value-font-size, 17px);
    margin: 4px 0 3px;
  }

  #flow-collection .flow-collection-metrics {
    gap: 5px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 0;
  }

  #flow-collection .flow-collection-metrics .metric-card {
    min-height: 54px;
    padding: 6px 4px;
  }

  #flow-collection .flow-collection-metrics .metric-card > span {
    font-size: 10px;
    line-height: 1.2;
    overflow: hidden;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #flow-collection .flow-collection-metrics .metric-card strong {
    font-size: 18px;
    margin: 3px 0 0;
    text-align: center;
  }

  #flow-collection .module-view-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #flow-collection .flow-collection-panel {
    display: grid;
    gap: 9px;
    padding: 10px;
  }

  #flow-collection .flow-collection-panel > .panel-header {
    align-items: center;
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  #flow-collection .flow-collection-panel > .panel-header h2 {
    font-size: 15px;
  }

  #flow-collection .flow-collection-panel > .panel-header p {
    font-size: 9px;
    line-height: 1.35;
    margin-top: 2px;
  }

  #flow-collection #flowCollectionExportBtn {
    min-height: 32px;
    padding-inline: 9px;
  }

  #flow-collection .flow-collection-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    background: rgba(239, 247, 252, 0.78);
    border: 1px solid rgba(190, 215, 231, 0.82);
    border-radius: 11px;
    gap: 6px;
    margin: 0;
    padding: 8px;
  }

  #flow-collection .flow-collection-toolbar label {
    gap: 3px;
    grid-template-rows: auto 36px;
  }

  #flow-collection .flow-collection-toolbar :is(input, select, .portal-control-shell, .precision-date-picker, :where(.precision-date-trigger)),
  #flow-collection .flow-collection-toolbar > button {
    height: 36px;
    min-height: 36px;
  }

  #flow-collection .flow-collection-toolbar > button {
    align-self: end;
    padding-inline: 6px;
  }

  #flow-collection .approval-table-wrap {
    margin: 0;
  }

  #flow-collection .table-pagination {
    margin-top: 0;
  }

  .panel {
    padding: 12px 10px;
  }

  .history-filter-summary,
  .inventory-summary {
    gap: 6px 10px;
    padding: 9px 10px;
  }

  .history-filter-summary span,
  .inventory-summary span {
    font-size: 11px;
  }

  .history-filter-summary:not(.hospital-development-summary) {
    align-items: stretch;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
    min-width: 0;
    width: 100%;
  }

  .history-filter-summary:not(.hospital-development-summary):has(> span:nth-child(3):last-child) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .history-filter-summary:not(.hospital-development-summary):has(> span:nth-child(4):last-child) {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .history-filter-summary:not(.hospital-development-summary) > span {
    min-width: 0;
    text-align: center;
  }

  .history-filter-summary:not(.hospital-development-summary) > span > strong {
    display: block;
    font-size: 12px;
    margin: 2px 0 0;
    overflow-wrap: anywhere;
  }

  .approval-progress {
    align-items: center;
    flex-direction: row;
    gap: 6px;
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
  }

  .approval-progress-step {
    flex: 0 0 150px;
    min-width: 150px;
    width: auto;
  }

  .approval-progress-arrow {
    flex: 0 0 22px;
    transform: none;
    width: 22px;
  }

  :is(#appShell, .portal-control-surface) .combobox-option {
    font-size: 10px;
    line-height: 1.3;
    min-height: 32px;
    padding: 5px 7px;
  }

  :is(#appShell, .portal-control-surface) .multi-filter-option {
    gap: 6px;
  }

  :is(#appShell, .portal-control-surface) .multi-filter-option > input[type="checkbox"] {
    flex: 0 0 14px;
    height: 14px;
    min-height: 14px;
    padding: 0;
    width: 14px;
  }

  :is(#appShell, .portal-control-surface) .multi-filter-option > span {
    display: block;
    flex: 1 1 auto;
    font-size: 10px;
    line-height: 1.3;
    min-width: 0;
  }

  .topbar-meta {
    max-width: 100%;
    min-width: 0;
    width: 100%;
  }

  .pending-summary {
    max-width: calc(100vw - 46px);
  }

  .main-content h1 {
    font-size: 20px;
    line-height: 1.15;
  }

  :is(.main-content, .detail-modal, .login-modal) h2 {
    font-size: 15px;
    line-height: 1.25;
  }

  :is(.main-content, .detail-modal, .login-modal) h3 {
    font-size: 13px;
    line-height: 1.3;
  }

  :is(.main-content, .detail-modal, .login-modal) :is(p, small) {
    font-size: 11px;
    line-height: 1.4;
  }

  :is(.history-title-block, .panel-header, .system-group-heading, .system-config-panel-heading) p {
    margin-bottom: 6px;
    margin-top: 3px;
  }

  .account-box .pending-chip,
  .data-refresh-button,
  .data-freshness {
    font-size: 10px;
  }

  :is(input, select, textarea, .portal-control-shell, :where(.precision-date-trigger)) {
    font-size: 11px;
    min-height: 36px;
    padding-inline: 7px;
  }

  textarea {
    padding-block: 7px;
  }

  button:not(.dialog-close-button):not(.approval-workflow-icon-button):not(.approval-workflow-plus) {
    font-size: 11px;
    min-height: 36px;
    padding-inline: 10px;
  }

  :is(label > span, .form-field > span, .document-filter-field > span, .filter-label) {
    font-size: 10px;
    line-height: 1.25;
  }

  :is(.form-grid, .line-fields, .hospital-application-fields, .flow-entry-fields) {
    gap: 8px 6px;
  }

  .form-section {
    margin-top: 12px;
    padding-top: 12px;
  }

  .form-section h3 {
    margin-bottom: 8px;
  }

  .account-profile-layout {
    gap: 10px;
  }

  .account-profile-panel .panel-header {
    align-items: flex-start;
    flex-direction: row;
    flex-wrap: nowrap;
  }

  .account-profile-panel .panel-header > div {
    flex: 1;
    min-width: 0;
  }

  .account-profile-summary,
  .account-profile-form-grid,
  .account-profile-actions {
    margin-top: 10px;
  }

  .account-profile-readonly-grid {
    gap: 6px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .account-profile-readonly-grid > div {
    background: rgba(247, 251, 255, 0.72);
    border: 1px solid rgba(203, 221, 233, 0.72);
    border-radius: 10px;
    gap: 3px;
    min-width: 0;
    padding: 7px 8px;
  }

  .account-profile-readonly-grid > div:has(.account-profile-tags) {
    grid-column: 1 / -1;
  }

  .account-profile-readonly-grid dt {
    font-size: 9px;
  }

  .account-profile-readonly-grid dd,
  .account-profile-tags > span {
    font-size: 11px;
  }

  .account-profile-tags {
    gap: 4px;
  }

  .account-profile-tags > span {
    padding: 2px 6px;
  }

  .account-profile-form-grid {
    gap: 8px 6px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #accountPasswordForm .account-profile-form-grid > label:first-child {
    grid-column: 1 / -1;
  }

  .account-profile-actions {
    align-items: center;
    display: grid;
    gap: 6px;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .history-filters,
  .history-filters.without-customer-filter,
  .document-filters,
  #hospital-development .hospital-development-filters,
  .flow-collection-toolbar {
    gap: 8px 6px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  :is(.history-filters, .document-filters, #hospital-development .hospital-development-filters, .flow-collection-toolbar) > * {
    min-width: 0;
  }

  :is(.history-filters, .document-filters, #hospital-development .hospital-development-filters, .flow-collection-toolbar) :is(label, .document-filter-field) > span {
    font-size: 10px;
    line-height: 1.25;
  }

  :is(.history-filters, .document-filters, #hospital-development .hospital-development-filters, .flow-collection-toolbar) :is(input, select, .portal-control-shell, :where(.precision-date-trigger)) {
    font-size: 11px;
    min-height: 36px;
    min-width: 0;
    padding-inline: 8px;
    width: 100%;
  }

  .history-date-filter {
    grid-column: 1 / -1;
  }

  .filter-reset-action,
  .document-filter-actions,
  #hospital-development .document-filter-actions,
  .flow-collection-toolbar label:last-of-type {
    grid-column: auto;
  }

  #hospital-development .hospital-development-search-field {
    grid-column: span 2;
  }

  #hospital-development .hospital-development-year-control {
    grid-column: auto;
    width: auto;
  }

  :is(.filter-reset-action, .document-filter-actions) > button,
  .flow-collection-toolbar > button {
    min-height: 36px;
    width: 100%;
  }

  .document-tabs,
  .approval-business-tabs:not(.module-view-tabs),
  .approval-view-tabs {
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }

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

  #document-approval .approval-business-tabs:not(.module-view-tabs) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  :is(.document-tabs, .approval-business-tabs:not(.module-view-tabs), .approval-view-tabs) > button {
    justify-content: center;
    min-width: 0;
    padding-inline: 7px;
    white-space: normal;
  }

  #document-approval .approval-business-tabs:not(.module-view-tabs) > button {
    white-space: normal;
  }

  .hospital-development-overview {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    overflow: visible;
  }

  .hospital-development-overview article {
    min-height: 62px;
    min-width: 0;
    padding: 6px 4px;
  }

  .dealer-management-panel {
    max-height: none;
    min-height: 0;
    overflow: visible;
  }

  .dealer-management-toolbar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dealer-management-toolbar > label {
    display: none;
  }

  .dealer-management-toolbar > span {
    grid-column: 1 / -1;
  }

  .dealer-management-toolbar > .portal-control-shell:has(input) {
    grid-column: span 2;
  }

  #dealerAccountsBody .status-chip {
    place-self: start;
  }

  .dealer-account-editor-dialog .system-log-dialog-header {
    flex-wrap: nowrap;
  }

  .dealer-account-editor-dialog .system-log-dialog-header > div {
    flex: 1;
  }

  #new-order :is(.form-grid, .line-fields) {
    gap: 8px 6px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #new-order .line-item {
    grid-template-columns: 30px minmax(0, 1fr) auto;
  }

  #new-order .line-fields {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  #new-order .line-item > .remove-line-button {
    align-self: center;
    grid-column: 3;
    grid-row: 1;
  }

  #new-order .order-info-grid > .precision-date-field,
  #new-order .order-info-grid > label:has([name="phone"]),
  #new-order .order-info-grid > label:has([name="invoiceEmail"]),
  #new-order .line-fields > label:has([data-field="name"]),
  #new-order .line-fields > label:has([data-field="department"]) {
    grid-column: span 2;
  }

  #new-order .order-info-grid > label:has([name="buyerCompany"]),
  #new-order .order-info-grid > label:has([name="address"]),
  #new-order .line-fields > label:has([data-field="remark"]) {
    grid-column: 1 / -1;
  }

  #new-order .line-item {
    gap: 7px 6px;
    padding: 8px;
  }

  #new-order .line-item .line-no {
    font-size: 11px;
    min-height: 30px;
  }

  #new-order .line-item > .remove-line-button {
    font-size: 11px;
    min-height: 32px;
  }

  #refreshPortalDataBtn,
  .pending-summary button,
  .panel-header .link-button,
  .date-presets button {
    height: auto;
    min-height: 36px;
  }

  :root {
    --control-actions-space: 56px;
    --control-arrow-space: 30px;
    --control-clear-width: 24px;
    --control-arrow-width: 24px;
  }

  .portal-dropdown-toggle {
    height: 36px;
    min-height: 36px;
    min-width: 36px;
    right: 3px;
    width: 36px;
  }

  .portal-clear-button {
    height: 30px;
    min-height: 30px;
    width: 30px;
  }

  .combobox-clear-button,
  .precision-date-clear-button {
    right: 28px;
  }

  .precision-date-clear-button,
  #hospital-development :is(
    .hospital-development-detail-toggle,
    .hospital-development-project-year-button,
    .hospital-development-history-button,
    .hospital-development-edit-button,
    .hospital-development-delete-button
  ) {
    min-height: 36px;
  }

  #hospital-development .hospital-development-detail-toggle {
    height: 36px;
    width: 36px;
  }

  :is(.table-wrap, .dingtalk-people-table-wrap):has(> table > tbody.mobile-card-rows) {
    border: 0;
    max-height: none;
    min-height: 0;
    overflow: visible;
    scrollbar-gutter: auto;
  }

  :is(.table-wrap, .dingtalk-people-table-wrap):has(> table > tbody.mobile-card-rows)::before {
    display: none;
  }

  table:has(> tbody.mobile-card-rows) {
    display: block;
    min-width: 0;
    table-layout: auto;
    width: 100%;
  }

  #dashboard table:has(> tbody.mobile-card-rows) {
    min-width: 0;
  }

  table:has(> tbody.mobile-card-rows) > thead {
    display: none;
  }

  tbody.mobile-card-rows {
    display: grid;
    gap: 10px;
  }

  tbody.mobile-card-rows > tr {
    background: #fff;
    border: 1px solid rgba(153, 190, 216, 0.74);
    border-radius: 14px;
    box-shadow: 0 5px 14px rgba(55, 91, 119, 0.08);
    display: grid;
    gap: 0 9px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: hidden;
    padding: 3px 9px 7px;
  }

  tbody.mobile-card-rows > tr > td {
    --mobile-label: "";
    background: transparent !important;
    border: 0;
    border-bottom: 1px solid rgba(203, 221, 233, 0.72);
    box-shadow: none !important;
    display: grid;
    font-size: 11px;
    gap: 3px;
    min-width: 0;
    overflow-wrap: anywhere;
    padding: 6px 0;
    position: static !important;
    text-align: left;
    transform: none !important;
    white-space: normal;
    width: auto;
  }

  tbody.mobile-card-rows > tr > td::before {
    color: #6a8293;
    content: var(--mobile-label);
    font-size: 9px;
    font-weight: 700;
    line-height: 1.25;
  }

  tbody.mobile-card-rows > tr > td:first-child,
  tbody:is(#orderRows, #submittedOrderHistoryRows, #flowApprovalRows, #flowHistoryRows, #dealerAccountsBody) > tr > td:last-child {
    grid-column: 1 / -1;
  }

  tbody.mobile-card-rows > tr > td:last-child {
    border-bottom: 0;
  }

  tbody.mobile-card-rows > tr > td.empty-state {
    border: 0;
    display: block;
    grid-column: 1 / -1;
    padding: 22px 8px;
    text-align: center;
  }

  tbody.mobile-card-rows > tr > td.empty-state::before {
    display: none;
  }

  tbody:is(#orderRows, #submittedOrderHistoryRows, #flowApprovalRows, #flowHistoryRows, #dealerAccountsBody) > tr > td:last-child button,
  #flowCollectionRows .flow-collection-document-actions button {
    min-height: 32px;
    width: 100%;
  }

  #flowCollectionRows .flow-collection-document-actions {
    align-items: stretch;
    display: grid;
    gap: 4px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-width: 0;
    width: 100%;
  }

  #flowCollectionRows > tr > td:last-child {
    grid-column: 1 / -1;
  }

  #dealerAccountsBody .system-log-dialog-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  #recentOrderRows td:nth-child(1) { --mobile-label: "单据号"; }
  #recentOrderRows td:nth-child(2) { --mobile-label: "发货日期"; }
  #recentOrderRows td:nth-child(3) { --mobile-label: "金额"; }

  #orderRows td:nth-child(1) { --mobile-label: "单据号"; }
  #orderRows td:nth-child(2) { --mobile-label: "发货日期"; }
  #orderRows td:nth-child(3) { --mobile-label: "客户名称"; }
  #orderRows td:nth-child(4) { --mobile-label: "产品摘要"; }
  #orderRows td:nth-child(5) { --mobile-label: "金额"; }
  #orderRows td:nth-child(6) { --mobile-label: "操作"; }

  #submittedOrderHistoryRows td:nth-child(1) { --mobile-label: "单据号"; }
  #submittedOrderHistoryRows td:nth-child(2) { --mobile-label: "订货日期"; }
  #submittedOrderHistoryRows td:nth-child(3) { --mobile-label: "订货公司"; }
  #submittedOrderHistoryRows td:nth-child(4) { --mobile-label: "产品摘要"; }
  #submittedOrderHistoryRows td:nth-child(5) { --mobile-label: "金额"; }
  #submittedOrderHistoryRows td:nth-child(6) { --mobile-label: "审批状态"; }
  #submittedOrderHistoryRows td:nth-child(7) { --mobile-label: "操作"; }

  #inventoryOrderRows td:nth-child(1),
  #inventoryOutboundRows td:nth-child(3),
  #inventoryStockRows td:nth-child(1) { --mobile-label: "经销商"; }
  #inventoryOrderRows td:nth-child(2),
  #inventoryOutboundRows td:nth-child(7),
  #inventoryStockRows td:nth-child(2) { --mobile-label: "生产企业"; }
  #inventoryOrderRows td:nth-child(3),
  #inventoryOutboundRows td:nth-child(8),
  #inventoryStockRows td:nth-child(3) { --mobile-label: "物料编码"; }
  #inventoryOrderRows td:nth-child(4),
  #inventoryOutboundRows td:nth-child(9),
  #inventoryStockRows td:nth-child(4) { --mobile-label: "产品名称"; }
  #inventoryOrderRows td:nth-child(5),
  #inventoryOutboundRows td:nth-child(10),
  #inventoryStockRows td:nth-child(5) { --mobile-label: "型号"; }
  #inventoryOrderRows td:nth-child(6),
  #inventoryOutboundRows td:nth-child(11),
  #inventoryStockRows td:nth-child(6) { --mobile-label: "规格"; }
  #inventoryOrderRows td:nth-child(7) { --mobile-label: "销售经理"; }
  #inventoryOrderRows td:nth-child(8) { --mobile-label: "数量合计"; }
  #inventoryOutboundRows td:nth-child(1) { --mobile-label: "出库日期"; }
  #inventoryOutboundRows td:nth-child(2) { --mobile-label: "填报月份"; }
  #inventoryOutboundRows td:nth-child(4) { --mobile-label: "二级商/配送商"; }
  #inventoryOutboundRows td:nth-child(5) { --mobile-label: "终端医院"; }
  #inventoryOutboundRows td:nth-child(6) { --mobile-label: "销售类型"; }
  #inventoryOutboundRows td:nth-child(12) { --mobile-label: "业务经理"; }
  #inventoryOutboundRows td:nth-child(13) { --mobile-label: "出库数量"; }
  #inventoryStockRows td:nth-child(7) { --mobile-label: "销售经理"; }
  #inventoryStockRows td:nth-child(8) { --mobile-label: "订货数量"; }
  #inventoryStockRows td:nth-child(9) { --mobile-label: "出库数量"; }
  #inventoryStockRows td:nth-child(10) { --mobile-label: "现有库存"; }

  #flowStockRows td:nth-child(1) { --mobile-label: "生产企业"; }
  #flowStockRows td:nth-child(2) { --mobile-label: "物料编码"; }
  #flowStockRows td:nth-child(3) { --mobile-label: "产品名称"; }
  #flowStockRows td:nth-child(4) { --mobile-label: "型号"; }
  #flowStockRows td:nth-child(5) { --mobile-label: "规格"; }
  #flowStockRows td:nth-child(6) { --mobile-label: "业务经理"; }
  #flowStockRows td:nth-child(7) { --mobile-label: "月初结转"; }
  #flowStockRows td:nth-child(8) { --mobile-label: "本月进货净额"; }
  #flowStockRows td:nth-child(9) { --mobile-label: "本月有效出库"; }
  #flowStockRows td:nth-child(10) { --mobile-label: "预计月末库存"; }

  #flowCollectionRows td:nth-child(1) { --mobile-label: "经销商"; }
  #flowCollectionRows td:nth-child(2) { --mobile-label: "负责销售"; }
  #flowCollectionRows td:nth-child(3) { --mobile-label: "月末库存"; }
  #flowCollectionRows td:nth-child(4) { --mobile-label: "提交要求"; }
  #flowCollectionRows td:nth-child(5) { --mobile-label: "提交状态"; }
  #flowCollectionRows td:nth-child(6) { --mobile-label: "最近提交"; }
  #flowCollectionRows td:nth-child(7) { --mobile-label: "账号/异常"; }
  #flowCollectionRows td:nth-child(8) { --mobile-label: "操作"; }

  #flowHistoryRows td:nth-child(1) { --mobile-label: "单据号"; }
  #flowHistoryRows td:nth-child(2) { --mobile-label: "经销商"; }
  #flowHistoryRows td:nth-child(3) { --mobile-label: "业务经理"; }
  #flowHistoryRows td:nth-child(4) { --mobile-label: "填表人"; }
  #flowHistoryRows td:nth-child(5) { --mobile-label: "联系电话"; }
  #flowHistoryRows td:nth-child(6) { --mobile-label: "记录数"; }
  #flowHistoryRows td:nth-child(7) { --mobile-label: "数量合计"; }
  #flowHistoryRows td:nth-child(8) { --mobile-label: "状态"; }
  #flowHistoryRows td:nth-child(9) { --mobile-label: "提交时间"; }
  #flowHistoryRows td:nth-child(10) { --mobile-label: "操作"; }

  #flowApprovalRows td::before {
    content: attr(data-label);
  }

  #dealerAccountsBody td:nth-child(1) { --mobile-label: "账号"; }
  #dealerAccountsBody td:nth-child(2) { --mobile-label: "资质状态"; }
  #dealerAccountsBody td:nth-child(3) { --mobile-label: "收货人 / 手机"; }
  #dealerAccountsBody td:nth-child(4) { --mobile-label: "收货地址"; }
  #dealerAccountsBody td:nth-child(5) { --mobile-label: "发票类型"; }
  #dealerAccountsBody td:nth-child(6) { --mobile-label: "发票接收邮箱"; }
  #dealerAccountsBody td:nth-child(7) { --mobile-label: "网站登录"; }
  #dealerAccountsBody td:nth-child(8) { --mobile-label: "操作"; }

  .login-modal,
  .detail-modal {
    height: 100dvh;
    max-height: 100dvh;
    overscroll-behavior-y: contain;
  }

  .login-modal {
    overflow-x: hidden;
    overflow-y: auto;
  }

  .detail-modal {
    overflow: hidden;
  }

  .detail-dialog,
  .modal-card,
  .order-detail-card,
  .approval-detail-dialog {
    -webkit-overflow-scrolling: touch;
    max-height: 100dvh;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
  }

  :is(.system-config-dialog, .fixed-options-dialog, .dingtalk-people-dialog, .management-person-detail-dialog, .user-information-accounts-dialog, .system-log-dialog) {
    height: auto;
    max-height: 100dvh;
    min-height: 0;
  }

  :is(.system-config-modal-body, .fixed-options-editor, .dingtalk-people-table-wrap, .system-log-table-wrap) {
    -webkit-overflow-scrolling: touch;
    min-height: 0;
    overscroll-behavior-y: contain;
  }

  .portal-action-dialog {
    -webkit-overflow-scrolling: touch;
    max-height: calc(100dvh - 24px);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
  }

  .portal-action-content {
    max-height: none;
  }
}

@media (min-width: 600px) and (max-width: 760px) {
  .history-filters,
  .history-filters.without-customer-filter,
  .document-filters,
  #hospital-development .hospital-development-filters,
  .flow-collection-toolbar {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  #new-order :is(.form-grid, .line-fields) {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  #flow-collection .flow-collection-toolbar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 359px) {
  .history-filters,
  .history-filters.without-customer-filter,
  .document-filters,
  #hospital-development .hospital-development-filters,
  .flow-collection-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #new-order :is(.form-grid, .line-fields) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hospital-development-editor-card .hospital-development-editor-grid,
  .hospital-development-editor-card[data-editor-section="ownership"] .hospital-development-editor-grid,
  .hospital-development-month-editor {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .account-profile-form-grid > * {
    grid-column: auto;
  }

  .account-profile-form-grid > .wide-field {
    grid-column: 1 / -1;
  }
}

/* 点击反馈只改变颜色、边框或阴影，不改变按钮尺寸和位置。 */
button:active:not(:disabled) {
  transform: none !important;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
.authorization-hospital-editor {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}
.authorization-hospital-editor-toolbar,
.authorization-hospital-row-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.authorization-hospital-editor-toolbar p,
.authorization-hospital-summary { margin: 0; color: var(--muted); }
.authorization-hospital-rows { display: grid; gap: 12px; }
.authorization-hospital-row {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(247, 251, 255, .72);
}
.authorization-hospital-row-heading .compact-button {
  min-height: 34px;
  min-width: 64px;
  padding: 6px 12px;
  font-size: 13px;
}
.authorization-hospital-row-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}
@media (max-width: 760px) {
  .authorization-hospital-row-grid { grid-template-columns: 1fr; }
  .authorization-hospital-editor-toolbar { align-items: flex-start; }
}

@media (max-width: 980px) {
  .detail-dialog.dingtalk-oa-field-mapping-dialog {
    width: min(960px, 100%);
  }

  .dingtalk-oa-mapping-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dingtalk-oa-mapping-sequence {
    grid-area: 1 / 1;
    text-align: left;
  }

  .dingtalk-oa-mapping-actions {
    flex-wrap: nowrap;
    grid-area: 1 / 2;
    justify-content: flex-end;
  }

  .dingtalk-oa-mapping-source {
    grid-area: 2 / 1;
  }

  .dingtalk-oa-mapping-target {
    grid-area: 2 / 2;
  }


  .flow-batch-common-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .flow-batch-product-toolbar {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 1fr);
  }

  .flow-batch-toolbar-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .flow-batch-workspace {
    grid-template-columns: minmax(300px, 0.45fr) minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .flow-ledger-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .flow-ledger-actions button {
    width: 100%;
  }

  .flow-batch-entry-modal {
    padding: 10px;
  }

  .flow-batch-entry-dialog {
    max-height: calc(100vh - 20px);
    width: calc(100vw - 20px);
  }

  .flow-batch-entry-dialog > form {
    min-height: calc(100vh - 22px);
  }

  .flow-batch-entry-header,
  .flow-batch-common-fields,
  .flow-batch-product-toolbar,
  .flow-batch-entry-footer {
    padding-inline: 14px;
  }

  .flow-batch-entry-header {
    padding-right: 72px;
  }

  .flow-batch-entry-header .dialog-close-button {
    right: 14px;
  }

  .flow-batch-common-fields,
  .flow-batch-product-toolbar {
    grid-template-columns: minmax(0, 1fr);
  }

  .flow-batch-workspace {
    display: block;
    overflow-y: auto;
  }

  .flow-batch-hospital-panel {
    border-bottom: 1px solid var(--line);
    border-right: 0;
    padding: 14px;
  }

  .flow-batch-hospital-groups {
    max-height: 46vh;
  }

  .flow-batch-hospital-group > header {
    grid-template-columns: minmax(80px, 1fr) minmax(110px, 124px) 52px;
  }

  .flow-batch-remove-group {
    min-width: 52px;
    width: 52px;
  }

  .flow-batch-toolbar-actions {
    grid-column: 1;
  }

  .flow-batch-table-wrap {
    margin-inline: 14px;
    max-height: none;
  }

  .flow-batch-table {
    min-width: 0;
  }

  .flow-batch-table thead {
    display: none;
  }

  .flow-batch-table tbody.mobile-card-rows > tr > td {
    grid-template-columns: minmax(0, 1fr);
  }

  .flow-batch-table tbody.mobile-card-rows > tr > td:nth-child(2) {
    grid-column: 1 / -1;
  }

  .flow-batch-table tbody.mobile-card-rows > tr > td::before {
    content: attr(data-label);
  }

  .flow-batch-table :is(.flow-batch-select-cell, .flow-batch-quantity-cell, .flow-batch-price-cell) {
    box-shadow: none;
    position: static;
  }

  .flow-batch-entry-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .flow-batch-entry-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .flow-batch-entry-actions button {
    width: 100%;
  }
}

/* Filing remains in page flow so it never covers business controls. */
.site-filing {
  margin-top: 24px;
  padding: 8px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}
.site-filing a {
  color: inherit;
  text-decoration: none;
}
.site-filing a:hover,
.site-filing a:focus-visible {
  text-decoration: underline;
}
.login-layout > .site-filing {
  grid-column: 1 / -1;
  margin-top: 0;
}
