.order-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.order-overview-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  padding: 24px;
  box-shadow: var(--shadow);
}

.order-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.order-card-header .eyebrow {
  font-size: 11px;
  margin-bottom: 6px;
}

.order-card-header h2 {
  margin: 0;
  font-size: 23px;
}

.order-card-header .support-case-id {
  font-size: 12px;
  max-width: 60%;
  text-align: center;
}

.order-card-date,
.order-card-arrival {
  color: var(--muted);
  font-size: 13px;
  margin: 16px 0;
}

.order-card-preview {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 146px;
  background: #f7faf8;
  border-radius: 12px;
  padding: 18px;
  margin: 0 0 20px;
}

.order-image-stack {
  position: relative;
  flex: 0 0 112px;
  height: 112px;
}

.order-stack-photo {
  position: absolute;
  inset: 0 12px 12px 0;
  border: 3px solid #fff;
  box-shadow: 0 3px 10px #18342416;
  border-radius: 10px;
  overflow: hidden;
  background: #eef5f1;
  z-index: 3;
}

.order-stack-photo:nth-child(2) {
  transform: translate(6px, 6px) rotate(4deg);
  z-index: 2;
}

.order-stack-photo:nth-child(3) {
  transform: translate(12px, 12px) rotate(8deg);
  z-index: 1;
}

.order-stack-photo img,
.order-product-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.order-photo-placeholder {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  background: #eef5f1;
  color: #84a692;
}

.order-photo-placeholder svg {
  width: 42%;
  height: 42%;
}

.order-card-copy {
  min-width: 0;
}

.order-card-copy h3 {
  font-size: 16px;
  line-height: 1.45;
  margin: 0 0 8px;
  overflow-wrap: anywhere;
}

.order-card-copy p {
  font-size: 13px;
  margin: 0 0 6px;
  overflow-wrap: anywhere;
}

.order-card-stores {
  color: var(--muted);
}

.order-overview-card footer {
  margin-top: auto;
}

.order-card-arrival {
  min-height: 20px;
  line-height: 20px;
}

.order-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 16px 0;
  font-size: 14px;
}

.order-card-meta strong {
  font-size: 20px;
}

