:root {
  --green: #0f7d61;
  --green-dark: #09694f;
  --green-soft: #e8f4ef;
  --line: #d7e3de;
  --text: #10231d;
  --muted: #6d7a76;
  --bg: #f2f6f4;
  --white: #fff;
}

* {
  box-sizing: border-box;
}

html,
body,
#root {
  width: 100%;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
  overscroll-behavior-x: none;
  touch-action: pan-y manipulation;
  -webkit-text-size-adjust: 100%;
}

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

button {
  border: 0;
  border-radius: 7px;
  background: var(--green);
  color: var(--white);
  font-weight: 800;
}

input,
select,
textarea {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--white);
  color: var(--text);
  text-align: center;
  font-weight: 800;
}

@media (max-width: 720px) {
  input,
  select,
  textarea {
    font-size: 16px !important;
  }
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.login-view {
  display: grid;
  min-height: 100dvh;
  padding: max(14px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom));
  place-items: center;
}

.login-panel {
  width: min(100%, 360px);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.login-panel h1 {
  margin: 0 0 16px;
  font-size: 26px;
  text-align: center;
}

.login-panel label {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  color: var(--muted);
  font-weight: 700;
}

.login-panel input {
  height: 46px;
  padding: 0 10px;
  text-align: left;
}

.login-panel button {
  width: 100%;
  height: 46px;
  margin-top: 2px;
}

.form-error {
  min-height: 20px;
  margin: 10px 0 0;
  color: #b42318;
  text-align: center;
  font-weight: 700;
}

.login-hint {
  margin: 8px 0 0;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
  font-weight: 700;
}

.app-shell {
  display: flex;
  width: 100%;
  max-width: 430px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(8px, env(safe-area-inset-top)) 7px max(8px, env(safe-area-inset-bottom));
  flex-direction: column;
  gap: 7px;
}

.top-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px;
  align-items: center;
  padding: 5px;
  border-radius: 7px;
  background: var(--green);
  color: var(--white);
}

.top-card > div:first-child {
  min-width: 72px;
}

.top-card strong {
  display: block;
  overflow: hidden;
  font-size: 18px;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-card span {
  display: none;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 700;
  opacity: 0.92;
}

.top-actions {
  display: flex;
  min-width: 0;
  gap: 3px;
  align-items: center;
  justify-content: flex-end;
}

.top-actions button,
.tab,
.pager button,
.export-row button {
  height: 38px;
}

.top-actions button {
  height: 34px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 13px;
  white-space: nowrap;
}

.top-actions .ghost-btn {
  width: 48px;
}

.top-actions .light-btn {
  width: 40px;
}

.top-actions .all-print-btn {
  width: 38px;
}

.top-actions .sync-pill {
  display: inline-flex;
  width: 72px;
  min-width: 72px;
  height: 30px;
  padding: 0 7px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: #6b7280;
  color: var(--white);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18), 0 2px 8px rgba(16, 35, 29, 0.18);
}

.sync-pill[data-status="synced"] {
  background: #12a46f;
}

.sync-pill[data-status="offline"] {
  background: #6b7280;
}

.sync-pill[data-status="pending"] {
  background: #dc2626;
}

.sync-pill[data-status="stale"] {
  background: #991b1b;
}

.sync-pill[data-status="saving"] {
  background: #2563eb;
}

.sync-pill[data-status="saved"] {
  background: #15803d;
}

.sync-pill[data-status="error"] {
  background: #b91c1c;
}

.mobile-more-btn {
  display: none;
  width: 48px;
  min-width: 48px;
  align-items: center;
  justify-content: center;
  border: 0;
  background: var(--white);
  color: var(--green);
  font-weight: 900;
}

.mobile-action-sheet {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  align-items: end;
}

.mobile-action-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(15, 35, 29, 0.28);
}

.mobile-action-panel {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(430px, calc(100vw - 16px));
  margin: 0 auto max(8px, env(safe-area-inset-bottom));
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  box-shadow: 0 18px 42px rgba(15, 35, 29, 0.22);
}

.mobile-action-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mobile-action-panel header strong {
  color: var(--text);
  font-size: 17px;
}

.mobile-action-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.mobile-action-grid button {
  min-height: 42px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--green);
  color: var(--white);
  font-size: 14px;
  font-weight: 900;
}

.mobile-action-grid .logout-action {
  background: #dc3545;
  grid-column: span 2;
}

@media (min-width: 641px) {
  .mobile-action-sheet {
    display: none !important;
  }
}

.ghost-btn {
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
}

.light-btn {
  background: var(--white);
  color: var(--green);
}

.tab-bar {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--green-soft);
  overflow-x: auto;
}

.tab {
  flex: 1 1 0;
  min-width: 0;
  white-space: nowrap;
  background: var(--white);
  color: var(--green);
}

.tab.active {
  background: var(--green);
  color: var(--white);
}

.desktop-manage-tab {
  flex: 0 0 auto;
  padding: 0 12px;
}

.date-capsule {
  display: grid;
  width: 156px;
  min-width: 148px;
  height: 36px;
  grid-template-columns: 1.1fr 0.78fr 1fr;
  overflow: hidden;
  border: 1px solid var(--green);
  border-radius: 999px;
  background: var(--green);
}

.date-capsule.off-today {
  border-color: #8f1d1d;
  background: #8f1d1d;
}

.date-capsule .date-segment select,
.date-capsule.off-today .date-segment select {
  color: var(--white);
}

.date-segment {
  display: block;
  min-width: 0;
  margin: 0;
}

.date-segment + .date-segment {
  border-left: 1px solid rgba(255, 255, 255, 0.35);
}

.date-segment select {
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  appearance: none;
  background: transparent;
  color: var(--white);
  font-size: 13px;
  font-weight: 900;
  text-align: center;
  text-align-last: center;
}

.date-segment select:focus {
  outline: 0;
  background: rgba(255, 255, 255, 0.14);
}

.date-segment option {
  color: var(--text);
  background: var(--white);
}

@media (max-width: 640px) {
  #main-export-btn,
  #print-page-btn,
  #print-all-btn {
    display: none !important;
  }

  .desktop-manage-tab {
    display: none !important;
  }

  .view-panel > .export-row {
    display: none !important;
  }

  .top-card {
    grid-template-columns: minmax(64px, 82px) minmax(0, 1fr);
  }

  .top-actions {
    gap: 5px;
  }

  .mobile-more-btn {
    display: inline-flex;
  }

  .date-capsule {
    width: clamp(146px, calc(100vw - 210px), 190px);
    min-width: 146px;
  }

  .tab-bar {
    gap: 6px;
  }

  .packing-table .table-row {
    padding-right: 42px;
  }

  .packing-table .table-row .swipe-delete-btn {
    top: 50%;
    right: 4px;
    width: 36px;
    height: 28px;
    border-radius: 6px;
    font-size: 11px;
    opacity: 0.92;
    pointer-events: auto;
    transform: translateY(-50%);
  }

  .packing-table .table-row.swipe-delete-open > input,
  .packing-table .table-row.swipe-delete-open > span {
    transform: none;
  }
}

@media (hover: none) and (pointer: coarse) {
  #main-export-btn,
  #print-page-btn,
  #print-all-btn {
    display: none !important;
  }

  .view-panel > .export-row {
    display: none !important;
  }

  .mobile-more-btn {
    display: inline-flex;
  }
}

.pager {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) 82px;
  gap: 8px;
  align-items: center;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--green-soft);
  text-align: center;
}

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

.pager button:last-child {
  background: var(--green);
  color: var(--white);
}

.pager strong {
  display: block;
  overflow: hidden;
  font-size: 18px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pager-title-btn {
  cursor: pointer;
}

.pager-title-btn:focus {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.pager-center {
  min-width: 0;
}

.group-pager-customer {
  display: grid;
  min-width: 0;
  min-height: 64px;
  align-content: center;
  gap: 2px;
  padding: 4px 8px;
}

.group-pager-customer #group-pager-title {
  color: var(--text);
  font-size: 18px;
}

.group-pager-customer #group-pager-subtitle {
  margin-top: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.pager span {
  display: block;
  overflow: hidden;
  margin-top: 1px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.view-panel {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  gap: 7px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

#app-shell {
  height: 100dvh;
  overflow: hidden;
}

.batch-grid {
  display: grid;
  grid-template-columns: 36px minmax(58px, 0.85fr) 54px 68px minmax(92px, 1.15fr);
  gap: 5px;
  align-items: stretch;
}

.sequence-rail {
  position: relative;
}

.sequence-pill {
  display: grid;
  width: 100%;
  min-height: 44px;
  border-radius: 7px;
  background: var(--green);
  color: var(--white);
  font-size: 25px;
  font-weight: 900;
  place-items: center;
}

.batch-jump-panel {
  position: absolute;
  left: 0;
  top: calc(100% + 5px);
  z-index: 7;
  display: grid;
  width: min(168px, calc(100vw - 22px));
  max-height: 310px;
  gap: 5px;
  padding: 7px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 12px 26px rgba(16, 35, 29, 0.18);
}

.batch-jump-panel button {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  min-height: 36px;
  gap: 6px;
  align-items: center;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--green);
  text-align: left;
}

.batch-jump-panel button.active {
  background: var(--green);
  color: var(--white);
}

.batch-jump-panel span {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-field,
.batch-field,
.autocomplete-field {
  position: relative;
  display: block;
}

.product-field input,
.batch-field input {
  width: 100%;
  height: 44px;
  padding: 0 8px;
  font-size: 20px;
}

.product-field input {
  padding-left: 8px;
  text-align: left;
}

.batch-quantity-field input {
  padding-left: 8px;
  padding-right: 8px;
  font-size: 16px;
  text-align: left;
}

.batch-code-wrap {
  display: block;
}

.batch-field input {
  font-size: 16px;
  letter-spacing: 0;
  padding-left: 4px;
  padding-right: 4px;
  text-transform: uppercase;
}

.batch-code-lock.locked input {
  border-color: var(--green);
  border-radius: 999px;
  background: var(--green);
  color: var(--white);
}

.unit-price-field {
  display: flex;
  min-width: 0;
  height: 44px;
  align-items: center;
  gap: 3px;
  padding: 0 6px;
  border: 1px solid var(--green);
  border-radius: 7px;
  background: var(--green);
}

.unit-price-field input {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--white);
  font-size: 17px;
  font-weight: 800;
  text-align: left;
}

.unit-price-field input::placeholder {
  color: rgba(255,255,255,0.64);
}

.unit-price-field input:-webkit-autofill,
.unit-price-field input:-webkit-autofill:hover,
.unit-price-field input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--green) inset;
  -webkit-text-fill-color: var(--white);
  caret-color: var(--white);
}

