/* ═══════════════════════════════════════════
   Ant Design Pro-style Theme
   ═══════════════════════════════════════════ */

:root {
  --primary: #1890ff;
  --primary-hover: #40a9ff;
  --primary-active: #096dd9;
  --success: #52c41a;
  --warning: #faad14;
  --error: #ff4d4f;
  --info: #1890ff;

  --sidebar-bg: #001529;
  --sidebar-width: 220px;
  --sidebar-menu-active: #1890ff;
  --sidebar-text: rgba(255,255,255,0.65);
  --sidebar-text-active: #fff;

  --header-height: 48px;
  --header-bg: #001529;

  --body-bg: #f0f2f5;
  --card-bg: #fff;
  --card-radius: 6px;
  --card-shadow: 0 1px 2px 0 rgba(0,0,0,0.03), 0 1px 6px -1px rgba(0,0,0,0.02), 0 2px 4px 0 rgba(0,0,0,0.02);

  --text-primary: rgba(0,0,0,0.88);
  --text-secondary: rgba(0,0,0,0.45);
  --border-color: #f0f0f0;

  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
}

/* ── Reset & Base ── */
* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-family);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--body-bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }

/* ── Layout ── */
.ant-layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ── */
.ant-sider {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 100;
  transition: width 0.2s;
}

.ant-sider-logo {
  height: 48px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  background: rgba(255,255,255,0.05);
}

.ant-sider-logo h1 {
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
}

.ant-sider-logo .logo-icon {
  width: 28px;
  height: 28px;
  background: var(--primary);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: bold;
  font-size: 14px;
  margin-right: 10px;
  flex-shrink: 0;
}

/* ── Sidebar Menu ── */
.ant-menu {
  list-style: none;
  padding: 4px 0;
  margin: 0;
}

.ant-menu-item {
  margin: 2px 8px;
  border-radius: 6px;
  transition: all 0.2s;
}

.ant-menu-item a {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  color: var(--sidebar-text);
  font-size: 14px;
  border-radius: 6px;
  transition: all 0.2s;
  text-decoration: none;
}

.ant-menu-item a:hover {
  color: #fff;
  background: rgba(255,255,255,0.06);
}

.ant-menu-item.active a {
  color: var(--sidebar-text-active);
  background: var(--sidebar-menu-active);
  font-weight: 500;
}

.ant-menu-item .menu-icon {
  font-size: 16px;
  margin-right: 10px;
  width: 16px;
  text-align: center;
}

