/* EDI dashboard: only the layout of these pages.
   Tokens, element defaults and every component come from the brand guide:
   /styles/tokens.css, /styles/base.css and /styles/components.css. Nothing
   here sets a colour, size or radius of its own; a value that is missing
   belongs in the brand guide, not in this file.

   Those three files are copies of mesurit-website/public/styles/. Copy them
   over again when the brand guide changes; never edit them here. */

/* ===== Frame =====
   The admin frame from the brand guide: a navigation bar on the left, the
   screen on the right. On a small screen the bar slides in from a Menu
   button. The bar itself is the brand guide's main navigation
   (components.css, "Main navigation"); here only where it sits. */

.admin-shell {
  --sidebar: 14.5rem;
  min-height: 100vh;
}

.admin-skip {
  position: absolute;
  left: -9999px;
}

.admin-skip:focus {
  left: var(--space-4);
  top: var(--space-4);
  z-index: 50;
  background: var(--color-surface);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-input);
  box-shadow: var(--focus-ring);
}

.admin-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  width: var(--sidebar);
  transform: translateX(-100%);
  transition: transform 0.2s ease;
}

.admin-shell.is-open .admin-sidebar {
  transform: none;
}

/* Collapsing is for wide screens; a small one slides the bar in instead. */
.admin-sidebar .mainnav-collapse {
  display: none;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: 0.625rem var(--space-4);
  background: var(--color-bg-inverse);
}

.admin-topbar a {
  color: inherit;
  text-decoration: none;
}

.admin-topbar :focus-visible {
  outline: 1px solid var(--color-focus-inverse);
  outline-offset: 1px;
}

.admin-topbar-brand img {
  display: block;
  width: 7.5rem;
  height: auto;
}

.admin-menu-button {
  font: inherit;
  font-weight: var(--fw-semibold);
  font-size: var(--fs-eyebrow);
  color: var(--mesurit-offwhite);
  background: color-mix(in srgb, var(--mesurit-offwhite) 6%, transparent);
  border: 1px solid color-mix(in srgb, var(--mesurit-offwhite) 10%, transparent);
  border-radius: var(--radius-input);
  padding: 0.3125rem var(--space-3);
  cursor: pointer;
}

.admin-scrim {
  position: fixed;
  inset: 0;
  z-index: 30;
  border: 0;
  background: color-mix(in srgb, var(--mesurit-navy) 25%, transparent);
  cursor: pointer;
}

.admin-main {
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--space-6) var(--gutter) var(--space-8);
}

/* The screen's own title, since the bar carries no page title. */
.page-head {
  margin-bottom: var(--space-5);
}

.page-head h1 {
  font-size: var(--fs-h3);
  line-height: var(--lh-snug);
}

.page-subtitle {
  margin-top: var(--space-1);
  font-size: var(--fs-small);
  color: var(--color-text-muted);
}

@media (min-width: 960px) {
  .admin-sidebar {
    transform: none;
    transition: none;
  }

  .admin-topbar,
  .admin-scrim {
    display: none;
  }

  .admin-shell {
    padding-left: var(--sidebar);
  }

  .admin-shell.is-collapsed {
    --sidebar: 4.25rem;
  }

  .admin-sidebar .mainnav-collapse {
    display: flex;
  }
}

@media (prefers-reduced-motion: reduce) {
  .admin-sidebar {
    transition: none;
  }
}

/* ===== Site switcher =====
   The brand guide's main navigation has no site switcher; this is the EDI's
   own row above the account, in the same quiet style as the bar. */
.mainnav-site {
  margin: 0 0.875rem var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid color-mix(in srgb, var(--mesurit-offwhite) 10%, transparent);
}

.mainnav-site label {
  display: block;
  padding: 0 0.625rem var(--space-1);
  font-size: 0.6875rem;
  font-weight: var(--fw-semibold);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--mesurit-offwhite) 82%, transparent);
}