.batch-quantity-field input:-webkit-autofill,
.batch-quantity-field input:-webkit-autofill:hover,
.batch-quantity-field input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--white) inset;
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
}

.batch-summary-row {
  display: grid;
  grid-template-columns: minmax(74px, 1.2fr) minmax(58px, 0.9fr) minmax(58px, 0.9fr) 48px 48px;
  gap: 6px;
}

.batch-summary-row > * {
  box-sizing: border-box;
  height: 44px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--white);
}

.batch-summary-input,
.batch-summary-stat {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 3px;
  padding: 0 6px;
}

.batch-summary-input span,
.batch-summary-stat span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.batch-summary-input input {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 17px;
  font-weight: 800;
  text-align: right;
}

.batch-summary-stat strong {
  min-width: 0;
  color: var(--green);
  font-size: 16px;
  text-align: right;
  white-space: nowrap;
}

.price-lock.locked {
  border-color: var(--green);
  background: var(--green);
}

.price-lock.locked span {
  color: rgba(255,255,255,0.8);
}

.price-lock.locked input {
  color: var(--white);
  text-align: center;
}

.price-lock.locked input::placeholder {
  color: rgba(255,255,255,0.6);
}

.add-line-form {
  display: grid;
  grid-template-columns: minmax(84px, 1fr) 54px minmax(64px, 0.72fr) 66px;
  gap: 6px;
}

.add-line-form input {
  width: 100%;
  height: 44px;
}

.add-line-form button {
  width: 100%;
  height: 44px;
  font-weight: 900;
}

.sort-lines-btn {
  border: 1px solid var(--green);
  background: var(--green-soft);
  color: var(--green);
}

.batch-summary-row > .sort-lines-btn {
  padding: 0;
  border-radius: 7px;
  font-weight: 900;
}

.clear-current-batch-btn {
  border: 1px solid #d75c56;
  background: #fff4f2;
  color: #b93a34;
}

.batch-summary-row > .clear-current-batch-btn {
  padding: 0;
  border-radius: 7px;
  font-weight: 900;
}

.suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 8;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--white);
  box-shadow: 0 10px 22px rgba(16, 35, 29, 0.12);
}

.suggestions button {
  appearance: none;
  -webkit-appearance: none;
  display: block;
  width: 100%;
  height: 34px;
  padding: 0 8px;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: var(--white);
  color: var(--text);
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggestions button:last-child {
  border-bottom: 0;
}

.readonly input,
.readonly button,
.readonly select,
.readonly textarea,
input:disabled,
button:disabled,
select:disabled,
textarea:disabled {
  opacity: 0.58;
}

.data-table {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.packing-table {
  flex: 1;
  min-height: 220px;
  overflow-y: auto;
}

.table-row {
  display: grid;
  min-height: 40px;
  border-bottom: 1px solid var(--line);
}

.packing-table .table-row {
  position: relative;
  overflow: hidden;
  grid-template-columns: minmax(68px, 1fr) 46px 50px 38px 98px;
}

.customer-table .table-row {
  grid-template-columns: 28px minmax(44px, 0.68fr) 40px 40px 46px 34px 38px minmax(76px, 1fr) 34px;
}

.table-row:last-child {
  border-bottom: 0;
}

.table-row > span,
.table-row > input {
  display: grid;
  min-width: 0;
  padding: 0 3px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  align-items: center;
  justify-items: center;
  text-align: center;
  font-size: 14px;
  font-weight: 850;
}

.table-row > span:last-child,
.table-row > input:last-child {
  border-right: 0;
}

.packing-table input {
  display: block;
  width: 100%;
  height: 39px;
  padding: 0 3px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  font-size: 14px;
  line-height: 39px;
}

.customer-table input {
  width: 100%;
  height: 39px;
  padding: 0 3px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  font-size: 14px;
  font-weight: 850;
  text-align: center;
}

.customer-row-actions {
  padding: 0 !important;
  display: flex !important;
  flex-direction: column;
  align-items: stretch !important;
  justify-content: center !important;
}

.service-fee-row {
  background: #f8fbf9;
}

.logistics-row {
  background: #f7fafc;
  grid-template-columns: 1fr !important;
  padding: 0;
}

.logistics-compact-grid {
  display: grid;
  grid-template-columns: 42px 1fr minmax(56px, 72px);
  width: 100%;
  min-height: 40px;
}

.logistics-info-fields {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(96px, 1.15fr);
  align-items: center;
  min-width: 0;
}

.logistics-info-fields .logistics-name-cell {
  width: 100%;
  min-width: 0;
  text-align: left;
  padding-left: 4px;
  border-right: 0;
}

.logistics-info-fields .logistics-phone-cell {
  width: 100%;
  min-width: 0;
  text-align: left;
  border-right: 0;
  padding-left: 0;
}

.logistics-compact-label,
.logistics-compact-field {
  display: grid;
  min-width: 0;
  height: 40px;
  padding: 0 6px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  align-items: center;
  justify-items: center;
  text-align: center;
  font-size: 14px;
  font-weight: 850;
}

.logistics-compact-label {
  white-space: nowrap;
  font-size: 13px;
  color: #2f5d7c;
  background: #edf5f8;
}

.logistics-info-fields .logistics-compact-field {
  display: block;
  height: auto;
  padding: 8px 2px;
  font-size: 14px;
  font-weight: 850;
  background: transparent;
  border: 0;
}

.logistics-row input[data-logistics-picker],
.logistics-row .logistics-compact-field[data-logistics-picker] {
  color: #245b7a;
  cursor: pointer;
  font-weight: 800;
}

.service-fee-row input[readonly] {
  color: #314a43;
}

.auto-fee-badge {
  display: inline-grid;
  min-width: 28px;
  min-height: 20px;
  padding: 0 5px;
  border: 1px solid #b9d9ce;
  border-radius: 999px;
  align-items: center;
  color: var(--green);
  font-size: 11px;
  font-weight: 900;
  margin: auto;
}

.logistics-badge {
  border-color: #c6d4e3;
  color: #2f5d7c;
}

.delete-line-btn {
  width: 100%;
  height: 100%;
  min-height: 39px;
  border-radius: 0;
  background: #b42318;
  color: var(--white);
  font-size: 12px;
}

.customer-row-actions .delete-line-btn,
.customer-row-actions .ack-duplicate-btn {
  width: 100%;
  flex: 1 1 0;
  min-height: 0;
  border-radius: 0;
  font-size: 11px;
}

.ack-duplicate-btn {
  background: var(--green);
  color: var(--white);
}

.swipe-delete-btn {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2;
  width: 54px;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  transform: translateX(100%);
  transition: transform 0.16s ease, opacity 0.16s ease;
}

.packing-table .table-row > input,
.packing-table .table-row > span {
  transition: transform 0.16s ease;
}

.packing-table .table-row.swipe-delete-open > input,
.packing-table .table-row.swipe-delete-open > span {
  transform: translateX(-54px);
}

.packing-table .table-row.swipe-delete-open .swipe-delete-btn {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.customer-table .table-row.duplicate-warning {
  position: relative;
  background: #fff4e6;
  box-shadow: inset 3px 0 0 #d92d20;
}

.customer-table .table-row.duplicate-warning::after {
  content: "疑似重复";
  position: absolute;
  right: 34px;
  top: 2px;
  padding: 1px 4px;
  border-radius: 999px;
  background: #fee4e2;
  color: #b42318;
  font-size: 10px;
  font-weight: 900;
}

.customer-total-row {
  background: #fff5f5;
  border-top: 2px solid #dc3545;
  font-weight: bold;
}

.total-amount {
  color: #dc3545;
}

.table-head {
  position: sticky;
  top: 0;
  z-index: 1;
  min-height: 36px;
  background: #edf5f2;
}

.table-head span {
  color: #314a43;
  font-size: 13px;
}

.name-cell {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qty-cell {
  height: 39px;
  font-size: 15px !important;
}

.slot-cell {
  color: var(--green);
}

.empty-state {
  display: grid;
  min-height: 110px;
  color: var(--muted);
  font-weight: 850;
  place-items: center;
  text-align: center;
}

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

.export-row button {
  font-size: 14px;
}

.customer-card {
  flex: 1 0 auto;
  min-height: 220px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.customer-add-panel,
.group-order-panel {
  display: grid;
  gap: 6px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--green-soft);
}

.inventory-panel,
.pending-panel,
.procurement-tabs {
  display: grid;
  gap: 6px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--green-soft);
}

.procurement-tabs {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 6px;
}

#procurement-pending-panel {
  display: flex;
  min-height: 0;
  flex: 1 0 auto;
  flex-direction: column;
  gap: 7px;
}

.pending-table {
  flex: 1 0 auto;
  min-height: 220px;
}

#procurement-purchased-panel,
#procurement-inbound-panel,
#procurement-inventory-panel,
#procurement-loss-panel {
  display: flex;
  min-height: 0;
  flex: 1 0 auto;
  flex-direction: column;
  gap: 7px;
}

#procurement-inbound-panel > .inventory-panel {
  display: flex;
  min-height: 0;
  flex: 1 0 auto;
  flex-direction: column;
  gap: 7px;
}

.purchased-table,
.inventory-table,
.loss-table,
.inventory-import-preview {
  flex: 1 0 auto;
  min-height: 220px;
}

.procurement-tabs button {
  min-height: 38px;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--green);
}

.procurement-tabs button.active {
  background: var(--green);
  color: var(--white);
}

.inventory-category-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.inbound-mode-tabs {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.purchase-category-tabs {
  margin-bottom: 6px;
}

.inventory-category-tabs button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--green);
  font-weight: 800;
}

.inventory-category-tabs button.active {
  background: var(--green);
  color: var(--white);
}

