.pdd-upload-card-grid {
  padding: 12px 14px 6px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 280px));
  align-items: stretch;
  justify-content: start;
  gap: 12px;
}

.pdd-upload-order-card {
  min-width: 0;
  min-height: 360px;
  overflow: visible;
  display: flex;
  flex-direction: column;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.pdd-upload-order-card:hover {
  transform: translateY(-1px);
  border-color: #f0a7a1;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.pdd-upload-order-card.is-complete {
  border-top: 3px solid #73d13d;
}

.pdd-upload-order-card.is-missing {
  border-top: 3px solid #fadb14;
}

.pdd-upload-order-card:has([data-pdd-upload-order-select]:checked) {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(225, 37, 27, 0.1);
}

.pdd-upload-card-body {
  height: 100%;
  padding: 11px;
  display: grid;
  grid-template-rows: auto auto auto auto auto auto 1fr auto;
  gap: 8px;
}

.pdd-upload-card-kicker,
.pdd-upload-card-state-stack,
.pdd-upload-card-timeline {
  display: flex;
  align-items: center;
}

.pdd-upload-card-kicker {
  min-height: 24px;
  justify-content: space-between;
  gap: 8px;
}

.pdd-upload-card-select {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #667085;
  font-size: 11px;
  cursor: pointer;
}

.pdd-upload-card-state-stack {
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 5px;
}

.pdd-upload-card-heading {
  min-width: 0;
  display: block;
}

.pdd-upload-card-order-link {
  width: 100%;
  min-width: 0;
  padding: 0;
  overflow: visible;
  border: 0;
  background: transparent;
  color: #111827;
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
  text-align: left;
  text-overflow: clip;
  white-space: nowrap;
}

.pdd-upload-card-order-link:hover {
  color: var(--primary);
}

.pdd-upload-card-shop {
  min-width: 0;
  gap: 7px;
  color: #667085;
  font-size: 11px;
}

.pdd-upload-card-shop span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdd-upload-card-shop span + span::before {
  content: "·";
  margin-right: 7px;
  color: #c5c9d0;
}

.pdd-upload-card-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.pdd-upload-card-metrics > span {
  min-width: 0;
  min-height: 48px;
  padding: 7px 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 1px solid #edf0f3;
  border-radius: 6px;
  background: #f8f9fb;
}

.pdd-upload-card-metrics strong {
  color: #111827;
  font-size: 15px;
  line-height: 1.1;
}

.pdd-upload-card-metrics small {
  margin-top: 3px;
  overflow: hidden;
  color: #8a8f98;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdd-upload-card-metrics .is-success {
  color: #237804;
  border-color: #d9f7be;
  background: #f6ffed;
}

.pdd-upload-card-metrics .is-warning {
  color: #ad6800;
  border-color: #ffe58f;
  background: #fffbe6;
}

.pdd-upload-card-platform {
  min-width: 0;
  align-items: flex-start;
  flex-direction: column;
  gap: 5px;
  padding-top: 7px;
  border-top: 1px solid #f0f1f3;
  color: #8a8f98;
  font-size: 10px;
}

.pdd-upload-card-platform-statuses {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.pdd-upload-card-platform > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdd-upload-card-task {
  min-height: 32px;
  padding: 6px 8px;
  display: grid;
  gap: 3px;
  border-radius: 5px;
  background: #f7f8fa;
  color: #6b7280;
  font-size: 10px;
}

.pdd-upload-card-task > div {
  min-width: 0;
  gap: 6px;
}

.pdd-upload-card-task > div > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdd-upload-card-task p {
  margin: 0;
  overflow: hidden;
  color: #cf1322;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdd-upload-card-task.is-empty {
  place-items: center start;
}

.pdd-upload-card-timeline {
  min-width: 0;
  align-items: flex-start;
  flex-direction: column;
  gap: 3px;
  color: #98a0ad;
  font-size: 10px;
}

.pdd-upload-card-timeline span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdd-upload-card-actions {
  min-width: 0;
  display: grid;
  gap: 7px;
  align-self: end;
  padding-top: 2px;
}

.pdd-upload-card-primary-action,
.pdd-upload-card-secondary-actions {
  min-width: 0;
  display: flex;
  gap: 6px;
}

.pdd-upload-card-primary-action .primary-button {
  width: 100%;
}

.pdd-upload-card-secondary-actions {
  justify-content: flex-end;
}

.pdd-upload-card-secondary-actions > .secondary-button {
  flex: 1 1 auto;
}

.pdd-upload-card-actions .primary-button,
.pdd-upload-card-actions .secondary-button {
  min-height: 30px;
  padding: 0 9px;
  font-size: 11px;
}

.pdd-upload-card-actions .pdd-upload-row-primary {
  flex: 1 1 100%;
}

.pdd-upload-card-actions .pdd-upload-order-menu {
  flex: 0 0 auto;
  margin-left: 0;
}

.pdd-upload-empty {
  margin: 14px;
}

.pdd-upload-action-menu > summary {
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.pdd-upload-action-menu > summary::-webkit-details-marker {
  display: none;
}

.pdd-upload-action-menu-popover {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 40;
  min-width: 190px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
}

.pdd-upload-action-menu-popover .text-button {
  width: 100%;
  min-height: 34px;
  justify-content: flex-start;
  padding: 0 10px;
  color: var(--text);
  text-decoration: none;
}

.pdd-upload-action-menu-popover .text-button:hover {
  background: #f5f7fa;
}

.pdd-upload-action-menu-popover .text-button.danger {
  color: var(--danger);
}
