:root {
  --bg: #eef5ff;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-strong: #ffffff;
  --line: rgba(30, 64, 175, 0.12);
  --ink: #10233f;
  --muted: #64748b;
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --accent-soft: rgba(37, 99, 235, 0.12);
  --accent-faint: rgba(37, 99, 235, 0.08);
  --surface: #f8fbff;
  --neutral-soft: rgba(15, 23, 42, 0.07);
  --danger: #c44d4d;
  --danger-soft: rgba(196, 77, 77, 0.12);
  --shadow: 0 20px 45px rgba(15, 36, 72, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.14), transparent 28%),
    linear-gradient(180deg, #f8fbff 0%, #edf4ff 100%);
}

a {
  color: var(--accent);
}

.hidden {
  display: none !important;
}

.login-page,
.mobile-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.mobile-review-page {
  display: block;
  min-height: 100dvh;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.login-card,
.mobile-card {
  width: min(960px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.login-card {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
}

.mobile-review-shell {
  width: min(100%, 720px);
  min-height: 100dvh;
  margin: 0 auto;
  padding-bottom: 24px;
}

.desktop-review-shell {
  width: 100%;
  max-width: none;
}

.desktop-review-view {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
}

.desktop-review-view .desktop-review-shell {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  padding-bottom: 0;
}

.mobile-review-toolbar {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 18px 16px 14px;
  background:
    linear-gradient(180deg, rgba(238, 245, 255, 0.98) 0%, rgba(238, 245, 255, 0.95) 100%);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.mobile-review-toolbar h1 {
  margin: 0 0 14px;
  font-size: 28px;
}

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

.mobile-review-search input {
  min-width: 0;
}

.mobile-review-list {
  margin: 0;
  padding: 16px;
}

.desktop-review-toolbar {
  position: static;
  flex: 0 0 auto;
  padding-left: 0;
  padding-right: 0;
}

.desktop-review-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding-left: 0;
  padding-right: 0;
}

.desktop-review-pagination {
  flex: 0 0 auto;
  margin: 0;
  padding: 10px 0 0;
}

.login-cover {
  background: linear-gradient(160deg, var(--accent), #173b8f);
  color: #fff;
  padding: 40px;
}

.login-form-wrap {
  padding: 40px;
}

.login-kicker,
.panel-kicker,
.drawer-kicker {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 12px;
  color: var(--muted);
}

.login-cover .login-kicker {
  color: rgba(255, 255, 255, 0.72);
}

.login-title,
.hero-title {
  margin: 8px 0 12px;
  font-size: 36px;
  line-height: 1.06;
}

.hero-copy,
.login-copy {
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.7;
}

.app-shell {
  min-height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-columns: 210px 1fr;
}

.sidebar {
  padding: 18px;
  border-right: 1px solid var(--line);
  background: rgba(15, 31, 61, 0.97);
  color: #eff6ff;
}

.brand-block {
  margin-bottom: 18px;
}

.brand-title {
  font-size: 24px;
  font-weight: 700;
}

.menu-group-title {
  color: rgba(239, 246, 255, 0.64);
  margin: 26px 0 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.muted {
  color: var(--muted);
}

.menu-button,
.tab-button,
.ghost-btn,
.primary-btn,
.danger-btn {
  border: 0;
  cursor: pointer;
  font: inherit;
}

.menu-button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: transparent;
  color: #eff6ff;
  padding: 10px 12px;
  border-radius: 0;
  margin-bottom: 0;
  border-bottom: 1px solid rgba(239, 246, 255, 0.1);
}

.menu-button:hover {
  background: rgba(255, 255, 255, 0.07);
}

.menu-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  color: rgba(219, 234, 254, 0.92);
}

.menu-icon svg {
  display: block;
  width: 16px;
  height: 16px;
}

.menu-button-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar > .menu-button:last-of-type,
.sidebar-foot .menu-button:last-child {
  border-bottom: 0;
}

.sidebar-foot {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  gap: 8px;
}

.sidebar-user {
  padding: 0 12px;
  color: rgba(239, 246, 255, 0.8);
  line-height: 1.5;
}

.menu-status {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(239, 246, 255, 0.1);
  border-radius: 0;
}

.menu-status.is-online {
  background: rgba(34, 197, 94, 0.12);
  color: #dcfce7;
}

.menu-status.is-offline {
  background: rgba(239, 68, 68, 0.12);
  color: #fee2e2;
}

.menu-status.is-checking {
  background: rgba(37, 99, 235, 0.16);
  color: #dbeafe;
}

.helper-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #93c5fd;
  box-shadow: 0 0 0 3px rgba(147, 197, 253, 0.14);
}

.menu-status.is-online .helper-status-dot {
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

.menu-status.is-offline .helper-status-dot {
  background: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18);
}

.helper-status-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.helper-status-main,
.helper-status-sub {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.helper-status-main {
  font-weight: 700;
  line-height: 1.25;
}

.helper-status-sub {
  color: rgba(239, 246, 255, 0.72);
  font-size: 12px;
  line-height: 1.25;
}

.sidebar-printer {
  display: grid;
  gap: 6px;
  padding: 10px 0 12px;
  border-bottom: 1px solid rgba(239, 246, 255, 0.1);
}

.sidebar-printer-label,
.sidebar-org-label {
  color: rgba(239, 246, 255, 0.72);
  font-size: 12px;
}

.sidebar-org {
  display: grid;
  gap: 6px;
  padding: 10px 0 12px;
  border-bottom: 1px solid rgba(239, 246, 255, 0.1);
}

.sidebar-printer-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 6px;
  align-items: center;
}

.sidebar-printer-select,
.sidebar-org-select {
  min-height: 34px;
  border-color: rgba(239, 246, 255, 0.16);
  background-color: rgba(255, 255, 255, 0.08);
  color: #eff6ff;
  font-size: 12px;
  padding: 7px 28px 7px 9px;
}

.sidebar-printer-select option,
.sidebar-org-select option {
  color: var(--ink);
}

.sidebar-printer-refresh {
  width: 34px;
  height: 34px;
  border: 0;
  background: rgba(255, 255, 255, 0.08);
  color: #dbeafe;
  cursor: pointer;
}

.sidebar-printer-refresh:hover {
  background: rgba(255, 255, 255, 0.14);
}

.ghost-btn,
.primary-btn,
.danger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 12px;
  transition: transform 0.16s ease, background 0.16s ease;
}

.button-icon {
  width: 15px;
  height: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.button-icon svg {
  width: 15px;
  height: 15px;
  display: block;
}

.button-text {
  white-space: nowrap;
}

.ghost-btn {
  background: var(--accent-faint);
  color: var(--ink);
}

.primary-btn {
  background: var(--accent);
  color: #fff;
}

.danger-btn {
  background: var(--danger-soft);
  color: var(--danger);
}

.ghost-btn:hover,
.primary-btn:hover,
.danger-btn:hover {
  transform: translateY(-1px);
}

.main-pane {
  padding: 8px 10px 10px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.badge {
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--neutral-soft);
}

.badge-button {
  border: 0;
  cursor: pointer;
  font: inherit;
}

.badge-button:hover {
  background: rgba(15, 23, 42, 0.12);
}

.badge.is-online {
  background: var(--accent-soft);
  color: var(--accent);
}

.tabs-strip {
  display: flex;
  gap: 4px;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  margin-bottom: 4px;
  min-height: 31px;
  padding: 0 0 1px;
  border-bottom: 1px solid var(--line);
  scrollbar-width: thin;
}

.tab-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  position: relative;
  background: rgba(239, 246, 255, 0.78);
  color: var(--muted);
  padding: 0 4px 0 9px;
  border: 1px solid rgba(30, 64, 175, 0.12);
  border-bottom-color: transparent;
  border-radius: 6px 6px 0 0;
  flex: 0 0 auto;
  min-height: 29px;
  box-shadow: inset 0 -1px 0 rgba(30, 64, 175, 0.08);
}

.tab-button.active {
  background: var(--panel-strong);
  color: var(--ink);
  border-color: rgba(37, 99, 235, 0.34);
  border-bottom-color: var(--panel-strong);
  box-shadow: 0 5px 12px rgba(15, 36, 72, 0.08);
}

.tab-button::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  border-radius: 6px 6px 0 0;
  background: transparent;
}