.mainnav-site select {
  width: 100%;
  min-height: 34px;
  padding: 5px 8px;
  font: inherit;
  font-size: var(--fs-small);
  color: var(--mesurit-offwhite);
  background: color-mix(in srgb, var(--mesurit-offwhite) 6%, transparent);
  border: 1px solid color-mix(in srgb, var(--mesurit-offwhite) 10%, transparent);
  border-radius: var(--radius-input);
}

.mainnav-site select:focus-visible {
  outline: 1px solid var(--color-focus-inverse);
  outline-offset: 1px;
}

.mainnav-site select option {
  color: var(--mesurit-navy);
  background: var(--mesurit-white);
}

.mainnav.is-collapsed .mainnav-site {
  display: none;
}

/* ===== Filters ===== */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  padding-bottom: var(--space-4);
}

.filters .field {
  min-width: 180px;
}

/* ===== Orders table ===== */
.table-container {
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  margin-bottom: var(--space-5);
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-line);
  background: var(--mesurit-offwhite);
}

.table-toolbar .btn-secondary {
  background: var(--color-surface);
}

.table-toolbar .btn-secondary:hover {
  background: var(--color-heading);
}

/* Feedback for a background refresh: quiet when it succeeds, red when it
   fails, so the table itself never has to be replaced by a message. */
.refresh-status {
  font-size: var(--fs-eyebrow);
  color: var(--color-text-muted);
}

.refresh-status.is-error {
  color: var(--color-error);
}

.btn.is-busy {
  opacity: 0.6;
  cursor: progress;
}

.btn:disabled {
  cursor: progress;
}

.table-scroll {
  overflow-x: auto;
}

/* The table keeps its natural width; the card scrolls it sideways when the
   screen is too narrow, instead of squeezing the columns. */
.orders-table {
  min-width: 720px;
}

/* Denser than the brand table: seven columns in one card. */
.orders-table th,
.orders-table td {
  padding: var(--space-3) var(--space-2);
}

.orders-table > tbody > tr {
  cursor: pointer;
}

.orders-table > tbody > tr.is-open > td {
  background: color-mix(in srgb, var(--mesurit-offwhite) 60%, var(--color-surface));
}

.orders-table > tbody > tr.is-open > td:first-child {
  box-shadow: inset 3px 0 0 var(--color-heading);
}

.orders-table > tbody > tr > td.loading {
  text-align: center;
  color: var(--color-text-muted);
  padding: var(--space-7) var(--space-4);
}

.loading.error {
  color: var(--color-error);
}

.order-id {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: var(--fs-eyebrow);
  color: var(--color-text-muted);
}

/* The order number never breaks; the supplier and segment below it may. */
.order-id-number {
  white-space: nowrap;
}

/* The supplier and segment of a split order, under the order number. */
.order-id-suffix {
  display: block;
  font-size: 0.6875rem;
  color: var(--color-text-muted);
  white-space: normal;
}

.price {
  font-weight: var(--fw-bold);
  color: var(--color-heading);
  white-space: nowrap;
}

.date-cell {
  font-size: var(--fs-eyebrow);
  color: var(--color-text-muted);
  white-space: nowrap;
}

/* ===== Detail panel (admin pages) ===== */
.detail-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  margin-bottom: var(--space-5);
  overflow: hidden;
}

.detail-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  background: var(--mesurit-offwhite);
  border-bottom: 1px solid var(--color-line);
}

.detail-header h2 {
  font-size: var(--fs-h4);
}

.detail-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
  justify-content: flex-end;
}

.detail-body {
  padding: var(--space-5);
}

/* The dispatch mode sits in the sheet's foot, left of the actions: it explains
   why the dispatch button is there (or not). */
.sheet-actions-meta {
  margin-right: auto;
  align-self: center;
  font-size: var(--fs-eyebrow);
  color: var(--color-text-muted);
}

.sheet-actions-meta strong {
  color: var(--color-heading);
}

/* ===== Order detail in the side sheet ===== */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
  margin-bottom: var(--space-5);
}