/* ── Main Content Area ── */
.ant-layout-main {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Header ── */
.ant-header {
  height: var(--header-height);
  background: var(--header-bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.ant-header-title {
  color: rgba(255,255,255,0.85);
  font-size: 15px;
  font-weight: 500;
}

.ant-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(255,255,255,0.65);
  font-size: 13px;
}

.ant-header-right .user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

/* ── Page Content ── */
.ant-content {
  flex: 1;
  padding: 20px 24px;
}

/* ── Page Header ── */
.ant-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.ant-page-header h4 {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  color: var(--text-primary);
}

/* ── Footer ── */
.ant-footer {
  text-align: center;
  padding: 16px 24px;
  color: var(--text-secondary);
  font-size: 12px;
}

/* ── Cards ── */
.ant-card {
  background: var(--card-bg);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  border: none;
}

.card {
  background: var(--card-bg);
  border: none;
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
}

.card-header {
  background: #fff;
  border-bottom: 1px solid var(--border-color);
  padding: 12px 20px;
}

.card-body {
  padding: 16px 20px;
}

/* ── Tables (Ant Design style) ── */
.table {
  margin-bottom: 0;
  font-size: 14px;
}

.table > thead > tr > th {
  background: #fafafa;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 13px;
  padding: 12px 16px;
  white-space: nowrap;
}

.table > tbody > tr > td {
  border-bottom: 1px solid var(--border-color);
  padding: 12px 16px;
  vertical-align: middle;
  color: var(--text-primary);
}

.table > tbody > tr:last-child > td {
  border-bottom: none;
}

.table-hover > tbody > tr:hover > td {
  background: #fafafa;
}

.table > tfoot > tr > td {
  background: #fafafa;
  border-top: 1px solid var(--border-color);
  padding: 12px 16px;
  font-weight: 600;
}

/* Remove Bootstrap table-light override */
.table-light, .table-light > th, .table-light > td {
  background: #fafafa !important;
}

/* Warning row for missing prices */
.table .row-warning > td {
  background: #fffbe6;
}
.table > tbody > tr.table-warning > td {
  background: #fffbe6;
}

/* ── Buttons (Ant Design style) ── */
.btn {
  border-radius: 6px;
  font-size: 14px;
  font-weight: 400;
  padding: 4px 16px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.3s cubic-bezier(0.645,0.045,0.355,1);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 0 rgba(0,0,0,0.02);
}

.btn-sm {
  height: 30px;
  padding: 2px 12px;
  font-size: 13px;
}

.btn-primary {
  background: linear-gradient(135deg, #1890ff 0%, #096dd9 100%);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 2px 6px rgba(24,144,255,0.35);
}
.btn-primary:hover, .btn-primary:focus {
  background: linear-gradient(135deg, #40a9ff 0%, #1890ff 100%);
  border-color: var(--primary-hover);
  color: #fff;
  box-shadow: 0 4px 12px rgba(24,144,255,0.4);
  transform: translateY(-1px);
}
.btn-primary:active {
  background: var(--primary-active);
  transform: translateY(0);
}

.btn-success {
  background: linear-gradient(135deg, #52c41a 0%, #389e0d 100%);
  border-color: var(--success);
  color: #fff;
  box-shadow: 0 2px 6px rgba(82,196,26,0.35);
}
.btn-success:hover, .btn-success:focus {
  background: linear-gradient(135deg, #73d13d 0%, #52c41a 100%);
  border-color: #73d13d;
  color: #fff;
  box-shadow: 0 4px 12px rgba(82,196,26,0.4);
  transform: translateY(-1px);
}

.btn-info {
  background: linear-gradient(135deg, #1890ff 0%, #096dd9 100%);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 2px 6px rgba(24,144,255,0.35);
}

.btn-outline-primary {
  color: var(--primary);
  border-color: var(--primary);
  background: #fff;
}
.btn-outline-primary:hover {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 2px 6px rgba(24,144,255,0.35);
}

.btn-outline-secondary {
  color: var(--text-primary);
  border-color: #d9d9d9;
  background: #fff;
}
.btn-outline-secondary:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: #fff;
}

.btn-outline-success {
  color: var(--success);
  border-color: var(--success);
  background: #fff;
}
.btn-outline-success:hover {
  color: #fff;
  background: var(--success);
  box-shadow: 0 2px 6px rgba(82,196,26,0.35);
}

.btn-outline-danger {
  color: var(--error);
  border-color: var(--error);
  background: #fff;
}
.btn-outline-danger:hover {
  color: #fff;
  background: var(--error);
  border-color: var(--error);
  box-shadow: 0 2px 6px rgba(255,77,79,0.35);
}

.btn-outline-warning {
  color: var(--warning);
  border-color: var(--warning);
  background: #fff;
}
.btn-outline-warning:hover {
  color: #fff;
  background: var(--warning);
  border-color: var(--warning);
}

/* ── Form Controls (Ant Design style) ── */
.form-control,
.form-select {
  border-radius: 8px;
  border: 1px solid #d9d9d9;
  font-size: 14px;
  padding: 6px 12px;
  height: 36px;
  transition: all 0.3s cubic-bezier(0.645,0.045,0.355,1);
  color: var(--text-primary);
  background: #fff;
}

.form-control:hover,
.form-select:hover {
  border-color: var(--primary);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(24,144,255,0.12);
  outline: none;
}

.form-control::placeholder {
  color: #bfbfbf;
}

.form-control-sm,
.form-select-sm {
  height: 30px;
  font-size: 13px;
  padding: 4px 10px;
  border-radius: 6px;
}

.form-label {
  font-size: 13px;
  color: var(--text-primary);
  margin-bottom: 4px;
  font-weight: 500;
}

.input-group-text {
  border-radius: 8px 0 0 8px;
  border: 1px solid #d9d9d9;
  background: #fafafa;
  font-size: 13px;
  padding: 4px 10px;
  color: var(--text-secondary);
  height: 36px;
  display: flex;
  align-items: center;
}

.input-group .form-control {
  border-radius: 0 8px 8px 0;
}

.input-group-sm .input-group-text {
  height: 30px;
  border-radius: 6px 0 0 6px;
  padding: 2px 8px;
}

.input-group-sm .form-control {
  border-radius: 0 6px 6px 0;
}

/* ── Ant Design style Search Input ── */
.ant-input-search {
  position: relative;
  display: flex;
  align-items: center;
}

.ant-input-search .form-control {
  padding-left: 36px;
  padding-right: 64px;
  border-radius: 8px 0 0 8px;
  height: 36px;
  border-right: none;
}

.ant-input-search .form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(24,144,255,0.12);
  z-index: 1;
}

.ant-input-search-icon {
  position: absolute;
  left: 12px;
  color: #bfbfbf;
  font-size: 14px;
  pointer-events: none;
  z-index: 2;
}

.ant-input-clear {
  position: absolute;
  right: 44px;
  color: #bfbfbf;
  font-size: 13px;
  cursor: pointer;
  z-index: 2;
  transition: color 0.2s;
}
.ant-input-clear:hover { color: var(--text-primary); }

.ant-input-search-btn {
  height: 36px;
  width: 36px;
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #fff;
  border-radius: 0 8px 8px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  flex-shrink: 0;
  transition: background 0.2s;
}
.ant-input-search-btn:hover { background: var(--primary-hover); }

/* ── Filter bar (card style) ── */
.filter-bar {
  background: #fff;
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  padding: 16px 20px;
  margin-bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.filter-bar .form-control,
.filter-bar .form-select {
  height: 36px;
  border-radius: 8px;
}

/* ── Page header with actions ── */
.ant-page-header .header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ant-page-header .header-extra {
  font-size: 14px;
  color: var(--text-secondary);
}

/* ── Badges (Ant Design Tag style) ── */
.badge {
  font-weight: 400;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 4px;
  line-height: 1.5;
}

.bg-primary { background-color: var(--primary) !important; }
.bg-success { background-color: var(--success) !important; }
.bg-warning {
  background-color: #fffbe6 !important;
  color: #d48806 !important;
  border: 1px solid #ffe58f;
}
.bg-info {
  background-color: #e6f7ff !important;
  color: #0958d9 !important;
  border: 1px solid #91caff;
}
.bg-secondary {
  background-color: #fafafa !important;
  color: var(--text-secondary) !important;
  border: 1px solid #d9d9d9;
}
.bg-pink {
  background-color: #eb2f96 !important;
  color: #fff !important;
}

/* ── Alerts (Ant Design style) ── */
.alert {
  border-radius: 6px;
  border: 1px solid;
  padding: 8px 16px;
  font-size: 14px;
  margin-bottom: 16px;
}

.alert-success {
  background: #f6ffed;
  border-color: #b7eb8f;
  color: #135200;
}

.alert-danger {
  background: #fff2f0;
  border-color: #ffccc7;
  color: #a8071a;
}

.alert-warning {
  background: #fffbe6;
  border-color: #ffe58f;
  color: #614700;
}

.alert-info {
  background: #e6f7ff;
  border-color: #91caff;
  color: #003eb3;
}

/* ── Pagination (Ant Design style) ── */
.pagination {
  gap: 4px;
  margin: 16px 0;
}

.page-item .page-link {
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 13px;
  min-width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  transition: all 0.2s;
}

.page-item .page-link:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: #fff;
}

.page-item.active .page-link {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.page-item.disabled .page-link {
  color: rgba(0,0,0,0.25);
  border-color: #d9d9d9;
  background: #fff;
}

/* ── Statistics Cards (Dashboard) ── */
.stat-card {
  background: #fff;
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  padding: 20px;
  text-align: center;
}

.stat-card .stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.stat-card .stat-value {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 4px;
}

.stat-card .stat-value.text-blue { color: var(--primary); }
.stat-card .stat-value.text-green { color: var(--success); }
.stat-card .stat-value.text-orange { color: var(--warning); }

.stat-card .stat-desc {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ── Products Table ── */
.products-table {
  table-layout: fixed;
  width: 100%;
}

.products-table > thead > tr > th {
  padding: 10px 8px;
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
}

.products-table > tbody > tr > td {
  padding: 8px;
  vertical-align: middle;
}

/* Column widths */
.products-table .col-product { width: auto; min-width: 180px; }
.products-table .col-supplier { width: 70px; }
.products-table .col-billing-name { width: 140px; }
.products-table .col-price { width: 80px; }
.products-table .col-edit-price { width: 100px; }
.products-table .col-upstream { width: 100px; }
.products-table .col-action { width: 44px; text-align: center; }

/* Product info cell: single line with ellipsis */
.product-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.product-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.4;
}

.product-code {
  font-size: 11px;
  color: var(--text-secondary);
  font-family: 'SF Mono', Monaco, Consolas, monospace;
  line-height: 1.2;
}

/* Price display cells */
.price-cell {
  font-size: 13px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

/* Compact inline inputs */
.products-table .form-control-sm,
.products-table .form-select-sm {
  height: 28px;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 6px;
}

.products-table .price-input {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.products-table .edit-billing-name {
  font-size: 12px;
}

/* Save button compact */
.btn-save-row {
  width: 28px;
  height: 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

/* Row without custom price: subtle left border indicator */
.products-table .row-no-price > td:first-child {
  box-shadow: inset 3px 0 0 var(--warning);
}

/* Row changed indicator */
.products-table .row-changed > td:first-child {
  box-shadow: inset 3px 0 0 var(--primary);
}

/* ── Cursor ── */
.cursor-pointer { cursor: pointer; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .ant-sider {
    transform: translateX(-100%);
    position: fixed;
    z-index: 200;
  }
  .ant-sider.open {
    transform: translateX(0);
  }
  .ant-layout-main {
    margin-left: 0;
  }
}

/* ── Filter bar ── */
.filter-bar {
  background: #fff;
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  padding: 16px 20px;
  margin-bottom: 16px;
}

/* ── Text helpers ── */
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger, .text-error { color: var(--error) !important; }

/* ── Scrollbar ── */
.ant-sider::-webkit-scrollbar {
  width: 6px;
}
.ant-sider::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.15);
  border-radius: 3px;
}

/* ── Flatpickr / Date picker (Ant Design style) ── */
.flatpickr-input {
  cursor: pointer !important;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23bfbfbf' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 0a.5.5 0 0 1 .5.5V1h8V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5a.5.5 0 0 1 .5-.5M1 4v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4z'/%3E%3C/svg%3E") no-repeat right 10px center !important;
  padding-right: 34px !important;
}

.flatpickr-input::placeholder {
  color: #bfbfbf !important;
}

/* Calendar dropdown */
.flatpickr-calendar {
  border-radius: 8px !important;
  box-shadow: 0 6px 16px 0 rgba(0,0,0,0.08), 0 3px 6px -4px rgba(0,0,0,0.12), 0 9px 28px 8px rgba(0,0,0,0.05) !important;
  border: 1px solid #f0f0f0 !important;
  font-family: var(--font-family) !important;
  overflow: hidden;
  padding: 0 !important;
  width: 320px !important;
}

.flatpickr-calendar.open {
  z-index: 9999 !important;
}

/* Month navigation */
.flatpickr-months {
  background: #fff !important;
  padding: 8px 8px 0 !important;
}

.flatpickr-months .flatpickr-month {
  height: 36px !important;
}

.flatpickr-current-month {
  font-size: 14px !important;
  font-weight: 600 !important;
  color: var(--text-primary) !important;
  padding-top: 4px !important;
}

.flatpickr-current-month .flatpickr-monthDropdown-months {
  font-weight: 600 !important;
  font-size: 14px !important;
  color: var(--text-primary) !important;
  background: transparent !important;
  appearance: none !important;
  -webkit-appearance: none !important;
}

.flatpickr-current-month input.cur-year {
  font-weight: 600 !important;
  font-size: 14px !important;
  color: var(--text-primary) !important;
}

.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
  padding: 6px 10px !important;
  fill: var(--text-secondary) !important;
  transition: all 0.2s !important;
}

.flatpickr-months .flatpickr-prev-month:hover,
.flatpickr-months .flatpickr-next-month:hover {
  fill: var(--primary) !important;
  background: #e6f7ff !important;
  border-radius: 4px !important;
}

.flatpickr-months .flatpickr-prev-month svg,
.flatpickr-months .flatpickr-next-month svg {
  width: 12px !important;
  height: 12px !important;
}

/* Weekday headers */
.flatpickr-weekdays {
  background: #fff !important;
  padding: 0 12px !important;
}

span.flatpickr-weekday {
  color: var(--text-secondary) !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  background: transparent !important;
}

/* Day cells */
.flatpickr-innerContainer {
  padding: 0 8px 8px !important;
}

.flatpickr-days {
  border: none !important;
}

.dayContainer {
  min-width: 304px !important;
  max-width: 304px !important;
}

.flatpickr-day {
  color: var(--text-primary) !important;
  font-size: 13px !important;
  border-radius: 6px !important;
  height: 34px !important;
  line-height: 34px !important;
  max-width: 40px !important;
  margin: 1px !important;
  border: 1px solid transparent !important;
  transition: all 0.15s !important;
}

.flatpickr-day:hover {
  background: #e6f7ff !important;
  border-color: var(--primary) !important;
  color: var(--primary) !important;
}

.flatpickr-day.today {
  border-color: var(--primary) !important;
  color: var(--primary) !important;
  font-weight: 600 !important;
  background: transparent !important;
}

.flatpickr-day.today:hover {
  background: #e6f7ff !important;
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: #fff !important;
  font-weight: 500 !important;
}

.flatpickr-day.selected:hover,
.flatpickr-day.startRange:hover,
.flatpickr-day.endRange:hover {
  background: var(--primary-hover) !important;
  border-color: var(--primary-hover) !important;
}

.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
  color: rgba(0,0,0,0.25) !important;
}

.flatpickr-day.flatpickr-disabled,
.flatpickr-day.flatpickr-disabled:hover {
  color: rgba(0,0,0,0.15) !important;
  background: transparent !important;
  border-color: transparent !important;
}

/* Date input wrapper with icon */
.date-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.date-input-wrap .date-icon {
  position: absolute;
  left: 10px;
  color: #bfbfbf;
  font-size: 14px;
  pointer-events: none;
  z-index: 1;
}

.date-input-wrap .form-control {
  padding-left: 32px;
  padding-right: 10px;
  background-image: none !important;
}

/* ── MOFA products table ── */
/* Columns: 1:ID 2:SKU 3:名称 4:分类 5:mofa零售 6:mofa成本 7:万国供货 8:万国零售 9:供货商利润 10:万国利润 11:发货仓 12:库存 13:保质期 14:同步 */
.mofa-table { table-layout: fixed; width: 100%; }
.mofa-table > thead > tr > th { padding: 10px 3px; font-size: 11px; color: var(--text-secondary); font-weight: 600; }
.mofa-table > tbody > tr > td { padding: 7px 3px; vertical-align: middle; font-size: 12px; }
.mofa-table > thead > tr > th:nth-child(1) { width: 42px; }
.mofa-table > thead > tr > th:nth-child(2) { width: 68px; }
.mofa-table .col-mofa-name { width: 17%; }
.mofa-table > thead > tr > th:nth-child(4) { width: 48px; }
.mofa-table > thead > tr > th:nth-child(5) { width: 64px; }
.mofa-table > thead > tr > th:nth-child(6) { width: 64px; }
.mofa-table .col-wanguo { width: 86px; }
.mofa-table > thead > tr > th:nth-child(8) { width: 82px; }
.mofa-table > thead > tr > th:nth-child(9) { width: 54px; }
.mofa-table > thead > tr > th:nth-child(10) { width: 54px; }
.mofa-table > thead > tr > th:nth-child(11) { width: 72px; }
.mofa-table > thead > tr > th:nth-child(12) { width: 36px; }
.mofa-table > thead > tr > th:nth-child(13) { width: 52px; }
.mofa-table > thead > tr > th:nth-child(14) { width: 52px; }
.mofa-table .row-out-of-stock { opacity: 0.5; }
.mofa-table code { font-size: 11px; color: var(--text-secondary); word-break: break-all; }
.mofa-table .product-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.4; }

/* 利润 cell */
.profit-cell { font-size: 13px; font-variant-numeric: tabular-nums; color: #389e0d; font-weight: 500; white-space: nowrap; }

/* 万国零售价 cell */
.retail-optimized { font-size: 13px; font-variant-numeric: tabular-nums; color: #531dab; font-weight: 500; white-space: nowrap; }
.retail-diff { font-size: 10px; color: #cf1322; }

/* 万国供货价 cell */
.wanguo-cell { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.wanguo-price { font-size: 13px; font-variant-numeric: tabular-nums; color: #cf1322; font-weight: 500; }
.wanguo-markup-display {
  font-size: 11px; color: var(--primary); cursor: pointer;
  padding: 0 4px; border-radius: 3px; transition: background 0.2s;
}
.wanguo-markup-display:hover { background: #e6f7ff; }

/* Markup popover */
.markup-popover {
  background: #fff; border-radius: 8px; padding: 12px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.08), 0 3px 6px -4px rgba(0,0,0,0.12);
  border: 1px solid #f0f0f0; width: 180px;
}
.markup-popover-title { font-size: 12px; color: var(--text-secondary); margin-bottom: 8px; }
.markup-popover-body .input-group { margin-bottom: 8px; }
.markup-popover-actions { display: flex; gap: 6px; justify-content: flex-end; }
.markup-popover-actions .btn { height: 26px; font-size: 12px; padding: 0 10px; }

/* ── Ant Design Pagination ── */
.ant-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 0;
  font-size: 13px;
  color: var(--text-primary);
  flex-wrap: wrap;
}

.ant-pagination-total {
  color: var(--text-secondary);
  margin-right: 4px;
  white-space: nowrap;
}

.ant-pagination-pages {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.ant-pagination-item {
  display: flex;
  align-items: center;
  justify-content: center;
}

.ant-pagination-item a,
.ant-pagination-item span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 4px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 13px;
  transition: all 0.15s;
  cursor: pointer;
  background: #fff;
}

.ant-pagination-item a:hover {
  color: var(--primary);
  border-color: var(--primary);
}

.ant-pagination-item.active a {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 500;
}

.ant-pagination-item.disabled a,
.ant-pagination-item.disabled span {
  color: rgba(0,0,0,0.25);
  border-color: var(--border);
  cursor: not-allowed;
  pointer-events: none;
}

.ant-pagination-size {
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 13px;
  color: var(--text-primary);
  background: #fff;
  cursor: pointer;
  outline: none;
}

.ant-pagination-size:hover,
.ant-pagination-size:focus {
  border-color: var(--primary);
  color: var(--primary);
}

.ant-pagination-jump {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.ant-pagination-jump-input {
  width: 48px;
  height: 28px;
  padding: 0 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 13px;
  text-align: center;
  outline: none;
}

.ant-pagination-jump-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(24,144,255,0.2);
}

/* ── Border overrides ── */
.border-primary { border-color: var(--primary) !important; }
.border-success { border-color: var(--success) !important; }
.border-warning { border-color: var(--warning) !important; }