.inventory-bulk-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  margin-top: 6px;
}

.inventory-bulk-actions button {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--green);
  color: var(--white);
  font-weight: 900;
}

.inventory-bulk-actions .danger-outline {
  border-color: #fecaca;
  background: #fff5f5;
  color: #b42318;
}

.inventory-add-grid {
  display: grid;
  grid-template-columns: minmax(58px, 1fr) minmax(82px, 1.08fr) 42px 50px 50px 50px 62px;
  gap: 5px;
}

.inventory-add-grid-two-row {
  grid-template-columns: minmax(0, 1.35fr) minmax(88px, 1fr) minmax(58px, 0.7fr) minmax(58px, 0.7fr);
  grid-template-areas:
    "product batch quantity cost"
    "sale member remark submit";
}

.inventory-add-grid-two-row #inventory-product { grid-area: product; }
.inventory-add-grid-two-row #inventory-batch { grid-area: batch; }
.inventory-add-grid-two-row #inventory-qty { grid-area: quantity; }
.inventory-add-grid-two-row #inventory-cost-price { grid-area: cost; }
.inventory-add-grid-two-row #inventory-sale-price { grid-area: sale; }
.inventory-add-grid-two-row #inventory-member-sale-price { grid-area: member; }
.inventory-add-grid-two-row #inventory-remark { grid-area: remark; }
.inventory-add-grid-two-row #inventory-add-btn { grid-area: submit; }

.inventory-add-grid input,
.inventory-add-grid button,
.inventory-ai-panel textarea,
.inventory-ai-panel button,
.inventory-panel > button,
.pending-panel button {
  width: 100%;
  min-height: 38px;
}

#inventory-batch {
  text-transform: uppercase;
}

.inventory-ai-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px 76px 92px;
  gap: 5px;
}

.inventory-ai-panel textarea {
  min-height: 42px;
  resize: vertical;
}

.inventory-import-preview {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.inventory-import-head,
.inventory-import-row {
  display: grid;
  grid-template-columns: 38px minmax(50px, 1fr) minmax(66px, 1fr) 48px 38px 44px 44px 44px;
  align-items: center;
  min-height: 34px;
  border-bottom: 1px solid var(--line);
  text-align: center;
  font-size: 12px;
  font-weight: 800;
}

.inventory-import-head {
  background: #f0f8f5;
  color: #36524a;
}

.inventory-import-row:last-child {
  border-bottom: 0;
}

.inventory-import-row strong {
  color: #b42318;
  font-weight: 900;
}

.inventory-import-unmatched {
  padding: 8px;
  color: #b42318;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.pending-panel {
  grid-template-columns: minmax(0, 1fr) 104px;
  align-items: center;
}

.pending-panel strong {
  overflow: hidden;
  color: var(--green);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-table .table-row {
  min-width: 720px;
  grid-template-columns: minmax(70px, 1fr) 70px 40px 40px 40px 40px 34px 32px 30px 54px minmax(52px, 0.7fr) 42px 104px;
}

.inventory-table .inventory-grass-row {
  min-width: 650px;
  grid-template-columns: minmax(78px, 1.15fr) 40px 40px 40px 40px 34px 32px 30px 54px minmax(52px, 0.7fr) 42px 104px;
}

.inventory-table {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.sale-price-table .table-row {
  grid-template-columns: minmax(52px, 1fr) 76px 42px 46px 46px 46px;
}

.loss-table .table-row {
  grid-template-columns: minmax(58px, 1fr) 72px 38px 42px 44px 56px 58px minmax(54px, 0.8fr);
}

.pending-table .table-row {
  grid-template-columns: minmax(58px, 1fr) 50px 58px minmax(78px, 1.1fr) 40px 106px;
}

.pending-actions {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex-wrap: wrap;
}

.purchased-table .table-row {
  grid-template-columns: minmax(64px, 1fr) 58px minmax(58px, 0.8fr) minmax(78px, 1fr) 72px;
}

.pending-qty,
.purchased-qty {
  display: inline-grid;
  min-width: 42px;
  min-height: 30px;
  padding: 0 6px;
  place-items: center;
  border-radius: 999px;
  font-weight: 900;
}

.pending-qty {
  background: #fee4e2;
  color: #b42318;
}

.pending-stock {
  display: inline-grid;
  min-height: 30px;
  place-items: center;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.pending-stock.muted {
  color: #8a9a93;
}

.purchased-qty {
  background: #dcfae6;
  color: var(--green);
}

.done-mini,
.reopen-mini,
.stock-mini {
  min-height: 34px;
  padding: 0 6px;
  border-radius: 6px;
  font-size: 12px;
}

.done-mini {
  background: #b42318;
}

.reopen-mini {
  background: var(--green);
}

.stock-mini {
  background: #0f7d61;
}

.inventory-table input {
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  font-size: 13px;
  font-weight: 800;
}

.inventory-table input[data-inventory-edit="batchCode"] {
  font-size: 11px !important;
}

.inventory-name-cell {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 4px;
  min-width: 0;
  height: 100%;
}

.inventory-select-box {
  width: 16px !important;
  min-width: 16px;
  height: 16px !important;
  margin: 0;
  accent-color: var(--green);
}

.inventory-remaining-cell {
  display: inline-grid;
  min-height: 30px;
  place-items: center;
  color: #b42318;
  font-weight: 900;
}

.inventory-loss-cell,
.loss-qty {
  display: inline-grid;
  min-height: 30px;
  place-items: center;
  color: #b42318;
  font-weight: 900;
}

.inventory-time-cell {
  display: inline-grid;
  min-height: 30px;
  place-items: center;
  color: #38544b;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.15;
  white-space: normal;
}

.inventory-row-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2px;
  align-items: center;
}

.inventory-table .danger-mini,
.inventory-table .loss-mini,
.inventory-table .merge-mini,
.inventory-table .calibrate-mini {
  min-height: 32px;
  padding: 0 2px;
  border-radius: 6px;
  color: #fff;
  font-size: 10px;
}

.inventory-table .danger-mini {
  background: #b3261e;
}

.inventory-table .loss-mini {
  background: #d97706;
}

.inventory-table .merge-mini {
  background: var(--green);
}

.inventory-table .calibrate-mini {
  background: #2563eb;
}

.customer-add-grid,
.group-add-grid {
  display: grid;
  grid-template-columns: minmax(54px, 0.8fr) minmax(42px, 0.55fr) minmax(42px, 0.55fr) minmax(82px, 1.15fr) 54px;
  gap: 5px;
}
.customer-add-grid {
  grid-template-columns: minmax(54px, 0.8fr) minmax(42px, 0.55fr) minmax(42px, 0.55fr) minmax(82px, 1.15fr) 54px;
}

.group-add-grid-auto {
  grid-template-columns: minmax(120px, 1.6fr) minmax(52px, 0.55fr) minmax(52px, 0.55fr) minmax(92px, 1fr);
}

.customer-new-name {
  grid-column: 1 / -1;
}

.customer-add-grid input,
.group-add-grid input,
.customer-add-grid select,
.group-add-grid select,
.customer-add-grid button,
.group-add-grid button {
  width: 100%;
  height: 38px;
}

.customer-add-grid select,
.group-add-grid select,
.smart-add-row select {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--white);
  color: var(--green);
  text-align: center;
  text-align-last: center;
  font-size: 14px;
  font-weight: 900;
}

#customer-add-batch,
#customer-ai-batch,
#group-add-batch {
  text-transform: uppercase;
}

.customer-add-grid button,
.group-add-grid button {
  min-height: 42px;
}

.group-customer-action-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px;
  gap: 5px;
}

.group-customer-action-row .autocomplete-field {
  position: relative;
}

.group-customer-action-row input,
.group-customer-action-row button {
  width: 100%;
  height: 38px;
}

.group-customer-action-row button {
  min-height: 38px;
  padding: 0 3px;
  font-size: 12px;
  white-space: nowrap;
}

.group-customer-action-row .suggestions {
  top: calc(100% + 4px);
  text-align: left;
}

.smart-add-row {
  display: grid;
  gap: 5px;
}
#group-view .smart-add-row {
  grid-template-columns: minmax(0, 1fr) 48px 68px;
}
#customer-view .smart-add-row {
  grid-template-columns: minmax(0, 1fr) 68px;
}

.smart-add-row input,
.smart-add-row select {
  width: 100%;
  height: 42px;
  text-transform: uppercase;
}

.smart-add-row textarea {
  width: 100%;
  min-height: 42px;
  max-height: 82px;
  padding: 7px;
  text-align: left;
  font-size: 13px;
  font-weight: 800;
  resize: vertical;
}

.smart-add-row textarea:focus {
  min-height: 92px;
}

.smart-add-row button {
  min-height: 42px;
  padding: 0 4px;
  font-size: 13px;
}

.smart-paste-review {
  display: grid;
  gap: 7px;
  margin-top: 7px;
}

.smart-paste-review-title {
  color: #a12828;
  font-size: 12px;
  font-weight: 800;
}

.smart-paste-review-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.smart-paste-review-close {
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  border-color: #d9c7c7;
  background: #fff;
  color: #8a3434;
  font-size: 22px;
  line-height: 1;
}

.smart-paste-review-item.unresolved {
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid #d94b4b;
  border-left-width: 4px;
  border-radius: 6px;
  background: #fff7f7;
}

.smart-paste-original {
  color: #a12828;
  font-size: 13px;
  font-weight: 800;
}

.smart-paste-candidates {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.smart-paste-candidates button {
  min-height: 30px;
  padding: 3px 9px;
  border-color: #b9d8ce;
  background: #fff;
  color: #0f745b;
  font-size: 12px;
}

.smart-paste-no-candidate {
  color: #7b6767;
  font-size: 12px;
}

.smart-paste-manual-row {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) 58px 50px;
  gap: 5px;
}

.smart-paste-manual-row input,
.smart-paste-manual-row button {
  min-width: 0;
  min-height: 36px;
  font-size: 13px;
}

.customer-title {
  padding: 18px 8px 14px;
  background: #fbfdfc;
  text-align: center;
}

