:root {
  color: #24282d;
  background: #f4f5f6;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 1080px;
  margin: 0;
  background: #f4f5f6;
}

button,
input,
select {
  font: inherit;
}

.shell {
  width: 100%;
  min-height: 100vh;
}

.is-hidden {
  display: none !important;
}

.login-panel {
  width: 520px;
  margin: 88px auto 0;
  padding: 32px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
}

.brand-name {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-subtitle {
  margin-top: 8px;
  color: #7a818a;
  font-size: 14px;
}

.config-status {
  margin-top: 24px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #f2f5f8;
  color: #56606b;
  font-size: 14px;
  line-height: 1.5;
}

.login-form {
  margin-top: 24px;
}

.field-label,
.field span {
  display: block;
  margin-bottom: 8px;
  color: #59616b;
  font-size: 14px;
  font-weight: 700;
}

.login-row {
  display: grid;
  grid-template-columns: 1fr 96px;
  gap: 10px;
}

.field-label-spaced {
  margin-top: 14px;
}

.text-input,
.select-input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid #ccd2d8;
  border-radius: 6px;
  background: #ffffff;
  color: #202429;
  outline: none;
}

.textarea-input {
  width: 100%;
  min-height: 112px;
  padding: 10px 12px;
  border: 1px solid #ccd2d8;
  border-radius: 6px;
  background: #ffffff;
  color: #202429;
  font: inherit;
  line-height: 1.5;
  outline: none;
  resize: vertical;
}

.text-input:focus,
.select-input:focus,
.textarea-input:focus {
  border-color: #4d6f8f;
  box-shadow: 0 0 0 3px rgba(77, 111, 143, 0.14);
}

.primary-button,
.ghost-button {
  height: 42px;
  padding: 0 18px;
  border-radius: 6px;
  font-weight: 800;
  cursor: pointer;
}

.primary-button {
  border: 1px solid #202429;
  background: #202429;
  color: #ffffff;
}

.ghost-button {
  border: 1px solid #cdd3da;
  background: #ffffff;
  color: #252a30;
}

.primary-button:disabled,
.ghost-button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

.admin-view {
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
  padding: 0 34px;
  border-bottom: 1px solid #e2e5e8;
  background: #ffffff;
}

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

.subtitle {
  margin-top: 4px;
  color: #7d858d;
  font-size: 13px;
}

.tabs {
  display: flex;
  gap: 6px;
  padding: 16px 34px 0;
  background: #ffffff;
  border-bottom: 1px solid #e2e5e8;
}

.tab {
  min-width: 112px;
  height: 44px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: #6d747c;
  font-weight: 800;
  cursor: pointer;
}

.tab.is-active {
  border-bottom-color: #202429;
  color: #202429;
}

.tab-panel {
  padding: 28px 34px 44px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.section-head h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0;
}

.section-head p {
  margin: 8px 0 0;
  color: #7c848d;
  font-size: 14px;
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.compact-select {
  width: 128px;
}

.cycle-select {
  width: 230px;
}

.panel {
  margin-top: 18px;
  padding: 22px;
  border: 1px solid #e1e5e9;
  border-radius: 8px;
  background: #ffffff;
}

.panel-title {
  margin-bottom: 18px;
  font-size: 16px;
  font-weight: 800;
}

.weekday-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
}

.weekday-item {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 58px;
  border: 1px solid #d5dbe1;
  border-radius: 8px;
  background: #ffffff;
  color: #535b65;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
}

.weekday-item input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.weekday-item.is-enabled {
  border-color: #4d6f8f;
  background: #eaf1f2;
  color: #244c58;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.field {
  display: block;
  padding: 18px;
  border: 1px solid #e1e5e9;
  border-radius: 8px;
  background: #ffffff;
}

.compact-field {
  padding: 14px;
}

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

.error-box,
.success-box {
  margin: 14px 0;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.5;
}

.error-box {
  border: 1px solid #e5c6bd;
  background: #fff1ed;
  color: #9a3e27;
}

.success-box {
  border: 1px solid #b9d8c9;
  background: #eef8f2;
  color: #276245;
}

.placeholder-panel {
  max-width: 720px;
}

.placeholder-list {
  display: grid;
  gap: 10px;
  color: #636b74;
}

.table-wrap {
  margin-top: 18px;
  overflow-x: auto;
  border: 1px solid #e1e5e9;
  border-radius: 8px;
  background: #ffffff;
}

.user-create-grid {
  display: grid;
  grid-template-columns: 90px minmax(140px, 1fr) minmax(120px, 0.75fr) minmax(200px, 1.2fr) 120px minmax(140px, 0.9fr) 116px;
  gap: 12px;
  align-items: end;
}

