/* Shared UI tokens + modal primitives ? admin & coder */
:root {
  --xdt-primary: #4f6ef7;
  --xdt-primary-hover: #3d5ce5;
  --xdt-success: #52c41a;
  --xdt-success-bg: #f6ffed;
  --xdt-success-border: #b7eb8f;
  --xdt-warning: #fa8c16;
  --xdt-warning-bg: #fff7e6;
  --xdt-warning-border: #ffd591;
  --xdt-danger: #ff4d4f;
  --xdt-danger-bg: #fff1f0;
  --xdt-danger-border: #ffa39e;
  --xdt-info: #1677ff;
  --xdt-info-bg: #e6f4ff;
  --xdt-info-border: #91caff;
  --xdt-bg: #f5f7fa;
  --xdt-card: #ffffff;
  --xdt-border: #f0f0f0;
  --xdt-border-strong: #d9d9d9;
  --xdt-text: #333333;
  --xdt-text-secondary: #888888;
  --xdt-text-muted: #aaaaaa;
  --xdt-btn-h: 34px;
  --xdt-input-h: 36px;
  --xdt-radius: 8px;
  --xdt-radius-sm: 6px;
  --xdt-shadow: 0 8px 28px rgba(15, 23, 42, 0.12);
  --xdt-modal-width: 480px;
  --xdt-modal-width-compact: 480px;
  --xdt-modal-width-normal: 600px;
  --xdt-modal-width-lg: 720px;
  --xdt-modal-width-wide: 840px;
  --xdt-modal-width-xl: 1100px;
  --xdt-table-row-h: 44px;
  --xdt-page-gap: 16px;
  --xdt-z-mask: 10000;
  --xdt-z-modal: 10001;
  --xdt-font: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  /* pile c-health 300px − table td horizontal padding 12+12 */
  --xdt-health-bar-max-width: 276px;
}

/* ?? Buttons ?? */
.xdt-btn,
.xdt-btn--primary,
.xdt-btn--secondary,
.xdt-btn--warning,
.xdt-btn--danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: var(--xdt-btn-h);
  padding: 0 16px;
  border-radius: var(--xdt-radius-sm);
  border: 1px solid transparent;
  font-size: 14px;
  font-family: var(--xdt-font);
  cursor: pointer;
  line-height: 1;
  white-space: nowrap;
  box-sizing: border-box;
  transition: background .12s, border-color .12s, color .12s, opacity .12s;
}
.xdt-btn:disabled { opacity: .55; cursor: not-allowed; }
.xdt-btn-primary,
.xdt-btn--primary { background: var(--xdt-primary); color: #fff; }
.xdt-btn-primary:hover:not(:disabled),
.xdt-btn--primary:hover:not(:disabled) { background: var(--xdt-primary-hover); }
.xdt-btn-secondary,
.xdt-btn--secondary { background: #fff; color: var(--xdt-text); border-color: var(--xdt-border-strong); }
.xdt-btn-secondary:hover:not(:disabled),
.xdt-btn--secondary:hover:not(:disabled) { border-color: var(--xdt-primary); color: var(--xdt-primary); }
.xdt-btn--warning { background: #fff; color: #c2410c; border-color: #fed7aa; }
.xdt-btn-danger,
.xdt-btn--danger { background: var(--xdt-danger); color: #fff; }
.xdt-btn-danger:hover:not(:disabled),
.xdt-btn--danger:hover:not(:disabled) { filter: brightness(.95); }
.xdt-btn-ghost { background: transparent; color: var(--xdt-text-secondary); border-color: transparent; }
.xdt-btn-sm,
.xdt-btn--compact {
  height: var(--xdt-btn-h-compact);
  padding: 0 12px;
  font-size: 13px;
}
.xdt-btn--icon { width: var(--xdt-btn-h); padding: 0; }

/* ?? Order status buttons ?? */
.xdt-order-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 78px;
  height: 28px;
  padding: 0 10px;
  border-radius: var(--xdt-radius-sm);
  border: 1px solid transparent;
  font-size: 12px;
  font-family: var(--xdt-font);
  cursor: pointer;
  line-height: 1;
}
.xdt-order-btn.on {
  background: var(--xdt-success-bg);
  color: #389e0d;
  border-color: var(--xdt-success-border);
}
.xdt-order-btn.off {
  background: var(--xdt-danger-bg);
  color: #cf1322;
  border-color: var(--xdt-danger-border);
}
.xdt-order-btn.locked {
  background: #f5f5f5;
  color: #8c8c8c;
  border-color: #d9d9d9;
  cursor: not-allowed;
}
.xdt-order-btn.loading { opacity: .7; pointer-events: none; }
.xdt-order-hint { font-size: 11px; color: var(--xdt-text-secondary); margin-left: 4px; }

/* ?? Inputs ?? */
.xdt-input, .xdt-select, .xdt-textarea {
  width: 100%;
  height: var(--xdt-input-h);
  border: 1px solid var(--xdt-border-strong);
  border-radius: var(--xdt-radius-sm);
  padding: 0 11px;
  font-size: 13px;
  font-family: var(--xdt-font);
  color: var(--xdt-text);
  background: #fff;
  outline: none;
}
.xdt-textarea { height: auto; min-height: 72px; padding: 8px 11px; resize: vertical; }
.xdt-textarea.xdt-textarea--tall { min-height: 220px; }
@media (min-height: 800px) {
  .xdt-textarea.xdt-textarea--tall { min-height: 260px; }
}
@media (max-width: 768px) {
  .xdt-textarea.xdt-textarea--tall { min-height: 180px; }
}
.xdt-input:focus, .xdt-select:focus, .xdt-textarea:focus {
  border-color: var(--xdt-primary);
  box-shadow: 0 0 0 2px rgba(79, 110, 247, 0.12);
}
.xdt-input.is-error, .xdt-select.is-error, .xdt-textarea.is-error {
  border-color: var(--xdt-danger);
}
.xdt-field { margin-bottom: 14px; }
.xdt-label {
  display: block;
  font-size: 12px;
  color: var(--xdt-text-secondary);
  margin-bottom: 6px;
}
.xdt-field-error {
  margin-top: 4px;
  font-size: 12px;
  color: var(--xdt-danger);
  line-height: 1.4;
}
.xdt-form-error {
  margin-bottom: 12px;
  padding: 8px 10px;
  border-radius: var(--xdt-radius-sm);
  background: var(--xdt-danger-bg);
  border: 1px solid var(--xdt-danger-border);
  color: #cf1322;
  font-size: 13px;
}
.xdt-hint { font-size: 12px; color: var(--xdt-text-secondary); margin-top: 4px; }

/* ?? Modal stack ?? */
.xdt-modal-root {
  position: fixed;
  inset: 0;
  z-index: var(--xdt-z-mask);
  pointer-events: none;
}
.xdt-modal-layer {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  pointer-events: auto;
}
.xdt-modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}
.xdt-modal-box {
  position: relative;
  z-index: 1;
  width: min(var(--xdt-modal-width), 100%);
  max-height: min(86vh, 720px);
  background: var(--xdt-card);
  border-radius: 10px;
  box-shadow: var(--xdt-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: var(--xdt-font);
  color: var(--xdt-text);
}
.xdt-modal-box.xdt-modal--compact,
.xdt-modal-box.sm {
  width: min(var(--xdt-modal-width-compact), calc(100vw - 48px));
  max-height: min(80vh, 560px);
}
.xdt-modal-box.xdt-modal--normal {
  width: min(var(--xdt-modal-width-normal), calc(100vw - 48px));
  max-height: min(86vh, 680px);
}
.xdt-modal-box.wide,
.xdt-modal-box.xdt-modal--wide {
  width: min(var(--xdt-modal-width-wide), calc(100vw - 48px));
  max-height: 90vh;
}
.xdt-modal-box.xdt-modal--xl {
  width: min(var(--xdt-modal-width-xl), calc(100vw - 48px));
  max-height: 90vh;
}
.xdt-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--xdt-border);
  flex-shrink: 0;
}
.xdt-modal-title { font-size: 16px; font-weight: 600; margin: 0; }
.xdt-modal-close {
  width: 28px; height: 28px; border: none; background: transparent;
  border-radius: 6px; cursor: pointer; color: var(--xdt-text-secondary); font-size: 18px; line-height: 1;
}
.xdt-modal-close:hover { background: #f5f5f5; color: var(--xdt-text); }
.xdt-modal-close:disabled { opacity: .4; cursor: not-allowed; }
.xdt-modal-body {
  padding: 16px;
  overflow: auto;
  flex: 1;
  font-size: 14px;
  line-height: 1.55;
}
.xdt-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--xdt-border);
  flex-shrink: 0;
}
.xdt-result-icon {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; margin: 4px auto 12px; font-weight: 700;
}
.xdt-result-icon.success { background: var(--xdt-success-bg); color: var(--xdt-success); }
.xdt-result-icon.error { background: var(--xdt-danger-bg); color: var(--xdt-danger); }
.xdt-result-icon.warning { background: var(--xdt-warning-bg); color: var(--xdt-warning); }
.xdt-result-icon.info { background: var(--xdt-info-bg); color: var(--xdt-info); }
.xdt-result-msg { text-align: center; white-space: pre-wrap; word-break: break-word; }
.xdt-scope { margin-top: 10px; padding: 8px 10px; background: #fafafa; border-radius: 6px; font-size: 12px; color: var(--xdt-text-secondary); }
.xdt-secret-box {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px; background: #fafafa; border: 1px solid var(--xdt-border);
  border-radius: 6px; padding: 10px; word-break: break-all; margin: 8px 0;
}
.xdt-spinner {
  width: 14px; height: 14px; border: 2px solid rgba(0,0,0,.15);
  border-top-color: currentColor; border-radius: 50%;
  animation: xdt-spin .7s linear infinite; display: inline-block;
}
@keyframes xdt-spin { to { transform: rotate(360deg); } }
.xdt-empty { text-align: center; color: var(--xdt-text-secondary); padding: 24px 8px; font-size: 13px; }

body.xdt-modal-open { overflow: hidden; }

@media (max-width: 640px) {
  .xdt-modal-box,
  .xdt-modal-box.wide,
  .xdt-modal-box.xdt-modal--wide,
  .xdt-modal-box.xdt-modal--xl,
  .xdt-modal-box.sm {
    width: 100%;
    max-height: 92vh;
  }
  .xdt-modal-layer { padding: 8px; align-items: flex-end; }
}

/* ?? Form layout (shared) ?? */
.xdt-form-grid {
  display: grid;
  gap: 12px 16px;
}
.xdt-form-grid--2 {
  grid-template-columns: 1fr 1fr;
  align-items: start;
}
.xdt-form-grid--3 {
  grid-template-columns: repeat(3, 1fr);
  align-items: start;
}
.xdt-form-grid .xdt-field,
.xdt-form-grid .form-item { margin-bottom: 0; }
.xdt-field--span2,
.xdt-form-grid .form-item--span2 { grid-column: 1 / -1; }
.xdt-form-section {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--xdt-border);
}
.xdt-form-section:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.xdt-form-section__title,
.xdt-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--xdt-text);
  margin-bottom: 8px;
}
.xdt-section-help {
  font-size: 12px;
  color: var(--xdt-text-secondary);
  line-height: 1.45;
  margin: -2px 0 10px;
}
.xdt-req { color: var(--xdt-danger); }

