* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f7f4ef;
  color: #33291f;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button {
  min-height: 38px;
  padding: 0 16px;
  color: #fff;
  background: #d86f2f;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

button.secondary {
  color: #6f6257;
  background: #efe7de;
}

.app {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 220px;
  padding: 24px 16px;
  background: #33291f;
  color: #fff;
}

.brand {
  margin-bottom: 28px;
  font-size: 22px;
  font-weight: 800;
}

.nav {
  display: block;
  width: 100%;
  margin-bottom: 10px;
  color: #e8ded4;
  text-align: left;
  background: transparent;
}

.nav.active {
  color: #fff;
  background: #d86f2f;
}

.content {
  flex: 1;
  min-width: 0;
  padding: 28px;
  overflow-x: hidden;
}

.hidden {
  display: none !important;
}

.login-panel,
.card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(61, 45, 32, 0.06);
}

.login-panel {
  max-width: 520px;
  margin: 80px auto;
  padding: 32px;
}

.login-row {
  display: flex;
  gap: 12px;
  margin: 24px 0 12px;
}

.login-row input {
  flex: 1;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

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

h1,
h2,
p {
  margin-top: 0;
}

.muted,
.hint {
  color: #88786b;
}

.grid.two {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 20px;
}

.editor-grid {
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
  gap: 28px;
}

.product-editor {
  max-width: 1100px;
}

.editor-actions {
  margin-top: 8px;
}

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

.section-head h3 {
  margin: 0 0 6px;
}

.sku-editor {
  margin: 8px 0 20px;
  padding-top: 18px;
  border-top: 1px solid #f0e7dd;
}

.sku-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sku-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.5fr) minmax(100px, 0.8fr) minmax(100px, 0.8fr) minmax(90px, 0.7fr) auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  background: #f7f4ef;
  border-radius: 8px;
}

.sku-row label {
  margin-bottom: 0;
}

.category-section {
  margin-top: 20px;
}

.card {
  max-width: 100%;
  min-width: 0;
  padding: 22px;
}

label {
  display: block;
  margin-bottom: 14px;
  color: #6f6257;
  font-size: 14px;
}

input,
select,
textarea {
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid #e3d8ce;
  border-radius: 8px;
}

textarea {
  min-height: 90px;
  resize: vertical;
}

.json-editor {
  min-height: 420px;
  font-family: Consolas, monospace;
}

.actions {
  display: flex;
  gap: 10px;
}

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

.stat {
  padding: 22px;
  background: #fff;
  border-radius: 8px;
}

.stat strong {
  display: block;
  margin-top: 8px;
  color: #d86f2f;
  font-size: 28px;
}

.table {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
}

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

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid #f0e7dd;
  text-align: left;
  vertical-align: top;
}

th {
  color: #6f6257;
  font-weight: 700;
}

.row-actions {
  display: flex;
  gap: 8px;
}

.danger {
  background: #b94132;
}

.image-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 6px 0 16px;
}

.image-row {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 8px;
  background: #f7f4ef;
  border-radius: 8px;
}

.image-row img {
  width: 70px;
  height: 70px;
  object-fit: cover;
  border-radius: 6px;
}

.image-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.image-path {
  margin-bottom: 8px;
  color: #88786b;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.product-thumb {
  width: 54px;
  height: 54px;
  object-fit: cover;
  border-radius: 6px;
  background: #f7f4ef;
}

.product-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
}

.thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  background: #d86f2f;
}

.status-select {
  min-width: 110px;
}

.order-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.order-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
  padding: 12px;
  background: #fffaf6;
  border: 1px solid #ead7c7;
  border-radius: 10px;
}

.order-filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.order-search {
  display: flex;
  flex: 1 1 360px;
  align-items: center;
  gap: 8px;
  min-width: 280px;
}

.order-search input {
  min-width: 0;
  margin: 0;
}

.filter-button {
  color: #6f6257;
  background: #ffffff;
  border: 1px solid #ead7c7;
}

.filter-button.active {
  color: #ffffff;
  background: #d86f2f;
  border-color: #d86f2f;
}

.order-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: #6f6257;
  font-size: 13px;
}

.order-no-cell {
  min-width: 0;
}

.order-card-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.order-card {
  padding: 16px;
  background: #ffffff;
  border: 1px solid #f0e7dd;
  border-radius: 10px;
}

.order-card.order-row-pending {
  background: #fffaf4;
}