.tab-button.active::before {
  background: var(--accent);
}

.tab-button-main,
.tab-close {
  border: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
  color: inherit;
}

.tab-button-main {
  padding: 4px 0 3px;
  line-height: 1.2;
  font-size: 13px;
  font-weight: 700;
}

.tab-close {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  line-height: 1;
  color: var(--muted);
}

.tab-close:hover {
  background: rgba(37, 99, 235, 0.1);
  color: var(--accent);
}

.tab-panel {
  display: none;
  min-height: 0;
}

.tab-panel.active {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
}

#tab-content {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  overflow: hidden;
}

.tab-view {
  width: 100%;
  min-height: 0;
}

.addresses-view {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  min-height: 0;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 0;
  box-shadow: var(--shadow);
  padding: 14px;
  margin-bottom: 8px;
}

.panel-title-row,
.table-toolbar,
.drawer-actions,
.toolbar-inline,
.two-column {
  display: flex;
  gap: 12px;
}

.panel-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.panel-title-row,
.table-toolbar {
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.table-toolbar-wrap {
  flex-wrap: wrap;
  align-items: center;
}

.table-toolbar-meta {
  display: grid;
  gap: 6px;
}

.table-toolbar-actions {
  display: flex;
  flex: 1 1 440px;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.toolbar-select-wrap {
  flex: 0 1 360px;
  min-width: min(280px, 100%);
  max-width: 360px;
}

.toolbar-select {
  position: relative;
  min-width: 0;
}

.toolbar-select-trigger {
  min-height: 44px;
  width: 100%;
}

.workbench-filter-panel {
  padding: 10px 12px;
}

.workbench-filter-panel .panel-title-row {
  margin-bottom: 10px;
}

.workbench-filter-panel .panel-kicker {
  font-size: 11px;
}

.workbench-filter-panel h2 {
  margin: 4px 0 0;
  font-size: 22px;
}

.workbench-filter-panel .panel-actions {
  gap: 8px;
}

.workbench-filter-panel .panel-actions .primary-btn {
  padding: 9px 14px;
}

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

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

.drawer-body .form-grid.form-grid-two {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.workbench-filters {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px 12px;
}

.form-grid label,
.stack label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.workbench-filters label {
  gap: 6px;
  font-size: 13px;
}

.address-filter-bar {
  display: grid;
  grid-template-columns: auto minmax(0, 2fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 0 0 8px;
}

.address-filter-bar .control-field,
.address-filter-bar .segmented-field {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.address-filter-bar .segmented-control.compact {
  width: 100%;
  min-height: 46px;
  align-items: center;
}

.address-filter-bar .segmented-field-inline {
  align-self: end;
  min-width: 180px;
}

.address-filter-bar .primary-btn {
  min-height: 46px;
  padding-inline: 22px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(30, 64, 175, 0.14);
  border-radius: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink);
}

.workbench-filters input {
  min-height: 38px;
  padding: 9px 12px;
  font-size: 13px;
}

.workbench-filters select {
  min-height: 38px;
  padding: 9px 34px 9px 12px;
  font-size: 13px;
}

select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 20px) calc(50% - 2px),
    calc(100% - 14px) calc(50% - 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 34px;
}

input[type="checkbox"] {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 1px solid rgba(30, 64, 175, 0.2);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.8);
  display: inline-grid;
  place-items: center;
  margin: 0;
}

input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: inset 0 0 0 3px #fff;
}

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

.form-block {
  margin-bottom: 18px;
}

.switch-row {
  flex-direction: row !important;
  align-items: center;
  gap: 10px !important;
}

.workbench-filters .switch-row {
  align-self: end;
  min-height: 38px;
  gap: 8px !important;
  padding-bottom: 4px;
}

.filter-switch-group {
  display: flex;
  align-items: end;
  gap: 12px;
  min-height: 38px;
  padding-bottom: 4px;
}

.filter-combo-field,
.filter-include-field,
.filter-segment-field,
.filter-action-field {
  display: grid;
  gap: 6px;
  align-content: end;
  min-width: 0;
}

.filter-include-field .filter-switch-inline {
  min-height: 38px;
}

.filter-action-field {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  min-height: 38px;
}

.filter-action-field .filter-switch-inline {
  min-height: 38px;
  flex: 0 0 auto;
}

.filter-action-field .primary-btn {
  min-height: 38px;
  padding: 9px 16px;
  white-space: nowrap;
  flex: 0 0 auto;
}

.filter-segment-field.has-inline-action {
  display: flex;
  align-items: end;
  gap: 10px;
  min-width: 0;
}

.filter-segment-field.has-inline-action .filter-segment-stack {
  flex: 0 0 auto;
}

.filter-inline-query-btn {
  min-height: 38px;
  padding: 9px 16px;
  white-space: nowrap;
  flex: 0 0 auto;
}

.workbench-view.is-order-only .filter-segment-field.is-pair {
  grid-column: 3;
  min-width: 0;
  width: 100%;
}

.workbench-view.is-order-only .filter-action-field {
  grid-column: 4 / span 2;
  flex-wrap: nowrap;
  justify-content: flex-start;
  align-self: end;
}

.workbench-view.is-order-only .filter-action-field .primary-btn {
  flex: 0 1 auto;
}

.workbench-view.is-order-only .filter-segment-field.is-pair .filter-segment-stack {
  width: 100%;
}

.workbench-view.is-order-only .filter-segment-field.is-pair .filter-segment-toggle {
  flex: 1 1 0;
  min-width: 0;
}

.workbench-view.is-order-only .filter-segment-field.is-pair .filter-segment-control {
  width: 100%;
}

.workbench-view.is-order-only .filter-segment-field.is-pair .segmented-button {
  flex: 1 1 0;
  min-width: 0;
  padding-inline: 8px;
}

.filter-select {
  position: relative;
  min-width: 0;
}

.filter-select-trigger,
.filter-printer-field .toolbar-select-trigger {
  height: 38px;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 12px;
  line-height: 1.2;
}

.filter-date-field {
  min-width: 0;
}

.date-control-label {
  position: relative;
}

.filter-date-control {
  position: relative;
  min-width: 0;
}

.date-trigger {
  width: 100%;
  min-height: 38px;
  border: 1px solid rgba(30, 64, 175, 0.14);
  border-radius: 12px;
  padding: 0 10px 0 12px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font: inherit;
  font-size: 13px;
  line-height: 1.2;
  cursor: pointer;
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease;
}

.date-trigger:hover,
.filter-date-control.is-open .date-trigger {
  border-color: rgba(37, 99, 235, 0.45);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.date-trigger-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.date-trigger-icon {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: var(--accent-faint);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.date-trigger-icon svg {
  width: 16px;
  height: 16px;
}

.date-picker {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 26;
  width: min(304px, calc(100vw - 36px));
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 34px rgba(15, 36, 72, 0.16);
}

.date-picker-head {
  display: grid;
  grid-template-columns: 32px 1fr 32px;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.date-picker-head strong {
  text-align: center;
  font-size: 14px;
  color: var(--ink);
}

.date-picker-nav {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 10px;
  background: var(--accent-faint);
  color: var(--accent);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.date-picker-nav:hover {
  background: var(--accent);
  color: #fff;
}

.date-picker-weekdays,
.date-picker-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.date-picker-weekdays {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.date-picker-weekdays span {
  padding: 4px 0;
}

.date-picker-day {
  aspect-ratio: 1;
  min-width: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
}

.date-picker-day:hover {
  background: var(--accent-faint);
  color: var(--accent);
}

.date-picker-day.is-muted {
  color: rgba(84, 103, 135, 0.5);
  font-weight: 600;
}

.date-picker-day.is-today {
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.35);
}

.date-picker-day.is-active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.25);
}

.date-picker-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 8px;
}

.date-today-btn {
  min-height: 30px;
  padding: 6px 12px;
  border-radius: 10px;
}

.filter-segment-stack {
  display: flex;
  align-items: end;
  flex-wrap: nowrap;
  gap: 6px;
}

.filter-segment-field.is-pair {
  min-width: 232px;
}

.filter-segment-field.is-single {
  min-width: 108px;
}

.filter-segment-toggle {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex: 0 0 auto;
}

.filter-segment-control {
  flex: 0 0 auto;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
}

.filter-segment-control .segmented-button {
  min-width: 44px;
  padding: 6px 10px;
  border-radius: 9px;
  font-size: 12px;
  white-space: nowrap;
}

.filter-printer-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px 38px;
  gap: 6px;
  align-items: end;
}

.filter-printer-row .toolbar-select-wrap {
  min-width: 0;
  max-width: none;
}

.filter-printer-row .select-menu,
.filter-select .select-menu {
  z-index: 24;
}

.filter-switch-inline {
  min-height: 38px;
}

.icon-btn {
  position: relative;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 12px;
  background: var(--accent-faint);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.16s ease, background 0.16s ease;
}

.icon-btn:hover {
  background: rgba(37, 99, 235, 0.14);
  transform: translateY(-1px);
}

.icon-btn-primary {
  background: var(--accent);
  color: #fff;
}

.icon-btn-primary:hover {
  background: var(--accent-strong);
}

.icon-btn svg {
  width: 17px;
  height: 17px;
}

.icon-badge {
  position: absolute;
  right: -5px;
  top: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  line-height: 18px;
  font-weight: 700;
}

.switch-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  color: var(--ink);
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

.switch-toggle.is-disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.switch-toggle .switch-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.switch-slider {
  position: relative;
  width: 42px;
  height: 24px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: rgba(30, 64, 175, 0.12);
  border: 1px solid rgba(30, 64, 175, 0.12);
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.switch-slider::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 4px 10px rgba(15, 36, 72, 0.16);
  transition: transform 0.18s ease;
}

.switch-input:checked + .switch-slider {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.18);
}