.customer-title-line {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.customer-title h2 {
  margin: 0;
  overflow: hidden;
  font-size: 24px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-rename-btn {
  flex: 0 0 auto;
  min-height: 28px;
  border: 1px solid rgba(12, 126, 91, 0.22);
  border-radius: 999px;
  background: #eff8f4;
  color: var(--green);
  font-size: 13px;
  font-weight: 900;
}

.customer-title p {
  margin: 7px 0 0;
  color: var(--green);
  font-size: 17px;
  font-weight: 900;
}

.status-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  padding: 4px 2px 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.status-bar span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-bar button {
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--green);
  font-size: 11px;
}

.profit-panel,
.profit-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.profit-panel {
  padding: 8px;
}

.profit-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.profit-header strong,
.profit-card h2 {
  margin: 0;
  font-size: 16px;
}

.profit-header span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.profit-actions {
  display: flex;
  gap: 6px;
}

.profit-actions button {
  min-width: 48px;
  height: 34px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--green);
  font-size: 13px;
}

.profit-actions button.active {
  background: var(--green);
  color: var(--white);
}

.profit-overview,
.profit-section {
  border: 1px solid var(--line);
  background: var(--white);
}

.profit-overview {
  padding: 10px;
  border-radius: 8px;
}

.profit-overview-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.profit-overview-header strong {
  display: block;
  font-size: 18px;
}

.profit-overview-header span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.profit-period-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  width: min(100%, 190px);
}

.profit-period-actions button,
.profit-filter-row button,
.profit-customer-filter > button {
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.profit-period-actions button.active {
  border-color: var(--green);
  background: var(--green);
  color: var(--white);
}

.profit-filter-row {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) minmax(128px, 0.9fr) 54px;
  gap: 6px;
  margin-top: 9px;
}

.profit-filter-row select,
.profit-filter-row input,
.profit-customer-search-wrap input {
  width: 100%;
  height: 36px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  color: var(--text);
  font-size: 16px;
}

.profit-summary {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(108px, 0.85fr);
  gap: 6px;
  margin-top: 8px;
}

.profit-summary .empty-state {
  grid-column: 1 / -1;
}

.profit-hero-metric {
  min-height: 112px;
  padding: 15px 13px;
  border-left: 4px solid var(--green);
  background: #fff4f2;
}

.profit-hero-metric span,
.profit-hero-side span,
.profit-secondary-metrics span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.profit-hero-metric strong {
  display: block;
  margin: 5px 0 2px;
  color: var(--green);
  font-size: 28px;
  line-height: 1.1;
}

.profit-hero-metric small {
  color: #287d62;
  font-size: 11px;
  font-weight: 800;
}

.profit-hero-side {
  display: grid;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.profit-hero-side > div {
  padding: 9px;
  background: #f7fbf9;
}

.profit-hero-side strong,
.profit-secondary-metrics strong {
  display: block;
  margin-top: 3px;
  font-size: 16px;
}

.profit-hero-side .profit-loss-summary {
  background: #f7fbf9;
}

.profit-hero-side .profit-loss-summary strong,
.profit-loss-table strong,
.profit-loss-summary-lines strong,
.negative {
  color: #b42318;
}

.profit-secondary-metrics {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.profit-secondary-metrics > div {
  min-width: 0;
  padding: 9px 7px;
  border-bottom: 3px solid #bfd7cd;
  background: #f7fbf9;
}

.profit-seller-summary {
  display: flex;
  grid-column: 1 / -1;
  flex-wrap: wrap;
  gap: 5px 10px;
  padding: 7px 9px;
  background: #edf5f2;
  color: #456057;
  font-size: 11px;
}

.profit-seller-summary b {
  color: var(--green);
}

.profit-section-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  margin: 8px 0;
  padding: 4px;
  border-radius: 7px;
  background: #dfeae6;
}

.profit-section-tabs button {
  height: 36px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #496159;
  font-size: 13px;
  font-weight: 900;
}

.profit-section-tabs button.active {
  background: var(--white);
  color: var(--green);
  box-shadow: 0 1px 4px rgba(16, 35, 29, 0.12);
}

.profit-section {
  overflow: visible;
  border-radius: 8px;
}

.profit-customer-filter {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 78px;
  gap: 6px;
  padding: 9px;
  border-bottom: 1px solid var(--line);
}

.profit-customer-search-wrap {
  position: relative;
  min-width: 0;
}

.profit-customer-search-wrap input {
  padding: 0 10px;
}

.profit-customer-suggestions {
  position: absolute;
  z-index: 30;
  top: calc(100% + 4px);
  right: 0;
  left: 0;
  overflow: hidden;
  border: 1px solid #b6cbc3;
  border-radius: 6px;
  background: var(--white);
  box-shadow: 0 10px 24px rgba(16, 35, 29, 0.16);
}

.profit-customer-suggestions button {
  display: flex;
  width: 100%;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border: 0;
  border-bottom: 1px solid #edf2f0;
  background: var(--white);
  color: var(--text);
  text-align: left;
}

.profit-customer-suggestions button:last-child {
  border-bottom: 0;
}

.profit-customer-suggestions small {
  color: var(--green);
  font-weight: 900;
}

.profit-suggestion-empty {
  padding: 10px;
  color: var(--muted);
  font-size: 12px;
}

.profit-selected-customer-summary {
  border-bottom: 1px solid var(--line);
}

.profit-selected-customer-title,
.profit-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px;
}

.profit-selected-customer-title strong,
.profit-section-heading strong {
  font-size: 14px;
}

.profit-selected-customer-title span,
.profit-section-heading span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.profit-selected-customer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
}

.profit-selected-customer-grid > div {
  min-width: 0;
  padding: 8px 5px;
  background: #f9fbfa;
  text-align: center;
}

.profit-selected-customer-grid span,
.profit-selected-customer-grid strong {
  display: block;
}

.profit-selected-customer-grid span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.profit-selected-customer-grid strong {
  margin-top: 3px;
  font-size: 13px;
}

.profit-customer-table .table-row {
  grid-template-columns: minmax(98px, 1.2fr) repeat(4, minmax(58px, 0.8fr));
}

.profit-customer-row {
  appearance: none;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: var(--white);
  color: var(--text);
  text-align: left;
}

.profit-customer-row:active {
  background: #edf6f2;
}

.profit-customer-row strong {
  color: var(--green);
  text-align: right;
}

.profit-document-table .table-row {
  grid-template-columns: 92px 64px minmax(112px, 1fr) 82px 86px;
}

.profit-batch-table .table-row {
  grid-template-columns: 92px minmax(120px, 1fr) minmax(104px, 0.9fr) 82px 86px;
}

.profit-document-row,
.profit-batch-row {
  appearance: none;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: var(--white);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.profit-document-row:focus-visible,
.profit-batch-row:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: -2px;
}

.profit-document-row:active,
.profit-batch-row:active {
  background: #edf6f2;
}

.profit-document-row strong,
.profit-batch-row strong,
.profit-detail-table .table-row > strong,
.profit-batch-detail-table .table-row > strong {
  color: var(--green);
  text-align: right;
}

.profit-customer-row > strong,
.profit-document-row > strong,
.profit-batch-row > strong {
  display: grid;
  min-width: 0;
  align-items: center;
  justify-items: center;
  text-align: center;
}

.profit-document-source {
  display: grid;
  min-width: 0;
  align-items: center;
  justify-items: center;
  overflow: hidden;
}

.profit-document-source .profit-source-badge {
  overflow: hidden;
  max-width: 100%;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profit-document-customer,
.profit-batch-product,
.profit-batch-code,
.profit-detail-customer {
  overflow: hidden;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profit-source-badge {
  color: var(--green);
  font-size: 11px;
  font-weight: 900;
}

.profit-mode-badge {
  color: #76521d;
  font-size: 11px;
  font-weight: 900;
}

.profit-section .not-applicable {
  color: #8a9893;
}

.profit-drilldown-header {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 58px;
  padding: 8px 9px;
  border-bottom: 1px solid var(--line);
  background: #f4f8f6;
}

.profit-drilldown-header button {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid #bdd1ca;
  border-radius: 6px;
  background: var(--white);
  color: var(--green);
  font-size: 22px;
  line-height: 1;
}

.profit-drilldown-header strong,
.profit-drilldown-header span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profit-drilldown-header strong {
  font-size: 15px;
}

.profit-drilldown-header span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.profit-drilldown-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1px;
  border-bottom: 8px solid #edf3f0;
  background: var(--line);
}

.profit-drilldown-summary > div {
  min-width: 0;
  padding: 8px 4px;
  background: var(--white);
  text-align: center;
}

.profit-drilldown-summary span,
.profit-drilldown-summary strong {
  display: block;
}

.profit-drilldown-summary span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.profit-drilldown-summary strong {
  overflow: hidden;
  margin-top: 3px;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profit-drilldown .pending,
.profit-section .pending {
  color: #9a5d00;
  font-weight: 900;
}

.profit-customer-detail-block {
  border-top: 8px solid #edf3f0;
}

.profit-customer-detail-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 54px 68px;
  gap: 6px;
  align-items: center;
  min-height: 46px;
  padding: 7px 9px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  width: 100%;
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  border-radius: 0;
  background: var(--white);
  color: var(--text);
  text-align: left;
}

.profit-customer-detail-line div,
.profit-detail-product,
.profit-loss-product {
  min-width: 0;
}

.profit-customer-detail-line div strong,
.profit-customer-detail-line div small,
.profit-detail-product b,
.profit-detail-product small,
.profit-loss-product b,
.profit-loss-product small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profit-customer-detail-line small,
.profit-detail-product small,
.profit-loss-product small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.profit-customer-detail-line > strong {
  color: var(--green);
  text-align: right;
}

.profit-detail-table .table-row {
  grid-template-columns: minmax(150px, 1.2fr) 72px 58px 78px 78px 86px 72px 82px;
}

.profit-batch-detail-table .table-row {
  grid-template-columns: minmax(110px, 1fr) 62px 72px 58px 78px 78px 86px 72px 82px;
}

.profit-batch-loss-block,
.profit-loss-group,
.profit-unmatched-block {
  border-top: 8px solid #edf3f0;
}

.profit-batch-loss-lines {
  border-top: 1px solid var(--line);
}

.profit-batch-loss-line {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 90px;
  gap: 8px;
  align-items: center;
  min-height: 42px;
  padding: 6px 9px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.profit-batch-loss-line strong {
  text-align: right;
}

.profit-empty-row {
  min-height: 44px;
  color: var(--muted);
}

.profit-empty-cell {
  color: var(--muted);
  font-weight: 900;
}

.profit-loss-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 0 8px 8px;
  border-bottom: 1px solid var(--line);
}

.profit-loss-summary-grid > div {
  min-height: 54px;
  padding: 8px;
  border-left: 3px solid #d95c50;
  background: #fff7f5;
}

.profit-loss-summary-grid > div > strong {
  display: block;
  margin-bottom: 5px;
  color: #7a271a;
  font-size: 13px;
}

.profit-loss-summary-lines {
  display: grid;
  gap: 4px;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.profit-loss-summary-lines > div:not(.empty-state) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}

.compact-empty {
  padding: 4px 0;
  font-size: 12px;
}

.profit-loss-table .table-row {
  grid-template-columns: minmax(90px, 1fr) minmax(120px, 1.2fr) 54px 74px 74px;
}

.profit-inventory-loss-table .table-row {
  grid-template-columns: 92px minmax(140px, 1.2fr) 60px 78px 86px;
}

.profit-unmatched-block {
  padding: 9px;
}

.profit-unmatched-block > strong {
  color: #7a271a;
  font-size: 13px;
}

.profit-unmatched {
  display: grid;
  gap: 6px;
  margin-top: 6px;
  color: #9b332b;
  font-size: 12px;
  font-weight: 800;
}

/* 利润页下半区按已确认的“客户总单式”草图展示。 */
.profit-sheet-view {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--white);
}