.order-card.order-row-refund {
  background: #fff5f2;
}

.order-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f0e7dd;
}

.order-card-status {
  flex-shrink: 0;
  padding: 8px 14px;
  color: #d86f2f;
  font-weight: 700;
  background: #ffffff;
  border-radius: 999px;
}

.order-card-grid {
  display: grid;
  grid-template-columns: minmax(160px, 0.85fr) minmax(260px, 1.5fr) minmax(170px, 0.9fr) minmax(170px, 0.9fr);
  gap: 14px;
  align-items: start;
}

.order-panel {
  min-width: 0;
  line-height: 1.7;
}

.order-panel-wide {
  min-width: 0;
}

.order-panel-wide:last-child {
  grid-column: 1 / -1;
}

.panel-label {
  margin-bottom: 8px;
  color: #88786b;
  font-size: 13px;
  font-weight: 700;
}

.order-item {
  padding: 10px;
  background: #f7f4ef;
  border-radius: 8px;
}

.order-item-line {
  display: flex;
  gap: 10px;
  min-width: 0;
}

.order-item-thumb {
  flex-shrink: 0;
  width: 54px;
  height: 54px;
  object-fit: cover;
  border-radius: 6px;
  background: #ffffff;
}

.order-item-thumb.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  background: #d86f2f;
}

.order-item-name {
  margin-bottom: 4px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.refund-cell {
  min-width: 0;
  line-height: 1.7;
}

.refund-status {
  font-weight: 700;
  color: #d86f2f;
}

.notification-type {
  font-weight: 700;
  color: #d86f2f;
}

.refund-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.refund-records {
  margin-top: 6px;
}

.logistics-editor {
  min-width: 0;
}

.order-ship-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.trace-list {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #f0e7dd;
}

.order-action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 92px;
}

.copy-row {
  margin-top: 8px;
}

.mini-copy {
  min-height: 28px;
  margin-top: 8px;
  padding: 5px 9px;
  color: #6f6257;
  font-size: 12px;
  background: #ffffff;
  border: 1px solid #ead7c7;
  border-radius: 999px;
}

.customer-cell,
.address-cell {
  min-width: 0;
  line-height: 1.7;
}

.amount-cell {
  margin-bottom: 10px;
  line-height: 1.7;
}

.amount-paid {
  font-weight: 700;
}

.empty-tip {
  padding: 20px;
  background: #fffaf6;
  border-radius: 10px;
}

@media (max-width: 1180px) {
  .order-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .order-card-grid {
    grid-template-columns: 1fr;
  }
}

.customer-name {
  font-weight: 700;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #33291f;
  white-space: nowrap;
}

.inline-check input {
  width: auto;
  margin: 0;
}

.member-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 150px;
}

.member-level-row input[readonly] {
  color: #88786b;
  background: #f7f4ef;
}

.member-users-card {
  margin-top: 20px;
}

.customer-ranking-card {
  margin-top: 20px;
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 28px;
  padding: 0 8px;
  color: #7a6a5c;
  font-size: 13px;
  font-weight: 800;
  background: #f4eee7;
  border-radius: 999px;
}

.rank-badge.top-1 {
  color: #ffffff;
  background: #d86f2f;
}

.rank-badge.top-2 {
  color: #5f5348;
  background: #ead7bf;
}

.rank-badge.top-3 {
  color: #6f4b2f;
  background: #f1caa4;
}

.strong-money {
  color: #d86f2f;
  font-weight: 800;
}

.marketing-section {
  margin-top: 20px;
}

.member-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
}

.member-user.compact {
  min-width: 0;
  margin-bottom: 6px;
}

.member-avatar {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border-radius: 50%;
}

.member-avatar.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 700;
  background: #d86f2f;
}

.pets-cell {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 220px;
}

.address-list-cell {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 240px;
}

.pet-count {
  font-weight: 700;
}

.pet-detail-card {
  padding: 8px 10px;
  border: 1px solid #ead7c7;
  border-radius: 8px;
  background: #fffaf6;
}

.address-detail-card {
  padding: 8px 10px;
  border: 1px solid #ead7c7;
  border-radius: 8px;
  background: #fffaf6;
}

.pet-detail-name {
  margin-bottom: 4px;
  font-weight: 700;
  color: #3a2a1f;
}

.default-text {
  margin-top: 4px;
  color: #d86f2f;
  font-weight: 700;
}