.switch-input:checked + .switch-slider::after {
  transform: translateX(18px);
}

.switch-input:focus-visible + .switch-slider {
  outline: 3px solid rgba(37, 99, 235, 0.22);
  outline-offset: 2px;
}

.switch-text {
  color: var(--muted);
}

.workbench-filters .toolbar-inline {
  align-items: end;
}

.workbench-filters .toolbar-inline .primary-btn {
  min-height: 38px;
  padding: 9px 16px;
}

.admin-permission-toolbar {
  grid-template-columns: minmax(240px, 420px);
  margin-bottom: 14px;
}

.admin-permission-toolbar input {
  min-height: 38px;
  padding: 9px 12px;
  font-size: 13px;
}

.admin-view {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

.admin-permission-panel {
  flex: 1 1 auto;
  min-height: 0;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
}

.admin-permission-panel .panel-title-row,
.admin-permission-panel .admin-permission-toolbar,
.admin-permission-panel .table-pagination {
  flex: 0 0 auto;
}

.admin-permission-table-shell {
  flex: 1 1 auto;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.admin-permission-table-shell .data-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface);
  box-shadow: inset 0 -1px 0 var(--line);
}

.field-label {
  font-size: 13px;
  color: var(--muted);
}

.segmented-wrap {
  display: grid;
  gap: 12px;
}

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