.product-create-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.3fr) 120px 116px 110px 110px 96px 116px 128px;
  gap: 12px;
  align-items: end;
}

.sale-product-field {
  grid-column: span 2;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(17, 24, 39, 0.42);
}

.modal-panel {
  width: min(1080px, 100%);
  max-height: calc(100vh - 56px);
  overflow: auto;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 52px rgba(16, 24, 40, 0.22);
}

.modal-backdrop-stacked {
  z-index: 70;
}

.catalog-editor-panel {
  padding: 24px;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.modal-head h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0;
}

.modal-head p {
  margin: 8px 0 0;
  color: #7c848d;
  font-size: 14px;
}

.catalog-editor-sections {
  display: grid;
  gap: 16px;
}

.editor-section {
  padding: 18px;
  border: 1px solid #e1e5e9;
  border-radius: 8px;
  background: #ffffff;
}

.editor-section-title {
  margin-bottom: 14px;
  color: #3f464d;
  font-size: 15px;
  font-weight: 800;
}

.catalog-preview-section {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.catalog-editor-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 88px;
  height: 88px;
  border: 1px dashed #cdd3da;
  border-radius: 8px;
  background: #f8f9fa;
  color: #8a929a;
  font-size: 12px;
  font-weight: 800;
}

.catalog-editor-preview img {
  width: 78px;
  height: 78px;
  border-radius: 6px;
  object-fit: cover;
}

.catalog-preview-actions {
  display: grid;
  justify-items: start;
  gap: 8px;
}

.catalog-info-grid {
  display: grid;
  grid-template-columns: 170px minmax(220px, 1fr) 140px 110px 130px;
  gap: 12px;
  align-items: end;
}

.image-resource-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}

.image-dropzone {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 12px;
  align-items: center;
  min-height: 92px;
  margin-top: 10px;
  padding: 14px;
  border: 1px dashed #b8c0c8;
  border-radius: 8px;
  background: #f8fafb;
  color: #3d454e;
}

.image-dropzone.is-dragging {
  border-color: #4d6f8f;
  background: #edf4f5;
}

.image-dropzone-title {
  font-size: 14px;
  font-weight: 800;
}

.catalog-file-input {
  display: none;
}

.image-upload-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.image-upload-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #e1e5e9;
  border-radius: 8px;
  background: #ffffff;
}

.image-upload-item.is-queued {
  grid-template-columns: minmax(0, 1fr) auto;
}

.image-upload-item.is-invalid {
  border-color: #e5c6bd;
  background: #fff8f5;
}

.image-upload-item.is-warning {
  border-color: #e7d49c;
  background: #fffbeb;
}

.image-upload-name {
  overflow: hidden;
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-upload-meta {
  margin-top: 4px;
  color: #7a838c;
  font-size: 12px;
}

.image-upload-status {
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.image-selector-panel {
  width: min(980px, 100%);
  padding: 24px;
}

.image-selector-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(136px, 1fr));
  gap: 12px;
  padding: 4px 2px 10px;
}

.image-selector-slot {
  display: grid;
  min-width: 0;
  min-height: 244px;
  padding: 10px;
  border: 1px dashed #cdd3da;
  border-radius: 8px;
  background: #f8fafb;
}

.image-selector-slot.is-drop-target {
  border-color: #202429;
  background: #eef2f4;
  box-shadow: inset 0 0 0 2px rgba(32, 36, 41, 0.08);
}

.image-selector-slot-label {
  margin-bottom: 8px;
  color: #5b646e;
  font-size: 12px;
  font-weight: 900;
}

.image-selector-slot.is-empty .image-selector-empty {
  min-height: 172px;
  background: #ffffff;
}

.image-selector-card {
  display: grid;
  position: relative;
  gap: 10px;
  padding: 12px;
  border: 1px solid #e1e5e9;
  border-radius: 8px;
  background: #ffffff;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.image-selector-card.is-selected {
  border-color: #202429;
  box-shadow: 0 0 0 3px rgba(32, 36, 41, 0.12);
}

.image-selector-card.is-dragging {
  opacity: 0.52;
}

.image-selector-card:active {
  cursor: grabbing;
}

.image-selector-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  background: #276245;
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
}

.image-selector-thumb {
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 6px;
  background: #f4f5f6;
}

.image-selector-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.image-selector-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  border: 1px dashed #cdd3da;
  border-radius: 8px;
  color: #8a929a;
  font-size: 13px;
  font-weight: 800;
}

.image-selector-hint {
  color: #7a838c;
  font-size: 12px;
  font-weight: 800;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid #e5e7eb;
}