.profit-sheet-bar {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 10px;
  background: var(--green);
  color: var(--white);
}

.profit-sheet-bar > strong {
  font-size: 15px;
  font-weight: 900;
}

.profit-sheet-bar .profit-sheet-bar-back {
  min-width: 72px;
  color: var(--white);
  font-size: 13px;
}

.profit-sheet-title {
  display: flex;
  min-height: 72px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 10px 9px;
}

.profit-sheet-title > div {
  min-width: 0;
}

.profit-sheet-title strong,
.profit-sheet-title small,
.profit-sheet-summary-line {
  display: block;
}

.profit-sheet-title > div > strong {
  overflow: hidden;
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profit-sheet-title small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.profit-sheet-summary-line {
  margin-top: 4px;
  color: #425951;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.55;
}

.profit-sheet-summary-line b {
  color: var(--green);
}

.profit-sheet-back {
  width: auto;
  min-width: 70px;
  height: 32px;
  padding: 0 8px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.profit-sheet-scroll {
  overflow-x: auto;
  border-top: 1px solid var(--line);
  -webkit-overflow-scrolling: touch;
}

.profit-sheet-table {
  min-width: 720px;
}

.profit-customer-detail-table {
  min-width: 640px;
}

.profit-mode-detail-table {
  min-width: 820px;
}

.profit-sheet-row {
  display: grid;
  min-height: 42px;
  align-items: center;
  border-top: 1px solid #e5ece9;
  background: var(--white);
  color: var(--text);
  font-size: 11px;
}

.profit-customer-detail-table .profit-sheet-row {
  grid-template-columns: 34px 74px 58px 54px 78px 72px 82px 68px 82px;
}

.profit-mode-detail-table .profit-sheet-row {
  grid-template-columns: 34px 88px 94px 58px 54px 76px 72px 72px 66px 76px;
}

.profit-sheet-row > span,
.profit-sheet-row > strong {
  overflow: hidden;
  padding: 6px 5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profit-sheet-row > strong {
  color: var(--green);
  text-align: right;
}

.profit-sheet-head {
  min-height: 34px;
  border-top: 0;
  background: #dfeae6;
  color: #40564e;
  font-size: 10px;
  font-weight: 900;
}

.profit-sheet-total {
  min-height: 38px;
  border-top: 2px solid #b9cec5;
  background: #f4f8f6;
  font-weight: 900;
}

.profit-sheet-action-row {
  appearance: none;
  width: 100%;
  padding: 0;
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  border-radius: 0;
  text-align: left;
}

.profit-sheet-action-row:active {
  background: #edf6f2;
}

.profit-sheet-tip,
.profit-loss-note {
  padding: 8px 10px;
  border-top: 1px solid var(--line);
  background: #fff9e9;
  color: #7e5d0a;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.55;
}

.profit-sheet-empty {
  width: 100%;
  min-width: 640px;
}

.profit-source-badge,
.profit-mode-badge {
  display: inline-block;
  width: max-content;
  padding: 3px 6px;
  border-radius: 4px;
  background: #e8f3ef;
  color: var(--green);
  font-size: 10px;
  font-weight: 900;
}

.profit-mode-badge.margin {
  background: #fff1dc;
  color: #8a5e12;
}

.profit-source-badge.group {
  background: #fff1dc;
  color: #8a5e12;
}

.profit-loss-impact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 0 8px 8px;
}

.profit-loss-impact-grid > div {
  min-width: 0;
  padding: 9px 8px;
  border-bottom: 3px solid #d68b84;
  background: var(--white);
}

.profit-loss-impact-grid span,
.profit-loss-impact-grid strong {
  display: block;
}

.profit-loss-impact-grid span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.profit-loss-impact-grid strong {
  margin-top: 4px;
  color: #a42d25;
  font-size: 14px;
}

.profit-loss-block {
  margin-top: 8px;
  border: 1px solid var(--line);
  background: var(--white);
}

.profit-loss-block-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
  background: #f0f5f3;
}

.profit-loss-block-title strong {
  font-size: 13px;
}

.profit-loss-block-title span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.profit-loss-row {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(100px, 0.9fr) 78px;
  gap: 8px;
  align-items: center;
  min-height: 46px;
  padding: 8px 10px;
  border-top: 1px solid #e5ece9;
  font-size: 11px;
}

.profit-loss-row span,
.profit-loss-row b,
.profit-loss-row small {
  display: block;
  min-width: 0;
}

.profit-loss-row small {
  overflow: hidden;
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profit-loss-row > strong {
  color: #a42d25;
  text-align: right;
}

@media (max-width: 640px) {
  .profit-document-table .table-head,
  .profit-batch-table .table-head {
    display: grid;
  }

  .profit-document-table .table-row:not(.profit-empty-row),
  .profit-batch-table .table-row:not(.profit-empty-row) {
    min-height: 44px;
    gap: 3px;
    padding: 0 4px;
  }

  .profit-document-table .table-row {
    grid-template-columns: 58px 52px minmax(88px, 1fr) 48px 66px;
  }

  .profit-batch-table .table-row {
    grid-template-columns: 54px minmax(74px, 1fr) minmax(86px, 1.1fr) 44px 66px;
  }

  .profit-document-row > *,
  .profit-batch-row > *,
  .profit-document-row .profit-document-customer,
  .profit-batch-row .profit-batch-date,
  .profit-batch-row .profit-batch-product,
  .profit-batch-row .profit-batch-code,
  .profit-document-row > span:nth-child(4),
  .profit-batch-row > span:nth-child(4),
  .profit-document-row > strong,
  .profit-batch-row > strong {
    grid-column: auto;
    grid-row: auto;
  }

  .profit-document-row > strong,
  .profit-batch-row > strong,
  .profit-document-row > span:nth-child(4),
  .profit-batch-row > span:nth-child(4) {
    text-align: right;
  }

  .profit-document-table .table-row > *,
  .profit-batch-table .table-row > * {
    overflow: hidden;
    padding: 0 2px;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .profit-sheet-title {
    min-height: 68px;
  }

  .profit-loss-row {
    grid-template-columns: minmax(0, 1.25fr) minmax(96px, 0.9fr) 70px;
    gap: 5px;
    padding: 8px;
  }
}

@media (max-width: 640px) {
  .profit-overview-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .profit-period-actions {
    width: 100%;
  }

  .profit-filter-row {
    grid-template-columns: minmax(0, 1fr) minmax(122px, 0.9fr) 50px;
  }

  .profit-hero-metric {
    min-height: 104px;
    padding: 13px 10px;
  }

  .profit-hero-metric strong {
    font-size: 24px;
  }

  .profit-hero-side strong,
  .profit-secondary-metrics strong {
    font-size: 14px;
  }

  .profit-secondary-metrics > div {
    padding: 8px 5px;
  }

  .profit-customer-table .table-row {
    grid-template-columns: minmax(92px, 1.2fr) repeat(4, minmax(52px, 0.8fr));
  }

  .profit-customer-table .table-row > * {
    padding: 0 4px;
    font-size: 11px;
  }

  .profit-detail-table .table-head,
  .profit-batch-detail-table .table-head,
  .profit-loss-table .table-head,
  .profit-inventory-loss-table .table-head {
    display: none;
  }

  .profit-document-date {
    color: var(--muted);
  }

  .profit-drilldown-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .profit-detail-table .table-row:not(.profit-empty-row),
  .profit-batch-detail-table .table-row:not(.profit-empty-row) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 10px;
    min-height: 112px;
    padding: 9px;
  }

  .profit-detail-table .profit-detail-product {
    grid-column: 1 / -1;
  }

  .profit-batch-detail-table .profit-detail-customer {
    font-weight: 900;
  }

  .profit-detail-table .table-row:not(.profit-empty-row) > strong,
  .profit-batch-detail-table .table-row:not(.profit-empty-row) > strong,
  .profit-detail-table .table-row:not(.profit-empty-row) > span:nth-child(even),
  .profit-batch-detail-table .table-row:not(.profit-empty-row) > span:nth-child(even) {
    text-align: right;
  }

  .profit-detail-table [data-label]::before,
  .profit-batch-detail-table [data-label]::before,
  .profit-loss-table [data-label]::before,
  .profit-inventory-loss-table [data-label]::before {
    margin-right: 3px;
    color: var(--muted);
    content: attr(data-label) " ";
    font-size: 10px;
  }

  .profit-loss-table .table-row:not(.profit-empty-row) {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 5px 8px;
    min-height: 78px;
    padding: 9px;
  }

  .profit-loss-table .table-row:not(.profit-empty-row) > span:nth-child(1) {
    font-weight: 900;
  }

  .profit-loss-table .profit-loss-product {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .profit-loss-table .table-row:not(.profit-empty-row) > span:nth-child(3),
  .profit-loss-table .table-row:not(.profit-empty-row) > span:nth-child(4) {
    grid-row: 3;
  }

  .profit-loss-table .table-row:not(.profit-empty-row) > span:nth-child(4),
  .profit-loss-table .table-row:not(.profit-empty-row) > strong {
    text-align: right;
  }

  .profit-inventory-loss-table .table-row:not(.profit-empty-row) {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 5px 8px;
    min-height: 86px;
    padding: 9px;
  }

  .profit-inventory-loss-table .profit-loss-product {
    grid-column: 1 / -1;
  }

  .profit-inventory-loss-table .table-row:not(.profit-empty-row) > strong,
  .profit-inventory-loss-table .table-row:not(.profit-empty-row) > span:nth-child(even) {
    text-align: right;
  }
}

.safety-panel {
  border-color: #bddbd2;
}

.safety-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 8px;
  border-bottom: 1px solid var(--line);
}

.safety-grid > div {
  min-height: 58px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fbfa;
}

.safety-grid strong {
  display: block;
  margin-bottom: 5px;
  color: var(--green);
  font-size: 13px;
}

.safety-lines {
  display: grid;
  gap: 4px;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.safety-lines .ok {
  color: var(--green);
}

.safety-lines .warning {
  color: #b42318;
}

.audit-table .table-row {
  grid-template-columns: minmax(82px, 1fr) minmax(52px, .7fr) 76px 54px 48px 42px 42px;
}

.export-sheet {
  position: fixed;
  inset: 0;
  z-index: 9;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 10px;
  background: rgba(8, 25, 20, 0.42);
}

.export-panel {
  display: grid;
  width: min(100%, 430px);
  max-height: calc(100dvh - 28px - env(safe-area-inset-top));
  gap: 8px;
  padding: 10px;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.export-panel header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 66px;
  gap: 8px;
  align-items: center;
}

.export-panel header strong,
.export-panel header span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.export-panel header strong {
  font-size: 18px;
}

.export-panel header span,
.export-tip {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.export-preview-image {
  width: 100%;
  max-height: none;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--white);
  touch-action: manipulation;
}

.export-tip {
  margin: 0;
  padding: 8px;
  border-radius: 7px;
  background: var(--green-soft);
  text-align: center;
}

.export-table-preview {
  max-height: 38dvh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.export-table-preview table {
  width: 100%;
  min-width: 390px;
  border-collapse: collapse;
}

.export-table-preview th,
.export-table-preview td {
  padding: 8px 6px;
  border: 1px solid var(--line);
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.export-table-preview th {
  background: var(--green-soft);
  color: var(--green);
}

.export-table-preview td[contenteditable="true"] {
  background: #fffaf0;
  box-shadow: inset 0 0 0 1px rgba(15, 125, 97, 0.2);
  cursor: text;
}

.export-table-preview td[contenteditable="true"]:focus {
  outline: 2px solid rgba(15, 125, 97, 0.35);
  outline-offset: -2px;
  background: #ffffff;
}

#export-copy-text {
  width: 100%;
  min-height: 86px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  resize: vertical;
}

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

.export-sheet-actions button {
  min-height: 42px;
}

.clear-day-sheet {
  position: fixed;
  inset: 0;
  z-index: 12;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 10px;
  background: rgba(40, 10, 10, 0.42);
}

.clear-day-panel {
  display: grid;
  width: min(100%, 430px);
  gap: 10px;
  padding: 12px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  border: 1px solid #f1b5b5;
  border-radius: 8px 8px 0 0;
  background: var(--white);
  box-shadow: 0 -12px 28px rgba(75, 18, 18, 0.18);
}

.clear-day-panel header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px;
  gap: 8px;
  align-items: center;
}

.clear-day-panel header strong {
  color: #9f1d1d;
  font-size: 18px;
}

.clear-day-panel p {
  margin: 0;
  padding: 8px;
  border-radius: 7px;
  background: #fff1f1;
  color: #7a2424;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
}

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

.clear-scope-row button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 14px;
}

.clear-scope-row button.active {
  border-color: var(--green);
  background: var(--green);
  color: var(--white);
}

.clear-date-capsule {
  display: grid;
  height: 42px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--green-soft);
}

.clear-date-capsule .date-segment + .date-segment {
  border-left: 1px solid var(--line);
}

.clear-date-capsule select {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  appearance: none;
  background: transparent;
  color: var(--green);
  font-size: 15px;
  font-weight: 900;
  text-align: center;
  text-align-last: center;
}

.clear-date-capsule select:disabled {
  color: var(--muted);
  opacity: 0.55;
}

.clear-date-capsule option {
  color: var(--text);
  background: var(--white);
}

.clear-day-panel label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.clear-day-panel input {
  height: 42px;
  letter-spacing: 0;
}

.danger-btn {
  min-height: 44px;
  background: #c62828;
  color: var(--white);
}

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

.group-clear-actions button {
  min-height: 44px;
}

.wheel-picker {
  position: fixed;
  inset: 0;
  z-index: 15;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(8, 25, 20, 0.36);
  touch-action: pan-y;
}

.wheel-picker.anchored {
  align-items: stretch;
  justify-content: flex-start;
  background: rgba(8, 25, 20, 0.08);
}

.wheel-picker-panel {
  width: min(100%, 430px);
  max-height: min(62dvh, 430px);
  padding: 8px;
  padding-bottom: max(8px, env(safe-area-inset-bottom));
  border: 1px solid var(--line);
  border-radius: 8px 8px 0 0;
  background: var(--white);
  box-shadow: 0 -12px 28px rgba(15, 35, 29, 0.16);
}

.wheel-picker.anchored .wheel-picker-panel {
  position: fixed;
  top: var(--wheel-top);
  left: var(--wheel-left);
  width: var(--wheel-width);
  max-height: min(46dvh, 360px);
  padding-bottom: 8px;
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(15, 35, 29, 0.22);
}

.wheel-picker-panel header {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 72px;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.wheel-picker-panel header strong {
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wheel-picker-panel header button {
  min-height: 38px;
  border-radius: 999px;
}

.wheel-picker-search-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  margin-bottom: 8px;
}

.wheel-picker-search-row span {
  display: grid;
  min-height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--green);
  font-weight: 900;
}

.wheel-picker-search-row input {
  width: 100%;
  height: 38px;
  text-align: left;
}

.wheel-picker-options {
  max-height: min(48dvh, 320px);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(#fff, #f7fbf9);
  overscroll-behavior: contain;
  scroll-snap-type: y mandatory;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

.wheel-picker.anchored .wheel-picker-options {
  max-height: min(34dvh, 260px);
}

.wheel-option-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px;
  border-bottom: 1px solid var(--line);
}

.wheel-option-row:last-child {
  border-bottom: 0;
}

.wheel-option {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-size: 17px;
  font-weight: 900;
  text-align: center;
  scroll-snap-align: center;
}

.wheel-option-row .wheel-option {
  border-bottom: 0;
}

.wheel-option-action {
  min-height: 48px;
  border-left: 1px solid var(--line);
  border-radius: 0;
  background: #fef3c7;
  color: #92400e;
  font-size: 14px;
  font-weight: 900;
}

.wheel-option:last-child {
  border-bottom: 0;
}

.wheel-option.selected {
  background: var(--green);
  color: var(--white);
}

.wheel-option:disabled {
  color: var(--muted);
  background: var(--green-soft);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(22px + env(safe-area-inset-bottom));
  z-index: 10;
  max-width: min(330px, calc(100vw - 28px));
  padding: 10px 14px;
  border-radius: 7px;
  background: rgba(15, 35, 29, 0.9);
  color: var(--white);
  font-weight: 800;
  text-align: center;
  cursor: pointer;
  user-select: none;
  transform: translateX(-50%);
}

@media (max-width: 360px) {
  .app-shell {
    padding-left: 5px;
    padding-right: 5px;
  }

  .top-card {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 4px;
  }

  .top-card > div:first-child {
    min-width: 68px;
  }

  .top-card strong {
    font-size: 17px;
  }

  .top-actions {
    gap: 2px;
  }

  .date-capsule {
    width: 166px;
    min-width: 160px;
  }

  .top-actions .ghost-btn {
    width: 42px;
  }

  .top-actions .light-btn {
    width: 38px;
  }

  .top-actions .all-print-btn {
    width: 34px;
  }

  .sync-pill {
    width: 72px;
    min-width: 72px;
    height: 30px;
    font-size: 12px;
  }

  .top-actions button {
    padding: 0 4px;
    font-size: 12px;
  }

  .batch-grid {
    grid-template-columns: 32px minmax(60px, 1fr) 50px 60px 72px;
    gap: 4px;
  }

  .batch-summary-row {
    gap: 5px;
  }

  .customer-add-grid,
  .group-add-grid {
    grid-template-columns: minmax(48px, 0.65fr) 46px 46px minmax(88px, 1.1fr) 52px;
    gap: 4px;
  }

  .group-add-grid.group-add-grid-auto {
    grid-template-columns: minmax(120px, 1.6fr) minmax(52px, 0.55fr) minmax(52px, 0.55fr) minmax(92px, 1fr);
  }

  .inventory-add-grid {
    grid-template-columns: minmax(50px, 1fr) minmax(74px, 1.05fr) 38px 46px 46px 46px 54px;
    gap: 4px;
  }

  .inventory-ai-panel {
    grid-template-columns: minmax(0, 1fr) 54px 68px 80px;
    gap: 4px;
  }

  #group-view .smart-add-row {
    grid-template-columns: minmax(0, 1fr) 42px 58px;
    gap: 4px;
  }
  #customer-view .smart-add-row {
    grid-template-columns: minmax(0, 1fr) 58px;
  }

  .packing-table .table-row {
    grid-template-columns: minmax(56px, 1fr) 40px 44px 34px 82px;
  }

  .packing-table .table-row {
    padding-right: 42px;
  }

  .packing-table .table-row .swipe-delete-btn {
    top: 50%;
    right: 4px;
    width: 36px;
    height: 28px;
    border-radius: 6px;
    font-size: 11px;
    opacity: 0.92;
    pointer-events: auto;
    transform: translateY(-50%);
  }

  .packing-table .table-row.swipe-delete-open > input,
  .packing-table .table-row.swipe-delete-open > span {
    transform: none;
  }

  .customer-table .table-row {
    grid-template-columns: 24px minmax(38px, 0.62fr) 36px 36px 42px 30px 34px minmax(68px, 1fr) 30px;
  }

  .inventory-table .table-row {
    min-width: 700px;
    grid-template-columns: minmax(40px, 1fr) 60px 34px 34px 34px 34px 30px 28px 28px 46px minmax(44px, 0.7fr) 38px 96px;
  }

  .inventory-table .inventory-grass-row {
    min-width: 630px;
    grid-template-columns: minmax(44px, 1fr) 34px 34px 34px 34px 30px 28px 28px 46px minmax(44px, 0.7fr) 38px 96px;
  }

  .loss-table .table-row {
    grid-template-columns: minmax(48px, 1fr) 58px 34px 36px 38px 44px 50px minmax(44px, 0.8fr);
  }

  .sale-price-table .table-row {
    grid-template-columns: minmax(44px, 1fr) 66px 38px 42px 42px 42px;
  }

  .pending-table .table-row {
    grid-template-columns: minmax(48px, 1fr) 42px 48px minmax(60px, 1fr) 34px 92px;
  }

  .purchased-table .table-row {
    grid-template-columns: minmax(54px, 1fr) 50px minmax(48px, 0.8fr) minmax(72px, 1fr) 64px;
  }
}