.segmented-field {
  display: grid;
  gap: 8px;
}

.segmented-control {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.segmented-control.compact {
  width: fit-content;
}

.segmented-button {
  border: 0;
  cursor: pointer;
  font: inherit;
  padding: 10px 16px;
  border-radius: 12px;
  color: var(--muted);
  background: transparent;
}

.segmented-button.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.18);
}

.segmented-button.is-disabled {
  opacity: 0.42;
  pointer-events: none;
}

.order-mode-switch {
  margin: -8px 0 12px;
}

.order-mode-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin: -8px 0 12px;
}

.order-mode-row .order-mode-switch {
  margin: 0;
}

.order-mode-row .segmented-field {
  min-width: 180px;
}

.segmented-field-inline {
  display: block;
  gap: 0;
}

.order-party-toggle .segmented-control.compact {
  min-height: 46px;
  align-items: center;
}

.picker-field,
.control-field {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
}

.picker-field {
  text-align: left;
}

.picker-field strong {
  font-size: 15px;
}

.picker-field-input {
  cursor: default;
}

.picker-field.is-static {
  cursor: default;
}

.picker-meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.static-field-value {
  min-height: 46px;
  padding: 12px 14px;
  border: 1px solid rgba(30, 64, 175, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink);
  line-height: 1.45;
}