/* Segmented control (status / dispatch mode) */
.xdt-segmented {
  display: inline-flex;
  flex-wrap: wrap;
  max-width: 100%;
  border: 1px solid var(--xdt-border-strong);
  border-radius: var(--xdt-radius-sm);
  overflow: hidden;
  background: #fff;
}
.xdt-segmented__item {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
  color: var(--xdt-text-secondary);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  border-right: 1px solid var(--xdt-border-strong);
  background: #fff;
}
.xdt-segmented__item:last-child { border-right: none; }
.xdt-segmented__item input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}
.xdt-segmented__item:hover { background: #fafafa; }
.xdt-segmented__item.is-on {
  background: var(--xdt-success-bg);
  color: #389e0d;
  font-weight: 600;
}
.xdt-segmented__item.is-off {
  background: #f5f5f5;
  color: #8c8c8c;
  font-weight: 600;
}
.xdt-segmented__item.is-active-primary {
  background: var(--xdt-info-bg);
  color: var(--xdt-info);
  font-weight: 600;
}
.xdt-segmented--dispatch .xdt-segmented__item { min-width: 140px; }

/* Chip multi/single pickers (batch plate rules) */
.xdt-chip-field { width: 100%; }
.xdt-chip-toolbar {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
}
.xdt-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 100%;
}
.xdt-chip {
  min-width: 32px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--xdt-border-strong);
  border-radius: var(--xdt-radius-sm);
  background: #fff;
  color: var(--xdt-text-secondary);
  font-size: 13px;
  line-height: 28px;
  cursor: pointer;
  user-select: none;
}
.xdt-chip:hover { border-color: var(--xdt-primary); color: var(--xdt-primary); }
.xdt-chip.is-on {
  background: var(--xdt-info-bg);
  border-color: var(--xdt-primary);
  color: var(--xdt-primary);
  font-weight: 600;
}
@media (max-width: 420px) {
  .xdt-chip { min-width: 28px; height: 28px; padding: 0 8px; font-size: 12px; }
}

.xdt-inline-tip {
  margin-top: 8px;
  padding: 6px 10px;
  border-radius: var(--xdt-radius-sm);
  font-size: 12px;
  line-height: 1.45;
  color: #ad6800;
  background: var(--xdt-warning-bg);
  border: 1px solid var(--xdt-warning-border);
}
.xdt-inline-tip--info {
  color: #0958d9;
  background: var(--xdt-info-bg);
  border-color: var(--xdt-info-border);
}

/* Compact coder picker table */
.xdt-compact-table-wrap {
  border: 1px solid var(--xdt-border);
  border-radius: var(--xdt-radius-sm);
  overflow: hidden;
  background: #fff;
}
.xdt-compact-table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding: 6px 10px;
  background: #fafafa;
  border-bottom: 1px solid var(--xdt-border);
  font-size: 12px;
  color: var(--xdt-text-secondary);
}
.xdt-compact-table-toolbar .xdt-toolbar-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.xdt-compact-table-scroll {
  max-height: 240px;
  overflow: auto;
}
.xdt-compact-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13px;
}
.xdt-compact-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fafafa;
  border-bottom: 1px solid var(--xdt-border);
  padding: 8px 10px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  color: var(--xdt-text-secondary);
  white-space: nowrap;
}
.xdt-compact-table tbody td {
  padding: 8px 10px;
  border-bottom: 1px solid #f5f5f5;
  height: 46px;
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.xdt-compact-table tbody tr:hover { background: #fafbff; }
.xdt-compact-table .col-check { width: 88px; }
.xdt-compact-table .col-sys { width: 120px; }
.xdt-compact-table .col-weight { width: 100px; }
.xdt-compact-table .col-admin { width: 96px; }
.xdt-compact-table .col-name { width: auto; }
.xdt-compact-table input[type="number"] {
  width: 80px;
  height: 28px;
  padding: 0 6px;
  border: 1px solid var(--xdt-border-strong);
  border-radius: 4px;
  font-size: 12px;
}
.xdt-compact-table .xdt-admin-cell {
  white-space: nowrap;
  writing-mode: horizontal-tb;
  text-orientation: mixed;
}
.xdt-ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  display: block;
}

.xdt-modal-footer--sticky,
.xdt-sticky-footer {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px;
  background: var(--xdt-card);
  border-top: 1px solid var(--xdt-border);
  flex-shrink: 0;
  box-shadow: 0 -4px 12px rgba(15, 23, 42, 0.04);
}
.xdt-shop-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--xdt-border);
  flex-shrink: 0;
}
.xdt-shop-modal-head h3 {
  margin: 0;
  padding: 0;
  border: none;
  font-size: 16px;
  font-weight: 600;
}
.xdt-shop-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 16px 20px 20px;
}
.xdt-shop-modal-body .xdt-textarea.xdt-remark {
  min-height: 84px;
  max-height: 160px;
  resize: vertical;
}
.xdt-shop-secondary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