@media (max-width: 560px) {
  .detail-grid {
    grid-template-columns: 1fr;
  }
}

.detail-section {
  margin-bottom: var(--space-5);
}

.detail-section h3,
.detail-section h4 {
  font-size: var(--fs-eyebrow);
  font-weight: var(--fw-semibold);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: var(--ls-eyebrow);
  margin-bottom: var(--space-3);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--color-line);
}

.detail-section table {
  width: 100%;
}

.detail-section td {
  padding: var(--space-1) 0;
  font-size: var(--fs-small);
}

/* Key/value tables only: the order-lines table is a data grid, so its first
   column must size to its content instead of taking a fixed label width. */
.detail-section table:not(.order-lines-table) td:first-child {
  color: var(--color-text-muted);
  width: 140px;
}

.muted {
  color: var(--color-text-muted);
  font-size: var(--fs-small);
}

/* A status line that is empty until something happens should not claim a
   grid track and its margins. */
.muted:empty {
  display: none;
}

/* ===== Order timeline ===== */

/* The timeline is the brand guide's ruler track, unchanged: `.b-track`,
   `.b-track-steps`, `.b-track-step` and `.b-track-number` come from
   components.css, so sizes, ticks and gaps are the same as on the site. Only
   what the site does not have is added here: the state of a step (done,
   current, expected, error) and the tape that stops at the step the order has
   reached instead of running the whole ruler. */
.order-track {
  /* The sheet is white, so the ring around a number masks in white. */
  --track-ground: var(--color-surface);
  /* The last step carries the check itself, so the track needs no closing
     mark and the ruler stops at the last step instead of running on. */
  --end: 0px;
}

/* The site measures the track while the page scrolls. The sheet is a panel
   that is already open, so the track is drawn as measured: without this the
   animation's fill-mode keeps every number on the ruler's grey. */
.order-track .b-track-number {
  animation: none;
  opacity: 1;
}

/* The tape: one segment per step, drawn on the ruler's axis. A step that has
   not happened leaves the ruler bare, so the yellow stops where the order is.
   The site draws one tape for the whole block because it measures on scroll;
   here the length is the order's progress. */
.timeline-step {
  position: relative;
}

.timeline-step::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: calc(-1 * var(--space-5));
  left: calc(var(--axis) - 1px);
  width: 3px;
  background: transparent;
}

.timeline-done::before {
  background: var(--color-accent);
}

/* The step in progress: the tape reaches its number and stops there. */
.timeline-current::before {
  bottom: 50%;
  background: var(--color-accent);
}

.timeline-error::before {
  background: var(--color-error);
}

/* The last step is the end of the ruler: its tape stops at its own number,
   which is the check once the order has arrived. Nothing runs on below it. */
.order-timeline > .timeline-step:last-child::before {
  bottom: 50%;
}

/* The ruler is one line for the whole track, so it would run on past the last
   step. The last step masks the part below its number in the ground colour,
   which ends the ruler exactly at the check. */
.timeline-last::after {
  content: "";
  position: absolute;
  top: 50%;
  bottom: 0;
  left: calc(var(--axis) - 8px);
  width: 24px;
  background: var(--track-ground);
}

/* The number paints above the tape; its ring in the ground colour masks the
   tape behind it, exactly as on the site. */
.timeline-step .b-track-number {
  position: relative;
  z-index: 1;
}

/* The site puts the step's title and text side by side from 960 px of
   viewport. The sheet stays 760 px wide whatever the screen, so the timeline
   keeps the site's narrow layout: label, then what the step adds. */
.order-track > .b-track-steps .b-track-text {
  display: block;
}

.order-track .b-track-step p {
  margin: 0;
  max-width: none;
}

.order-track .b-track-step p + p {
  margin-top: var(--space-1);
}

/* A step that has not happened yet: the number stays grey, the label muted. */
.timeline-expected .b-track-number {
  background: var(--color-line);
  color: var(--color-text-muted);
}