@media (min-width: 900px) {
  body {
    background: #edf4f1;
  }

  .app-shell {
    width: min(100%, 1180px);
    max-width: 1180px;
    min-height: 100dvh;
    padding: 16px;
    gap: 10px;
  }

  .top-card {
    grid-template-columns: minmax(160px, 1fr) auto;
    padding: 12px 14px;
  }

  .top-card strong {
    font-size: 24px;
  }

  .top-card span {
    display: block;
    font-size: 14px;
  }

  .top-actions {
    gap: 8px;
  }

  .group-customer-action-row {
    grid-template-columns: minmax(180px, 1fr) 72px 96px;
    gap: 8px;
  }

  .date-capsule {
    width: 206px;
    height: 42px;
  }

  .top-actions button,
  .tab,
  .pager button,
  .export-row button {
    height: 42px;
  }

  .top-actions .ghost-btn,
  .top-actions .light-btn {
    width: 76px;
  }

  .tab-bar {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
  }

  .pager {
    grid-template-columns: 132px minmax(0, 1fr) 132px;
    padding: 8px;
  }

  .pager strong {
    font-size: 20px;
  }

  .pager span {
    font-size: 13px;
  }

  .view-panel {
    gap: 10px;
  }

  .batch-grid {
    grid-template-columns: 58px minmax(180px, 1fr) 104px 130px 180px;
    gap: 10px;
  }

  .sequence-pill,
  .product-field input,
  .batch-field input,
  .unit-price-field {
    min-height: 50px;
    height: 50px;
  }

  .unit-price-field input {
    font-size: 20px;
  }

  .product-field input {
    font-size: 24px;
  }

  .batch-field input {
    font-size: 19px;
  }

  .batch-summary-row {
    grid-template-columns: 150px 120px 120px 80px 80px;
    gap: 8px;
  }

  .batch-summary-row > * {
    height: 46px;
    min-height: 46px;
  }

  .batch-summary-input span,
  .batch-summary-stat span {
    font-size: 13px;
  }

  .batch-summary-input input,
  .batch-summary-stat strong {
    font-size: 18px;
  }

  .add-line-form {
    grid-template-columns: minmax(320px, 1fr) 120px 180px 116px;
    gap: 8px;
  }

  .add-line-form input,
  .add-line-form button {
    height: 46px;
  }

  .packing-table {
    min-height: min(58vh, 640px);
  }

  .table-row {
    min-height: 44px;
  }

  .packing-table .table-row {
    grid-template-columns: minmax(220px, 1.35fr) 96px 110px 88px 180px;
  }

  .customer-table .table-row {
    grid-template-columns: 58px minmax(170px, 1fr) 86px 86px 104px 110px 86px 180px 70px;
  }

  .table-row > span,
  .table-row > input {
    font-size: 16px;
  }

  .customer-add-grid,
  .group-add-grid {
    grid-template-columns: minmax(220px, 0.85fr) 110px 110px 180px 120px;
    gap: 8px;
  }

  .group-add-grid.group-add-grid-auto {
    grid-template-columns: minmax(280px, 1.6fr) 120px 120px minmax(180px, 1fr);
  }

  .inventory-add-grid {
    grid-template-columns: minmax(240px, 1fr) 190px 100px 100px 100px 100px minmax(120px, 0.7fr) 120px;
    gap: 8px;
  }

  .inventory-table .table-row {
    min-width: 0;
    grid-template-columns: minmax(150px, 1fr) 120px 78px 86px 86px 86px 74px 70px 70px 128px minmax(120px, 0.7fr) 90px 136px;
  }

  .inventory-table .inventory-grass-row {
    min-width: 0;
    grid-template-columns: minmax(170px, 1fr) 78px 86px 86px 86px 74px 70px 70px 128px minmax(120px, 0.7fr) 90px 136px;
  }

  .loss-table .table-row {
    grid-template-columns: minmax(170px, 1fr) 150px 90px 90px 100px 120px 130px minmax(150px, 0.8fr);
  }

  .sale-price-table .table-row {
    grid-template-columns: minmax(200px, 1fr) 170px 110px 110px 120px 120px;
  }

  .pending-table .table-row {
    grid-template-columns: minmax(180px, 1fr) 120px 120px minmax(220px, 1.2fr) 120px 150px;
  }

  .purchased-table .table-row {
    grid-template-columns: minmax(180px, 1fr) 120px 160px minmax(180px, 1fr) 130px;
  }

  .profit-customer-table .table-row {
    grid-template-columns: minmax(220px, 1fr) 130px 130px 130px 140px;
  }

  .profit-document-table .table-row {
    grid-template-columns: 120px 90px minmax(220px, 1fr) 120px 130px;
  }

  .profit-batch-table .table-row {
    grid-template-columns: 120px minmax(220px, 1fr) 190px 120px 130px;
  }

  .profit-detail-table .table-row {
    grid-template-columns: minmax(220px, 1.2fr) 100px 90px 120px 120px 120px 110px 120px;
  }

  .profit-batch-detail-table .table-row {
    grid-template-columns: minmax(170px, 1fr) 90px 100px 90px 110px 110px 120px 100px 120px;
  }

  .profit-loss-table .table-row {
    grid-template-columns: minmax(150px, 1fr) minmax(220px, 1.2fr) 90px 110px 110px;
  }

  .profit-inventory-loss-table .table-row {
    grid-template-columns: 120px minmax(240px, 1.2fr) 90px 110px 120px;
  }

  #group-view .smart-add-row {
    grid-template-columns: minmax(0, 1fr) 90px 120px;
    gap: 8px;
  }
  #customer-view .smart-add-row {
    grid-template-columns: minmax(0, 1fr) 120px;
  }

  .export-panel {
    width: min(100%, 760px);
  }
}