.order-overview-card footer .btn-market {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

.order-detail-product {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.order-detail-product:last-child {
  border-bottom: 0;
}

.order-product-photo {
  width: 88px;
  height: 88px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.order-product-price {
  white-space: nowrap;
}

.order-product-price small {
  display: block;
  color: var(--muted);
  font-weight: 400;
  text-align: right;
}

@media(max-width:1199px) {

  .order-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media(max-width:700px) {

  .order-card-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .order-overview-card {
    padding: 18px;
  }

  .order-detail-product {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 12px;
  }

  .order-product-photo {
    width: 64px;
    height: 64px;
  }

  .order-product-price {
    grid-column: 2;
    font-size: 14px;
  }

  .order-product-price small {
    display: inline;
    text-align: left;
    margin-left: 4px;
  }
}

.contact-details {
  margin: 16px 0 0;
  font-size: 14px;
}

.contact-details>div {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 14px;
  margin: 12px 0;
}

.contact-details dt {
  color: var(--muted);
  font-weight: 500;
}

.contact-details dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.support-case-id[data-status="CANCELLED" i],
.status-pill[data-status="CANCELLED" i],
.status-badge[data-status="CANCELLED" i] {
  color: #b42318;
  background: #fef3f2;
  border: 1px solid #fda29b;
}

.support-case-id[data-status="DELIVERED" i],
.status-pill[data-status="DELIVERED" i],
.status-badge[data-status="DELIVERED" i] {
  color: #067647;
  background: #ecfdf3;
  border: 1px solid #75e0a7;
}

.order-card-grid>.empty-state {
  grid-column: 1 / -1;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.header-inner.workspace-header-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}

.workspace-header-inner .header-actions {
  margin-left: auto;
}

.site-header .header-signout {
  display: flex;
  margin: 0;
}

.inspection-case {
  border-top: 1px solid var(--line);
  padding: 24px 0;
  min-width: 0;
}

.inspection-case:last-child {
  padding-bottom: 0;
}

.support-case-id[data-status="CLOSED" i] {
  color: #476754;
  background: #f2f7f4;
  border-color: #d0ddd5;
}

.support-case-id[data-status="REFUNDED" i] {
  color: #067647;
  background: #ecfdf3;
  border-color: #75e0a7;
}

.inspection-case .section-heading {
  align-items: start;
}

.inspection-line {
  margin: 16px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.inspection-line legend {
  font-size: 15px;
  font-weight: 650;
}

.inspection-message-form,
.inspection-refund-form {
  margin: 20px 0;
  max-width: 640px;
}

.inspection-messages {
  max-height: 240px;
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow-wrap: anywhere;
}

.replacement-progress {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 0;
  margin: 20px 0;
  list-style: none;
}

.replacement-progress li {
  flex: 1 1 140px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.replacement-progress li>span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 50%;
  background: #edf4f0;
}

.replacement-progress .is-done {
  color: var(--ink);
}

.replacement-progress .is-done>span {
  background: #f4d57d;
}

.delivery-assignments-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 24px;
}

.delivery-assignments-panel .delivery-assignment-list {
  display: block;
}

.delivery-assignment-row {
  display: grid;
  grid-template-columns: minmax(160px, .8fr) minmax(0, 2fr) auto;
  align-items: center;
  gap: 28px;
  padding: 24px 0;
  border-top: 1px solid var(--line, #e1ede6);
}

.delivery-assignment-row>* {
  min-width: 0;
}

.delivery-assignment-contact {
  margin: 0;
  display: grid;
  gap: 10px;
}

.delivery-assignment-contact>div {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 12px;
}

.delivery-assignment-contact dt {
  color: var(--muted, #668573);
  font-weight: 500;
}

.delivery-assignment-contact dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.delivery-assignment-row .btn-market {
  white-space: nowrap;
}

@media (max-width: 767px) {

  .delivery-assignments-heading {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
  }

  .delivery-assignment-row {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .delivery-assignment-row .btn-market {
    justify-self: start;
  }
}

/* Doorstep actions sit below the delivery details and share the workspace theme. */
.delivery-resolution-area {
  margin-top: 32px;
}

.delivery-action-heading {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.delivery-action-heading>div {
  min-width: 0;
}

.delivery-action-heading .eyebrow {
  margin-bottom: 6px;
  font-size: 11px;
}

.delivery-action-heading h2 {
  margin-bottom: 10px;
}

.delivery-action-icon {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  height: 44px;
  border-radius: 12px;
  background: #fcf3cf;
  color: var(--ink);
}

.delivery-action-icon .nav-icon {
  width: 24px;
  height: 24px;
}

.delivery-action-panel .inspection-form {
  margin-top: 24px !important;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.delivery-action-panel .inspection-form>summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  background: #f8fbf9;
  color: var(--ink);
  font-weight: 650;
  cursor: pointer;
  list-style: none;
}

.delivery-action-panel .inspection-form>summary::-webkit-details-marker {
  display: none;
}

.inspection-toggle {
  font-size: 24px;
  line-height: 1;
}

.inspection-form[open] .inspection-toggle {
  transform: rotate(45deg);
}

.delivery-action-panel .inspection-form>form {
  padding: 4px 20px 20px;
}

.delivery-action-panel label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
}

.delivery-issue-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 24px;
  margin-top: 24px;
}

.delivery-issue-fields>div {
  min-width: 0;
}

.delivery-action-panel textarea {
  resize: vertical;
  min-height: 100px;
}

.delivery-field-hint {
  font-size: 13px;
  margin: 10px 0 0;
}

.delivery-action-footer {
  border-top: 1px solid var(--line);
  margin-top: 24px;
  padding-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.delivery-action-footer>p {
  font-size: 13px;
}

.delivery-action-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.delivery-action-buttons button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.delivery-report-note {
  margin: 24px 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fbf9;
  overflow-wrap: anywhere;
}

.delivery-report-note p {
  margin-top: 8px;
}

@media (max-width: 767px) {

  .delivery-issue-fields {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .delivery-action-heading {
    gap: 12px;
  }

  .delivery-action-icon {
    flex-basis: 36px;
    height: 36px;
    border-radius: 10px;
  }

  .delivery-action-footer,
  .delivery-action-buttons {
    width: 100%;
  }

  .delivery-action-buttons button {
    width: 100%;
  }

  .delivery-action-panel .inspection-form>summary {
    padding: 16px;
  }

  .delivery-action-panel .inspection-form>form {
    padding: 0 16px 16px;
  }
}

/* Keep seller milestones in chronological order, independent of current outcome. */
.seller-receipt-flow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
}

.seller-receipt-flow li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .65rem;
  text-align: center;
  position: relative;
  min-width: 0;
}

.seller-receipt-flow li:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 22px;
  left: calc(50% + 28px);
  width: calc(100% - 40px);
  height: 2px;
  background: #e2efe7;
}

.seller-receipt-flow .is-done .delivery-step-dot {
  background: #efd785;
  color: #193324;
}

.seller-receipt-flow .muted {
  font-size: .85rem;
}

.seller-receipt-note {
  margin: 1.5rem 0 0;
  padding: .85rem 1rem;
  background: #f7faf8;
  border-radius: 10px;
}

@media (max-width: 575px) {

  .seller-receipt-flow {
    gap: .5rem;
  }

  .seller-receipt-flow strong {
    font-size: .8rem;
  }

  .seller-receipt-flow .muted {
    font-size: .75rem;
  }
}

/* Shared admin/seller workspace: keep navigation beside the current section. */
.dashboard-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.dashboard-sidebar,
.dashboard-content {
  min-width: 0;
}

.dashboard-sidebar .seller-workspace-nav {
  display: flex;
  flex-direction: column;
}

.dashboard-sidebar .workspace-menu>summary {
  display: none;
}

.dashboard-content>.shell {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

.dashboard-content .seller-workspace {
  display: block;
}

.dashboard-content .seller-workspace>.workspace-menu {
  display: none;
}

.dashboard-content[aria-busy="true"] {
  opacity: .65;
}

.dashboard-content .operations-links {
  overflow-wrap: anywhere;
}

.replacement-list-card {
  display: flex;
  align-items: center;
  gap: 20px;
}

.replacement-list-card>div:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.replacement-list-card .order-product-photo {
  flex: 0 0 100px;
  width: 100px;
  height: 100px;
}

.replacement-list-card .order-product-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
}

.replacement-store-name {
  color: #193324;
  font-weight: 600;
  margin-bottom: 6px;
}

@media (max-width: 900px) {

  .dashboard-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .dashboard-sidebar .workspace-menu>summary {
    display: list-item;
  }

  .dashboard-sidebar .seller-workspace-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-sidebar .seller-workspace-nav .eyebrow {
    grid-column: 1 / -1;
  }
}

@media (max-width: 420px) {

  .replacement-list-card {
    gap: 12px;
    align-items: flex-start;
  }

  .replacement-list-card .order-product-photo {
    flex-basis: 68px;
    width: 68px;
    height: 68px;
  }
}

.dashboard-content .support-case-id {
  white-space: normal;
  overflow-wrap: anywhere;
}

@media (max-width: 500px) {

  .dashboard-content .order-card-preview {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .dashboard-content .order-image-stack {
    flex: 0 0 112px;
    width: 112px;
  }

  .dashboard-content .order-card-header {
    flex-wrap: wrap;
  }

  .dashboard-content .order-card-header .support-case-id {
    max-width: 100%;
  }
}

/* Sidebar styling is independent of the page loaded into the workspace. */
.dashboard-sidebar .seller-workspace-nav a,
.dashboard-sidebar .seller-workspace-nav a:visited {
  color: #193324 !important;
  font-weight: 400;
  text-decoration: none;
}

.dashboard-sidebar .seller-workspace-nav a:hover {
  background: #faf3cf !important;
  color: #193324 !important;
}

.dashboard-sidebar .seller-workspace-nav a[aria-current="page"] {
  color: #193324 !important;
  background: #fcf4cf !important;
  border-color: #ead896 !important;
  font-weight: 700;
}

.dashboard-content:focus {
  outline: none;
}

.replacement-list-card .replacement-store-name {
  color: #359a5f;
  font-weight: 400;
}

.replacement-list-card .replacement-product-name {
  font-size: 1.2em;
  font-weight: 700;
  line-height: 1.4;
  color: #193324;
}

.delivery-activity-list {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
}

.delivery-activity-list li {
  border-top: 1px solid var(--line);
  padding: 16px 0;
}

.delivery-activity-heading {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  justify-content: space-between;
}

.delivery-activity-heading time,
.delivery-activity-store {
  color: var(--muted);
  font-size: 13px;
}

.delivery-activity-store {
  margin: 8px 0;
}

#workspace-content:focus {
  outline: none !important;
}

.dashboard-sidebar .seller-workspace-nav a:focus-visible {
  outline: 2px solid #d5ad45;
  outline-offset: 2px;
}

.portal-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 16px;
  margin: 24px 0
}

.portal-stat-grid .workspace-panel {
  padding: 22px
}

.portal-stat-grid strong {
  display: block;
  font-size: 1.8rem;
  color: #193123;
  margin-top: 8px
}

.portal-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 24px 0
}

.portal-tabs a {
  padding: 12px 18px;
  background: white;
  color: #193123;
  border: 1px solid #dce9e1;
  border-radius: 10px;
  text-decoration: none
}

.portal-tabs a[aria-current=page] {
  background: #fbf3d0;
  border-color: #e8d796;
  font-weight: 700
}

.portal-form {
  max-width: 1000px;
  display: grid;
  gap: 18px
}

.portal-form textarea {
  min-height: 100px
}

.portal-form .btn-market {
  justify-self: start
}

.portal-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr));
  gap: 22px
}