/* The step in progress is mid-measurement: the number is the colour halfway
   between the yellow of the steps behind it and the grey of the steps still to
   come, which is what the site's tape shows while it is measuring. */
.timeline-current .b-track-number {
  background: color-mix(in srgb, var(--color-accent) 50%, var(--color-line));
}

/* The last step has nothing after it, so there is no grey half to show: when
   the order has reached it, it is simply done and fully yellow. */
.timeline-last.timeline-current .b-track-number {
  background: var(--color-accent);
  color: var(--color-on-accent);
}

.timeline-error .b-track-number {
  background: var(--color-error);
  color: var(--color-surface);
}

/* The last step shows a check once the order has reached it. The check is
   wider than two digits, so the pill keeps its width and centres it. */
.timeline-last .b-track-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-small);
}

.timeline-expected .timeline-label {
  color: var(--color-text-muted);
}

.timeline-current .timeline-label {
  font-weight: var(--fw-semibold);
  color: var(--color-heading);
}

.timeline-error .timeline-label {
  color: var(--color-error);
}

/* The label and its meta sit in the step's text column, as on the site. */
.timeline-label {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2);
  margin: 0;
  color: var(--color-text);
}

.timeline-time {
  font-size: var(--fs-eyebrow);
  font-weight: var(--fw-regular);
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}

/* What the step adds: the outcome of a merged step, the moment it happened,
   the supplier's own wording when it says more than the label. */
.timeline-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
}

.timeline-note {
  font-size: var(--fs-eyebrow);
  color: var(--color-text-muted);
}

.timeline-detail {
  font-size: var(--fs-eyebrow);
  color: var(--color-error);
}

/* The consignment of a transport step: the parcel the shipment feed reported,
   with its tracking link. */
.timeline-shipment {
  font-size: var(--fs-eyebrow);
  color: var(--color-text-muted);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

.timeline-shipment a {
  color: var(--color-heading);
}

/* The supplier's own wording, next to the normalized label. */
.timeline-supplier-status {
  font-size: var(--fs-eyebrow);
  color: var(--color-text-muted);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-pill);
  padding: 0 6px;
  white-space: nowrap;
}

.timeline-empty {
  list-style: none;
}

/* ===== Order lines table ===== */
.order-lines-table {
  width: 100%;
  border-collapse: collapse;
}

.order-lines-table th {
  text-align: left;
  font-size: var(--fs-eyebrow);
  font-weight: var(--fw-semibold);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: var(--ls-eyebrow);
  padding: 6px 8px 6px 0;
  border-bottom: 1px solid var(--color-line);
}

.order-lines-table td {
  padding: 6px 8px 6px 0;
  font-size: var(--fs-small);
  border-bottom: 1px solid var(--color-line);
  vertical-align: top;
}

.order-lines-table th.num,
.order-lines-table td.num {
  text-align: right;
}

/* The id and the action are short and must not wrap; the product name takes
   the remaining width. The expanded detail row spans all columns, so it is
   excluded. */
.order-lines-table tr:not(.order-line-detail) th:first-child,
.order-lines-table tr:not(.order-line-detail) td:first-child,
.order-lines-table tr:not(.order-line-detail) th:last-child,
.order-lines-table tr:not(.order-line-detail) td:last-child {
  width: 1%;
  white-space: nowrap;
}

/* The expanded line: a nested block, so it reads as part of its row. */
.order-line-detail td {
  padding: 0;
  border-bottom: 1px solid var(--color-line);
}

.order-line-detail-body {
  background: var(--color-bg);
  border-left: 2px solid var(--color-line);
  padding: var(--space-4);
  margin: 0 0 var(--space-3);
}

.order-line-detail-body h5 {
  font-size: var(--fs-eyebrow);
  font-weight: var(--fw-semibold);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: var(--ls-eyebrow);
  margin: var(--space-4) 0 var(--space-2);
}

.order-line-detail-body h5:first-child {
  margin-top: 0;
}