.shelf-panel {
  margin-top: 18px;
}

.line-clamp {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  word-break: break-all;
}

.catalog-products-table {
  min-width: 880px;
  table-layout: fixed;
}

.catalog-products-table th:nth-child(1),
.catalog-products-table td:nth-child(1) {
  width: 78px;
}

.catalog-products-table th:nth-child(2),
.catalog-products-table td:nth-child(2) {
  width: 82px;
}

.catalog-products-table th:nth-child(3),
.catalog-products-table td:nth-child(3) {
  width: 280px;
}

.catalog-products-table th:nth-child(4),
.catalog-products-table td:nth-child(4) {
  width: 130px;
}

.catalog-products-table th:nth-child(5),
.catalog-products-table td:nth-child(5) {
  width: 116px;
}

.catalog-products-table th:nth-child(6),
.catalog-products-table td:nth-child(6) {
  width: 168px;
}

.products-table .text-input,
.products-table .select-input {
  height: 38px;
  padding: 0 10px;
}

.catalog-preview-button,
.catalog-preview-empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  overflow: hidden;
  border: 1px solid #d7dde3;
  border-radius: 6px;
  background: #f6f7f8;
  color: #8a929a;
  font-size: 12px;
  font-weight: 800;
}

.catalog-preview-button {
  padding: 0;
  cursor: pointer;
}

.catalog-preview-button img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.catalog-name-cell {
  display: grid;
  gap: 4px;
}

.catalog-name-main {
  font-weight: 800;
}

.product-image-field,
.product-desc-field {
  grid-column: span 3;
}

.products-table {
  min-width: 1560px;
  table-layout: fixed;
}

.products-table th:nth-child(1),
.products-table td:nth-child(1) {
  width: 82px;
}

.products-table th:nth-child(2),
.products-table td:nth-child(2) {
  width: 270px;
}

.products-table th:nth-child(3),
.products-table td:nth-child(3) {
  width: 130px;
}

.products-table th:nth-child(4),
.products-table td:nth-child(4) {
  width: 116px;
}

.products-table th:nth-child(5),
.products-table td:nth-child(5),
.products-table th:nth-child(6),
.products-table td:nth-child(6) {
  width: 132px;
}

.products-table th:nth-child(7),
.products-table td:nth-child(7) {
  width: 300px;
}

.products-table th:nth-child(8),
.products-table td:nth-child(8) {
  width: 110px;
}

.products-table th:nth-child(9),
.products-table td:nth-child(9) {
  width: 156px;
}

.product-desc-input {
  margin-top: 8px;
}

.product-sort-input {
  text-align: center;
}

.product-actions {
  min-width: 132px;
}

.users-table {
  min-width: 1270px;
  table-layout: fixed;
}

.users-table th:nth-child(1),
.users-table td:nth-child(1) {
  width: 78px;
}

.users-table th:nth-child(2),
.users-table td:nth-child(2) {
  width: 180px;
}

.users-table th:nth-child(3),
.users-table td:nth-child(3) {
  width: 140px;
}

.users-table th:nth-child(4),
.users-table td:nth-child(4) {
  width: 220px;
}

.users-table th:nth-child(5),
.users-table td:nth-child(5) {
  width: 106px;
}

.users-table th:nth-child(6),
.users-table td:nth-child(6) {
  width: 96px;
}

.users-table th:nth-child(7),
.users-table td:nth-child(7) {
  width: 142px;
}

.users-table th:nth-child(8),
.users-table td:nth-child(8) {
  width: 298px;
}

.users-table th,
.users-table td {
  padding: 12px 14px;
  vertical-align: middle;
}

.users-table .text-input,
.users-table .select-input {
  height: 38px;
  padding: 0 10px;
}

.employee-no-input {
  text-align: center;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 260px;
}

.password-reset {
  display: grid;
  grid-template-columns: 118px 66px;
  gap: 8px;
  align-items: center;
  min-width: 192px;
}

.row-actions .text-input,
.row-actions .select-input {
  height: 36px;
  font-size: 13px;
}

.small-button {
  height: 36px;
  min-width: 66px;
  padding: 0 10px;
  border: 1px solid #cdd3da;
  border-radius: 6px;
  background: #ffffff;
  color: #252a30;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.icon-button {
  width: 36px;
  height: 36px;
  border: 1px solid #cdd3da;
  border-radius: 6px;
  background: #ffffff;
  color: #252a30;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.danger-button {
  border-color: #e0bbb1;
  color: #a03e2b;
}

.refunds-table {
  min-width: 1320px;
}

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

.refund-status-sub {
  margin-top: 8px;
}