.portal-inventory-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0
}

.portal-inventory-card p {
  margin: 0
}

.portal-product-image {
  width: 100%;
  height: 190px;
  object-fit: contain;
  border-radius: 12px;
  background: #f6f9f7
}

.portal-product-facts,
.portal-card-actions,
.portal-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap
}

.portal-list-row {
  padding: 20px 0;
  border-bottom: 1px solid #e4efe9
}

.portal-search {
  display: flex;
  gap: 12px;
  margin-bottom: 24px
}

.portal-search input {
  flex: 1;
  min-width: 0
}

.portal-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer
}

.portal-toggle input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px
}

.portal-toggle span {
  display: block;
  width: 42px;
  height: 24px;
  border-radius: 99px;
  background: #c5d6cc;
  padding: 3px
}

.portal-toggle span:after {
  content: '';
  display: block;
  background: white;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  transition: transform .15s
}

.portal-toggle input:checked+span {
  background: #edcc70
}

.portal-toggle input:checked+span:after {
  transform: translateX(18px)
}

.portal-toggle input:focus-visible+span {
  outline: 3px solid #367052;
  outline-offset: 3px
}

.portal-card-actions {
  margin-top: auto;
  padding-top: 16px
}

.portal-table {
  max-width: 100%;
  overflow: auto
}

