/* Workflow admin view — stage transition matrix + hamburger pill membership.
   Server-rendered into #admin-content by as-core handlers/workflow_admin.rs
   (admin.switch_view view=workflow). Read-only chrome only; all state is
   server-owned via SSE OOB. */

.admin-view-workflow .admin-view-sub code {
  font-family: var(--font-family-mono);
  font-size: 0.85em;
}

/* Horizontal scroll: the incident matrix can be ~21 columns wide. */
.workflow-matrix-scroll {
  overflow-x: auto;
  max-width: 100%;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

.admin-table-workflow {
  border-collapse: collapse;
  font-size: 0.85rem;
  white-space: nowrap;
}

.admin-table-workflow th,
.admin-table-workflow td {
  border: 1px solid var(--color-border-light);
  padding: 0.35rem 0.5rem;
  text-align: center;
}

/* Sticky header row + first column so labels stay visible while scrolling. */
.admin-table-workflow thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--color-bg-raised);
  color: var(--color-text-secondary);
  font-weight: 600;
}

.admin-table-workflow .workflow-col-head {
  max-width: 7.5rem;
  white-space: normal;
  font-size: 0.75rem;
  line-height: 1.15;
}

.admin-table-workflow .workflow-stage-head,
.admin-table-workflow .workflow-stage-label {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--color-bg-raised);
  text-align: left;
}

.admin-table-workflow thead .workflow-stage-head {
  z-index: 3; /* corner cell sits above both sticky axes */
}

.workflow-stage-label {
  font-weight: 600;
  color: var(--color-text);
}

.workflow-stage-meta {
  display: block;
  font-weight: 400;
  font-size: 0.7rem;
  color: var(--color-text-muted);
  font-family: var(--font-family-mono);
}

/* Transition matrix cells (mechanism 1: allowed_transitions). */
.workflow-cell {
  width: 2rem;
}

.workflow-cell-on {
  background: var(--color-primary-light);
}

.workflow-cell-self {
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 3px,
    var(--color-border-light) 3px,
    var(--color-border-light) 4px
  );
}

.workflow-cell-dash {
  color: var(--color-text-muted);
}

.workflow-cell-box,
.workflow-pill-box {
  cursor: pointer;
  accent-color: var(--color-status-info);
}

/* Pill-membership column (mechanism 2: reference_data.filter_surfaces). */
.workflow-pill-head,
.workflow-pill-cell {
  text-align: left;
  white-space: nowrap;
}

/* "Shows in" phase dropdown (incident lifecycle only). */
.workflow-phase-head,
.workflow-phase-cell {
  text-align: left;
  white-space: nowrap;
}

.workflow-phase-select {
  font-size: 0.8rem;
  padding: 0.15rem 0.3rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  color: var(--color-text);
  cursor: pointer;
}