.form-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.78);
}

.form-card .picker-field,
.form-card .control-field,
.form-card .select-field,
.form-card .segmented-field {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.form-card .picker-meta {
  display: none;
}

.form-card .segmented-control.compact,
.segmented-inline-row .segmented-control {
  width: 100%;
}

.segmented-inline-row .segmented-control {
  flex-wrap: nowrap;
}

.segmented-inline-row .segmented-button {
  flex: 1 1 0;
  text-align: center;
  white-space: nowrap;
}

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

.drawer-body .wide,
.drawer-body .is-wide {
  grid-column: 1 / -1;
}

.drawer-body .address-add-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.address-maintain-drawer {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.address-maintain-close {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 6;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 0;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.address-maintain-close:hover {
  background: rgba(196, 77, 77, 0.18);
}

.address-maintain-form {
  flex: 0 0 auto;
}

.address-maintain-form .form-card {
  display: grid;
  gap: 12px;
  margin: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
}

.address-maintain-table-shell {
  flex: 1 1 auto;
  min-height: 0;
  border: 0;
  border-radius: 0;
}

.address-maintain-table-shell .selection-table {
  border-radius: 0;
}

.address-maintain-table-shell .selection-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface);
  box-shadow: inset 0 -1px 0 var(--line);
}

.address-row-action-col {
  width: 150px;
}

.address-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.address-row-actions .ghost-btn {
  padding: 8px 10px;
}

.address-textarea-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}

.address-textarea-row textarea,
.address-textarea-row .textarea-action-wrap textarea {
  height: 128px;
  min-height: 128px;
}

.address-textarea-row .textarea-action-wrap {
  height: 128px;
}

.address-maintain-footer {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.address-maintain-footer .drawer-actions {
  order: 0;
}

.address-maintain-footer > span {
  color: var(--muted);
  font-size: 13px;
}

.address-add-grid .segmented-field {
  min-width: 0;
}

.address-add-grid .segmented-control.compact {
  width: 100%;
}

.textarea-action-wrap {
  position: relative;
}

.textarea-action-wrap textarea {
  min-height: 106px;
  padding-right: 112px;
  padding-bottom: 48px;
  resize: vertical;
}

.textarea-action-btn {
  position: absolute;
  right: 8px;
  bottom: 8px;
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  cursor: pointer;
}

.textarea-action-btn:hover {
  background: var(--accent-strong);
}

.textarea-action-btn svg {
  width: 16px;
  height: 16px;
  pointer-events: none;
}

.picker-toolbar {
  display: flex;
  justify-content: flex-start;
}

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

.picker-toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.selection-dialog-add-btn {
  min-height: 40px;
  padding-inline: 14px;
  white-space: nowrap;
}

.selection-dialog-add-btn svg {
  width: 16px;
  height: 16px;
  flex: none;
}

.input-action-wrap {
  position: relative;
  width: 100%;
}

.input-action-input {
  padding-right: 52px;
}

.input-action-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  transform: translateY(-50%);
  background: rgba(37, 99, 235, 0.1);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.input-action-btn:hover {
  background: rgba(37, 99, 235, 0.16);
}

.input-action-btn svg {
  width: 16px;
  height: 16px;
  pointer-events: none;
}

.select-field {
  position: relative;
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
}

.select-trigger {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(30, 64, 175, 0.14);
  border-radius: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}

.select-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.select-trigger.is-disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

.select-value.is-placeholder {
  color: var(--muted);
}

.select-chevron {
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg) translateY(-2px);
  flex: none;
}

.select-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 12;
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 34px rgba(15, 36, 72, 0.14);
  max-height: 280px;
  overflow: auto;
}

.select-option {
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 12px 14px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}

.select-option strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.select-option span {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  flex: none;
}

.select-option:hover,
.select-option.is-active {
  background: var(--accent-faint);
}

.select-option.is-disabled,
.select-option:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.select-option.is-disabled:hover,
.select-option:disabled:hover {
  background: transparent;
}

.toolbar-select .select-option span {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--accent);
  font-size: 12px;
}

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

.picker-card {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  border-radius: 18px;
  padding: 16px;
  text-align: left;
  cursor: pointer;
}

.picker-card:hover {
  border-color: rgba(37, 99, 235, 0.32);
  transform: translateY(-1px);
}

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

.picker-card-address {
  color: var(--ink);
  line-height: 1.5;
}

.table-shell {
  overflow: auto;
}

.address-table-panel {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  background: var(--panel);
  border: 1px solid var(--line);
}

.address-table-shell {
  flex: 1 1 auto;
  min-height: 0;
}

.address-table-shell .data-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface);
  box-shadow: inset 0 -1px 0 var(--line);
}