.portal-table table {
  width: 100%;
  border-collapse: collapse
}

.portal-table td,
.portal-table th {
  padding: 14px;
  text-align: left;
  border-bottom: 1px solid #e4efe9
}

.portal-form .form-field {
  min-width: 0
}

.portal-form input,
.portal-form select,
.portal-form textarea {
  max-width: 100%
}

@media(max-width:600px) {

  .portal-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr))
  }

  .portal-stat-grid .workspace-panel {
    padding: 15px
  }

  .portal-tabs a {
    padding: 10px;
    font-size: .9rem
  }

  .portal-search {
    flex-wrap: wrap
  }

  .portal-form {
    padding: 18px
  }

  .portal-stat-grid strong {
    font-size: 1.35rem
  }
}

.portal-product-form {
  grid-template-columns: repeat(2, minmax(0, 1fr))
}

.portal-product-form>* {
  grid-column: 1/-1
}

.portal-product-form>.form-field {
  grid-column: auto
}

.portal-product-form>.form-field:has(textarea) {
  grid-column: 1/-1
}

.portal-product-form textarea {
  min-height: 110px
}

.portal-report-filter {
  display: flex;
  align-items: end;
  gap: 16px;
  flex-wrap: wrap;
  margin: 24px 0
}

.portal-report-filter>div {
  flex: 1;
  min-width: 150px
}

.portal-report-filter label {
  display: block;
  margin-bottom: 8px
}

@media(max-width:650px) {

  .portal-product-form {
    grid-template-columns: 1fr
  }

  .portal-product-form>.form-field {
    grid-column: 1/-1
  }
}

.product-image,
.gallery-main,
.gallery-stage {
  position: relative
}

.product-discount-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  background: #af293b;
  color: #fff;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: .72rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 2px 6px #0001
}

.price-original {
  color: #789283;
  font-weight: 400;
  font-size: .78em;
  margin-left: 8px
}

.price-current {
  font-weight: 750;
  color: #111
}

.price:has(.price-original) .price-current {
  color: #111
}