/* Vue modal size shells (admin/index .modal-box) */
.modal-box.xdt-modal--compact { width: min(var(--xdt-modal-width-compact), calc(100vw - 48px)); max-height: 80vh; }
.modal-box.xdt-modal--normal { width: min(var(--xdt-modal-width-normal), calc(100vw - 48px)); max-height: 86vh; }
.modal-box.xdt-modal--wide { width: min(var(--xdt-modal-width-wide), calc(100vw - 48px)); max-height: 90vh; }
.modal-box.xdt-modal--xl { width: min(var(--xdt-modal-width-xl), calc(100vw - 48px)); max-height: 90vh; }
.modal-box.xdt-modal-shell {
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-box.xdt-modal-shell > .xdt-shop-modal-head,
.modal-box.xdt-modal-shell > .xdt-modal-footer--sticky,
.modal-box.xdt-modal-shell > .xdt-sticky-footer,
.modal-box.xdt-modal-shell > .modal-actions.xdt-sticky-footer {
  flex-shrink: 0;
}
.modal-box.xdt-modal-shell > .xdt-shop-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

/* ?? Page layout primitives ?? */
.xdt-page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.xdt-page-title { font-size: 18px; font-weight: 600; color: var(--xdt-text); margin: 0; }
.xdt-page-desc { font-size: 12px; color: var(--xdt-text-secondary); margin-top: 4px; line-height: 1.45; max-width: 720px; }
.xdt-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.xdt-toolbar .xdt-toolbar-left { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.xdt-toolbar .xdt-toolbar-right { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-left: auto; }
.xdt-action-group { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* ?? Filter bars (dense horizontal; must beat page .filter-bar flex) ?? */
.xdt-filter-bar,
.filter-bar.xdt-filter-grid,
.xdt-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px 10px;
  align-items: center;
  padding: 12px 16px;
  background: var(--xdt-card);
  border: 1px solid var(--xdt-border);
  border-radius: var(--xdt-radius);
  margin-bottom: 0;
  border-bottom: 1px solid var(--xdt-border);
  min-width: 0;
}
.filter-bar.xdt-filter-grid {
  /* override page .filter-bar { display:flex; flex-wrap } */
  flex-wrap: nowrap;
  border-radius: 0;
  box-shadow: none;
}
.xdt-filter-grid--dense,
.filter-bar.xdt-filter-grid--dense {
  grid-template-columns:
    minmax(90px, 0.7fr)
    minmax(130px, 1fr)
    minmax(160px, 1.2fr)
    minmax(130px, 1fr)
    repeat(5, minmax(100px, 0.75fr))
    auto;
}
.xdt-filter-grid .xdt-filter-actions,
.xdt-filter-actions {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}
.xdt-filter-field--xs { min-width: 0; max-width: 110px; }
.xdt-filter-field--sm { min-width: 0; max-width: 140px; }
.xdt-filter-field--md { min-width: 0; max-width: 200px; }
.xdt-filter-grid > input,
.xdt-filter-grid > select,
.filter-bar.xdt-filter-grid > input,
.filter-bar.xdt-filter-grid > select,
.xdt-filter-grid .xdt-filter-field,
.xdt-filter-grid .xdt-filter-field input,
.xdt-filter-grid .xdt-filter-field select {
  width: 100%;
  min-width: 0;
  max-width: none;
  height: var(--xdt-input-h);
  border: 1px solid var(--xdt-border-strong);
  border-radius: var(--xdt-radius-sm);
  padding: 0 10px;
  font-size: 13px;
  box-sizing: border-box;
}
.filter-bar.xdt-filter-grid > input,
.filter-bar.xdt-filter-grid > select {
  /* kill page .filter-bar input { min-width:140px } that forces wrap */
  min-width: 0 !important;
  flex: unset;
}
.xdt-filter-grid .xdt-btn,
.xdt-filter-grid .btn,
.filter-bar.xdt-filter-grid .btn {
  height: var(--xdt-input-h);
  padding: 0 14px;
  white-space: nowrap;
  flex-shrink: 0;
}
.xdt-filter-grid .btn-search { background: var(--xdt-primary); color: #fff; border: none; border-radius: var(--xdt-radius-sm); cursor: pointer; font-size: 13px; }
.xdt-filter-grid .btn-reset { background: #fff; color: var(--xdt-text); border: 1px solid var(--xdt-border-strong); border-radius: var(--xdt-radius-sm); cursor: pointer; font-size: 13px; }

@media (max-width: 1440px) and (min-width: 1024px) {
  .xdt-filter-grid--dense,
  .filter-bar.xdt-filter-grid--dense {
    grid-template-columns: repeat(6, minmax(100px, 1fr));
  }
  .xdt-filter-grid--dense .xdt-filter-actions,
  .filter-bar.xdt-filter-grid--dense .xdt-filter-actions {
    grid-column: 5 / -1;
  }
}

@media (max-width: 1023px) and (min-width: 768px) {
  .xdt-filter-grid,
  .filter-bar.xdt-filter-grid,
  .xdt-filter-grid--dense,
  .filter-bar.xdt-filter-grid--dense {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .xdt-filter-grid .xdt-filter-actions,
  .filter-bar.xdt-filter-grid .xdt-filter-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
}

@media (max-width: 767px) {
  .xdt-filter-grid,
  .filter-bar.xdt-filter-grid,
  .xdt-filter-grid--dense,
  .filter-bar.xdt-filter-grid--dense {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .xdt-filter-grid .xdt-filter-actions,
  .filter-bar.xdt-filter-grid .xdt-filter-actions {
    grid-column: 1 / -1;
    flex-wrap: wrap;
  }
}
.xdt-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--xdt-border);
  border-radius: var(--xdt-radius);
  background: #fff;
}
.xdt-table-wrap table,
table.xdt-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 13px;
}
.xdt-table-wrap th,
.xdt-table-wrap td,
table.xdt-table th,
table.xdt-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--xdt-border);
  vertical-align: middle;
  white-space: nowrap;
  writing-mode: horizontal-tb;
  text-orientation: mixed;
}
.xdt-table-wrap th,
table.xdt-table th {
  background: #fafafa;
  color: var(--xdt-text-secondary);
  font-weight: 600;
  font-size: 12px;
  position: sticky;
  top: 0;
  z-index: 1;
}
.xdt-table-wrap td.num,
.xdt-td-num { text-align: right; font-variant-numeric: tabular-nums; }
.xdt-table-wrap td.status,
.xdt-td-status { text-align: center; }
.xdt-table-wrap td.ops,
.xdt-td-ops {
  min-width: 160px;
  white-space: nowrap;
}
.xdt-empty-state {
  text-align: center;
  color: var(--xdt-text-secondary);
  padding: 36px 16px;
  font-size: 13px;
}
.xdt-detail-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: var(--xdt-card);
  border: 1px solid var(--xdt-border);
  border-radius: var(--xdt-radius);
  margin-bottom: 12px;
}
.xdt-detail-header .xdt-back {
  margin-right: 8px;
}
.xdt-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 20px;
  font-size: 13px;
}
.xdt-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}
.xdt-stat-card {
  background: var(--xdt-card);
  border: 1px solid var(--xdt-border);
  border-radius: var(--xdt-radius);
  padding: 12px 14px;
}
.xdt-stat-card .lbl { font-size: 12px; color: var(--xdt-text-secondary); }
.xdt-stat-card .val { font-size: 20px; font-weight: 700; margin-top: 4px; color: var(--xdt-text); }
.xdt-badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  border: 1px solid transparent;
}
.xdt-badge--ok { background: var(--xdt-success-bg); color: #389e0d; border-color: var(--xdt-success-border); }
.xdt-badge--off { background: #f5f5f5; color: #8c8c8c; border-color: #d9d9d9; }
.xdt-badge--warn { background: var(--xdt-warning-bg); color: #d48806; border-color: var(--xdt-warning-border); }
.xdt-badge--danger { background: var(--xdt-danger-bg); color: #cf1322; border-color: var(--xdt-danger-border); }
.xdt-badge--info { background: var(--xdt-info-bg); color: var(--xdt-info); border-color: var(--xdt-info-border); }
.xdt-more-menu {
  position: fixed;
  z-index: 12000;
  min-width: 140px;
  background: #fff;
  border: 1px solid var(--xdt-border);
  border-radius: 8px;
  box-shadow: var(--xdt-shadow);
  padding: 4px 0;
}
.xdt-more-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 14px;
  border: none;
  background: transparent;
  font-size: 13px;
  cursor: pointer;
  color: var(--xdt-text);
}
.xdt-more-menu button:hover { background: #f5f7ff; }
.xdt-more-menu button.danger { color: var(--xdt-danger); }
.xdt-qr-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.xdt-qr-card {
  border: 1px solid var(--xdt-border);
  border-radius: var(--xdt-radius);
  padding: 12px;
  background: #fff;
}

@media (max-width: 1199px) and (min-width: 768px) {
  .xdt-form-grid--2 { gap: 10px 12px; }
  .xdt-form-grid--3 { grid-template-columns: 1fr 1fr; }
  .xdt-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .xdt-compact-table-scroll { overflow-x: auto; }
  .xdt-compact-table { min-width: 640px; }
}

@media (max-width: 767px) {
  .xdt-form-grid--2,
  .xdt-form-grid--3,
  .xdt-detail-grid { grid-template-columns: 1fr; }
  .xdt-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .xdt-qr-grid { grid-template-columns: 1fr; }
  .xdt-segmented--dispatch { width: 100%; }
  .xdt-segmented--dispatch .xdt-segmented__item {
    flex: 1 1 50%;
    min-width: 0;
  }
  .modal-box.xdt-modal--compact,
  .modal-box.xdt-modal--normal,
  .modal-box.xdt-modal--wide,
  .modal-box.xdt-modal--xl,
  .xdt-modal-box.xdt-modal--compact,
  .xdt-modal-box.xdt-modal--normal,
  .xdt-modal-box.xdt-modal--wide,
  .xdt-modal-box.xdt-modal--xl {
    width: calc(100vw - 24px);
    max-height: 92vh;
  }
  .xdt-compact-table-scroll,
  .xdt-table-wrap { overflow-x: auto; }
  .xdt-compact-table { min-width: 560px; }
  .xdt-compact-table .col-admin,
  .xdt-compact-table th.col-admin,
  .xdt-compact-table td.col-admin,
  .xdt-compact-table .xdt-admin-cell,
  .xdt-table-wrap th,
  .xdt-table-wrap td {
    white-space: nowrap !important;
    writing-mode: horizontal-tb !important;
  }
}

/* ???? Order detail modal ???? */
.xdt-modal-title-extra {
  margin-left: 10px;
  font-size: 13px;
  font-weight: 400;
  color: #94a3b8;
}
.od-root { font-size: 13px; color: #334155; }
.od-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
  background: #f8fafc;
  border: 1px solid #e8ecf2;
  border-radius: 10px;
}
.od-summary-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
  background: #dcfce7;
  color: #16a34a;
}
.od-summary-icon.is-wait { background: #dbeafe; color: #2563eb; }
.od-summary-icon.is-warn { background: #ffedd5; color: #ea580c; }
.od-summary-icon.is-err { background: #fee2e2; color: #dc2626; }
.od-summary-icon.is-muted { background: #f1f5f9; color: #64748b; }
.od-summary-main { flex: 1; min-width: 0; }
.od-summary-title { font-size: 15px; font-weight: 600; color: #0f172a; line-height: 1.3; }
.od-summary-sub { font-size: 12px; color: #64748b; margin-top: 2px; }
.od-summary-charge { flex-shrink: 0; }
.od-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.od-section {
  background: #fff;
  border: 1px solid #e8ecf2;
  border-radius: 10px;
  padding: 12px 14px;
  min-width: 0;
}
.od-section-title {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  margin: 0 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid #f1f5f9;
}
.od-rows { display: grid; gap: 7px; }
.od-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}
.od-label { color: #94a3b8; font-size: 12px; line-height: 1.5; }
.od-value { color: #334155; font-size: 13px; line-height: 1.5; min-width: 0; word-break: break-all; }
.od-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}
.od-copy-row { display: flex; align-items: flex-start; gap: 6px; }
.od-copy-row .od-mono { flex: 1; min-width: 0; }
.od-copy-btn {
  border: 0;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  padding: 0 2px;
  font-size: 12px;
  line-height: 1.5;
  flex-shrink: 0;
}
.od-copy-btn:hover { color: #2563eb; }
.od-copy-btn.is-ok { color: #16a34a; }
.od-hint { color: #94a3b8; font-size: 11px; margin-left: 4px; }
.od-actions {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  margin: 0 0 12px; padding: 10px 12px;
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px;
}
.od-actions .od-hint { margin-left: 0; }
.od-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  border: 1px solid transparent;
}
.od-badge-ok { background: #dcfce7; color: #15803d; border-color: #bbf7d0; }
.od-badge-info { background: #e0f2fe; color: #0369a1; border-color: #bae6fd; }
.od-badge-warn { background: #ffedd5; color: #c2410c; border-color: #fed7aa; }
.od-badge-err { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
.od-badge-muted { background: #f1f5f9; color: #64748b; border-color: #e2e8f0; }
.od-badge-tech {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 500;
  background: #f8fafc;
  color: #64748b;
  border-color: #e2e8f0;
  border-radius: 6px;
}
.od-h5-ip { color: #94a3b8; font-size: 11px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.od-notify { margin-top: 8px; padding-top: 8px; border-top: 1px dashed #e2e8f0; font-size: 12px; color: #64748b; }
@media (max-width: 768px) {
  .od-grid { grid-template-columns: 1fr; }
  .od-row { grid-template-columns: 76px minmax(0, 1fr); }
}
/* ?? Unified portal visual system (order-center baseline) ?? */
:root {
  --xdt-bg: #f5f7fa;
  --xdt-card: #ffffff;
  --xdt-border: #e8ecf2;
  --xdt-border-strong: #d9e2ec;
  --xdt-text: #0f172a;
  --xdt-text-secondary: #64748b;
  --xdt-text-muted: #94a3b8;
  --xdt-hover: #f8fafc;
  --xdt-primary: #2563eb;
  --xdt-primary-hover: #1d4ed8;
  --xdt-primary-soft: #eff6ff;
  --xdt-btn-h: 36px;
  --xdt-btn-h-compact: 32px;
  --xdt-input-h: 36px;
  --xdt-table-row-h: 48px;
  --xdt-page-gap: 14px;
  --xdt-stack-gap: 14px;
  --xdt-radius: 10px;
  --xdt-radius-sm: 8px;
  --xdt-shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.04);
  --xdt-stat-h: 112px;
}

.xdt-page { display: flex; flex-direction: column; gap: var(--xdt-page-gap); min-width: 0; }
.xdt-page-header,
.xdt-page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 0;
}
.xdt-page-title { font-size: 24px; font-weight: 700; color: var(--xdt-text); margin: 0; letter-spacing: -0.02em; line-height: 1.25; }
.xdt-page-subtitle,
.xdt-page-desc { font-size: 13px; color: var(--xdt-text-secondary); margin: 4px 0 0; line-height: 1.45; max-width: 760px; }
.xdt-page-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-left: auto; }
.xdt-breadcrumb,
.breadcrumb {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  font-size: 13px; line-height: 20px; font-weight: 400;
  color: #64748b; margin: 0 0 12px;
}
.xdt-breadcrumb a,
.xdt-breadcrumb__item,
.breadcrumb a {
  color: #64748b; text-decoration: none; font-size: 13px; line-height: 20px; font-weight: 400;
}
.xdt-breadcrumb a:hover,
.xdt-breadcrumb__item:hover,
.breadcrumb a:hover { color: var(--xdt-primary); }
.xdt-breadcrumb__separator,
.xdt-breadcrumb > span:not(.xdt-breadcrumb__current):not(.xdt-breadcrumb__item) {
  color: #94a3b8; font-size: 13px; line-height: 20px;
}
.xdt-breadcrumb__current,
.xdt-breadcrumb > span:last-child {
  color: #94a3b8; font-size: 13px; line-height: 20px; font-weight: 400;
}

.xdt-inline-tip {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 8px 12px; border-radius: 8px; font-size: 12px; line-height: 1.45;
  background: #f8fafc; border: 1px solid var(--xdt-border); color: var(--xdt-text-secondary);
}
.xdt-inline-tip--info { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.xdt-inline-tip--warn { background: #fff7ed; border-color: #fed7aa; color: #9a3412; }

.xdt-content-card,
.data-card,
.oc-card {
  background: var(--xdt-card);
  border: 1px solid var(--xdt-border);
  border-radius: var(--xdt-radius);
  box-shadow: var(--xdt-shadow-sm);
  overflow: hidden;
  margin-bottom: 0;
}
.xdt-content-card > .xdt-filter-panel,
.xdt-content-card > .xdt-toolbar,
.data-card > .filter-bar,
.data-card > .xdt-toolbar { border-bottom: 1px solid #f1f5f9; }
.card {
  background: var(--xdt-card);
  border: 1px solid var(--xdt-border);
  border-radius: var(--xdt-radius);
  box-shadow: var(--xdt-shadow-sm);
  padding: 14px 16px;
}
.card-title { font-size: 15px; font-weight: 600; color: var(--xdt-text); margin-bottom: 10px; }

/* Tabs ? same language as order center */
.xdt-tabs,
.oc-tabs {
  display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 4px;
}
.xdt-tab,
.oc-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border: 1px solid #e5e7eb; border-radius: 8px;
  background: #fff; color: #475569; font-size: 13px; cursor: pointer; line-height: 1.2;
}
.xdt-tab:hover,
.oc-tab:hover { border-color: #93c5fd; color: #1d4ed8; }
.xdt-tab.active,
.oc-tab.active { background: var(--xdt-primary); border-color: var(--xdt-primary); color: #fff; }
.xdt-tab-badge,
.oc-tab-badge {
  min-width: 18px; padding: 0 6px; border-radius: 999px; font-size: 11px;
  background: rgba(15, 23, 42, 0.08); color: inherit;
}
.xdt-tab.active .xdt-tab-badge,
.oc-tab.active .oc-tab-badge { background: rgba(255, 255, 255, 0.22); }

.xdt-filter-panel {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 12px 14px; background: var(--xdt-card);
}
.xdt-filter-panel.xdt-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  flex-wrap: unset;
  border: 0;
  background: transparent;
}
.xdt-filter-panel .xdt-filter-grid { border: 0; padding: 0; background: transparent; }
.xdt-filter-panel input,
.xdt-filter-panel select,
.oc-filters input,
.oc-filters select {
  height: var(--xdt-input-h); border: 1px solid var(--xdt-border-strong);
  border-radius: var(--xdt-radius-sm); padding: 0 10px; font-size: 13px; background: #fff; min-width: 120px;
}
.xdt-filter-actions,
.oc-filters .oc-filter-actions {
  display: flex; gap: 6px; align-items: center; margin-left: auto; flex-wrap: wrap;
}
.oc-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.xdt-summary-grid,
.oc-stats,
.xdt-stat-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px;
}
.xdt-summary-card,
.oc-stat,
.xdt-stat-card {
  background: var(--xdt-card); border: 1px solid var(--xdt-border);
  border-radius: var(--xdt-radius); padding: 10px 12px; min-width: 0;
}
.xdt-summary-card .t,
.oc-stat .t,
.xdt-stat-card .lbl { font-size: 12px; color: var(--xdt-text-secondary); }
.xdt-summary-card .v,
.oc-stat .v,
.xdt-stat-card .val {
  font-size: 22px; font-weight: 700; color: var(--xdt-text); margin-top: 2px; letter-spacing: -0.02em;
}
.xdt-summary-card .s,
.oc-stat .s { font-size: 11px; color: var(--xdt-text-muted); margin-top: 4px; }

.xdt-table-wrap,
.oc-table-wrap,
.table-wrap.xdt-table-wrap { overflow-x: auto; border: 1px solid var(--xdt-border); border-radius: var(--xdt-radius); background: #fff; }
.xdt-table-wrap > table,
table.xdt-table,
.oc-table {
  width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12px;
}
.xdt-table-wrap th,
table.xdt-table th,
.oc-table th {
  background: #f8fafc; color: var(--xdt-text-secondary); font-weight: 600;
  text-align: left; padding: 10px 8px; border-bottom: 1px solid #e2e8f0; white-space: nowrap;
  height: auto; position: sticky; top: 0; z-index: 1;
}
.xdt-table-wrap td,
table.xdt-table td,
.oc-table td {
  padding: 10px 8px; border-bottom: 1px solid #f1f5f9; vertical-align: middle;
  color: #334155; min-height: var(--xdt-table-row-h);
}
.xdt-table-wrap tr:hover td,
.oc-table tr:hover td { background: var(--xdt-hover); }
.xdt-td-num, .oc-amt { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.xdt-mono, .oc-mono {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.xdt-empty, .empty { text-align: center; color: var(--xdt-text-muted); padding: 28px 12px !important; }

.xdt-badge, .oc-badge, .status-tag {
  display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 999px;
  font-size: 11px; font-weight: 600; line-height: 1.4; white-space: nowrap; border: 1px solid transparent;
}
.xdt-badge--ok, .oc-pay-ok, .status-success, .oc-chg-on { background: #ecfdf5; color: #047857; border-color: #bbf7d0; }
.xdt-badge--info, .oc-pay-wait, .oc-badge-type { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.xdt-badge--warn, .oc-pay-timeout, .oc-chg-warn { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
.xdt-badge--danger, .oc-pay-fail, .status-fail, .oc-chg-bad, .oc-pay-unk { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.xdt-badge--muted, .oc-pay-legacy, .oc-badge-type-hist, .oc-chg { background: #f1f5f9; color: #64748b; border-color: #e2e8f0; }
.xdt-badge--proc, .oc-pay-proc { background: #f5f3ff; color: #6d28d9; border-color: #ddd6fe; }
.oc-badge-type-test { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }

.xdt-ops, .oc-ops { display: flex; gap: 4px; align-items: center; white-space: nowrap; position: relative; }
.xdt-btn-sm-ops, .oc-btn, .xdt-btn--table {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 10px; border-radius: 6px; border: 1px solid #cbd5e1; background: #fff;
  color: #334155; font-size: 12px; cursor: pointer;
  height: 28px; min-height: 28px; max-height: 28px; line-height: 1;
  box-sizing: border-box; gap: 6px; white-space: nowrap;
}
.oc-btn-primary, .xdt-btn-sm-ops.primary, .xdt-btn--table.oc-btn-primary {
  border-color: #93c5fd; background: var(--xdt-primary-soft); color: #1d4ed8;
}
.xdt-ops .oc-btn[data-testid="btn-merchant-credentials"],
.xdt-ops .oc-btn.oc-btn--wide {
  padding-inline: 12px;
}
@media (max-width: 767px) {
  .xdt-btn-sm-ops, .oc-btn, .xdt-btn--table {
    min-height: 32px; height: 32px; max-height: 32px; padding-inline: 12px; font-size: 13px;
  }
}
.oc-more, .xdt-more { position: relative; display: inline-flex; }
/* Legacy in-table absolute menus (deprecated ? prefer XdtActionMenu portal) */
.oc-more-menu, .xdt-more-menu {
  position: absolute; right: 0; top: 100%; margin-top: 4px; min-width: 140px;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12); z-index: 20; padding: 4px;
  display: flex; flex-direction: column;
}
.oc-more-menu button, .xdt-more-menu button, .xdt-more-menu .xdt-more-item {
  text-align: left; border: 0; background: transparent; padding: 7px 10px;
  border-radius: 6px; font-size: 12px; cursor: pointer; color: #334155; width: 100%;
}
.oc-more-menu button:hover, .xdt-more-menu button:hover, .xdt-more-menu .xdt-more-item:hover { background: #f1f5f9; }
.xdt-more-item.danger { color: #b91c1c; }

/* Body-portal floating action menu ? not clipped by card/table overflow */
.xdt-action-menu {
  position: fixed;
  top: 0; left: 0;
  min-width: 148px;
  max-width: min(280px, calc(100vw - 16px));
  max-height: min(70vh, 420px);
  overflow-y: auto;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
  padding: 4px;
  display: none;
  flex-direction: column;
  z-index: 1100;
}
.xdt-action-menu__item {
  text-align: left; border: 0; background: transparent; padding: 7px 10px;
  border-radius: 6px; font-size: 12px; cursor: pointer; color: #334155; width: 100%;
  font-family: inherit; line-height: 1.35;
}
.xdt-action-menu__item:hover { background: #f1f5f9; }
.xdt-action-menu__item.is-danger { color: #b91c1c; }
.xdt-action-menu__divider { height: 1px; background: #f1f5f9; margin: 4px 0; }

/* Stable list card / table viewport (page-type opt-in) */
.xdt-list-card {
  display: flex;
  flex-direction: column;
  min-height: 420px;
  background: var(--xdt-card);
  border: 1px solid var(--xdt-border);
  border-radius: var(--xdt-radius);
  box-shadow: var(--xdt-shadow-sm);
  overflow: hidden;
}
.xdt-list-card__header {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 8px 10px; padding: 12px 14px; border-bottom: 1px solid #f1f5f9;
}
.xdt-list-card__header .card-title,
.xdt-list-card__title { margin: 0; font-size: 15px; font-weight: 600; color: var(--xdt-text); }
.xdt-list-card__hint { font-size: 12px; color: var(--xdt-text-secondary); margin: 0; padding: 0 14px 10px; line-height: 1.4; }
.xdt-list-card__body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.xdt-table-viewport {
  flex: 1;
  min-height: 260px;
  height: clamp(280px, calc(100vh - 430px), 620px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.xdt-list-card__footer {
  border-top: 1px solid #f1f5f9;
  padding: 0;
}
.xdt-list-card .xdt-table-wrap,
.xdt-list-card .table-wrap {
  border: 0;
  border-radius: 0;
  max-height: none;
  overflow: visible;
}
.xdt-list-card .xdt-table-viewport.xdt-table-wrap,
.xdt-list-card .xdt-table-viewport.table-wrap {
  overflow: auto;
}
@media (max-width: 1365px) {
  .xdt-list-card { min-height: 360px; }
  .xdt-table-viewport { min-height: 220px; height: clamp(240px, calc(100vh - 400px), 520px); }
}
@media (max-width: 767px) {
  .xdt-list-card { min-height: 0; }
  .xdt-table-viewport { min-height: 160px; height: auto; max-height: min(60vh, 420px); }
}

/* Compact page head card (primary list pages) */
.xdt-page-stack {
  display: flex;
  flex-direction: column;
  gap: var(--xdt-stack-gap);
  min-width: 0;
}
.xdt-page-stack > * { margin-top: 0; margin-bottom: 0; }
.xdt-page-head-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 16px 20px;
  min-height: 72px;
  max-height: 84px;
  background: var(--xdt-card);
  border: 1px solid var(--xdt-border);
  border-radius: 12px;
  box-shadow: var(--xdt-shadow-sm);
  box-sizing: border-box;
}
.xdt-page-head-card__main { min-width: 0; flex: 1 1 auto; }
.xdt-page-head-card__title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  line-height: 32px;
  color: var(--xdt-text);
  letter-spacing: -0.02em;
}
.xdt-page-head-card__subtitle {
  margin: 3px 0 0;
  font-size: 13px;
  line-height: 1.35;
  color: var(--xdt-text-secondary);
}
.xdt-page-head-card__actions {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-left: auto;
}
.xdt-page-head-card__meta {
  font-size: 12px; color: var(--xdt-text-muted); margin-top: 2px;
}
.xdt-page-stack > .xdt-inline-tip {
  min-height: 36px;
  max-height: 42px;
  align-items: center;
  padding: 8px 12px;
  overflow: hidden;
}
.xdt-page-stack > .xdt-tabs,
.xdt-page-stack > .oc-tabs { margin: 0; }
.xdt-page-stack > .xdt-summary-grid,
.xdt-page-stack > .oc-stats { margin: 0; }

/* Legacy page-header becomes compact when inside stack (fallback) */
.xdt-page-stack > .xdt-page-header,
.xdt-page-stack > .xdt-page-head {
  padding: 16px 20px;
  min-height: 72px;
  max-height: 84px;
  align-items: center;
  background: var(--xdt-card);
  border: 1px solid var(--xdt-border);
  border-radius: 12px;
  box-shadow: var(--xdt-shadow-sm);
  box-sizing: border-box;
}
.xdt-page-stack > .xdt-page-header .xdt-page-title,
.xdt-page-stack > .xdt-page-head .xdt-page-title {
  font-size: 22px; line-height: 32px;
}
.xdt-page-stack > .xdt-page-header .xdt-page-subtitle,
.xdt-page-stack > .xdt-page-head .xdt-page-subtitle,
.xdt-page-stack > .xdt-page-header .xdt-page-desc {
  margin-top: 3px; font-size: 13px;
}

.page-xdt-accounts .xdt-list-card__actions {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}
.page-xdt-accounts .xdt-list-card__actions .xdt-btn { height: var(--xdt-btn-h-compact); font-size: 13px; }

/* Strict equal stats cards (order center + shared summary) */
.xdt-summary-grid,
.oc-stats,
.xdt-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}
.xdt-summary-card,
.oc-stat,
.xdt-stat-card {
  height: var(--xdt-stat-h);
  min-height: var(--xdt-stat-h);
  max-height: var(--xdt-stat-h);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-sizing: border-box;
  margin: 0;
}
.xdt-summary-card .t,
.oc-stat .t,
.xdt-stat-card .lbl { font-size: 12px; margin: 0; color: var(--xdt-text-secondary); }
.xdt-summary-card .v,
.oc-stat .v,
.xdt-stat-card .val {
  font-size: 26px; font-weight: 700; margin-top: 4px; line-height: 1.15;
  letter-spacing: -0.02em; color: var(--xdt-text);
}
.xdt-summary-card .s,
.oc-stat .s {
  font-size: 11px; margin-top: 6px; color: var(--xdt-text-muted);
  white-space: normal; line-height: 1.35; overflow: hidden;
}
.page-order-center .oc-stat {
  min-height: calc(var(--xdt-stat-h) + 8px);
  max-height: none;
  height: auto;
}
.page-order-center.oc-page,
.page-order-center {
  display: flex; flex-direction: column; gap: var(--xdt-stack-gap);
}
.page-order-center .oc-card { margin: 0; padding: 12px 14px; }
.page-order-center .oc-filters { margin: 0; gap: 8px; }
.page-order-center .oc-stats { margin: 0; }
.page-order-center .oc-table-wrap { margin: 0; }
.page-order-center .btn.btn-search,
.page-order-center .btn.btn-reset,
.page-order-center .xdt-btn {
  height: 36px; padding: 0 16px; font-size: 14px; border-radius: 8px;
}
.page-funds .xdt-list-card,
.page-funds .xdt-table-viewport {
  min-height: 280px;
}
.page-funds .xdt-table-viewport .xdt-empty,
.page-funds .xdt-table-viewport .empty {
  height: 100%;
  min-height: 220px;
  vertical-align: middle;
}
@media (max-width: 1199px) {
  .xdt-summary-grid, .oc-stats, .xdt-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  .xdt-page-head-card { max-height: none; min-height: 0; }
  .xdt-summary-grid, .oc-stats, .xdt-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .xdt-summary-card, .oc-stat, .xdt-stat-card {
    height: auto; min-height: 88px; max-height: none;
  }
}
@media (max-width: 390px) {
  .xdt-summary-grid, .oc-stats, .xdt-stat-grid { grid-template-columns: 1fr; }
}

/* Sticky table header below floating menu */
.xdt-table-wrap th,
table.xdt-table th,
.oc-table th { z-index: 2; }

.xdt-pagination, .pagination {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 10px 14px; font-size: 12px; color: var(--xdt-text-secondary);
}
.xdt-pagination button, .pagination button {
  min-width: 28px; height: 28px; border: 1px solid var(--xdt-border-strong);
  border-radius: 6px; background: #fff; cursor: pointer; font-size: 12px;
}
.xdt-pagination button.active, .pagination button.active,
.xdt-pagination button.is-active {
  background: var(--xdt-primary); border-color: var(--xdt-primary); color: #fff;
}

.xdt-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 10px 14px; margin-bottom: 0;
}
.btn.btn-search, .oc-filters .btn-search,
.xdt-filter-actions .btn-search {
  height: var(--xdt-btn-h); padding: 0 16px; border: none; border-radius: 8px;
  background: var(--xdt-primary); color: #fff; cursor: pointer; font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box;
}
.btn.btn-reset, .oc-filters .btn-reset,
.xdt-filter-actions .btn-reset {
  height: var(--xdt-btn-h); padding: 0 16px; border: 1px solid var(--xdt-border-strong);
  border-radius: 8px; background: #fff; color: #475569; cursor: pointer; font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box;
}
.oc-filters .btn-refresh,
.btn.btn-refresh {
  height: var(--xdt-btn-h); padding: 0 16px; border: 1px solid #93c5fd;
  border-radius: 8px; background: #eff6ff; color: #1d4ed8; cursor: pointer; font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box;
}

/* Order-center specific leftovers shared */
.oc-page { background: transparent; }
.oc-id { width: 56px; color: var(--xdt-text-muted); font-variant-numeric: tabular-nums; }
.oc-mono-copy { cursor: pointer; }
.oc-mono-copy:hover { color: var(--xdt-primary); }
.oc-time { line-height: 1.25; white-space: nowrap; color: #475569; }
.oc-time .d { font-size: 12px; }
.oc-time .tm { font-size: 11px; color: var(--xdt-text-muted); }
.oc-h5 { white-space: normal; line-height: 1.35; max-width: 220px; }
.oc-h5 .r { font-size: 12px; color: #334155; word-break: break-all; }
.oc-h5 .ip { font-size: 11px; color: var(--xdt-text-muted); font-family: ui-monospace, Consolas, monospace; word-break: break-all; }
.oc-stat .s { white-space: normal; line-height: 1.35; }
.oc-exec { line-height: 1.35; min-width: 72px; }
.oc-exec-coder { font-size: 12px; color: #334155; white-space: nowrap; }
.oc-exec-member { font-size: 11px; color: #64748b; white-space: nowrap; margin-top: 2px; }
.oc-member-muted { color: #94a3b8; font-size: 12px; }
.oc-member-del {
  display: inline-flex; padding: 1px 6px; border-radius: 999px; font-size: 11px;
  background: #fff7ed; color: #9a3412; border: 1px solid #fed7aa;
}
.oc-member-login { display: block; font-size: 10px; color: #94a3b8; margin-top: 2px; }
.oc-member-cell { display: flex; flex-direction: column; gap: 2px; min-width: 0; line-height: 1.35; }
.oc-member-account { display: block; font-size: 11px; color: #94a3b8; white-space: nowrap; }
.oc-table.oc-table--fixed { table-layout: fixed; width: 100%; min-width: 1280px; }
.oc-table--fixed .oc-col-id { width: 56px; }
.oc-table--fixed .oc-col-type { width: 64px; }
.oc-table--fixed .oc-col-mch { width: 9%; }
.oc-table--fixed .oc-col-member { width: 10%; }
.oc-table--fixed .oc-col-mchno { width: 11%; }
.oc-table--fixed .oc-col-sys { width: 12%; }
.oc-table--fixed .oc-col-amt { width: 72px; }
.oc-table--fixed .oc-col-pay { width: 72px; }
.oc-table--fixed .oc-col-time { width: 84px; }
.oc-table--fixed .oc-col-charge { width: 72px; }
.oc-table--fixed .oc-col-ip { width: 140px; }
.oc-table--fixed .oc-col-ops { width: 88px; }
.oc-table.oc-table--fixed { min-width: 1360px; }
.od-account-value {
  display: flex; align-items: center; gap: 6px; min-width: 0;
}
.od-account-text { min-width: 0; word-break: break-all; }
.od-account-eye {
  flex-shrink: 0; width: 26px; height: 26px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid #e2e8f0; border-radius: 6px; background: #fff;
  color: #64748b; cursor: pointer;
}
.od-account-eye:hover { color: #2563eb; border-color: #93c5fd; background: #eff6ff; }
.od-account-eye:focus-visible { outline: 2px solid #93c5fd; outline-offset: 1px; }
.od-account-eye svg { width: 14px; height: 14px; display: block; }
.oc-table--fixed td.oc-col-ops,
.oc-table--fixed th:last-child,
.oc-table--fixed td:last-child { text-align: right; }
.oc-table--fixed .oc-ops { justify-content: flex-end; }
.oc-h5 .r--muted { color: #94a3b8; font-size: 11px; }
.oc-h5 .r--empty { color: #94a3b8; }

@media (max-width: 1199px) {
  .oc-table { min-width: 1100px; }
  .oc-table.oc-table--fixed { min-width: 1360px; }
}
@media (max-width: 768px) {
  .oc-filters .oc-filter-actions, .xdt-filter-actions { margin-left: 0; width: 100%; justify-content: flex-start; }
  .oc-table { min-width: 980px; }
  .oc-table.oc-table--fixed { min-width: 1280px; }
}
@media (max-width: 390px) {
  .xdt-tab, .oc-tab { padding: 5px 8px; font-size: 12px; }
}

/* Compact tip bar (single risk tip under page head) */
.xdt-page-stack > .xdt-inline-tip,
.xdt-inline-tip--compact {
  min-height: 34px; max-height: 38px; padding: 8px 12px;
  align-items: center; box-sizing: border-box;
}

/* Icons */
.xdt-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; flex: 0 0 20px; color: inherit;
}
.xdt-icon svg { display: block; width: 18px; height: 18px; }

/* Sidebar navigation (shared; overrides page-local emoji styles) */
.app-layout .sider .menu-item,
.app-layout .sider .menu-parent {
  display: flex; align-items: center; gap: 12px;
  height: 42px; padding: 0 14px; margin: 2px 10px;
  border-radius: 8px; font-size: 14px; font-weight: 400;
  color: #475569; position: relative; box-sizing: border-box;
  transition: background .12s, color .12s;
}
.app-layout .sider .menu-item:hover,
.app-layout .sider .menu-parent:hover {
  background: #f1f5f9; color: #1e293b;
}
.app-layout .sider .menu-item.active {
  background: #eff6ff; color: #1d4ed8; font-weight: 500;
  box-shadow: inset 3px 0 0 #2563eb;
}
.app-layout .sider .menu-item.sub {
  padding-left: 42px; height: 38px; font-size: 13px;
}
.app-layout .sider .menu-group {
  margin: 16px 18px 6px; font-size: 11px; font-weight: 500;
  color: #94a3b8; letter-spacing: 0.04em; text-transform: none;
}
.app-layout .sider .menu-parent .arrow {
  margin-left: auto; font-size: 10px; color: #94a3b8;
}
.app-layout .sider .logo .xdt-icon { color: #2563eb; }

/* Fixed table column language */
.xdt-table.xdt-table--fixed { table-layout: fixed; width: 100%; }
.xdt-table th, .xdt-table td,
table.xdt-table th, table.xdt-table td {
  padding: 10px 12px; vertical-align: middle; box-sizing: border-box;
}
.xdt-table td { padding-top: 11px; padding-bottom: 11px; }
.xdt-table th { height: 44px; }
.xdt-table tbody tr { height: 50px; }
.xdt-cell--mono, .xdt-cell--id {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.xdt-cell--number { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.xdt-cell--status { text-align: left; white-space: nowrap; }
.xdt-cell--actions { text-align: right; white-space: nowrap; }
.xdt-cell--actions .xdt-ops { justify-content: flex-end; }
.xdt-cell--truncate {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%;
}
.xdt-cell--two-line { line-height: 1.3; }
.xdt-cell--two-line .xdt-hint { margin-top: 2px; }

/* Page-specific col hints via col classes (owner-members widths refined later) */
.page-members col.c-owner-order { width: 120px; }
.page-members col.c-eff-order { width: 120px; }

.page-merchants col.c-name { width: 14%; }
.page-merchants col.c-dispatch { width: 10%; }
.page-merchants col.c-sys { width: 12%; }
.page-merchants col.c-role { width: 10%; }
.page-merchants col.c-admin { width: 9%; }
.page-merchants col.c-coder { width: 9%; }
.page-merchants col.c-weight { width: 6%; }
.page-merchants col.c-apps { width: 6%; }
.page-merchants col.c-today { width: 8%; }
.page-merchants col.c-date { width: 8%; }
.page-merchants col.c-ops { width: 18%; }

.page-applications col.c-app-name,
[data-testid="owner-apps-panel"] col.c-app-name,
[data-testid="merchant-apps-panel"] col.c-app-name { width: 16%; }
.page-applications col.c-appid,
[data-testid="owner-apps-panel"] col.c-appid,
[data-testid="merchant-apps-panel"] col.c-appid { width: 20%; }
.page-applications col.c-mch,
[data-testid="owner-apps-panel"] col.c-mch,
[data-testid="merchant-apps-panel"] col.c-mch { width: 12%; }
.page-applications col.c-status,
[data-testid="owner-apps-panel"] col.c-status,
[data-testid="merchant-apps-panel"] col.c-status { width: 9%; }
.page-applications col.c-secret,
[data-testid="owner-apps-panel"] col.c-secret,
[data-testid="merchant-apps-panel"] col.c-secret { width: 12%; }
.page-applications col.c-fp,
[data-testid="owner-apps-panel"] col.c-fp,
[data-testid="merchant-apps-panel"] col.c-fp { width: 12%; }
.page-applications col.c-updated,
[data-testid="owner-apps-panel"] col.c-updated,
[data-testid="merchant-apps-panel"] col.c-updated { width: 11%; }
.page-applications col.c-ops,
[data-testid="owner-apps-panel"] col.c-ops,
[data-testid="merchant-apps-panel"] col.c-ops { width: 12%; }

.page-piles col.c-member { width: 120px; }
.page-piles col.c-remark { width: 140px; }
.page-piles col.c-weight { width: 6%; }
.page-piles col.c-cooldown { width: 90px; }
.page-piles col.c-num { width: 80px; }
.page-piles col.c-health { width: 300px; }
.page-piles col.c-hook { width: 72px; }
.page-piles col.c-amt { width: 100px; }
.page-piles col.c-ops { width: 268px; }
.page-piles col.c-coder { width: 12%; }
.page-piles col.c-status { width: 7%; }
.page-piles col.c-date { width: 10%; }
.page-piles [data-testid="pile-sources-table"] { min-width: 1500px; width: 100%; table-layout: fixed; }
.page-piles [data-testid="admin-pile-sources-table"] { min-width: 1100px; }
.page-piles .xdt-cell--actions .xdt-ops { justify-content: flex-end; flex-wrap: nowrap; }

.page-xdt-accounts col.c-check,
[data-testid="page-owner-accounts"] col.c-check { width: 44px; }
.page-xdt-accounts col.c-mobile { width: 11%; }
.page-xdt-accounts col.c-remark { width: 9%; }
.page-xdt-accounts col.c-coder { width: 11%; }
.page-xdt-accounts col.c-member { width: 10%; }
.page-xdt-accounts col.c-charge { width: 8%; }
.page-xdt-accounts col.c-ended { width: 10%; }
.page-xdt-accounts col.c-status { width: 6%; }
.page-xdt-accounts col.c-en { width: 6%; }
.page-xdt-accounts col.c-expire { width: 10%; }
.page-xdt-accounts col.c-refresh { width: 9%; }
.page-xdt-accounts col.c-ops { width: 200px; }
.page-xdt-accounts [data-testid="admin-accounts-table"] { min-width: 1200px; }
.page-xdt-accounts .xdt-cell--actions .xdt-ops { justify-content: flex-end; flex-wrap: nowrap; }

[data-testid="page-owner-accounts"] [data-testid="member-dashboard-table"] {
  min-width: 1480px;
  width: 100%;
  table-layout: fixed;
}
[data-testid="page-owner-accounts"] col.c-md-name { width: 120px; }
[data-testid="page-owner-accounts"] col.c-md-weight { width: 64px; }
[data-testid="page-owner-accounts"] col.c-md-cd { width: 90px; }
[data-testid="page-owner-accounts"] col.c-md-stat { width: 100px; }
[data-testid="page-owner-accounts"] col.c-md-health { width: 420px; }
[data-testid="page-owner-accounts"] col.c-md-collect { width: 100px; }
[data-testid="page-owner-accounts"] col.c-md-date { width: 140px; }
[data-testid="page-owner-accounts"] col.c-md-ops { width: 160px; }
[data-testid="page-owner-accounts"] .xdt-cell--actions .xdt-ops { justify-content: flex-end; }
.app-layout.sider-collapsed .sider .menu-item > span:not(.xdt-icon),
.app-layout.sider-collapsed .sider .menu-parent > span:not(.xdt-icon):not(.arrow) {
  display: none;
}
.app-layout.sider-collapsed .sider .menu-group,
.app-layout.sider-collapsed .sider .menu-parent .arrow,
.app-layout.sider-collapsed .sider .logo h3 {
  display: none;
}
.app-layout.sider-collapsed .sider { width: 72px; }
.app-layout.sider-collapsed .header { left: 72px; }
.app-layout.sider-collapsed .main-content { margin-left: 72px; }
.app-layout.sider-collapsed .sider .menu-item,
.app-layout.sider-collapsed .sider .menu-parent {
  justify-content: center; padding: 0 10px; gap: 0; margin-left: 8px; margin-right: 8px;
}
.app-layout.sider-collapsed .sider .menu-item.sub { padding-left: 10px; }
.app-layout.sider-collapsed .sider .menu-item .xdt-icon { margin: 0; }
.app-layout.sider-collapsed .sider .menu-item[title]:hover::after,
.app-layout.sider-collapsed .sider .menu-parent[title]:hover::after {
  content: attr(title);
  position: absolute; left: calc(100% + 8px); top: 50%; transform: translateY(-50%);
  background: #0f172a; color: #fff; font-size: 12px; line-height: 1;
  padding: 6px 8px; border-radius: 6px; white-space: nowrap; z-index: 1200;
  pointer-events: none;
}

/* ===== Member account workbench (xdtMemberAccounts) ===== */
.page-member-accounts-workbench {
  display: flex;
  flex-direction: column;
  gap: var(--xdt-stack-gap, 12px);
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}
.page-member-accounts-workbench .xdt-summary-grid--5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
@media (max-width: 1199px) {
  .page-member-accounts-workbench .xdt-summary-grid--5 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 767px) {
  .page-member-accounts-workbench .xdt-summary-grid--5 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 390px) {
  .page-member-accounts-workbench .xdt-summary-grid--5 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.page-member-accounts-workbench .xdt-workbench-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  min-height: 52px;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid var(--xdt-border);
  border-radius: 12px;
  box-sizing: border-box;
}
.page-member-accounts-workbench .xdt-workbench-toolbar__left,
.page-member-accounts-workbench .xdt-workbench-toolbar__right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.page-member-accounts-workbench .xdt-workbench-toolbar__right { margin-left: auto; }
.page-member-accounts-workbench .xdt-selection-count {
  font-size: 13px;
  color: var(--xdt-text-secondary);
  padding: 0 4px;
}
.page-member-accounts-workbench .xdt-list-card {
  min-height: 320px;
}
.page-member-accounts-workbench .xdt-table-wrap {
  overflow-x: auto;
  overflow-y: auto;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}
.page-member-accounts-workbench table.xdt-account-workbench-table {
  min-width: 1620px;
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}
.page-member-accounts-workbench table.xdt-account-workbench-table th,
.page-member-accounts-workbench table.xdt-account-workbench-table td {
  vertical-align: middle;
  padding: 10px 12px;
  box-sizing: border-box;
}
.page-member-accounts-workbench table.xdt-account-workbench-table tbody tr {
  min-height: 60px;
}
.page-member-accounts-workbench table.xdt-account-workbench-table tbody td {
  height: 60px;
  min-height: 60px;
}
.xdt-cell-stack {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  max-width: 100%;
}
.xdt-cell-primary {
  display: block;
  font-size: 13px;
  line-height: 20px;
  color: var(--xdt-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.xdt-cell-secondary {
  display: block;
  font-size: 12px;
  line-height: 18px;
  color: var(--xdt-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.xdt-cell-secondary.is-warn { color: #d48806; }
.xdt-cell-secondary.is-danger { color: #cf1322; }
.xdt-cell-secondary.is-ok { color: #389e0d; }
.xdt-badge-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  max-width: 100%;
}
.page-member-accounts-workbench col.c-check { width: 44px; min-width: 44px; }
.page-member-accounts-workbench col.c-account { width: 148px; min-width: 140px; }
.page-member-accounts-workbench col.c-plate { width: 110px; min-width: 100px; }
.page-member-accounts-workbench col.c-token-st { width: 128px; min-width: 120px; }
.page-member-accounts-workbench col.c-token-exp { width: 210px; min-width: 190px; }
.page-member-accounts-workbench col.c-charge { width: 96px; min-width: 88px; }
.page-member-accounts-workbench col.c-last-end { width: 148px; min-width: 140px; }
.page-member-accounts-workbench col.c-cool { width: 120px; min-width: 110px; }
.page-member-accounts-workbench col.c-avail { width: 118px; min-width: 110px; }
.page-member-accounts-workbench col.c-today { width: 130px; min-width: 120px; }
.page-member-accounts-workbench col.c-ops { width: 132px; min-width: 120px; }
.page-member-accounts-workbench th.xdt-sticky-check,
.page-member-accounts-workbench td.xdt-sticky-check,
.page-member-accounts-workbench th.xdt-sticky-account,
.page-member-accounts-workbench td.xdt-sticky-account,
.page-member-accounts-workbench th.xdt-sticky-ops,
.page-member-accounts-workbench td.xdt-sticky-ops {
  position: sticky;
  background: #fff;
  z-index: 3;
}
.page-member-accounts-workbench thead th.xdt-sticky-check,
.page-member-accounts-workbench thead th.xdt-sticky-account,
.page-member-accounts-workbench thead th.xdt-sticky-ops {
  z-index: 5;
  background: #f8fafc;
}
.page-member-accounts-workbench th.xdt-sticky-check,
.page-member-accounts-workbench td.xdt-sticky-check {
  left: 0;
  text-align: center;
  box-shadow: 1px 0 0 #eef2f7;
}
.page-member-accounts-workbench th.xdt-sticky-account,
.page-member-accounts-workbench td.xdt-sticky-account {
  left: 44px;
  box-shadow: 1px 0 0 #eef2f7;
}
.page-member-accounts-workbench.no-owner-check th.xdt-sticky-account,
.page-member-accounts-workbench.no-owner-check td.xdt-sticky-account {
  left: 0;
}
.page-member-accounts-workbench th.xdt-sticky-ops,
.page-member-accounts-workbench td.xdt-sticky-ops {
  right: 0;
  box-shadow: -1px 0 0 #eef2f7;
  text-align: right;
}
.page-member-accounts-workbench tbody tr:hover td.xdt-sticky-check,
.page-member-accounts-workbench tbody tr:hover td.xdt-sticky-account,
.page-member-accounts-workbench tbody tr:hover td.xdt-sticky-ops {
  background: #f8fafc;
}
@media (max-width: 767px) {
  .page-member-accounts-workbench .xdt-workbench-toolbar__right { margin-left: 0; width: 100%; }
}

/* ===== Unassigned / pile detail / merchant table align ===== */
.page-unassigned-accounts-workbench.page-member-accounts-workbench,
[data-testid="unassigned-panel"].page-member-accounts-workbench {
  gap: 0;
}
.page-unassigned-accounts-workbench .xdt-workbench-toolbar {
  margin: 0 0 10px;
  border-radius: 10px;
}
/* legacy --6 kept for other pages; accounts/piles use --single-* below */
.page-pile-source-detail .xdt-pile-detail-table {
  min-width: 1480px;
  width: 100%;
  table-layout: fixed;
}
.page-pile-source-detail .xdt-pile-detail-table th,
.page-pile-source-detail .xdt-pile-detail-table td {
  vertical-align: middle;
  padding: 10px 12px;
}
.page-pile-source-detail .xdt-pile-detail-table tbody td {
  height: 56px;
  min-height: 56px;
}
.page-pile-source-detail col.c-pno { width: 140px; min-width: 120px; }
.page-pile-source-detail col.c-station { width: 140px; }
.page-pile-source-detail col.c-online { width: 120px; }
.page-pile-source-detail col.c-model { width: 110px; }
.page-pile-source-detail col.c-guns,
.page-pile-source-detail col.c-chg,
.page-pile-source-detail col.c-idle,
.page-pile-source-detail col.c-fault { width: 72px; }
.page-pile-source-detail col.c-en { width: 88px; }
.page-pile-source-detail col.c-sync,
.page-pile-source-detail col.c-created { width: 130px; min-width: 120px; }
.page-pile-source-detail col.c-ops { width: 132px; min-width: 120px; }
.page-pile-source-detail th.xdt-sticky-ops,
.page-pile-source-detail td.xdt-sticky-ops {
  position: sticky;
  right: 0;
  background: #fff;
  z-index: 3;
  box-shadow: -1px 0 0 #eef2f7;
}
.page-pile-source-detail thead th.xdt-sticky-ops { z-index: 5; background: #f8fafc; }
.page-pile-source-detail tbody tr:hover td.xdt-sticky-ops { background: #f8fafc; }

.page-merchants .xdt-merchant-workbench-table {
  min-width: 1500px;
  width: 100%;
  table-layout: fixed;
}
.page-merchants .xdt-merchant-workbench-table th,
.page-merchants .xdt-merchant-workbench-table td {
  vertical-align: middle;
  padding: 10px 12px;
}
.page-merchants .xdt-merchant-workbench-table tbody td {
  height: 58px;
  min-height: 58px;
}
.page-merchants col.c-name { width: 13%; }
.page-merchants col.c-dispatch { width: 10%; }
.page-merchants col.c-sys { width: 13%; }
.page-merchants col.c-role { width: 18%; min-width: 190px; }
.page-merchants col.c-order { width: 16%; min-width: 150px; }
.page-merchants col.c-weight { width: 7%; }
.page-merchants col.c-apps { width: 8%; }
.page-merchants col.c-today { width: 8%; }
.page-merchants col.c-date { width: 12%; }
.page-merchants col.c-ops { width: 220px; min-width: 200px; }
.page-merchants th.xdt-sticky-ops,
.page-merchants td.xdt-sticky-ops {
  position: sticky;
  right: 0;
  background: #fff;
  z-index: 3;
  box-shadow: -1px 0 0 #eef2f7;
  text-align: right;
}
.page-merchants thead th.xdt-sticky-ops { z-index: 5; background: #f8fafc; }
.page-merchants tbody tr:hover td.xdt-sticky-ops { background: #f8fafc; }
.page-merchants [data-testid="shop-permission-badges"] {
  max-width: 100%;
}

/* ===== Ops metrics cards: forced single row (accounts 6 / piles 7) ===== */
.xdt-metrics-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  margin: 0;
}
.xdt-metrics-scroll::-webkit-scrollbar { height: 6px; }
.page-xdt-accounts .xdt-accounts-metrics,
.page-piles .xdt-piles-metrics {
  display: grid !important;
  grid-auto-flow: row;
  gap: 10px;
  margin: 0;
  width: max(100%, calc(6 * 150px + 5 * 10px));
  min-width: 100%;
  align-items: stretch;
}
.page-xdt-accounts .xdt-accounts-metrics {
  grid-template-columns: repeat(6, minmax(150px, 1fr)) !important;
}
.page-piles .xdt-piles-metrics {
  width: max(100%, calc(7 * 140px + 6 * 10px));
  grid-template-columns: repeat(7, minmax(140px, 1fr)) !important;
}
/* Defeat global summary-grid wrap breakpoints for these pages */
@media (max-width: 1920px), (max-width: 1600px), (max-width: 1366px), (max-width: 1199px), (max-width: 767px), (max-width: 390px) {
  .page-xdt-accounts .xdt-accounts-metrics {
    grid-template-columns: repeat(6, minmax(150px, 1fr)) !important;
  }
  .page-piles .xdt-piles-metrics {
    grid-template-columns: repeat(7, minmax(140px, 1fr)) !important;
  }
}
.xdt-metric-card {
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--xdt-stat-h, 88px);
  min-height: var(--xdt-stat-h, 88px);
  max-height: var(--xdt-stat-h, 88px);
  padding: 12px 12px;
  background: var(--xdt-card, #fff);
  border: 1px solid var(--xdt-border, #e8edf5);
  border-radius: var(--xdt-radius, 10px);
  box-sizing: border-box;
  min-width: 0;
}
.page-piles .xdt-metric-card {
  padding: 10px 10px;
  gap: 8px;
}
.xdt-metric-card__icon {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #475569;
  background: #f1f5f9;
}
.page-piles .xdt-metric-card__icon {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
}
.xdt-metric-card__icon .xdt-icon svg,
.xdt-metric-card__icon svg { width: 16px; height: 16px; }
.xdt-metric-card__icon--members { background: #eff6ff; color: #2563eb; }
.xdt-metric-card__icon--total { background: #f8fafc; color: #475569; }
.xdt-metric-card__icon--avail { background: #ecfdf5; color: #059669; }
.xdt-metric-card__icon--charge { background: #eff6ff; color: #2563eb; }
.xdt-metric-card__icon--cool { background: #f5f3ff; color: #7c3aed; }
.xdt-metric-card__icon--occupied { background: #fff7ed; color: #c2410c; }
.xdt-metric-card__icon--reauth { background: #fef2f2; color: #dc2626; }
.xdt-metric-card__icon--source { background: #eff6ff; color: #2563eb; }
.xdt-metric-card__icon--pile { background: #f8fafc; color: #475569; }
.xdt-metric-card__icon--gun { background: #ecfeff; color: #0891b2; }
.xdt-metric-card__icon--fault { background: #fff7ed; color: #c2410c; }
.xdt-metric-card__body { min-width: 0; flex: 1; }
.xdt-metric-card__body .t {
  font-size: 12px;
  color: var(--xdt-text-secondary, #64748b);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.xdt-metric-card__body .v {
  margin-top: 4px;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  color: var(--xdt-text, #0f172a);
}

.xdt-health-cell {
  min-width: 0;
  max-width: none;
  overflow: hidden;
}
.xdt-health-inline {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 12px;
  white-space: nowrap;
  font-size: 12px;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
  color: #475569;
  font-weight: 400;
}
.xdt-health-inline strong {
  color: #0f172a;
  font-weight: 600;
}
/* legacy nums class kept as single-line for any residual markup */
.xdt-health-cell__nums {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 12px;
  white-space: nowrap;
  font-size: 12px;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
  color: #475569;
}
.xdt-health-cell__nums b { color: #0f172a; font-weight: 600; }
.xdt-health-bar {
  display: flex;
  width: 100%;
  max-width: var(--xdt-health-bar-max-width);
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: #eef2f7;
  margin-top: 8px;
  box-sizing: border-box;
}
.xdt-health-bar > span {
  display: block;
  height: 100%;
  min-width: 0;
}
.xdt-health-bar__avail { background: #22c55e; }
.xdt-health-bar__charge { background: #3b82f6; }
.xdt-health-bar__cool { background: #8b5cf6; }
.xdt-health-bar__abnormal,
.xdt-health-bar__fault { background: #ef4444; }
.page-xdt-accounts .xdt-td-num,
.page-piles .xdt-td-num,
.page-members .xdt-td-num { font-variant-numeric: tabular-nums; text-align: right; }
.page-xdt-accounts [data-testid="member-dashboard-table"] th.xdt-td-num,
.page-piles [data-testid="pile-sources-table"] th.xdt-td-num,
.page-members [data-testid="owner-members-table"] th.xdt-td-num { text-align: right; }
.page-xdt-accounts [data-testid="member-dashboard-table"] th.xdt-cell--actions,
.page-xdt-accounts [data-testid="member-dashboard-table"] td.xdt-cell--actions,
.page-piles [data-testid="pile-sources-table"] th.xdt-cell--actions,
.page-piles [data-testid="pile-sources-table"] td.xdt-cell--actions,
.page-members [data-testid="owner-members-table"] th.xdt-cell--actions,
.page-members [data-testid="owner-members-table"] td.xdt-cell--actions { text-align: right; }
.page-xdt-accounts [data-testid="member-dashboard-table"] th,
.page-xdt-accounts [data-testid="member-dashboard-table"] td,
.page-piles [data-testid="pile-sources-table"] th,
.page-piles [data-testid="pile-sources-table"] td,
.page-members [data-testid="owner-members-table"] th,
.page-members [data-testid="owner-members-table"] td {
  vertical-align: middle;
  box-sizing: border-box;
}
.page-xdt-accounts col.c-md-health { width: 420px; }
.page-piles col.c-health { width: 300px; }
.page-piles col.c-ops { width: 268px; }
.page-xdt-accounts col.c-md-ops { width: 160px; }
.page-members [data-testid="owner-members-table"] { min-width: 1200px; width: 100%; table-layout: fixed; }
.page-members col.c-member { width: 140px; }
.page-members col.c-login { width: 120px; }
.page-members col.c-status { width: 72px; }
.page-members col.c-weight { width: 80px; }
.page-members col.c-amount { width: 220px; }
.page-members col.c-owner-order { width: 120px; }
.page-members col.c-eff-order { width: 120px; }
.page-members col.c-ops { width: 160px; }
.xdt-inline-edit {
  color: inherit;
  text-decoration: underline dotted;
  text-underline-offset: 2px;
  cursor: pointer;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.xdt-inline-edit:hover {
  color: #2563eb;
}
.xdt-inline-num {
  width: 78px;
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--xdt-border-strong, #d9d9d9);
  border-radius: 6px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  box-sizing: border-box;
  vertical-align: middle;
}
.xdt-amount-range {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  white-space: nowrap;
}
.xdt-amount-range input.xdt-inline-num { width: 96px; }
.xdt-amount-range__sep { color: #94a3b8; font-size: 12px; }
.xdt-inline-save {
  display: inline-block;
  margin-left: 6px;
  font-size: 11px;
  color: #64748b;
  min-width: 36px;
  white-space: nowrap;
}
.xdt-inline-save.ok { color: #059669; }
.xdt-inline-save.err { color: #dc2626; }