.order-line-detail-body table {
  width: 100%;
}

.order-line-detail-body td {
  padding: 2px 0;
  font-size: var(--fs-small);
  border: 0;
}

.order-line-detail-body td:first-child {
  color: var(--color-text-muted);
  width: 150px;
}

.order-line-detail-body .mono {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: var(--fs-eyebrow);
  word-break: break-all;
}

.order-line-toggle {
  white-space: nowrap;
}

/* ===== JSON and XML previews ===== */
.json-preview {
  background: var(--color-bg-inverse);
  color: var(--color-text-inverse);
  padding: var(--space-4);
  border-radius: var(--radius-input);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: var(--fs-eyebrow);
  line-height: 1.5;
  overflow-x: auto;
  max-height: 300px;
  overflow-y: auto;
}

.json-preview.inspector-preview {
  max-height: none;
  white-space: pre-wrap;
  word-break: break-word;
}

.xml-viewers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin-top: var(--space-3);
}

@media (max-width: 1100px) {
  .xml-viewers {
    grid-template-columns: 1fr;
  }
}

.xml-viewer h4 {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  font-size: var(--fs-eyebrow);
  color: var(--color-heading);
  margin-bottom: var(--space-2);
}

.xml-meta {
  font-size: var(--fs-eyebrow);
  font-weight: var(--fw-regular);
  color: var(--color-text-muted);
}

.xml-viewer .xml-meta + .xml-preview {
  margin-top: 6px;
}

.xml-compatibility {
  margin-top: var(--space-4);
}

.xml-compatibility h4 {
  font-size: var(--fs-eyebrow);
  color: var(--color-heading);
  margin-bottom: 6px;
}

.xml-compatibility-status {
  font-size: var(--fs-eyebrow);
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.xml-status-compatible {
  color: var(--color-success);
}

.xml-status-different,
.xml-status-invalid_generated_xml,
.xml-status-invalid_reference_xml {
  color: var(--color-error);
}

.xml-preview {
  max-height: 420px;
  white-space: pre;
}

/* ===== Traffic inspector =====
   One list of every machine-to-machine exchange about the order: what was
   received or sent, when, over which endpoint, with the content and the
   response. The list is chronological, so the order of events reads top to
   bottom. */
.traffic-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.traffic-entry {
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-line);
}

.traffic-entry:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

/* The summary is the entry's header: it stays visible while the content is
   folded away, so the list reads as a log. */
.traffic-details > summary {
  display: block;
  cursor: pointer;
  list-style: none;
  padding: var(--space-3);
  border-radius: var(--radius-input);
}

.traffic-details > summary:hover {
  background: var(--color-bg);
}

.traffic-details > summary::-webkit-details-marker {
  display: none;
}

.traffic-details > summary::after {
  content: "Show content";
  display: block;
  margin-top: var(--space-2);
  font-size: var(--fs-eyebrow);
  color: var(--color-heading);
  text-decoration: underline;
}

.traffic-details[open] > summary::after {
  content: "Hide content";
}

.traffic-details[open] > summary {
  margin-bottom: var(--space-3);
}

.traffic-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.traffic-label {
  font-size: var(--fs-small);
  color: var(--color-heading);
}

.traffic-time {
  margin-left: auto;
  font-size: var(--fs-eyebrow);
  color: var(--color-text-muted);
}

.traffic-endpoint {
  display: block;
  margin-bottom: var(--space-2);
  font-size: var(--fs-eyebrow);
  color: var(--color-text-muted);
  overflow-wrap: anywhere;
}

.traffic-endpoint code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

.traffic-response {
  margin-bottom: var(--space-2);
  font-size: var(--fs-eyebrow);
}

.traffic-ok {
  color: var(--color-success);
}

.traffic-failed {
  color: var(--color-error);
}

/* ===== Settings pages =====
   The fields are the brand guide's .field and .input; only the layout of
   these pages is here. */
.settings-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: var(--space-5);
}

.settings-toolbar:empty {
  display: none;
}