.address-pagination {
  flex: 0 0 auto;
  margin: 0;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.workbench-table-shell {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}

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

.data-table th,
.data-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

.action-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.checkbox-cell {
  display: inline-flex;
  justify-content: center;
  width: 100%;
}

.selection-col {
  width: 52px;
  text-align: center !important;
}

.workbench-table-shell .data-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface);
  box-shadow: inset 0 -1px 0 var(--line);
}

.workbench-table-shell .data-table th,
.workbench-table-shell .data-table td {
  padding: 10px 10px;
}

.workbench-table-shell .receiver-col,
.workbench-table-shell .receiver-cell {
  min-width: 420px;
  width: 42%;
}

.workbench-table-shell .business-col,
.workbench-table-shell .business-cell {
  min-width: 190px;
  width: 18%;
}

.workbench-table-shell .express-col,
.workbench-table-shell .express-cell {
  min-width: 260px;
  width: 24%;
}

.workbench-table-shell .action-col,
.workbench-table-shell .action-cell {
  width: 180px;
  min-width: 180px;
}

.workbench-view.has-printing .workbench-table-shell .action-col,
.workbench-view.has-printing .workbench-table-shell .action-cell {
  width: 280px;
  min-width: 280px;
}

.workbench-table-shell td.action-cell {
  display: table-cell;
  vertical-align: middle;
}

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

.workbench-table-shell .row-actions .ghost-btn,
.workbench-table-shell .row-actions .danger-btn {
  font-weight: 700;
}

.workbench-table-shell .row-actions .action-complete {
  background: rgba(37, 99, 235, 0.14);
  color: var(--accent);
}

.workbench-table-shell .row-actions .action-unlock {
  background: rgba(14, 165, 233, 0.13);
  color: #0369a1;
}

.workbench-table-shell .row-actions .action-append {
  background: rgba(217, 119, 6, 0.14);
  color: #b45309;
}

.workbench-table-shell .row-actions .action-print {
  background: rgba(15, 23, 42, 0.08);
  color: var(--ink);
}

.workbench-table-shell .row-actions .action-bind {
  background: rgba(37, 99, 235, 0.14);
  color: var(--accent);
}

.workbench-view {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 0;
  height: 100%;
}

.workbench-view .workbench-filter-panel {
  flex: 0 0 auto;
}

.workbench-view .workbench-table-panel {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.workbench-view .panel:last-child {
  margin-bottom: 0;
}

.workbench-view .table-toolbar,
.workbench-view .table-pagination {
  flex: 0 0 auto;
}

.workbench-table-shell .contact-address {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
}

.workbench-table-shell .summary-time {
  color: var(--muted);
  font-size: 13px;
}

.workbench-table-shell .summary-code {
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  word-break: break-all;
}

.workbench-table-shell .status-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.status-chip {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--neutral-soft);
  margin-right: 6px;
  margin-bottom: 6px;
}

.status-chip.is-done {
  background: var(--accent-soft);
  color: var(--accent);
}

.source-tag,
.payment-tag,
.sub-order-tag,
.status-tag {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-top: 6px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 13px;
  line-height: 1;
  font-weight: 700;
}

.source-tag {
  margin-right: 6px;
}

.source-tag.is-offline {
  background: rgba(217, 119, 6, 0.14);
  color: #b45309;
}

.source-tag.is-online {
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
}

.source-tag.is-special {
  background: rgba(126, 58, 242, 0.12);
  color: #6d28d9;
}

.payment-tag.is-collect {
  background: rgba(196, 77, 77, 0.14);
  color: var(--danger);
}

.payment-tag.is-normal {
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
}

.express-line {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.sub-order-tag {
  margin-top: 0;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.16);
  color: #b45309;
  font-size: 12px;
  flex: none;
}

.status-tag {
  margin-top: 0;
  padding: 4px 8px;
  font-size: 12px;
}

.status-tag.is-on {
  background: var(--accent-soft);
  color: var(--accent);
}

.status-tag.is-pending {
  background: rgba(217, 119, 6, 0.14);
  color: #b45309;
}

.status-tag.is-off {
  background: var(--neutral-soft);
  color: var(--muted);
}

.address-kind-tag {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1;
  font-weight: 700;
}

.address-kind-tag.is-normal {
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
}

.address-kind-tag.is-temporary {
  background: rgba(126, 58, 242, 0.12);
  color: #6d28d9;
}

.preview-list,
.stack,
.mini-table {
  display: grid;
  gap: 12px;
}

.preview-card,
.mini-row,
.mobile-link-box {
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
}

.mini-row,
.two-column {
  align-items: start;
}

.mini-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.preview-title,
.subheading {
  font-weight: 700;
}

