/* Cloudstore Central — Shared Visibility & Exception Management page.

   Only the page-specific additions live here: the responsive role-access matrix
   (wide table on large screens, accessible role cards on small screens), the
   illustrative exception card, and the resolution stepper. Everything else
   reuses the shared om-* visibility components (order-management.css /
   shipping-fulfilment.css).

   Accessibility notes:
   - Status, severity and role access are never communicated by colour alone;
     every state carries a text label. Colour and weight only reinforce it.
   - The stepper controls are hidden when JavaScript is unavailable (.no-js) so
     no non-functional control is exposed.
   - Reduced-motion users get instant, non-animated emphasis. */

/* Visual-editor refinement: size every section heading + lead pair on this
   page (the .section-head blocks). Scoped to .page-svem so it never affects
   other pages, the hero (.page-header), the final CTA, or footer headings. */
.page-svem .section-head h2 { font-size: 34px; }
.page-svem .section-head .lead { font-size: 18px; }

/* Visual-editor refinement: compact the order CS-10482 tab row on this page —
   12px labels and 5px padding. min-height (--max-touch) is left intact so the
   WCAG 2.2 AA touch target is preserved. Scoped to .page-svem only. */
.page-svem .om-tab { font-size: 12px; padding: 5px; }

/* ---------- responsive role-access matrix ---------- */
.svem-matrix__cap {
  caption-side: top;
  text-align: left;
  font-weight: 600;
  font-size: 18px;
  color: var(--color-ink);
  padding-bottom: var(--space-sm);
}

.svem-matrix th[scope="col"] {
  white-space: normal;
  min-width: 7rem;
}

/* Visual-editor refinements: column headers in primary ink, the corner
   "Information" header muted/smaller, and body cells muted at 12px. */
.om-table.svem-matrix thead th { color: var(--text-primary); }
.om-table.svem-matrix thead th:first-child {
  color: var(--colour-muted);
  font-size: 14px;
  font-weight: 600;
}
.om-table.svem-matrix tbody td {
  color: var(--text-muted);
  font-size: 12px;
}

/* Wide table by default; role cards hidden until the narrow breakpoint. */
.svem-matrix-cards {
  display: none;
}

@media (max-width: 60rem) {
  .svem-matrix-wrap {
    display: none;
  }

  .svem-matrix-cards {
    display: grid;
  }

  .svem-matrix-card__list {
    margin: 0;
  }

  .svem-matrix-card__list > div {
    display: flex;
    justify-content: space-between;
    gap: var(--space-md);
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--color-border);
  }

  .svem-matrix-card__list > div:last-child {
    border-bottom: 0;
  }

  .svem-matrix-card__list dt {
    font-weight: 500;
    color: var(--color-ink-soft, var(--color-ink));
  }

  .svem-matrix-card__list dd {
    margin: 0;
    text-align: right;
    font-weight: 600;
  }
}

/* ---------- illustrative exception card ---------- */
.svem-exception {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg, 14px);
  background: var(--color-surface, #fff);
  padding: var(--space-lg);
}

.svem-exception__tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 var(--space-sm);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--color-accent-ink, var(--color-accent, #0a6c74));
}

.svem-exception__title {
  margin: 0 0 var(--space-md);
}

.svem-exception__fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 0.75rem var(--space-lg);
  margin: 0 0 var(--space-lg);
}

.svem-exception__fields > div {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-border);
}

.svem-exception__fields dt {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-ink-soft, var(--color-ink));
}

.svem-exception__fields dd {
  margin: 0;
}

/* ---------- resolution stepper ---------- */
.svem-stepper {
  border-top: 1px dashed var(--color-border);
  padding-top: var(--space-md);
}

.svem-stepper__heading {
  margin: 0 0 var(--space-sm);
  font-weight: 600;
}

.svem-stepper__list {
  list-style: none;
  margin: 0 0 var(--space-md);
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.svem-stepper__step {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md, 10px);
  background: var(--color-surface-subtle, transparent);
}

.svem-stepper__dot {
  flex: 0 0 auto;
  width: 0.85rem;
  height: 0.85rem;
  margin-top: 0.25rem;
  border-radius: 50%;
  border: 2px solid var(--color-border-strong, var(--color-ink));
  background: transparent;
}

.svem-stepper__label {
  line-height: 1.4;
}

/* Completed steps: filled dot + a textual marker (never colour alone). */
.svem-stepper__step.is-done .svem-stepper__dot {
  background: var(--color-accent, #0a6c74);
  border-color: var(--color-accent, #0a6c74);
}

.svem-stepper__step.is-done .svem-stepper__label::after {
  content: " — done";
  font-weight: 600;
  color: var(--color-ink-soft, var(--color-ink));
}

/* Current step: stronger border + weight + an explicit text marker. */
.svem-stepper__step.is-current {
  border-color: var(--color-accent, #0a6c74);
  border-width: 2px;
  background: var(--color-accent-wash, rgba(10, 108, 116, 0.08));
  font-weight: 600;
}

.svem-stepper__step.is-current .svem-stepper__dot {
  border-color: var(--color-accent, #0a6c74);
  box-shadow: 0 0 0 3px var(--color-accent-wash, rgba(10, 108, 116, 0.18));
}

.svem-stepper__step.is-current .svem-stepper__label::after {
  content: " — current step";
  font-weight: 600;
  color: var(--color-accent-ink, var(--color-accent, #0a6c74));
}

.svem-stepper__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.svem-stepper__btn {
  font: inherit;
  cursor: pointer;
  padding: 0.5rem 1rem;
  border: 1px solid var(--color-border-strong, var(--color-ink));
  border-radius: var(--radius-md, 10px);
  background: var(--color-surface, #fff);
  color: var(--color-ink);
  min-height: 44px;
}

.svem-stepper__btn:hover {
  border-color: var(--color-accent, #0a6c74);
}

.svem-stepper__btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.svem-stepper__status {
  font-size: 0.875rem;
  color: var(--color-ink-soft, var(--color-ink));
}

/* Hide the non-functional stepper controls without JavaScript. */
.no-js .svem-stepper__controls {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .svem-stepper__step,
  .svem-stepper__dot {
    transition: none;
  }
}