.finance-panel {
  display: grid;
  grid-template-columns: 180px 240px 128px;
  gap: 12px;
  align-items: end;
  max-width: 620px;
}

.orders-table {
  width: 100%;
  min-width: 1480px;
  border-collapse: collapse;
}

.orders-table th,
.orders-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #edf0f2;
  text-align: left;
  vertical-align: top;
}

.orders-table th {
  background: #f8fafb;
  color: #59616b;
  font-size: 13px;
  font-weight: 800;
}

.orders-table td {
  color: #272c32;
  font-size: 14px;
}

.orders-table tr:last-child td {
  border-bottom: 0;
}

.muted {
  color: #858d96;
  font-size: 12px;
}

.status-pill {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 6px;
  background: #eef1f3;
  color: #3f464d;
  font-size: 12px;
  font-weight: 800;
}

.delivery-warning {
  margin: 14px 0;
  padding: 14px 16px;
  border: 1px solid #e3b6a9;
  border-radius: 8px;
  background: #fff3ee;
  color: #8b3827;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.6;
}

.delivery-provider-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.delivery-provider-card {
  padding: 16px;
  border: 1px solid #dfe4e8;
  border-radius: 8px;
  background: #ffffff;
}

.delivery-provider-card.is-ready {
  border-color: #a9cfbb;
  background: #f2f9f5;
}

.delivery-provider-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 800;
}

.delivery-provider-meta,
.delivery-provider-missing {
  margin-top: 9px;
  color: #747d86;
  font-size: 13px;
  line-height: 1.5;
}

.delivery-provider-missing {
  color: #9a3e27;
}

.delivery-flow-hint {
  margin-bottom: 14px;
  padding: 11px 13px;
  border-radius: 8px;
  background: #f2f5f7;
  color: #56606a;
  font-size: 13px;
  line-height: 1.5;
}

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

.delivery-wide-field {
  grid-column: span 2;
}

.delivery-quote-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
}

.delivery-jobs-head {
  margin-top: 30px;
  margin-bottom: 0;
}

.delivery-jobs-table {
  min-width: 1320px;
}

.delivery-job-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 210px;
}

@media (max-width: 1050px) {
  .delivery-form-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

@media (max-width: 680px) {
  .delivery-form-grid {
    grid-template-columns: 1fr;
  }

  .delivery-wide-field {
    grid-column: auto;
  }

  .delivery-quote-actions {
    align-items: stretch;
    flex-direction: column;
  }
}

.empty-cell {
  height: 120px;
  color: #8a929a !important;
  text-align: center !important;
  vertical-align: middle !important;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 16px;
}

.page-number-pager {
  flex-wrap: wrap;
}

.page-button {
  min-width: 38px;
  height: 36px;
  padding: 0 11px;
  border: 1px solid #cdd3da;
  border-radius: 6px;
  background: #ffffff;
  color: #252a30;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.page-button.is-active {
  border-color: #202429;
  background: #202429;
  color: #ffffff;
}

.page-button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

#ordersPageText {
  color: #646c75;
  font-size: 14px;
  font-weight: 800;
}

.store-search-field {
  position: relative;
}

.store-suggest-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 30;
  margin-top: 4px;
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid #d5dae0;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(32, 36, 41, 0.14);
}

.store-suggest-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  padding: 10px 14px;
  border: none;
  border-bottom: 1px solid #eef1f4;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.store-suggest-item:last-child {
  border-bottom: none;
}

.store-suggest-item:hover {
  background: #f4f6f8;
}

.store-suggest-title {
  font-size: 14px;
  font-weight: 800;
  color: #202429;
}

.store-suggest-address {
  font-size: 12px;
  color: #646c75;
}

.store-map-preview {
  color: #646c75;
  font-size: 14px;
}

.store-map-preview img {
  display: block;
  max-width: 100%;
  border-radius: 10px;
  border: 1px solid #d5dae0;
}

.store-editor-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

/* 门店表：列少，不继承订单表的 1480px 最小宽 */
.store-table {
  min-width: 640px;
}

.store-table td {
  vertical-align: middle;
}

.store-table .store-actions {
  white-space: nowrap;
}

.store-table .store-actions .ghost-button {
  margin-right: 8px;
}

/* 条款文档只读查看 */
.document-meta {
  margin: 8px 0 14px;
  color: #858d96;
  font-size: 13px;
}

.document-content {
  max-height: 520px;
  overflow-y: auto;
  padding: 16px 18px;
  border: 1px solid #edf0f2;
  border-radius: 8px;
  background: #fafbfc;
  color: #272c32;
  font-size: 14px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
}

.orders-table tr.is-selected td {
  background: #f4f6f8;
}