.helper-hint {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.helper-config-note {
  display: grid;
  gap: 6px;
}

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

.helper-download-btn {
  min-height: 42px;
  text-decoration: none;
}

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

.timeline-item {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
}

.timeline-time {
  color: var(--muted);
  font-size: 13px;
}

.timeline-body {
  line-height: 1.6;
}

.empty-cell,
.empty-mini {
  color: var(--muted);
  text-align: center;
  padding: 20px;
}

.table-pagination {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.pagination-summary,
.pagination-size {
  color: var(--muted);
  font-size: 13px;
}

.pagination-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pagination-btn {
  min-width: 44px;
  padding: 8px 12px;
}

.pagination-btn[disabled] {
  opacity: 0.48;
  cursor: not-allowed;
  transform: none;
}

.pagination-btn.is-active {
  background: var(--accent);
  color: #fff;
}

.toast-stack {
  position: fixed;
  right: 20px;
  top: 18px;
  display: grid;
  gap: 10px;
  z-index: 1000;
}

.toast {
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
  padding: 12px 14px;
  border-radius: 14px;
  transform: translateY(-6px);
  opacity: 0;
  transition: 0.18s ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast-success {
  background: rgba(37, 99, 235, 0.96);
}

.toast-error {
  background: rgba(196, 77, 77, 0.96);
}

.loading-mask,
.drawer-shell,
.dialog-shell,
.modal-shell {
  position: fixed;
  inset: 0;
  z-index: 999;
}

html.ui-scroll-locked,
body.ui-scroll-locked {
  overflow: hidden;
  overscroll-behavior: none;
}

body.ui-scroll-locked {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
}

.loading-mask {
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.24);
}

.loading-card,
.modal-card {
  background: var(--panel-strong);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.loading-ring {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 4px solid rgba(37, 99, 235, 0.18);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
  margin: 0 auto 12px;
}

.drawer-backdrop,
.dialog-backdrop,
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.46);
}

.drawer-panel {
  position: absolute;
  right: 0;
  top: 0;
  width: min(80vw, 1440px);
  height: 100%;
  background: var(--surface);
  border-left: 1px solid var(--line);
  transform: translateX(100%);
  transition: transform 0.18s ease;
  display: flex;
  flex-direction: column;
}

.drawer-shell.open .drawer-panel {
  transform: translateX(0);
}

.drawer-panel-order .drawer-header {
  align-items: center;
  padding: 12px 16px;
}

.drawer-panel-order .drawer-kicker {
  display: none;
}

.drawer-panel-order .drawer-title {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}

.drawer-panel-order [data-drawer-close] {
  min-height: 34px;
  padding: 8px 12px;
  background: var(--danger-soft);
  color: var(--danger);
}

.drawer-panel-order [data-drawer-close]:hover {
  background: rgba(239, 68, 68, 0.18);
}

.drawer-panel-address-nested {
  width: min(70vw, 1160px);
}

.drawer-header,
.drawer-body {
  padding: 22px;
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  border-bottom: 1px solid var(--line);
}

.drawer-title {
  margin: 6px 0 0;
}

.drawer-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

.drawer-body:has(.address-maintain-drawer) {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.address-maintain-root {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

.dialog-card {
  position: relative;
  width: min(1240px, calc(100% - 48px));
  max-height: calc(100vh - 72px);
  margin: 36px auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transform: translateY(14px);
  opacity: 0;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.dialog-shell.open .dialog-card {
  transform: translateY(0);
  opacity: 1;
}

.dialog-card.dialog-card-preview {
  width: min(var(--dialog-preview-width, 860px), calc(100% - 48px));
}

.dialog-card.dialog-card-logistics {
  width: min(680px, calc(100% - 48px));
}

.dialog-header,
.dialog-body {
  padding: 22px 24px;
}

.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  border-bottom: 1px solid var(--line);
}

.dialog-title {
  margin: 6px 0 0;
}

.dialog-body {
  overflow: auto;
  overscroll-behavior: contain;
}

.dialog-body.dialog-body-preview {
  display: flex;
  justify-content: center;
}

.selection-table-shell {
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: auto;
  background: rgba(255, 255, 255, 0.88);
}

.selection-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.selection-table th,
.selection-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 14px;
}

.selection-table tbody tr {
  cursor: pointer;
}

.selection-table tbody tr:hover {
  background: rgba(37, 99, 235, 0.06);
}

.selection-table td {
  color: var(--ink);
  line-height: 1.5;
  word-break: break-word;
}

.selection-action-col {
  width: 110px;
  white-space: nowrap;
}

.logistic-codes-table-shell {
  border-radius: 12px;
  max-height: min(58vh, 420px);
}

.logistic-codes-table {
  table-layout: auto;
}

.logistic-codes-table .logistic-type-col {
  width: 94px;
}

.logistic-codes-table .logistic-actions-col {
  width: 172px;
}

.logistic-codes-table th,
.logistic-codes-table td {
  padding: 10px 12px;
}

.logistic-code-cell {
  white-space: nowrap;
}

.logistic-code-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  white-space: nowrap;
}

.selection-action-btn {
  padding: 8px 12px;
}

.logistic-code-actions .selection-action-btn {
  min-height: 34px;
  padding: 7px 10px;
}

.addresses-action-cell {
  white-space: nowrap;
}

.addresses-action-cell .primary-btn,
.addresses-action-cell .ghost-btn {
  min-width: 88px;
}

.address-list-table {
  table-layout: fixed;
}

.address-list-table tbody tr {
  cursor: default;
}

.address-list-table th:nth-child(1),
.address-list-table td:nth-child(1) {
  width: 120px;
}

.address-list-table th:nth-child(2),
.address-list-table td:nth-child(2) {
  width: 136px;
}

.address-list-table th:nth-child(4),
.address-list-table td:nth-child(4) {
  width: 170px;
}

.address-list-table th:nth-child(5),
.address-list-table td:nth-child(5) {
  width: 180px;
}

.address-text-block {
  display: grid;
  gap: 4px;
  line-height: 1.5;
  word-break: break-word;
}

.address-text-block strong {
  color: var(--ink);
}

.address-text-block span {
  color: var(--muted);
}

.address-status-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.bind-drawer {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: calc(100vh - 190px);
}

.bind-toolbar {
  display: grid;
  gap: 10px;
}

.bind-toolbar-controls {
  display: grid;
  grid-template-columns: minmax(420px, 520px) 220px;
  gap: 12px;
  align-items: end;
}

.bind-toolbar-controls .segmented-field,
.bind-toolbar-controls .control-field {
  min-width: 0;
}

.bind-toolbar-search-row {
  display: grid;
  grid-template-columns: minmax(360px, 520px);
  gap: 8px;
  align-items: start;
}

.bind-toolbar-search {
  width: 100%;
}

.bind-toolbar .segmented-field,
.bind-toolbar .control-field {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.bind-toolbar .segmented-control.compact {
  width: 100%;
  flex-wrap: nowrap;
}

.bind-toolbar .segmented-button {
  flex: 1 1 0;
  text-align: center;
  white-space: nowrap;
}

.bind-toolbar-note,
.bind-transfer-meta {
  color: var(--muted);
  font-size: 13px;
}

.bind-transfer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
  flex: 1;
  min-height: 420px;
}

.bind-transfer-pane {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bind-transfer-pane-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
}

.bind-transfer-actions {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
}

.bind-transfer-btn {
  min-height: 42px;
  width: 100%;
}

.bind-transfer-btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.bind-transfer-table-shell {
  flex: 1;
  min-height: 0;
}

.bind-transfer-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface);
}

