.order-purchase-card {
  margin: 20px 0;
  padding: 22px;
  border: 1px solid var(--jl-color-border-default, #dce3eb);
  border-radius: var(--jl-radius-panel, 22px);
  background: var(--jl-color-bg-surface, #fff);
  box-shadow: var(--jl-shadow-card, 0 8px 24px rgba(24, 34, 48, .06));
  color: var(--jl-color-text-primary, #182230);
}

.order-purchase-card.is-ready {
  border-color: #b9dfca;
  background: linear-gradient(180deg, #fbfffc 0%, #fff 100%);
}

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

.order-purchase-eyebrow {
  display: block;
  margin-bottom: 4px;
  color: var(--jl-color-bg-brand, #0071e3);
  font-size: 14px;
  font-weight: 750;
}

.order-purchase-head h3 {
  margin: 0;
  font-size: 25px;
  line-height: 1.25;
  letter-spacing: -.02em;
}

.order-purchase-head p {
  margin: 7px 0 0;
  color: var(--jl-color-text-secondary, #667085);
  font-size: 16px;
  line-height: 1.55;
}

.order-purchase-summary {
  min-width: 250px;
  padding: 13px 16px;
  border-radius: var(--jl-radius-lg, 14px);
  background: var(--jl-color-bg-brand-soft, #e8f2ff);
  text-align: right;
}

.order-purchase-summary strong,
.order-purchase-summary span {
  display: block;
}

.order-purchase-summary strong {
  font-size: 17px;
  line-height: 1.4;
}

.order-purchase-summary span {
  margin-top: 3px;
  color: #6b778c;
  font-size: 14px;
}

.order-purchase-card.is-ready .order-purchase-summary {
  color: #166534;
  background: #eaf8ef;
}

.order-purchase-list {
  display: grid;
  gap: 10px;
}

.order-purchase-item {
  display: grid;
  grid-template-columns: 42px minmax(220px, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 15px 16px;
  border: 1px solid var(--jl-color-border-default, #dce3eb);
  border-radius: var(--jl-radius-lg, 14px);
  background: var(--jl-color-bg-subtle, #fbfcfe);
}

.order-purchase-item.is-ordered {
  border-color: #bfd5fb;
  background: #f7faff;
}

.order-purchase-item.is-arrived {
  border-color: #c7e7d3;
  background: #f7fcf9;
}

.order-purchase-status-dot {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  background: #eef2f7;
  color: #667085;
  font-size: 15px;
  font-weight: 800;
}

.is-ordered .order-purchase-status-dot {
  color: #1d4ed8;
  background: #e8f0ff;
}

.is-arrived .order-purchase-status-dot {
  color: #166534;
  background: #dcf5e5;
}

.order-purchase-main {
  min-width: 0;
}

.order-purchase-name {
  display: flex;
  align-items: center;
  gap: 10px;
}

.order-purchase-name strong {
  overflow: hidden;
  font-size: 18px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-purchase-badge {
  flex: none;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef2f7;
  color: #566176;
  font-size: 13px;
  font-weight: 700;
}

.is-ordered .order-purchase-badge {
  color: #1d4ed8;
  background: #e8f0ff;
}

.is-arrived .order-purchase-badge {
  color: #166534;
  background: #dcf5e5;
}

.order-purchase-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 16px;
  margin-top: 5px;
  color: #69758a;
  font-size: 14px;
}

.order-purchase-meta .is-risk {
  color: #b42318;
  font-weight: 750;
}

.order-inventory-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.order-inventory-strip span {
  padding: 5px 8px;
  border-radius: 8px;
  background: #f3f6fa;
  color: #536176;
  font-size: 12px;
  font-weight: 650;
}

.order-purchase-primary {
  min-width: 170px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.order-purchase-primary > .btn,
.order-purchase-order-action .btn {
  min-height: 42px;
  white-space: nowrap;
}

.order-purchase-order-action {
  display: flex;
  align-items: center;
  gap: 8px;
}

.order-purchase-order-action input {
  width: 180px;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid #d5dde8;
  border-radius: 11px;
  background: #fff;
  font: inherit;
}

.order-purchase-arrived-action {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  color: #166534;
}

.order-purchase-arrived-action button {
  border: 0;
  background: transparent;
  color: #718096;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.order-purchase-delete {
  flex: none;
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid #efb5ad;
  border-radius: 11px;
  background: #fff;
  color: #c43226;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.order-purchase-delete:hover { background: #fff3f1; }

.order-purchase-details {
  grid-column: 2 / -1;
  margin-top: -2px;
}

.order-purchase-details summary,
.order-purchase-add summary {
  width: max-content;
  color: #315a9d;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.order-purchase-edit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.order-purchase-edit-grid label {
  color: #667085;
  font-size: 13px;
  font-weight: 650;
}

.order-purchase-edit-grid input,
.order-purchase-edit-grid select,
.order-purchase-add-row input {
  display: block;
  width: 100%;
  min-height: 42px;
  margin-top: 5px;
  padding: 8px 11px;
  border: 1px solid #d5dde8;
  border-radius: 11px;
  background: #fff;
  color: #1f2937;
  font: inherit;
}

.order-purchase-edit-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
}

.order-purchase-empty {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 74px;
  padding: 14px 16px;
  border: 1px dashed #cbd6e4;
  border-radius: 16px;
  background: #fafcff;
}

.order-purchase-empty strong {
  font-size: 17px;
}

.order-purchase-empty span {
  flex: 1;
  color: #6b778c;
  font-size: 14px;
}

.order-purchase-add {
  margin-top: 13px;
  padding-top: 13px;
  border-top: 1px solid #edf0f5;
}

.order-purchase-add-row {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) minmax(200px, 1fr) auto;
  align-items: end;
  gap: 10px;
  margin-top: 12px;
}

.order-purchase-add-row input {
  margin-top: 0;
}

@media (max-width: 900px) {
  .order-purchase-head,
  .order-purchase-empty {
    align-items: stretch;
    flex-direction: column;
  }

  .order-purchase-summary {
    min-width: 0;
    text-align: left;
  }

  .order-purchase-item {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .order-purchase-primary,
  .order-purchase-details {
    grid-column: 2;
  }

  .order-purchase-primary { justify-content: flex-start; }

  .order-purchase-order-action {
    align-items: stretch;
    flex-direction: column;
  }

  .order-purchase-order-action input {
    width: 100%;
  }

  .order-purchase-edit-grid,
  .order-purchase-add-row {
    grid-template-columns: 1fr;
  }
}