/* The brand guide's .form-grid fills the row with fields; a button in it
   starts at the left and keeps its own height instead of stretching. */
.form-grid > .btn {
  justify-self: start;
  align-self: end;
}

.copy-field {
  display: flex;
  gap: var(--space-2);
}

.copy-field input {
  flex: 1;
  min-width: 0;
}

.copy-btn {
  flex: 0 0 auto;
}

.supplier-settings-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(260px, 1fr));
  gap: var(--space-4);
}

/* The brand guide's .card, laid out as a column: a summary and its link. */
.supplier-settings-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.supplier-settings-card .btn {
  align-self: flex-start;
}

.settings-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px 12px;
  margin: 0;
  font-size: var(--fs-small);
}

.settings-summary dt {
  color: var(--color-text-muted);
}

.settings-summary dd {
  margin: 0;
  overflow-wrap: anywhere;
}

/* The buttons of a form sit on a row of their own, under the fields. */
.settings-actions {
  display: flex;
  flex-wrap: wrap;
  grid-column: 1 / -1;
  gap: var(--space-2);
  align-items: center;
}

@media (max-width: 768px) {
  .settings-toolbar,
  .supplier-settings-list {
    grid-template-columns: 1fr;
    display: grid;
    align-items: start;
  }
}

/* ===== Admin lists ===== */
.admin-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.admin-list-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  padding: 10px 12px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-button);
  background: var(--mesurit-offwhite);
}

.admin-list-item strong {
  min-width: 180px;
}

/* The role picker in a grant row is the brand guide's .input, one size down. */
.grant-item .input {
  width: auto;
  min-height: 36px;
  padding: 5px 8px;
  font-size: var(--fs-eyebrow);
}

/* ===== Status callback test ===== */
.callback-test-result {
  margin-top: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-line);
  border-left-width: 4px;
  border-radius: var(--radius-input);
  background: var(--mesurit-offwhite);
  font-size: var(--fs-small);
  line-height: 1.5;
}

.callback-test-result.is-ok {
  border-left-color: var(--color-success);
}

.callback-test-result.is-warning {
  border-left-color: var(--mesurit-yellow-hover);
}

.callback-test-result.is-error {
  border-left-color: var(--color-error);
}

.callback-test-result dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: var(--space-1) var(--space-4);
  margin: var(--space-2) 0 0;
}

.callback-test-result dt {
  color: var(--color-text-muted);
}

.callback-test-result dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.callback-test-result pre {
  margin: var(--space-2) 0 0;
  padding: var(--space-2);
  border-radius: var(--radius-input);
  background: color-mix(in srgb, var(--mesurit-navy) 6%, transparent);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: var(--fs-eyebrow);
}

/* ===== Status matrix ===== */
.status-matrix-wrap {
  overflow-x: auto;
  margin-top: var(--space-3);
}

.status-matrix {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-small);
}

.status-matrix th,
.status-matrix td {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--color-line);
  text-align: left;
  vertical-align: middle;
}

.status-matrix thead th {
  font-size: var(--fs-eyebrow);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  border-bottom: 2px solid var(--color-line);
  white-space: nowrap;
}

.status-matrix tbody th {
  font-weight: var(--fw-semibold);
  color: var(--color-text);
}

.status-matrix-label {
  display: block;
}

.status-matrix-code {
  display: block;
  font-size: var(--fs-eyebrow);
  font-weight: var(--fw-regular);
  color: var(--color-text-muted);
}

.status-matrix-dot,
.status-matrix-empty {
  text-align: center;
  width: 96px;
}

.status-matrix-empty {
  color: var(--color-text-muted);
}

.status-matrix-dot {
  cursor: help;
}

.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-border-input);
}

.status-dot.status-info {
  background: var(--color-heading);
}

.status-dot.status-success {
  background: var(--color-success);
}

.status-dot.status-error {
  background: var(--color-error);
}

.status-dot.status-neutral {
  background: var(--color-text-muted);
}
