.order-items-cell {
  min-width: 270px;
  white-space: normal;
}

.order-product-row {
  display: grid;
  grid-template-columns: 30px minmax(130px, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
}

.order-product-row + .order-product-row {
  border-top: 1px solid var(--line);
}

.order-product-mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 9px;
  background: var(--mint);
  color: var(--green);
  font-family: serif;
}

.order-product-row div {
  min-width: 0;
}

.order-product-row b,
.order-product-row small {
  display: block;
}

.order-product-row b {
  overflow: hidden;
  color: #29473d;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-product-row small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.order-product-row strong {
  color: var(--green);
  font-size: 11px;
  white-space: nowrap;
}

.order-items-more,
.order-items-empty {
  display: block;
  color: var(--muted);
  font-size: 9px;
}

.order-items-more {
  padding-top: 7px;
  border-top: 1px dashed var(--line);
}

.order-edit-modal {
  width: min(580px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}

.product-edit-modal,
.order-detail-modal {
  width: min(680px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}

.modal .check-label {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding-top: 18px;
}

.modal .check-label input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--green);
}

.modal label small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
}

.stat-card-link {
  width: 100%;
  color: inherit;
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
  touch-action: manipulation;
}

.stat-card-link:hover {
  transform: translateY(-2px);
  border-color: rgba(14, 74, 58, 0.26);
  box-shadow: 0 14px 34px rgba(31, 57, 46, 0.09);
}

.stat-card-link:focus-visible,
.text-button:focus-visible,
.close-button:focus-visible {
  outline: 3px solid rgba(25, 102, 80, 0.28);
  outline-offset: 2px;
}

.stat-card-link .stat-top,
.stat-card-link .stat-value,
.stat-card-link .stat-note {
  display: flex;
}

.stat-card-link .stat-value {
  display: block;
}

.stat-card-link .stat-note {
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.stat-card-link .stat-note i {
  color: var(--green);
  font-style: normal;
  font-weight: 600;
  white-space: nowrap;
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
}

.table-actions .text-button {
  min-height: 30px;
  padding: 4px 7px;
  border-radius: 7px;
}

.table-actions .text-button:hover {
  background: var(--mint);
}

.primary-button:disabled,
.text-button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.detail-loading,
.detail-error {
  display: grid;
  min-height: 210px;
  place-items: center;
  border-radius: 14px;
  background: #f8faf8;
  color: var(--muted);
  font-size: 12px;
}

.detail-error {
  align-content: center;
  gap: 8px;
  color: var(--danger);
}

.order-detail-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  padding: 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, #eff6f2, #f8faf8);
}

.order-detail-summary small,
.order-detail-summary b {
  display: block;
}

.order-detail-summary small,
.detail-section small {
  color: var(--muted);
  font-size: 10px;
}

.order-detail-summary b {
  margin-top: 5px;
  color: var(--green);
  font: 16px Georgia, serif;
  overflow-wrap: anywhere;
}

.detail-section {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.detail-section-head,
.detail-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.detail-section-head h3 {
  margin: 0;
  font-size: 13px;
}

.detail-section-head span {
  color: var(--muted);
  font-size: 10px;
}

.detail-line {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 11px;
}

.detail-money-grid,
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 20px;
}

.detail-money-grid div,
.detail-grid div {
  min-width: 0;
}

.detail-money-grid small,
.detail-money-grid b,
.detail-grid small,
.detail-grid b {
  display: block;
}

.detail-money-grid b,
.detail-grid b {
  margin-top: 5px;
  font-size: 11px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.detail-money-grid .detail-total b {
  color: var(--green);
  font: 15px Georgia, serif;
}

.detail-timeline {
  margin-top: 10px;
}

.detail-timeline > div {
  display: grid;
  grid-template-columns: 12px 1fr;
  gap: 10px;
  position: relative;
  padding-bottom: 12px;
}

.detail-timeline > div:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 10px;
  bottom: -2px;
  left: 4px;
  width: 1px;
  background: var(--line);
}

.detail-timeline i {
  width: 9px;
  height: 9px;
  margin-top: 3px;
  border-radius: 50%;
  background: var(--green2);
}

.detail-timeline b,
.detail-timeline small {
  display: block;
}

.detail-timeline b {
  font-size: 11px;
}

.detail-timeline small {
  margin-top: 4px;
}

.detail-created {
  padding-top: 14px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.7;
  text-align: center;
}

.order-product-section {
  margin: 2px 0 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8faf8;
}

.order-product-heading,
.order-product-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.order-product-heading h3 {
  margin: 0;
  font-size: 13px;
}

.order-product-heading span,
.order-product-total span {
  color: var(--muted);
  font-size: 10px;
}

.order-product-list {
  margin: 9px 0;
  padding: 4px 10px;
  border-radius: 11px;
  background: #fff;
}

.order-product-total {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.order-product-total b {
  color: var(--green);
  font-family: Georgia, serif;
  font-size: 14px;
}

@media (max-width: 720px) {
  .order-items-cell {
    min-width: 235px;
  }

  .order-edit-modal {
    padding: 24px 20px;
  }

  .product-edit-modal,
  .order-detail-modal {
    max-height: calc(100dvh - 20px);
    padding: 24px 18px max(24px, env(safe-area-inset-bottom));
  }

  .detail-money-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  #productEditForm .form-grid,
  #productCommerceForm .form-grid {
    grid-template-columns: 1fr;
  }

  #productEditForm .span-2,
  #productCommerceForm .span-2 {
    grid-column: auto;
  }

  .detail-grid .span-2 {
    grid-column: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .stat-card-link {
    transition: none;
  }
}
