.workflows-main {
  gap: 18px;
}

.workflow-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  gap: 18px;
  padding: 26px;
  border: 1px solid rgba(99, 102, 241, 0.22);
  border-radius: 28px;
  background:
    radial-gradient(circle at 90% 0%, rgba(14, 165, 233, 0.16), transparent 30%),
    linear-gradient(135deg, #ffffff, #f7f8ff);
  box-shadow: var(--shadow);
}

.workflow-eyebrow {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
  padding: 7px 10px;
  border-radius: 999px;
  background: #eef2ff;
  color: #4338ca;
  font-size: 12px;
  font-weight: 950;
}

.workflow-eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #6366f1;
}

.workflow-hero h2 {
  max-width: 760px;
  margin-bottom: 8px;
  font-size: clamp(34px, 4vw, 56px);
  line-height: 1;
  letter-spacing: -0.06em;
}

.workflow-hero p {
  max-width: 720px;
  color: var(--muted);
  line-height: 1.55;
}

.workflow-task-form {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.workflow-task-form textarea,
.workflow-actions select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  color: var(--ink);
  outline: 0;
}

.workflow-task-form textarea {
  min-height: 126px;
  padding: 16px;
  resize: vertical;
  font-size: 16px;
  line-height: 1.5;
}

.workflow-actions {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr) 160px;
  gap: 12px;
}

.workflow-actions select {
  min-height: 50px;
  padding: 0 14px;
}

.workflow-actions button {
  min-height: 50px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--purple), var(--blue));
  color: white;
  font-weight: 950;
}

.workflow-actions .secondary-action {
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
}

.workflow-current-card {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
  padding: 20px;
  border: 1px solid rgba(99, 102, 241, 0.24);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--soft-shadow);
}

.workflow-current-card > span {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 18px;
  background: #eef2ff;
  font-size: 24px;
}

.workflow-current-card b {
  display: block;
  font-size: 20px;
}

.workflow-current-card p,
.workflow-current-card dd {
  overflow-wrap: anywhere;
}

.workflow-current-card p {
  margin: 2px 0 0;
  color: var(--muted);
}

.workflow-current-card dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.workflow-current-card dl div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-2);
}

.workflow-current-card dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.workflow-current-card dd {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}

.workflow-current-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.workflow-current-actions button,
.workflow-stepper article,
.workflow-approval-list article,
.workflow-run-stack article,
.workflow-action-group,
.workflow-history-list article {
  min-width: 0;
}

.workflow-current-actions button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.workflow-current-actions button:first-child {
  border: 0;
  background: var(--ink);
  color: white;
}

.workflow-stepper {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.workflow-stepper article {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.workflow-stepper article small {
  color: #10b981;
  font-weight: 950;
}

.workflow-stepper article span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 13px;
  background: #eef2ff;
  color: #4338ca;
  font-weight: 950;
}

.workflow-stepper article.done {
  border-color: rgba(16, 185, 129, 0.34);
  background: #f0fdf4;
}

.workflow-stepper article.approval {
  border-color: rgba(245, 158, 11, 0.4);
  background: #fffbeb;
}

.workflow-stepper p,
.workflow-action-group p,
.workflow-run-stack p,
.workflow-approval-list p,
.workflow-history-list p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.workflow-split {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(360px, 1.08fr);
  gap: 18px;
}

.workflow-approval-list,
.workflow-run-stack,
.workflow-history-list {
  display: grid;
  gap: 10px;
}

.workflow-approval-list article {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 110px;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-2);
}

.workflow-approval-list span {
  display: grid;
  place-items: center;
  min-height: 38px;
  border-radius: 14px;
  background: #eef2ff;
  color: #4338ca;
  font-size: 12px;
  font-weight: 950;
}

.workflow-approval-list button,
.workflow-run-stack button,
.workflow-action-group button,
.workflow-next-panel button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.workflow-approval-list button:hover,
.workflow-run-stack button:hover,
.workflow-action-group button:hover,
.workflow-next-panel button:hover {
  border-color: rgba(99, 102, 241, 0.5);
  background: #eef2ff;
}

.workflow-run-stack article,
.workflow-history-list article {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-2);
}

.workflow-run-stack article > div:first-child {
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.workflow-run-stack span,
.workflow-history-list span {
  color: var(--muted);
  font-size: 12px;
}

.workflow-progress-line {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  margin: 12px 0;
}

.workflow-progress-line i {
  height: 7px;
  border-radius: 99px;
  background: #dbe4ff;
}

.workflow-progress-line i.done {
  background: linear-gradient(135deg, var(--purple), var(--blue));
}

.workflow-run-stack footer {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.workflow-run-stack footer button:first-child {
  border: 0;
  background: var(--ink);
  color: white;
}

.workflow-action-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.workflow-action-group {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 252px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.workflow-action-group b {
  display: block;
  margin-bottom: 5px;
  font-size: 16px;
}

.workflow-action-group > div:last-child {
  display: grid;
  gap: 8px;
}

.workflow-action-group button {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 0 12px;
  text-align: left;
}

.workflow-history-list article b,
.workflow-history-list article span {
  display: block;
}

.workflow-history-list article span {
  margin: 4px 0 8px;
  color: #4338ca;
  font-weight: 900;
}

.workflow-safety-panel .profile-row,
.workflow-audit-panel .profile-row {
  margin-bottom: 8px;
}

.workflow-next-panel {
  gap: 10px;
}

.workflow-next-panel button {
  width: 100%;
}

@media (max-width: 1520px) {
  .workflow-hero,
  .workflow-split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1240px) {
  .workflow-action-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .workflows-main {
    gap: 14px;
  }

  .workflow-hero,
  .workflow-actions,
  .workflow-action-grid,
  .workflow-approval-list article,
  .workflow-run-stack article > div:first-child,
  .workflow-run-stack footer {
    grid-template-columns: 1fr;
  }

  .workflow-hero {
    gap: 14px;
    padding: 16px;
    border-radius: 22px;
  }

  .workflow-eyebrow {
    margin-bottom: 10px;
    padding: 6px 10px;
    font-size: 11px;
  }

  .workflow-hero h2 {
    font-size: 32px;
  }

  .workflow-hero p {
    font-size: 14px;
    line-height: 1.48;
  }

  .workflow-task-form {
    gap: 10px;
    margin-top: 16px;
  }

  .workflow-task-form textarea {
    min-height: 104px;
    padding: 14px;
  }

  .workflow-actions button,
  .workflow-actions select {
    min-height: 48px;
  }

  .workflow-current-card,
  .workflow-action-group {
    padding: 14px;
  }

  .workflow-current-actions {
    grid-template-columns: 1fr;
  }

  .workflow-action-group {
    min-height: auto;
  }
}