@media print {
  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  html,
  body,
  #root {
    min-height: auto;
    overflow: visible;
    background: #fff;
  }

  .login-view,
  .top-card,
  .tab-bar,
  .pager,
  .add-line-form,
  .customer-add-panel,
  .group-order-panel,
  .status-bar,
  .toast,
  .clear-day-sheet,
  .wheel-picker,
  .export-sheet:not(.hidden) {
    display: none !important;
  }

  .app-shell {
    display: block;
    width: 100%;
    max-width: none;
    min-height: auto;
    padding: 0;
  }

  .view-panel {
    display: block;
  }

  .view-panel.hidden {
    display: none !important;
  }

  .data-table,
  .customer-card {
    border: 1px solid #9aa8a2;
    box-shadow: none;
  }

  .packing-table {
    max-height: none;
    overflow: visible;
  }

  .table-head {
    position: static;
  }
}

/* === 采购/核准弹窗 === */
.dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 35, 29, 0.35);
}
.dialog-panel {
  width: min(380px, calc(100vw - 24px));
  max-height: 85vh;
  padding: 16px;
  border-radius: 12px;
  background: var(--white);
  box-shadow: 0 12px 40px rgba(15, 35, 29, 0.25);
  overflow-y: auto;
}
.dialog-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.dialog-panel header strong { font-size: 17px; color: var(--text); }
.close-btn {
  width: 32px; height: 32px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 18px; line-height: 1;
}
.dialog-body label {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
  color: var(--muted);
  font-weight: 700;
}
.dialog-body label input {
  height: 40px;
  padding: 0 8px;
  text-align: center;
  font-weight: 800;
}
.dialog-panel footer {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.dialog-panel footer button {
  flex: 1;
  height: 42px;
  font-weight: 900;
}
.dialog-panel footer .ghost-btn {
  background: var(--green-soft);
  color: var(--green);
  border: 1px solid var(--green);
}

/* 采购弹窗 */
.purchase-product-name {
  font-size: 15px; font-weight: 900;
  color: var(--text);
  margin: 0 0 10px;
}
.purchase-customer-list {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.purchase-customer-title { margin: 0 0 6px; font-weight: 700; color: var(--muted); }
#purchase-dialog-customer-rows > div {
  padding: 4px 0;
  border-bottom: 1px solid var(--green-soft);
  font-weight: 700;
}

/* 核准弹窗 */
.calibrate-info {
  display: flex; gap: 6px; align-items: center;
  margin-bottom: 10px; font-weight: 700;
}
.calibrate-diff {
  padding: 8px 10px;
  border-radius: 7px;
  background: #fff3cd;
  color: #5d3700;
  font-weight: 700;
  font-size: 13px;
}

/* 客户明细弹窗 */
.pending-customer-popup {
  position: fixed; inset: 0; z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pending-customer-popup .popup-backdrop {
  position: absolute; inset: 0;
  background: rgba(15, 35, 29, 0.3);
}
.pending-customer-popup .popup-panel {
  position: relative;
  width: min(320px, calc(100vw - 32px));
  max-height: 60vh;
  padding: 14px;
  border-radius: 12px;
  background: var(--white);
  box-shadow: 0 12px 36px rgba(15, 35, 29, 0.2);
  overflow-y: auto;
}
.pending-customer-popup .popup-header {
  display: flex; align-items: center;
  justify-content: space-between; margin-bottom: 10px;
}
.customer-detail-row {
  display: flex; justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
}
.customer-detail-row .customer-qty { color: var(--green); }
.customer-detail-btn {
  background: none; border: none;
  color: var(--green); font-weight: 700;
  cursor: pointer; padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* 已采购表格扩列适配打印 */
.purchased-table .table-row {
  grid-template-columns: minmax(60px, 0.9fr) 42px minmax(68px, 0.9fr) 48px 48px 48px minmax(52px, 0.7fr) 52px;
}

.dialog-body select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
}

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

.purchased-readonly {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.purchased-row-actions {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px;
  align-items: center;
}

.purchased-row-actions .reopen-mini,
.purchased-row-actions .danger-mini {
  min-width: 0;
  min-height: 32px;
  padding: 0 3px;
  border-radius: 6px;
  color: #fff;
  font-size: 11px;
}

.purchased-row-actions .danger-mini {
  background: #b3261e;
}

@media (max-width: 720px) {
  .inventory-add-grid.inventory-add-grid-two-row {
    grid-template-columns: minmax(0, 1.25fr) minmax(76px, 1fr) minmax(48px, 0.65fr) minmax(48px, 0.65fr);
  }
}

@media (min-width: 1100px) {
  .inventory-add-grid.inventory-add-grid-two-row {
    grid-template-columns: minmax(240px, 1.35fr) 190px 100px 100px;
  }
  .purchased-table .table-row {
    grid-template-columns: minmax(180px, 1fr) 110px 150px 100px 100px 100px 100px 100px;
  }
}

/* ── 通用管理页弹窗 ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,.4);
  display: flex; align-items: center; justify-content: center;
}
.modal-overlay.hidden { display: none; }
.modal-panel {
  background: var(--bg-panel, #fff); border-radius: 8px;
  max-width: 380px; width: calc(100vw - 32px); max-height: 80vh;
  display: flex; flex-direction: column;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
}
.modal-panel header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--border, #e0e0e0);
}
.modal-panel .close-btn {
  background: none; border: none; font-size: 1.3rem; cursor: pointer; padding: 0 4px; line-height: 1;
}
.modal-body { padding: 16px; overflow-y: auto; flex: 1; }
.modal-body label { display: block; margin-bottom: 10px; font-size: 0.92rem; }
.modal-body input, .modal-body select {
  width: 100%; padding: 6px 8px; margin-top: 2px;
  border: 1px solid var(--border, #ccc); border-radius: 4px;
  font-size: 0.92rem;
}
.modal-footer {
  display: flex; gap: 8px; justify-content: flex-end;
  padding: 10px 16px; border-top: 1px solid var(--border, #e0e0e0);
}
.modal-footer button {
  padding: 6px 16px; border-radius: 4px; font-size: 0.92rem; cursor: pointer;
}
.modal-footer .light-btn { background: var(--bg-light, #f0f0f0); border: 1px solid var(--border, #ccc); }

/* ── 管理页表格操作按钮 ── */
.manage-action-btn {
  padding: 2px 8px; font-size: 0.82rem; border-radius: 3px;
  border: 1px solid var(--border, #ccc); background: var(--bg-panel, #fff); cursor: pointer;
  color: var(--green); font-weight: 700;
  margin-right: 4px;
}
.manage-action-btn:hover { background: var(--bg-hover, #e8f4fd); }
.manage-action-btn.danger { color: #c0392b; border-color: #e74c3c; }

/* ── 管理页卡片布局 ── */

.manage-view {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.manage-view.hidden { display: none; }

.manage-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  overflow: hidden;
}

.manage-card-bar {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 8px;
  border-bottom: 1px solid var(--line);
  background: var(--green-soft);
}

.manage-card-bar strong {
  flex: 1;
  font-size: 16px;
  color: var(--green);
}

.manage-card-bar input {
  flex: 1;
  min-width: 0;
  height: 34px;
  padding: 0 8px;
  font-size: 14px;
  text-align: left;
}

.manage-card-bar select {
  height: 34px;
  padding: 0 6px;
  font-size: 13px;
  font-weight: 800;
}

.manage-card-bar button {
  height: 34px;
  padding: 0 10px;
  white-space: nowrap;
  font-size: 13px;
}

.manage-card > .data-table {
  border: none;
  border-radius: 0;
}

.manage-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border-top: 1px solid var(--line);
  background: var(--green-soft);
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}

.customer-detail-summary {
  display: flex;
  gap: 14px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.customer-history-list {
  display: grid;
  max-height: min(48vh, 360px);
  overflow-y: auto;
  border-top: 1px solid var(--line);
}

.customer-history-row {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) minmax(90px, 1fr) auto;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: 13px;
}

.customer-history-row span:last-child {
  white-space: nowrap;
  color: var(--muted);
}

/* 管理页表格列宽 */
#product-manage-view .data-table .table-row {
  grid-template-columns: minmax(54px, 0.8fr) minmax(46px, 0.9fr) minmax(42px, 0.8fr) 42px 62px;
}

/* H5 端隐藏来源列 */
@media (max-width: 640px) {
  #product-manage-view .data-table .table-row {
    grid-template-columns: minmax(56px, 1fr) 60px 80px 58px;
  }
  #product-manage-view .data-table .table-row > span:nth-child(4) {
    display: none;
  }
}
#logistics-manage-view .data-table .table-row {
  grid-template-columns: minmax(68px, 1fr) minmax(48px, 0.8fr) 38px 60px;
}
#customer-manage-view .data-table .table-row {
  grid-template-columns: minmax(112px, 1.2fr) 64px 78px minmax(118px, 1.1fr) 72px 64px;
}
#permission-manage-view .data-table .table-row {
  grid-template-columns: minmax(36px, 0.8fr) minmax(56px, 1fr) 38px 34px 38px 58px;
}