.bind-transfer-table th,
.bind-transfer-table td {
  padding: 10px 12px;
  font-size: 13px;
}

.bind-transfer-table .selection-col {
  width: 52px;
}

.bind-transfer-table tbody tr.is-selected {
  background: rgba(37, 99, 235, 0.08);
}

.bind-transfer-table tbody tr:hover {
  background: rgba(37, 99, 235, 0.06);
}

.bind-transfer-table .bind-remark-cell {
  width: 220px;
}

.bind-remark-btn {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--accent);
  font: inherit;
  cursor: pointer;
  text-align: left;
  line-height: 1.5;
}

.bind-remark-btn:hover {
  text-decoration: underline;
}

.template-preview-shell {
  display: grid;
  gap: 14px;
  width: min(100%, var(--template-preview-width, 760px));
  margin: 0 auto;
}

.template-preview-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.template-preview-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.template-preview-printer {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.template-preview-frame {
  display: block;
  width: min(100%, var(--template-preview-width, 760px));
  min-height: 72vh;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

.link-button {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--accent);
  font: inherit;
  cursor: pointer;
  text-align: left;
}

.link-button:hover {
  text-decoration: underline;
}

.modal-card {
  position: relative;
  width: min(420px, calc(100% - 32px));
  margin: 16vh auto 0;
}

.modal-shell.open .modal-card {
  transform: translateY(0);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 18px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

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

  .drawer-panel {
    width: 100%;
  }

  .dialog-card {
    width: calc(100% - 20px);
    max-height: calc(100vh - 20px);
    margin: 10px;
  }

  .dialog-card.dialog-card-preview {
    width: calc(100% - 20px);
  }

  .sidebar {
    padding-bottom: 12px;
  }

  .form-grid,
  .form-grid.form-grid-two,
  .segmented-inline-row {
    grid-template-columns: 1fr;
  }

  .address-filter-bar {
    grid-template-columns: 1fr;
  }

  .address-filter-bar .primary-btn {
    width: 100%;
  }

  .drawer-body .address-add-grid {
    grid-template-columns: 1fr;
  }

  .drawer-body:has(.address-maintain-drawer) {
    display: block;
    overflow: auto;
  }

  .address-maintain-root {
    display: block;
  }

  .address-maintain-drawer {
    height: auto;
    min-height: auto;
  }

  .address-textarea-row {
    grid-template-columns: 1fr;
  }

  .bind-drawer {
    min-height: auto;
  }

  .bind-toolbar-controls,
  .bind-transfer {
    grid-template-columns: 1fr;
  }

  .bind-toolbar-search-row {
    grid-template-columns: 1fr;
  }

  .bind-transfer-actions {
    flex-direction: row;
    justify-content: flex-start;
  }

  .dialog-body.dialog-body-preview,
  .template-preview-toolbar {
    display: grid;
    justify-content: stretch;
  }

  .workbench-table-shell {
    max-height: none;
  }

  .workbench-view.is-order-only .filter-segment-field.is-pair,
  .workbench-view.is-order-only .filter-action-field {
    grid-column: auto;
    justify-content: flex-start;
  }

  .segmented-inline-row .segmented-control {
    flex-wrap: wrap;
  }

  .login-card {
    grid-template-columns: 1fr;
  }
}