@media (min-width: 641px) {
  #product-manage-view .data-table .table-row {
    grid-template-columns: minmax(84px, 0.75fr) minmax(88px, 0.9fr) minmax(96px, 0.75fr) 88px 112px;
  }
  #logistics-manage-view .data-table .table-row {
    grid-template-columns: minmax(140px, 1fr) minmax(120px, 0.8fr) 68px 140px;
  }
  #customer-manage-view .data-table .table-row {
    grid-template-columns: minmax(148px, 1.2fr) 80px 110px minmax(180px, 1.5fr) 96px 72px;
  }
  #permission-manage-view .data-table .table-row {
    grid-template-columns: minmax(110px, 0.8fr) minmax(140px, 1fr) 76px 58px 70px 150px;
  }
}

/* 管理页表格通用：去掉多余边框 */
.manage-card .table-row {
  border-bottom: 1px solid var(--line);
}
.manage-card .table-row:last-child {
  border-bottom: 0;
}
.manage-card .table-head {
  background: #edf5f2;
}

/* 客户管理采用独立的紧凑资料列表，避免复用通用表格的粗重文字与窄列。 */
#customer-manage-view .manage-card {
  border-color: #d5e5de;
  box-shadow: 0 8px 20px rgba(21, 86, 65, 0.06);
}

#customer-manage-view .customer-manage-heading {
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: var(--white);
}

#customer-manage-view .customer-manage-title {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
}

#customer-manage-view .manage-card-bar {
  padding: 10px 12px;
  background: #f6faf8;
}

#customer-manage-view .manage-card-bar select {
  width: 84px;
  color: var(--text);
  background: var(--white);
}

#customer-manage-view .manage-action-btn {
  min-width: 42px;
  margin-right: 0;
  white-space: nowrap;
}

#customer-manage-view .table-row {
  min-height: 48px;
}

#customer-manage-view .table-head {
  min-height: 38px;
}

#customer-manage-view .table-head > span {
  padding: 0 8px;
  color: #527568;
  font-size: 12px;
  font-weight: 800;
}

#customer-manage-lines .table-row > span {
  padding: 0 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
}

#customer-manage-lines .customer-name-cell {
  min-width: 0;
  color: #173d30;
  font-size: 14px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#customer-manage-lines .customer-pinyin-cell,
#customer-manage-lines .customer-phone-cell,
#customer-manage-lines .customer-last-order-cell,
#customer-manage-lines .table-row > span:last-child {
  justify-content: center;
  text-align: center;
}

#customer-manage-lines .customer-pinyin-cell,
#customer-manage-lines .customer-last-order-cell {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

#customer-manage-lines .customer-phone-cell {
  white-space: nowrap;
}

#customer-manage-lines .customer-address-cell {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#customer-manage-lines .customer-address-mobile {
  display: none;
}

@media (max-width: 640px) {
  #customer-manage-view .customer-manage-heading {
    min-height: 46px;
    padding: 0 10px;
  }

  #customer-manage-view .customer-manage-title {
    font-size: 16px;
  }

  #customer-manage-view .manage-card-bar {
    gap: 5px;
    padding: 8px;
  }

  #customer-manage-view .manage-card-bar select {
    width: 76px;
    padding: 0 4px;
    font-size: 12px;
  }

  #customer-manage-view .manage-card-bar button {
    padding: 0 8px;
  }

  #customer-manage-view .data-table .table-row {
    grid-template-columns: minmax(122px, 1.1fr) minmax(110px, 1fr) 64px;
  }

  #customer-manage-view .data-table .table-row > span:nth-child(2),
  #customer-manage-view .data-table .table-row > span:nth-child(3),
  #customer-manage-view .data-table .table-row > span:nth-child(5) {
    display: none;
  }

  #customer-manage-lines .table-row > span {
    padding: 0 6px;
  }

  #customer-manage-lines .customer-name-cell {
    font-size: 13px;
  }

  #customer-manage-lines .customer-address-desktop {
    display: none;
  }

  #customer-manage-lines .customer-address-mobile {
    display: block;
    color: var(--muted);
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}
